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
Loop through rows and find the longest 2D array element
function getTableDimensions(data) { let width = 0; let height = 0; if (Array.isArray(data)) { data.forEach(element => { if (element.length > width) width = element.length; }); height = data.length; } return [width, height]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function largestOfFour(arr) {\n var longest = [0, 0, 0, 0];\n for (var i = 0; i < arr.length; i++) {\n for (var j = 0; s < arr[i].length; s++) {\n if (longest[i] < arr[i][s]) {\n longest[i] = arr[i][s];\n }\n }\n }\n\n\n return longest;\n}", "function largestOfFour(arr) {\n var returnArr = [];\n for (var i = 0; i < arr.length; i++) {\n var longest = arr[i][0];\n for (var j = 0;j<arr[i].length;j++) {\n if (arr[i][j]>longest) {\n longest = arr[i][j];\n }\n }\n returnArr[i]=longest;\n }\n return returnArr;\n }", "function maxwidth(shape){\n //default first to false\n var last = false\n var count = 0\n //whilst theres nothing found in the last collumn then keep looping\n while (last == false && count < (shape.length -1)){\n for(var row = 0; row < (shape.length - checkBottom()); row++){\n //checks if last collum for that row is filled\n if(shape[row][shape.length -1 ] !== 0){ //use - 1, i know the array will always be a square\n last = true\n return(shape.length -1)\n }\n }\n count++\n }\n if (last == false){\n return(shape.length - 2)\n }\n}", "function find_longest(array){\r\n\tvar longest_length = 0, longest_index;\r\n\tfor (var i = 0; i < array.length; i++) {\r\n\t\tif (array[i].length > longest_length){\r\n\t\t\tlongest_length = array[i].length;\r\n\t\t\tlongest_index = i;\r\n\t\t}\r\n\t}\r\n\treturn array[longest_index];\r\n}", "function findLongest(array) {\n var longest = 0;\n var longestElem;\n\n for (let i = 0; i < array.length; i++) {\n if (array[i].toString().length > longest) {\n longest = array[i].toString().length;\n longestElem = array[i];\n }\n }\n\n return longestElem;\n}", "function getQtyOfJewelsFromTheLongestNeighbordChain(col, row) {\n var type = getJewel(col, row);\n var right = getQtyOfJewelsFromRigthNeighbordChain(type, col, row);\n var left = getQtyOfJewelsFromLeftNeighbordChain(type, col, row);\n var up = getQtyOfJewelsFromUpperNeighbordChain(type, col, row);\n var down = getQtyOfJewelsFromLowerNeighbordChain(type, col, row);\n var totalVerticalJewels = left + 1 + right;\n var totalHorizontalJewels = up + 1 + down;\n\n return Math.max(totalVerticalJewels, totalHorizontalJewels);\n }", "static largestProduct(matrix, length) {\n const fixedLength = length - 1\n return matrix.reduce((p, line, i) => {\n const innerMaxProduct = line.reduce((iP, element, j) => {\n const arrowElements = [\n this.upElementsFromPosition(matrix, fixedLength, { x: i, y: j }),\n this.downElementsFromPosition(matrix, fixedLength, { x: i, y: j }),\n this.diagonalUpRightElementsFromPosition(matrix, fixedLength, { x: i, y: j }),\n this.diagonalUpLeftElementsFromPosition(matrix, fixedLength, { x: i, y: j }),\n this.diagonalDownRightElementsFromPosition(matrix, fixedLength, { x: i, y: j }),\n this.diagonalDownLeftElementsFromPosition(matrix, fixedLength, { x: i, y: j })\n ]\n\n const arrowProducts = arrowElements\n .map(arrowDirection => ({\n product: this.productFromArray(arrowDirection),\n elements: arrowDirection\n }))\n\n const innerMaxProduct = arrowProducts\n .reduce((p, line) => {\n return !p || line.product > p.product ? line : p\n }, undefined)\n\n return !iP || innerMaxProduct.product > iP.product ? innerMaxProduct : iP\n }, undefined)\n\n return !p || innerMaxProduct.product > p.product ? innerMaxProduct : p\n }, undefined)\n }", "function longest(arr)\n{\n let longest;\n\n for (let i = 0; i < arr.length - 1; i++)\n longest = arr[i].length > arr[i + 1].length ? arr[i] : arr[i + 1];\n return longest;\n}", "function largestOfFour(arr) {\n // You can do this!\n var theLongest = 0;\n var array = [];\n for(var i = 0; i < arr.length; i++){\n for(var j = 0; j < arr[i].length; j++){\n if(arr[i][j] > theLongest){\n theLongest = arr[i][j];\n }\n }\n array.push(theLongest);\n theLongest = 0;\n }\n\n\n return array;\n}", "function printMaxOf2DArray(arr) {\n var max = arr[0][0]\n for (var i = 0; i < arr.length; i++) {\n console.log(\"i is \" + i)\n for (var j = 0; j < arr[i].length; j++) { //The arr[i] is important to remember so that it can go through the parent array\n console.log(\"j is \" + j)\n if (arr[i][j] > max) {\n console.log(\"In the if block.\")\n max = arr[i][j]\n }\n }\n }\n console.log(max)\n}", "function biggestElement (input) {\n let matrix = input.map(line => line.map(Number));\n let biggestNumber = Number.MIN_SAFE_INTEGER;\n\n for (let row = 0; row < matrix.length; row++) {\n for (let col = 0; col < matrix[row].length; col++) {\n let currentNumber = matrix[row][col];\n\n biggestNumber = Math.max(biggestNumber, currentNumber);\n }\n }\n\n // matrix.forEach(row =>\n // row.forEach(currentNumber =>\n // (biggestNumber = Math.max(biggestNumber, currentNumber))\n // )\n // );\n\n // matrix.forEach(row =>\n // row.forEach(currentNumber => {\n // if (currentNumber > biggestNumber) {\n // biggestNumber = currentNumber;\n // }\n // })\n // );\n\n // biggestNumber = Math.max.apply(null, matrix.reduce((firstRow, secondRow) => firstRow.concat(secondRow)));\n\n console.log(biggestNumber);\n}", "function maxLength(arr){\n\tvar max = -1;\n\tfor(var row = 0; row < arr.length; row++){\n\t\tif(arr[row].length > max){\n\t\t\tmax = arr[row].length;\n\t\t}\n\t}\n\tfor(var row = 0; row < arr.length; row++){\n\t\twhile(arr[row].length < max){\n\t\t\tarr[row].splice(0,0,-1);\n\t\t}\n\t}\n\tconsole.log(arr);\n\treturn max;\n}", "function largestOfFour(arr) {\r\n var subArrayPos = 0; // var for I array\r\n var subArrayNum = [0];// var for J array\r\n for(i = 0; i < arr.length; i++)\r\n { //loop 4 arrays, inside array\r\n for(j = 0; j < arr[i].length; j++)\r\n { //loop numbers inside 4 arrays\r\n var newArrayMax = arr[i][j];\r\n if(subArrayPos < newArrayMax)\r\n {\r\n subArrayPos = newArrayMax;\r\n subArrayNum[i] = subArrayPos;\r\n }\r\n }\r\n subArrayPos = 0; //set to zero\r\n }\r\n return subArrayNum;\r\n}", "function getLongestElement(arr) {\n\t// if the arr length is 0\n\tif (arr.length === 0) {\n\t\t// return ''\n\t\treturn '';\n\t}\n\t// create a variable max assign it to the first element of arr\n\tlet max = arr[0];\n\t// iterate through the arr\n\tfor (let i = 1; i < arr.length; i++) {\n\t\t// if the element length is > than max length\n\t\tif (arr[i].length > max.length) {\n\t\t\t// reassign max to element\n\t\t\tmax = arr[i];\n\t\t}\n\t}\n\t// return max\n\treturn max;\n}", "function maxTwoDimArray(matrix) {\n \n}", "function findLongest(array) {\n var currentLongest = array[0];\n var longestItems = [array[0]]\n for (var i = 1; i < array.length; i++) {\n if (array[i].length >= currentLongest.length) {\n currentLongest = array[i];\n longestItems.push(array[i]);\n }\n }\n for (var n = 0; n < longestItems.length; n++) {\n if (longestItems[n].length < currentLongest.length) {\n longestItems.splice(n, 1);\n n -= 1;\n }\n }\n return longestItems;\n}", "function printMaxOf2DArray(arr){\n var max = arr[0][0]\n for (var i = 0; i < arr.length; i++){\n console.log(\"i is \" + i)\n for (var j = 0; j < arr[i].length; j++){\n console.log(\"j is \" + j)\n if (arr[i][j] > max){\n console.log(\"In the if block.\")\n max = arr[i][j]\n }\n }\n }\n console.log(max)\n}", "function maxTwoDimArray(matrix) {\n let biggestNumber = 0;\n for (let i = 0; i < matrix.length; i++) {\n for (let j = 0; j < matrix[i].length; j++) {\n if (matrix[i][j] > biggestNumber) {\n biggestNumber = matrix[i][j];\n }\n }\n }\n return biggestNumber;\n //\n}", "function longestItem(array) {\r\n\tvar longest = ''\r\n\t\tfor ( var i = 0; i < array.length; i++) {\r\n\t\t\tif (array[i].length > longest.length) {\r\n\t\t\t\tlongest = array[i] }\r\n\t\t}\r\n\treturn longest\r\n}", "function longest(array){\n let longest\n let length = -999\n\n for(let i=0; i<array.length; i++){\n if(array[i].length > length){\n length = array[i].length\n longest = array[i]\n }\n }\n console.log(longest)\n\n}", "function lorgestNumberInArr(arr) {\n let result = [];\n for (let i = 0; i < arr.length; i++){\n let largestNumber = arr[i][0];\n for (let j = 0; j < arr[i].length; j++){\n if (arr[i][j] > largestNumber) {\n largestNumber = arr[i][j];\n }\n }\n result[i] = largestNumber;\n }\n return result;\n}", "function maxTwoDimArray(matrix) {\n let largestNum = 0;\n for(let i = 0; i < matrix.length; i++){\n if(matrix[0][i] > largestNum && matrix[1][i] > largestNum && matrix[2][i] > largestNum){\n largestNum = matrix[i][i];\n }\n }\n return largestNum;\n}", "function largestOfFour(arr) {\n let results = [];\n for (let i = 0; i < arr.length; i++) {\n let largestNumber = arr[i][0];\n for (let j = 1; j < arr[i].length; j++) {\n if (arr[i][j] > largestNumber) {\n largestNumber = arr[i][j];\n }\n }\n results[i] = largestNumber;\n }\n return results;\n}", "function findLongestWord(arr) {\n\n let longest = arr[0];\n let indexOfLongest = 0;\n // arr.forEach(function (item, index) {\n // if (item.length > longest.length) {\n // longest = arr[index];\n // }\n // });\n // return longest.length;\n\n for(let i=0; i<arr.length; i++){\n if(arr[i].length > longest.length){\n longest = arr[i];\n }\n }\n return longest.length;\n}", "function maxTwoDimArray(matrix) {\n //\n}", "function maxTwoDimArray(matrix) {\n //\n}", "function maxTwoDimArray(matrix) {\n //\n}", "function maxTwoDimArray(matrix) {\n //\n}", "function findBiggestElement(input) {\n let biggestNumber = Number.NEGATIVE_INFINITY;\n let matrix = input.map(row => row.split(' ').map(Number)); // read matrix from input\n matrix.forEach(\n element => element.forEach(\n num => biggestNumber = Math.max(biggestNumber, num)\n ));\n return biggestNumber;\n}", "function returnLongestString(array){\n let newArray = array;\n\n let currentStr = newArray[0]; \n for(let i = 1; i <= newArray.length; i++){\n if( newArray[i].length > currentStr.length ) return currentStr = newArray[i] ;\n }\n return currentStr;\n}", "function longestSubArrLen(arr) {\n let currentLongest = 1;\n let runningLongest = 0;\n for (let i = 0; i < arr.length - 1; i++) {\n if (arr[i] === arr[i + 1]) {\n // update currentLongest\n currentLongest++;\n } else {\n // update runningLongest by comparing to currentLongest\n // reset currentLongest to 0\n runningLongest = Math.max(runningLongest, currentLongest);\n currentLongest = 1;\n }\n }\n return runningLongest;\n}", "function longest_str_in_array(arra) {\n\n var max_str = arra[0].length;\n\n var ans = arra[0];\n\n for (var i = 1; i< arra.length; i++) {\n\n var maxi = arra[i].length;\n\n if(maxi > max_str) {\n\n ans = arra[i];\n\n max_str = maxi;\n }\n }\n \n return ans;\n }", "function maxTwoDimArray (matrix) {\n\tlet largest = [0][0];\n\tfor (let i = 0; i < matrix.length; i++) {\n\t\tfor (let j = 0; j < matrix[i].length; j++) {\n\t\t\tif (matrix[i][j] > largest) {\n\t\t\t\tlargest = matrix[i][j];\n\t\t\t}\n\t\t}\n\t}\n\treturn largest;\n\n}", "function biggestProductAllColumn(mat){\n let result = [];\n for(let i =0;i<mat.length;i++){\n for (let j=0;j<mat.length;j++){\n result.push(mat[j][i]); \n }\n }\n return bigProd1Row(result);\n }", "function longestPeak(array) {\n \tlet longest = 0;\n\t\n\tfor (let i = 1; i < array.length; i++) {\n\t\tlet left = i-1;\n\t\tlet right = i+1;\n\t\tif (array[i] > array[left] && array[i] > array[right]) {\n\t\t\tlet curLength = 3;\n\t\t\tleft--;\n\t\t\tright++;\n\t\t\twhile (left >= 0) {\n\t\t\t\tif (array[left] < array[left+1]) {\n\t\t\t\t\tcurLength++;\n\t\t\t\t} else break;\n\t\t\t\tleft--\n\t\t\t}\n\t\t\t\n\t\t\twhile (right < array.length) {\n\t\t\t\tif (array[right] < array[right-1]) {\n\t\t\t\t\tcurLength++\n\t\t\t\t} else break;\n\t\t\t\tright++\n\t\t\t}\n\t\t\tlongest = Math.max(longest, curLength)\n\t\t}\n\t}\n\t\n\treturn longest\n}", "function largestOfFour(arr) {\n var largestArr = []; // empty holder array to hold results of largest numbers\n for (var i = 0; i < arr.length; i++) { // iterates through outer arrays\n var largestNum = 0; // set largest number to 0 to compare to initially. Resets after each sub-array iteration\n for (var j = 0; j < arr.length; j++) { // iterates through inner arrays\n if (arr[i][j] >= largestNum) { // if current number in loop is greater than or equal to largestNum.\n largestNum = arr[i][j]; // current number in loop becomes largest number\n }\n }\n largestArr.push(largestNum); // pushes the largest number of each inner array in to holder array.\n }\n console.log(largestArr);\n return largestArr; // returns the new array with largest numbers of each inner array.\n}", "function maxTwoDimArray(matrix) {\n let highestNum = -Infinity;\n matrix.forEach(function(array) {\n array.forEach(function(num) {\n if (num > highestNum) {\n highestNum = num;\n }\n });\n });\n return highestNum;\n}", "function return_longest(array) {\n var longest_item = \"\"\n for (var i = 0; i <= array.length - 1 ; i++) {\n if ((array[i]).length > longest_item.length) {\n longest_item = array[i];\n }\n }\nconsole.log(longest_item);\n}", "function getMaxArr(arr){\n var maxVal = arr[0][0];\n for( var i=0; i<arr.length; i++ ){\n for ( var j=0; j<arr[i].length; j++ ){\n if( arr[i][j] > maxVal) maxVal = arr[i][j];\n }\n }\n return maxVal;\n}", "function longestLength(array) {\r\n// start with an empty current longest\r\n\tvar currentLongest = \"\";\r\n\t// iterate over the array\r\n\tfor (var i = 0; i < array.length; i++) {\r\n\t\t// IF the string is longer than current longest\r\n\t\tif (array[i].length > currentLongest.length) {\r\n\t\t\t// THEN it becomes the current_longest \r\n\t\t\tcurrentLongest = array[i];\r\n\t\t}\r\n\t}\r\n\r\n\t// RETURN the length of the current longest\r\n\treturn currentLongest.length;\r\n}", "function largestOfFour(arr) {\n var largest = [0,0,0,0];\n for(i=0; i<4; i++){\n for(j=0; j<4; j++){\n if (arr[i][j] > largest[i])\n largest[i] = arr[i][j];\n }\n }\n return largest;\n}", "getDataMax(data) {\n let max = 0;\n for (let i = 0; i < data.length; i++) {\n for (let j = 0; j < data[i].length; j++) {\n if (data[i][j] > max) {\n max = data[i][j]\n }\n }\n }\n return max\n }", "function findLongestWord(arr){\n let result=0;\n for(i=0; i<arr.length; i++){\n if(arr[i].length>result)\n result = arr[i].length;\n }\n return result;\n }", "function largestOfFour(arr) {\n var largestArray = [];\n\n //Move through each sub-array.\n for (var i = 0; i < arr.length; i++) {\n var biggestNum = 0;\n //Move through each element in the specific sub-array.\n for (var j = 0; j < arr[i].length; j++) {\n if (arr[i][j] > biggestNum) {\n biggestNum = arr[i][j];\n } \n } //Push biggestNum result to array, then we'll try next sub-array.\n largestArray.push(biggestNum);\n }\n \n return largestArray;\n}", "function habashtakalat(){\narray.forEach((row,i) =>{\n\n lastarrayList[i] = ( row.map(\n function(element, j)\n {\n if(element > arrThis[i][j]){\n return element; \n }; \n return arrThis[i][j];\n },\n arrThis[i]));\n\n});\n\n}", "function longestWordLengthInArray(array) {\n let maxLength = 0;\n for (let i = 0; i < array.length; i++) {\n if (array[i].length > maxLength) {\n maxLength = array[i].length;\n }\n }\n return maxLength;\n}", "function longestString(arr){\n\tvar result = \"\";\n\tfor(var i=0; i<arr.length; i++){\n\t\tif(arr[i].length >= arr[0].length){\n\t\t\tresult = arr[i];\n\t\t}\n\t}\n\treturn result;\n}", "function longestPeak(array) {\n let maxLen = 0\n let len = 0\n for (let i = 1; i < array.length - 1; i++) {\n if (array[i] > array[i+1] && array[i] > array[i-1]) {\n let left = i - 1\n let right = i + 1\n while (left > 0 && array[left] > array[left - 1]) {\n left -= 1\n }\n while (right < array.length && array[right] > array[right + 1]) {\n right += 1\n }\n\n len = right - left + 1\n if (len > maxLen) maxLen = len\n }\n }\n return maxLen\n}", "function maxTwoDimArray(matrix) {\n let maxNumber = array[0];\n for(let i = 1; i < array.length; i++){\n if(array[i] > maxNumber){\n maxNumber = array[i];\n }\n }\n return maxNumber;\n}", "function findLongestWord(arr) {\n let longestWord = 0;\n for (let i = 0; i < arr.length; i++) {\n if (arr[i].length > longestWord) {\n longestWord = arr[i].length;\n }\n }\n return longestWord;\n}", "function largestOfFour(arr) {\n // You can do this!\n\n var results = [];\n\n for (var i = 0; i < arr.length; i++) {\n var largeNum = 0;\n\n for (var n = 0; n < arr[i].length; n++) {\n if (arr[i][n] > largeNum) {\n largeNum = arr[i][n];\n }\n }\n results[i] = largeNum;\n }\n return results;\n}", "function longestItem(array) {\nvar lengths = []; \nvar max = 0;\n array.forEach(function (item, index, array) {\n lengths.push(item.length);\n });\n lengths.forEach(function (item, index, array) {\n if (max < item) {\n max = item;\n } \n });\nreturn array[lengths.indexOf(max)];\n}", "function largestOfFour(arr) {\n // You can do this!\n let results = []\n\n for (let i = 0; i < arr.length; i++) {\n let largetsNumber = arr[i][0]\n console.log(largetsNumber)\n for (let j = 1; j < arr[i].length; j++) {\n if (arr[i][j] > largetsNumber) {\n largetsNumber = arr[i][j]\n }\n }\n\n results[i] = largetsNumber;\n }\n return results;\n}", "function findLongestWord(array) {\n var norm = 0;\n var longest;\n\n for (var i = 0; i < array.length; i++) {\n if (array[i].length > norm) {\n norm = array[i].length;\n longest = array[i];\n }\n }\n return longest;\n}", "function findTextLongest(arr){\nvar res=[];\nvar max=0;\nif(arr=='' || typeof arr != \"object\"){\nreturn 'nhap mang ko rong';\n}\nfor (var i=0;i<arr.length;i++){\n if(typeof arr[i] != 'string'){\n return \"co phan tu cua mang ko phai la string\";\n }\n}\nfor(var i=0;i<arr.length;i++){\nif(arr[i].length>max){\n max=arr[i].length;\n}\nfor (var i=0;i<arr.length;i++){\n if(arr[i].length==max){\n res.push(arr[i]);\n }\n}\n}\nreturn res;\n}", "function getMaxSum(array) {\n let result = 0;\n for (let i = 1; i < array.length-1; i++) {\n for (let j = 1; j < array[i].length-1; j++) {\n if (array[i-1][j-1] !== undefined && array[i+1][j+1] !== undefined && array[i-1][j+1] !== undefined && array[i+1][j-1] !== undefined){\n let sum = array[i][j] + array[i-1][j-1] + array[i-1][j] + array[i-1][j+1] + array[i+1][j-1] + array[i+1][j] + array[i+1][j+1];\n if (sum > result) { result = sum; }\n }\n }\n }\n return result;\n}", "function main() {\n var arr = [];\n for(arr_i = 0; arr_i < 6; arr_i++){\n arr[arr_i] = readLine().split(' ');\n arr[arr_i] = arr[arr_i].map(Number);\n }\n \n let max = -Infinity\n \n for (let i = 1; i < 5; i += 1 ) {\n for (let j = 1; j < 5; j += 1) {\n const topLeft =\t \tarr[i - 1][j - 1] \n const top = \t\tarr[i - 1][j ] \n const topRight = \tarr[i - 1][j + 1]\n const center = \t\tarr[i ][j ] \n const bottomLeft =\tarr[i + 1][j - 1]\n const bottom = \t\tarr[i + 1][j ]\n const bottomRight = arr[i + 1][j + 1]\n\n const sum = topLeft + top + topRight + center + bottomLeft + bottom + bottomRight\n if (sum > max) max = sum\n }\n }\n console.log(max)\n}", "function biggestProduct1Column(mat ,col){\n let result = [];\n for(let i =0;i<mat.length;i++){\n for (let j=0;j<mat.length;j++){\n result.push(mat[j][col]); \n }\n }\n return bigProd1Row(result);\n }", "function get_max(input) {\n // console.log(input);\n if (input.length <= 0 || input[0].length <= 0) {\n return -1;\n }\n var max = input[0][0];\n var ans = [max, 0];\n for (var i = 0; i<input.length; i++) {\n if (input[i][0] > max) {\n max = input[i][0];\n ans = [max, i];\n }\n }\n return ans;\n}", "function Longest(arr) {\n var longestVariable = \"\";\n for (let element of arr) {\n if (element.length > longestVariable.length)\n longestVariable = element;\n }\n return longestVariable;\n}", "function findLongestWord(array) {\n let longestWord;\n let length = 0;\n for (let i = 0; i < array.length; i++) {\n if (array[i].length > length) {\n length = array[i].length;\n longestWord = array[i];\n\n }\n }\n return longestWord;\n\n}", "function longestWord(array) {\n var longest = array[0];\n for(var i = 0; i < array.length;i++) {\n var arrayWords = array[i];\n if (arrayWords.length >= longest.length) {\n longest = arrayWords;\n }\n };\n return longest;\n}", "function lastArr(arr) {\n for (let y = 8; y > 0; y--) {\n for (let x = 8; x > 0; x--) {\n if (typeof arr[y][x] === \"object\") {\n return [y, x];\n }\n }\n }\n }", "function longest(arr){\n\tvar longestWord = \"\";\n\tfor(var i = 0; i < arr.length; i++){\n\t\tif (arr[i].length > longestWord.length){\n\t\t\tlongestWord = arr[i];\n\t\t}\n\t}\n\treturn longestWord;\n}", "function getMaxSumRow() {\n\t\tvar curr = 0;\n\t\tfor (i = 0; i < matrix.length; i++) {\n\t\t\tvar tmp = 0;\n\t\t\tvar arr = matrix[i].length;\n\t\t\twhile(arr--){\n\t\t\t\ttmp += matrix[i][arr];\n\t\t\t}\n\t\t\tif(curr <= tmp){\n\t\t\t\tcurr = tmp;\n\t\t\t}\n\t\t}\n\t\treturn curr;\n\t}", "function longestPeak(array) {\n\tlet currLength;\n\tlet max = 0;\n\tfor (let i = 1; i < array.length; i++) {\n\t\tlet prev = array[i - 1];\n\t\tlet curr = array[i];\n\t\tlet next = array[i + 1];\n\t\tif (curr > prev && curr > next) {\n\t\t\tlet leftIndex = i - 1;\n\t\t\tlet rightIndex = i + 1;\n\t\t\twhile (leftIndex > 0 && array[leftIndex] > array[leftIndex - 1]) leftIndex--;\n\t\t\twhile (rightIndex < array.length && array[rightIndex] > array[rightIndex + 1]) rightIndex++;\n\t\t\tcurrLength = rightIndex - leftIndex + 1;\n\t\t\tmax = Math.max(max, currLength);\n\t\t}\n\t}\n\treturn max;\n}", "function largestOfFour(arr) {\r\n var results = [];\r\n for (var n = 0; n < arr.length; n++) {\r\n var largestNumber = arr[n][0];\r\n for (var sb = 1; sb < arr[n].length; sb++) {\r\n if (arr[n][sb] > largestNumber) {\r\n largestNumber = arr[n][sb];\r\n }\r\n }\r\n\r\n results[n] = largestNumber;\r\n }\r\n\r\n return results;\r\n}", "function largestOfFour(arr) {\n var results = [];\n for (var n = 0; n < arr.length; n++) {\n var largestNumber = arr[n][0];\n for (var sb = 1; sb < arr[n].length; sb++) {\n if (arr[n][sb] > largestNumber) {\n largestNumber = arr[n][sb];\n }\n }\n\n results[n] = largestNumber;\n }\n\n return results;\n}", "function longestSlideDown(pyramid){\n for (var stage = pyramid.length-1; stage > 0; stage--){\n for (var square = 0; square < pyramid[stage-1].length; square++){\n pyramid[stage-1][square] = pyramid[stage-1][square] + Math.max(pyramid[stage][square], pyramid[stage][square+1]);\n }\n }\n return pyramid[0][0];\n}", "function allLongestStrings2(inputArray) {\n 'use strict';\n let maxSize = Math.max(...inputArray.map(x => x.length));\n console.log('maxSize', maxSize)\n return inputArray.filter(x => x.length === maxSize);\n}", "function findLongestRow(rows){\n var maxNumberOfSeats = 0;\n for(var row in rows){\n if(rows.hasOwnProperty(row)) {\n if (rows[row] > maxNumberOfSeats)\n maxNumberOfSeats = rows[row];\n }\n }\n return maxNumberOfSeats;\n}", "function longestCollatzSequence(searchMax) {\n var n, i, j, len, path;\n //store known results, expect no more than 1 million records\n //improve search of 1,000,000 from 10 sec to 2 sec\n var memo = {1: 1};\n var maxLen = 1\n , maxNum = 1;\n for (i = 2; i < searchMax; i++) {\n n = i;\n path = [];\n while (true) {\n if (memo[n]) {\n //hit cache, remember 1 is already in the cache\n //so this is our exit of the while loop\n len = memo[n];\n break;\n }\n else {\n path.push(n);\n if (n % 2 === 0) {\n //even\n n = n / 2;\n }\n else {\n n = 3 * n + 1;\n }\n }\n }\n //unwind the stack, add to memo\n for (j = path.length - 1; j >= 0; j--) {\n len++;\n memo[path[j]] = len;\n }\n if (len > maxLen) {\n //save max result\n maxLen = len;\n maxNum = i;\n }\n }\n return maxNum;\n}", "function largestOfFour(arr) {\n let largestNumber = Number.NEGATIVE_INFINITY ;\n let largestArray = [];\n\n for (let i = 0; i < arr.length; i++) {\n\n for (let j = 0; j < arr[i].length; j++) {\n\n if (arr[i][j] > largestNumber) {\n largestNumber = arr[i][j];\n }\n \n }\n\n largestArray.push(largestNumber);\n largestNumber = Number.NEGATIVE_INFINITY;\n }\n console.log(largestArray);\n return largestArray;\n}", "function largestOfFour(arr) {\n let newArr = []\n const MIN_VAL = -324324243 \n for(let i = 0; i < arr.length; i++) {\n // console.log(arr[i]);\n let tempNum = MIN_VAL;\n for(let j = 0; j < arr[i].length; j++) {\n\n if(arr[i][j] > tempNum) {\n tempNum = arr[i][j];\n }\n \n }\n newArr.push(tempNum);\n }\n return newArr;\n}", "function findLongestWord (input_arr){\r\n var longestWord = \"\";\r\n\r\n for (var i=0; i < input_arr.length; i++){\r\n if (input_arr[i].length > longestWord.length) {\r\n longestWord = input_arr[i];\r\n }\r\n }\r\n\r\n return longestWord;\r\n}", "function largestOfFour(arr) {\n // You can do this!\n let largestNumArray = [];\n\n for (let i = 0 ; i < arr.length ; i++ ) {\n let subLargeNum = arr[i][0];\n for(let j = 0 ; j < arr[i].length ; j++ ) {\n if (arr[i][j] > subLargeNum ) {\n subLargeNum = arr[i][j];\n }\n }\n largestNumArray.push(subLargeNum)\n }\n\n\n return largestNumArray;\n}", "function maxSubarray(arr) {\n\n}", "function longest(array) {\nvar longestWord = \" \";\nfor (var x = 0; x < array.length; x++) {\n if (array[x].length > longestWord.length ) {\n longestWord = array[x];\n}\n}\nconsole.log(longestWord);}", "function Longest(array) {\r\n\tthis.array = array;\r\n\tvar longest = \"\";\r\n\tfor (var i = 0; i< array.length; i++) {\r\n\t\t// longest = array[i];\r\n\t\t// console.log(longest)\r\n\t\tif (array[i].length > longest.length) {\r\n\t\t\t longest = array[i];\r\n\t\t}\r\n\t}\r\nreturn longest;\r\n}", "function maxTwoDimArray(matrix) {\n let maxRow = matrix.map(function(row){ return Math.max.apply(Math, row); });\n return max = Math.max.apply(null, maxRow); \n}", "function findMaximumSubarray2(A) {\n \n}", "function largestOfFour (arr) {\n let max = 0\n let newArr = []\n\n for (let j = 0; j < arr.length; j++) {\n for (let i = 0; i < arr[j].length; i++) {\n max = Math.max(...arr[j])\n }\n newArr.push(max)\n }\n return newArr\n}", "function getNeighborCoordsRightCol(i, jMax) {\n return [\n [i - 1, jMax - 1], // The cells above-left and directly above.\n [i - 1, jMax],\n [i, jMax - 1], // The cell to the left.\n [i + 1, jMax - 1], // The cells below-left and directly below.\n [i + 1, jMax]\n ];\n}", "function findLongestWord (words) {\n\t//iterate through the array\n\t//iterate through each letter in each word\n\t//record the number of letters in each word\n\t//record which one is the greatest\nvar lgth = 0;\nvar longest;\n\nfor(var i=0; i < words.length; i++){\n if(words[i].length > lgth){\n lgth = words[i].length;\n longest = words[i];\n } \n} \n\nreturn(longest);\n\n \n}", "function findLongestWordInArray( wordArray ){\n\tvar bigNumber = 0;\n\tfor (var i=0; i < wordArray.length; i++){\n\t\tif (wordArray[i].length > bigNumber) {\n\t\t\tbigNumber = wordArray[i];\n\t\t}\n\t}\n\treturn bigNumber;\n}", "function findLongestWord(array){\n \"use strict\";\n var count = 0;\n for (i = 0; i < array.length; i++) {\n if (array[i].length > count)\n count = array[i].length;\n }\n return count;\n}", "function findLongestWord(wordArray) {\r\n const wordLengths = wordArray.map(word => word.length);\r\n //console.log(wordLengths);\r\n const longest = wordLengths.reduce((accum, curr) => {\r\n if (curr > accum) {\r\n return curr;\r\n } else {\r\n return accum;\r\n }\r\n });\r\n return longest;\r\n}", "function worst(row,rowFixedLength,ratio){var areaMax=0;var areaMin=Infinity;for(var i=0,area,len=row.length;i < len;i++) {area = row[i].getLayout().area;if(area){area < areaMin && (areaMin = area);area > areaMax && (areaMax = area);}}var squareArea=row.area * row.area;var f=rowFixedLength * rowFixedLength * ratio;return squareArea?mathMax(f * areaMax / squareArea,squareArea / (f * areaMin)):Infinity;}", "function largestOfFour(arr) {\n \n let arrLarge = arr,\n arrSmall = [];\n \n //1. simple for loops\n arrSmall.length = arrLarge.length;\n for (let i = 0; i < arrSmall.length; i++){\n arrSmall[i] = -Infinity;\n }\n \n for (let i = 0; i < arrLarge.length; i++){\n for (let j = 0; j < arrLarge[i].length; j++){\n if(arrLarge[i][j] > arrSmall[i]){\n arrSmall[i] = arrLarge[i][j];\n }\n }\n }\n\n //2. using reduce\n /*for (let i = 0; i < arrLarge.length; i++){\n arrSmall.push(arrLarge[i].reduce((number, nextNumber) => {\n if (number > nextNumber){\n return number;\n } else{\n return nextNumber;\n }\n }))\n }*/\n \n return arrSmall;\n\n //3. using map and reduce\n /*return arr.map(function(group){\n return group.reduce(function(prev, current) {\n return (current > prev) ? current : prev;\n });\n });*/\n }", "function getLongestWorm()\r\n{\r\n\tlongestWormSize = 0;\r\n\tlongestWorm = \"\";\r\n\t\r\n\tfor(var i = 0; i < worms.length; i++)\r\n\t{\r\n\t\tif(players[i])\r\n\t\t{\r\n\t\t\t//alert(i+\" \"+worms[i].length+\" \"+longestWormSize);\r\n\t\t\tif(worms[i].length >= longestWormSize)\r\n\t\t\t{\r\n\t\t\t\tlongestWorm = worms[i];\r\n\t\t\t\tlongestWormSize = worms[i].length;\r\n\t\t\t\t//alert(worms[i].length);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function longestWord(array) {\n var longestWord = \"\";\n for (var i = 0; i < array.length; i++) {\n var currentWordLength = array[i].length;\n if (currentWordLength > longestWord.length) {\n longestWord = array[i];\n }\n }\n console.log(longestWord);\n return longestWord;\n}", "function longestFailure(array, matcher) {\n let fail = null;\n for (let i = 0; i < array.length; i++) {\n const innerInspection = { ...inspection, failureReason: '' };\n if (match(array[i], matcher, innerInspection)) {\n return null;\n }\n if (fail === null || innerInspection.failureReason.length > fail[1].length) {\n fail = [i, innerInspection.failureReason];\n }\n }\n return fail;\n }", "function findLongestArraySnippetBasedOnSum(s, arr) {\n\n}", "function longest (l) { // {{{\n\tvar maxlen = 0;\n\tl.shift().forEach( function (s) { if (s && s.length > maxlen) { maxlen = s.length } } );\n\treturn maxlen;\n} // }}}", "function findLongestWord(array) {\n return array.reduce(function (long1, long2) {\n return long2.length > long1.length ? long2 : long1;\n }, '');\n}", "function longest_word(word_array) {\r\n\t// 1\r\n\tmax_word_length = 0\r\n\tfor (var i = 0; i < word_array.length; i++) {\r\n\t\tif (word_array[i].length > max_word_length) { max_word_length = word_array[i].length; }\r\n\t}\r\n // 2\r\n for (var i = 0; i < word_array.length; i++) {\r\n \tif (word_array[i].length == max_word_length) {console.log(\"Longest Word in the array [\"+ word_array+\"] is \"+word_array[i]+\". \");}\r\n }\r\n}", "function returnLongest(array){\r\n\tvar longestPhrase = \"\";\r\n\tvar longestPhraseLength = 0;\r\n\tfor (var i = 0; i < array.length; i ++){\r\n\t\tif (array[i].length > longestPhraseLength){\r\n\t\t\tlongestPhraseLength = array[i].length;\r\n\t\t\tlongestPhrase = array[i]\r\n\t\t}\r\n\t\t\r\n\t}\r\n\treturn longestPhrase\r\n}", "function findSolution(arr) {\n const x = [];\n let longestSubArrayLength = 0;\n let subArrayLength = 0;\n for (i = 0; i < arr.length; i++) {\n if (x.includes(arr[i])) {\n if (subArrayLength > longestSubArrayLength) {\n longestSubArrayLength = subArrayLength;\n }\n subArrayLength = 1;\n x.length = 0;\n } else {\n x.push(arr[i]);\n subArrayLength += 1;\n }\n }\n return subArrayLength > longestSubArrayLength\n ? subArrayLength\n : longestSubArrayLength;\n}", "function sortByLongest(array) {\n return array.sort((a,b)=>{ \n return b.length - a.length || a.localeCompare(b) \n })\n}", "function largestOfFour(arr) {\n \n var largestNumbers = [];\n \n //Loop through array to access subarrays\n for (var j = 0; j < arr.length; j++) {\n \n var largest = 0;\n for (var i = 0; i < arr[j].length; i++) {\n //Compare each value in sub array\n if (arr[j][i] > largest) {\n largest = arr[j][i];\n }\n }\n \n //Append largest value in each sub array to new array\n largestNumbers.push(largest);\n }\n \n //Return the new array\n return largestNumbers;\n}", "function largestNumbersInSubarrays(arr) {\n\tlet maxArr = [];\n\tlet maxInside;\n\tfor(let i = 0; i<arr.length; i++) {\n\t\tmaxInside = arr[i][0];\n\t\tfor (let j = 0; j <arr[i].length; j++) {\n\t\t\tif (arr[i][j] > maxInside) {\n\t\t\t\tmaxInside = arr[i][j];\n\t\t\t}\n\t\t}\n\t\tmaxArr.push(maxInside);\n\t}\n\treturn maxArr;\n}" ]
[ "0.7076965", "0.67478013", "0.671844", "0.6654538", "0.6619572", "0.66142774", "0.6592924", "0.65276855", "0.6515298", "0.6469621", "0.6424584", "0.6409311", "0.63431895", "0.6265667", "0.6229832", "0.6218169", "0.6215327", "0.61861247", "0.6151872", "0.61493623", "0.6144392", "0.6140586", "0.61308944", "0.6130591", "0.61290616", "0.61290616", "0.61290616", "0.61290616", "0.6114315", "0.6066804", "0.60596853", "0.60410553", "0.60387003", "0.6031347", "0.6026932", "0.6017054", "0.6012831", "0.6006164", "0.5995912", "0.59914345", "0.5987772", "0.5983827", "0.5977873", "0.5966863", "0.5961386", "0.5954313", "0.594817", "0.5947244", "0.59313345", "0.5927671", "0.591239", "0.5911027", "0.58735585", "0.58730453", "0.5866861", "0.58609873", "0.58564997", "0.5853575", "0.584991", "0.5842885", "0.58334655", "0.5832968", "0.5831256", "0.5822906", "0.58196247", "0.581578", "0.58101696", "0.58021104", "0.5792751", "0.5775155", "0.57717025", "0.57621753", "0.5743754", "0.57422", "0.57317674", "0.57266074", "0.5715864", "0.5712681", "0.5706746", "0.5706711", "0.569434", "0.5692847", "0.5690529", "0.5689332", "0.56710863", "0.566486", "0.56628317", "0.5661582", "0.5659067", "0.5658373", "0.56546265", "0.5653715", "0.5651954", "0.56476426", "0.5646933", "0.563365", "0.56310755", "0.5628308", "0.5627966", "0.5616675", "0.5614577" ]
0.0
-1
Reducer handles cell navigation and updates It does not mix the toast dispatchers Any actions are available globally in the app
function reducer(state, action) { let { type, x, y, value, tableData, code } = action; switch (type) { case 'LOAD_DATA': { // Input data is valid JSON here tableData = JSON.parse(tableData); let size = getTableDimensions(tableData); // Loop though array object and convert formulas to values // TODO: Let user decide if the input JSON should instantly be normalized let normalizedData = tableData.map(function(tableRow) { return tableRow.map(value => { let normalizedValue = value.length > 0 ? parseFomula(tableData, value) : value; return normalizedValue; }); }); return { ...state, tableData: normalizedData, size, coordinates: [0, 0] }; } case 'SAVE_CELL': { let newTable = state.tableData; if (!newTable[y]) newTable[y] = []; newTable[y][x] = value; return { ...state, tableData: newTable }; } case 'SET_MOUSE_DOWN': { return { ...state, mouseDown: !state.mouseDown }; } case 'SET_SELECTION': { return { ...state, coordinates: action.coordinates, selection_coordinates: action.coordinates, }; } case 'SET_SELECTION_END': { return { ...state, selection_coordinates: [x, y] }; } case 'MASS_DELETE': { let { tableData, coordinates, selection_coordinates } = state; // Prevent unncessary looping by defining clear start and end indexes // Sort is required to get the lowest x or y coordinate first let row_range = [coordinates[0], selection_coordinates[0]].sort(); let column_range = [coordinates[1], selection_coordinates[1]].sort(); console.log('row', row_range); console.log('column', column_range); for (let c = column_range[0]; c < column_range[1]; c++) { for (let r = row_range[0]; r < row_range[1]; r++) { tableData[c].splice(r); } } return { ...state, tableData }; } case 'ARROW_KEY_PRESS': { let [x, y] = state.coordinates; let [width, height] = state.size; // Prevents out-of-bounds navigation if (code === 37 && x !== 0) { --x; // Left arrow press } else if (code === 38 && y !== 0) { --y; // Up arrow press } else if (code === 39 && x !== width - 1) { ++x; // Right arrow press } else if (code === 40 && y !== height - 1) { ++y; // Down arrow press } return { ...state, coordinates: [x, y], selection_coordinates: [x, y] }; } default: { throw new Error(`Unhandled action type: ${action.type}`); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "dispatch(tr) {\n let dispatchTransaction = this._props.dispatchTransaction;\n if (dispatchTransaction)\n dispatchTransaction.call(this, tr);\n else\n this.updateState(this.state.apply(tr));\n }", "function ActionCell_ActionCell(_ref) {\n var logsEnabled = _ref.logsEnabled,\n rowIndex = _ref.rowIndex,\n data = _ref.data;\n var _data$rowIndex = data[rowIndex],\n isSession = _data$rowIndex.isSession,\n session = _data$rowIndex.session,\n operation = _data$rowIndex.operation;\n\n if (isSession) {\n return renderSessionCell(session);\n }\n\n if (logsEnabled) {\n return renderOperationCell(operation);\n }\n\n return null;\n}", "_onDispatch(action) {\n // In the pursuit of immutability of data, we want to create a new state without mutating the old state\n // So we can grab the current state and \"reduce\" it, using the current state and the provided action\n const newState = this.reduce(this._state, action);\n // Check if the action dispatched described and resulted in any changes \n if(newState !== this._state) {\n // If it did, we want to preserve a copy of the state in history\n this._history.push(this._state);\n // Then update the value of the state\n this._state = newState;\n // Then we emit the changes to notify any listeners \"automatically\" that the state has been updated\n this._emitChange();\n // Otherwise there's nothing to do\n }\n }", "function mapCellAction2Function(range) {\n const row = +range.getRow();\n const column = +range.getColumn();\n const isChecked = range.getValue() === true;\n console.log(\"MAPPING\", { row, column, isChecked, value: range.getValue() });\n const allowedCols = [5, 7];\n if (!isChecked || !allowedCols.includes(column)) return;\n let title = \"\";\n let action = () => console.log(\"No action found\");\n let [rowValues] = ACTIVE_SPREADSHEET.getSheetValues(row, 1, 1, column - 1);\n let actionName = (rowValues[2] || \"\").toLowerCase();\n console.log(\"actionName\", actionName);\n console.log(\"rowValues\", rowValues);\n if (row >= 8 && row <= 11) {\n action = () => useOrder(rowValues);\n }\n if (row === 12) {\n action = getLastestOrders;\n }\n if (row === 17) {\n if (column === 5) action = searchOrder;\n if (column === 7) action = () => useOrder(rowValues);\n }\n //Click on client actions\n if (row === 50) {\n if (actionName.includes(\"crear\")) {\n action = updateOrCreateClient;\n } else if (actionName.includes(\"borrar\")) {\n action = deleteClient;\n }\n }\n //Click on order actions\n if (row === 70) {\n if (actionName.includes(\"crear\")) {\n action = updateOrCreateOrder;\n } else if (actionName.includes(\"borrar\")) {\n action = deleteOrder;\n }\n }\n //Click on finance actions\n if (row === 87) {\n if (actionName.includes(\"actualizar\")) {\n action = updateOrderFinances;\n }\n }\n try {\n showAlert({ title, onAccepted: action });\n } catch (error) {\n console.log(\"GAS OWL ERROR: \", error);\n showErrorMessage(error);\n }\n}", "function Reducer(state = loadState() , action) {\n switch (action.type) {\n case 'UPDATE':\n let newState = [...state];\n newState[action.index] = action.data\n return newState;\n default:\n return state\n }\n}", "function tableReducer(state = [], action) {\n switch (action.type) {\n case 'ADD_TABLE':\n if (action.tableData.after_id === -1) {\n return [action.tableData.table, ...state];\n } else {\n return [...state, action.tableData.table];\n }\n return;\n case 'REMOVE_TABLE':\n return state.filter(table => table.id !== action.tableData.id);\n\n case 'UPDATE_TABLE':\n let tableToUpdateIndex;\n state.some((t,i) => t.id === action.tableData.table.id ? tableToUpdateIndex = i : null);\n\n return [\n ...state.slice(0, tableToUpdateIndex),\n action.tableData.table,\n ...state.slice(tableToUpdateIndex+1)\n ];\n case 'SET_TABLES':\n return state.concat(action.tables);\n case 'UNSUBSCRIBE_TABLES':\n\n return [];\n default:\n return state;\n }\n}", "componentWillUpdate() {\n\n // TODO: Make reload only if necessary.\n if (module.hot) {\n const ReactComponent = this.constructor;\n const actions = (new ReactComponent).actions;\n\n this.unRegisterReducers({...this.actions, ...this.rootActions});\n this.actions = actions;\n this.registerReducers({...this.actions, ...this.rootActions});\n this.mapActions(this.actions, this.rootActions);\n }\n\n }", "function dispatch(action){\n state = reducer(state, action);\n //notify all our listeners about the recent state change\n listeners.forEach(subscribed_listener => subscribed_listener());\n }", "function funcUpdateTodo(url, id, column, newValue, dispatch) {\n axios\n .post(url, {\n id: id,\n column: column,\n newValue: newValue,\n })\n .then((response) => {\n if (response.data.status.code === \"201\") {\n // console.log(\"UPDATE SUCCESSFUL\");\n } else {\n // console.log(\n // `Error : ERROR CODE=${response.data.status.code} ERROR MESSAGE=${response.data.status.message}`\n // );\n }\n })\n .catch((error) => {\n console.error(`Axios Error: ${error}`);\n })\n .then(() => {\n axios\n .get(`${SERVER_URL}?action=GET_ALL_TODO`)\n .then((response) => {\n // disptach all todo to store\n // this refreshes the UI\n if (response.data.status.code === \"200\") {\n dispatch(getAllTodo(response.data.payload));\n } else {\n // console.log(\n // `Error : ERROR CODE=${response.data.status.code} ERROR MESSAGE=${response.data.status.message}`\n // );\n }\n })\n .catch((error) => console.error(`Error: ${error}`));\n });\n}", "_toggleFavorite() {\n const action = { type: \"TOGGLE_FAVORITE\", value: this.state.film }\n this.props.dispatch(action)// il va renvoyer l'action a mon Store donc a favoriteReducer\n }", "actionReducer(action){\n return unitActionReducer.call(this, this.state, action);\n }", "function reducer(state, action) {\n switch (action.type) {\n case 'SELECT_ROW':\n return {\n selectedRow: action.data,\n tasks: state.tasks,\n change: state.change\n };\n case 'ADD_TASKS':\n return{\n selectedRow: state.selectedRow,\n tasks: action.data,\n change: state.change\n };\n case 'TASKS_ADDED':\n return{\n selectedRow: state.selectedRow,\n tasks: state.tasks,\n change: action.data\n };\n default:\n return initialState;\n }\n}", "function reducer(state,action){\n console.log(action);\n\n switch(action.type){ //update user when they log in/out\n\n case 'SET_USER':\n return{\n ...state, user:action.user ///sets user to authenticated user name \n\n }\n case 'ADD_TO_BASKET':\n //Logic for adding item to basket\n return{\n ...state,basket:[...state.basket,action.item],};\n case 'REMOVE_FROM_BASKET':\n let newBasket = [...state.basket]; //current state of basket\n const index = state.basket.findIndex((basketItem)=>basketItem.id===action.id)//find index of basketItem where item id = action id\n if(index>=0){\n\n newBasket.splice(index,1); //removing index\n ///....\n\n }\n \n //Logic for removing item to basket\n return{ ...state,basket:newBasket };//setting basket to new basket\n\n default:\n return state; \n }\n}", "handleAction(action) {\n\n switch (action.type) {\n case \"INITIAL_TABLE_DATA_FETCH\": {\n //Fetch Initial Data\n axios.post(config.url, this.getData({}), {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n\n let rData = response.data,\n fields = [],\n fieldLabels = {},\n noFSFieldsInfo = {};\n\n rData.InitialFields.forEach((f) => {\n //forcefully setting TraitID and columnlabel same in case of initial data as\n //initail data / fields don't have any triatid / dont' belong to trait table.\n fieldLabels[f.ColumnLabel] = f.ColumnLabel;\n noFSFieldsInfo[f.ColumnLabel] = f;\n fields.push(f.ColumnLabel);\n })\n\n this.setState({\n noFSTableData: rData.InitialData,\n mainTableData: rData.InitialData,\n totalRecords: rData.TotalRecords,\n fields: fields,\n noFSfields: fields,\n noFSFieldsInfo: noFSFieldsInfo,\n noFSFieldLabels: fieldLabels,\n fieldLabels: fieldLabels,\n sortColumnList: fieldLabels,\n firstColSortList: fieldLabels,\n secondColSortList: fieldLabels,\n thirdColSortList: fieldLabels\n\n });\n\n /*\n This seciton will be shifted to administration part\n //fetch list of records added to different modules eg, Trialbook, Crossing etc.\n axios.get(config.tempRecordListUrl + \"?CC=TO&getCount=true\", {withCredentials: true})\n .then((response)=> {\n\n let data = response.data.Data;\n if (data.length) {\n data.forEach((d)=> {\n switch (d.Module) {\n case \"TRL\": {\n this.setState({trialbookRecordsCount: d.TotalCount})\n }\n break;\n case \"CRO\": {\n this.setState({crossingRecordsCount: d.TotalCount})\n }\n default:\n break;\n\n }\n })\n }\n })\n .catch((response)=> {\n this.errorHandler(response);\n })*/\n })\n .catch((response) => {\n this.errorHandler(response);\n })\n }\n break;\n case \"FIELDSET_LIST_FETCH\": {\n\n if (this.state.fieldsets.length == 0) {\n\n axios.get(config.fieldsetUrl, {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then(function (response) {\n this.setState({fieldsets: response.data})\n }.bind(this))\n\n .catch((response) => {\n this.errorHandler(response);\n })\n }\n }\n break;\n case \"COLUMNS_LIST_FETCH\": {\n\n if (this.state.columnsList.length == 0) {\n //fetch columns data\n axios.get(config.columnsUrl, {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then(function (response) {\n this.setState({columnsList: response.data})\n }.bind(this))\n .catch((response) => {\n this.errorHandler(response);\n })\n }\n }\n break;\n case \"HIERARCHY_FETCH\": {\n //fetch hierary Data\n axios.post(config.url,\n this.getData({\n nav: action.args,\n sort: false,\n filter: false\n }), {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then(function (response) {\n let rData = response.data,\n dataHistory = this.state.dataHistory,\n rowIds = [],\n mainData = this.state.mainTableData.concat([]),\n noFSTableData = this.state.noFSTableData.concat([]),\n mergedObj = (rData.FinalData != undefined) ? rData.FinalData : rData.InitialData;\n\n if (mergedObj) {\n rowIds = mergedObj.map((row) => {\n return row.EZID\n });\n dataHistory.push({\"ezid\": action.args.ezid, \"rowids\": rowIds});\n }\n\n //need to combine initial data with observation and/or propertyata if present\n if (rData.ObservationData != undefined && rData.ObservationData.length > 0) {\n\n for (let obj of mergedObj)\n for (let tObj of rData.ObservationData) {\n if (tObj.EZID == obj.EZID) {\n Object.assign(obj, tObj);\n }\n }\n }\n\n if (rData.PropertyData != undefined && rData.PropertyData.length > 0) {\n for (let obj of mergedObj)\n for (let tObj of rData.PropertyData) {\n if (obj.EZID == tObj.EZID) {\n Object.assign(obj, tObj);\n }\n }\n }\n\n //pushing in the hierarchy data just after the parent data/record/row\n mergedObj.forEach(function (row) {\n mainData.splice(action.data.rowIndex + 1, 0, row);\n });\n\n //set flag for expanded hierarchy\n mainData[action.data.rowIndex].expanded = true;\n\n if (rData.FinalData == undefined) {\n rData.InitialData.forEach(function (row) {\n noFSTableData.splice(action.data.rowIndex + 1, 0, row);\n });\n }\n else {\n mergedObj.forEach(function (row) {\n noFSTableData.splice(action.data.rowIndex + 1, 0, row);\n });\n }\n //pushed expanded flag state to noFSTableData as well\n noFSTableData[action.data.rowIndex].expanded = true;\n\n //save the data to App state\n // both No Fieldset data columns with expanded flag where needed\n // and the main table data\n this.setState({\n noFSTableData: noFSTableData,\n mainTableData: mainData,\n dataHistory: dataHistory\n });\n\n\n }.bind(this))\n .catch((response) => {\n this.errorHandler(response);\n })\n\n }\n break;\n case \"PAGINATION_FETCH\": {\n\n //fetch pagination data ;\n let newPageNo;\n\n switch (action.args.pn) {\n case \"first\":\n newPageNo = 1;\n break;\n case \"previous\":\n newPageNo = this.state.currentPage - 1;\n break;\n case \"next\":\n newPageNo = this.state.currentPage + 1;\n break;\n case \"last\":\n newPageNo = Math.ceil(this.state.totalRecords / this.state.pageSize);\n break;\n default:\n newPageNo = action.args.pn;\n\n }\n\n let args = {\n \"pn\": newPageNo,\n \"level\": \"-1\",\n \"ezid\": '',\n \"etc\": this.entityTypeCode.toLowerCase() != \"bat\" ? this.entityTypeCode : \"BAT\",\n \"ps\": this.state.pageSize,\n 'tcols': this.state.traitColSelected.concat(this.state.otherTraitCols),\n 'pcols': this.state.propertyColSelected.concat(this.state.otherPropertyCols),\n 'ezids': '',\n 'etcs': '',\n 'pfsid': '',\n 'tfsid': ''\n };\n\n axios.post(config.url, this.getData({nav: args, sort: true, filter: true}), {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then(function (response) {\n\n let rData = response.data;\n //if sorting or filter is also applied\n if (rData.FinalData) {\n\n //extrating base columns set from new Response Data.\n let noFSTableData = rData.FinalData.map((rd) => {\n return {\n \"EZID\": rd.EZID,\n \"EntityTypeCode\": rd.EntityTypeCode,\n \"Name\": rd.Name,\n \"ChildRows\": rd.ChildRows || 0,\n \"Level\": rd.Level\n }\n });\n\n\n this.setState({\n noFSTableData: noFSTableData,\n mainTableData: rData.FinalData,\n currentPage: newPageNo,\n highLightedCol: null,\n selectedRow: []\n }, function () {\n\n })\n\n }\n else {\n let startData = (rData.InitialData != undefined) ? rData.InitialData : this.state.noFSTableData.concat([]),\n mergedObj = [];\n\n //if no colums is selected in both property and trait\n if (rData.ObservationData == undefined && rData.PropertyData == undefined) {\n this.setState({\n noFSTableData: startData,\n mainTableData: startData,\n currentPage: newPageNo,\n highLightedCol: null,\n selectedRow: []\n });\n }\n else {\n\n if (rData.ObservationData != undefined) {\n for (let obj of startData) {\n for (let newObj of rData.ObservationData) {\n if (obj.EZID == newObj.EZID) {\n mergedObj.push(Object.assign({}, obj, newObj));\n break;\n }\n }\n }\n }\n\n if (rData.PropertyData != undefined) {\n\n mergedObj = (rData.ObservationData != undefined) ? mergedObj : startData;\n\n for (let obj of mergedObj) {\n for (let newObj of rData.PropertyData) {\n if (obj.EZID == newObj.EZID) {\n Object.assign(obj, newObj);\n break;\n }\n }\n }\n }\n\n if (mergedObj.length == 0)\n mergedObj = this.state.noFSTableData.concat([]);\n\n //update mainTableData from merged Obj\n this.setState({\n noFSTableData: startData,\n mainTableData: mergedObj,\n currentPage: newPageNo,\n highLightedCol: null,\n selectedRow: []\n })\n }\n }\n\n }.bind(this))\n .catch((response) => {\n this.errorHandler(response);\n })\n }\n break;\n case \"FIELDSET_FETCH\": {\n\n if (this.propertyFieldset)\n this.toggleProperty();\n if (this.traitFieldset)\n this.toggleTrait();\n\n //fetch fiedlsetData only\n let etc = [], ezidz = [];\n this.state.mainTableData.forEach((row) => {\n if (etc.indexOf(row.EntityTypeCode) < 0)\n etc.push(row.EntityTypeCode);\n });\n if (etc.length >= 1) {\n for (let i = 0; i < etc.length; i++) {\n let ezidtemp = [];\n this.state.mainTableData.forEach((row) => {\n if (row.EntityTypeCode == etc[i])\n ezidtemp.push(row.EZID)\n })\n ezidz.push(ezidtemp.join(\",\"));\n }\n }\n\n let fieldSetId = action.data.value,\n tCols = [],\n pCols = [],\n type;\n if (action.data.isProperty) {\n tCols = this.state.traitColSelected.concat(this.state.otherTraitCols);\n pCols = this.state.otherPropertyCols;\n type = \"p\";\n }\n else {\n pCols = this.state.propertyColSelected.concat(this.state.otherPropertyCols);\n tCols = this.state.otherTraitCols;\n type = \"t\"\n }\n\n let args = {\n \"etcs\": encodeURIComponent(etc.join(\"|\")),\n \"ezids\": encodeURIComponent(ezidz.join(\"|\")),\n \"tcols\": tCols.join(\",\"),\n \"pcols\": pCols.join(\",\"),\n \"pfsid\": '',\n \"tfsid\": '',\n \"ezid\": '',\n \"level\": -1,\n \"pn\": this.state.currentPage\n };\n\n\n //added property or trait fieldsetID to data\n args[type + \"fsid\"] = fieldSetId;\n\n\n axios.post(config.fieldsetDataUrl, this.getData({\n nav: args,\n sort: true,\n filter: true\n }), {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n\n let rData = response.data;\n\n\n let mergedObj = this.state.noFSTableData.concat([]),\n currentFields = this.state.noFSfields.concat([]),\n sortColumnList;\n\n //no col response\n if (rData.Fields.length == 0) {\n //reset all data\n sortColumnList = Object.assign({}, this.state.noFSFieldLabels);\n let currentFields = this.state.noFSfields;\n\n //re-adjust column sort order if any columns are removed while fieldset are swtiched\n this.updateSortColumns(currentFields, sortColumnList);\n\n\n //removed filter applied if column no longer exists in result set from server.\n this.updateFilterColumns(currentFields);\n\n let noFSTableData = [];\n if (rData.FinalData) {\n //extrating base columns set from new Response Data.\n noFSTableData = rData.FinalData.map((rd) => {\n return {\n \"EZID\": rd.EZID,\n \"EntityTypeCode\": rd.EntityTypeCode,\n \"Name\": rd.Name,\n \"ChildRows\": rd.ChildRows || 0,\n \"Level\": rd.Level\n }\n });\n } else\n noFSTableData = this.state.noFSTableData;\n\n this.setState({\n mainTableData: rData.FinalData ? rData.FinalData : this.state.noFSTableData.concat([]),\n noFSTableData: noFSTableData,\n fields: this.state.noFSfields,\n traitFieldsetLabels: {},\n propertyFieldsetLabels: {},\n traitColSelected: [],\n propertyColSelected: [],\n sortColumnList: this.state.noFSFieldLabels,\n fisrtColSortList: this.state.noFSFieldLabels\n })\n }\n else {\n\n //extracting property fields and preserving in state\n let propertyFields = [],\n pNewFieldLabels = [],\n traitFields = [],\n tNewFieldLabels = [],\n fieldsInfo = {};\n\n\n rData.Fields.forEach((f) => {\n if (f.Property) {\n if (this.state.otherPropertyCols.indexOf(f.TraitID) < 0)\n propertyFields.push(f.TraitID);\n pNewFieldLabels[f.TraitID] = f.ColumnLabel;\n } else {\n if (this.state.otherTraitCols.indexOf(f.TraitID) < 0)\n traitFields.push(f.TraitID)\n tNewFieldLabels[f.TraitID] = f.ColumnLabel\n }\n //bulid current field list\n currentFields.push(f.TraitID);\n //build fields information\n if (fieldsInfo[f.TraitID] == undefined)\n fieldsInfo[f.TraitID] = f;\n });\n\n\n let sortColumnList = Object.assign({}, this.state.noFSFieldLabels, pNewFieldLabels, tNewFieldLabels);\n\n if (rData.ObservationData == undefined && !action.data.isProperty) {\n this.setState({\n traitfieldColsRemoved: []\n })\n }\n\n if (rData.PropertyData == undefined && action.data.isProperty) {\n this.setState({\n propertyfieldColsRemoved: []\n })\n }\n\n\n let noFSTableData = this.state.noFSTableData;\n if (rData.FinalData) {\n mergedObj = rData.FinalData;\n\n //extrating base columns set from new Response Data.\n noFSTableData = rData.FinalData.map((rd) => {\n return {\n \"EZID\": rd.EZID,\n \"EntityTypeCode\": rd.EntityTypeCode,\n \"Name\": rd.Name,\n \"ChildRows\": rd.ChildRows || 0,\n \"Level\": rd.Level\n }\n });\n this.setState({noFSTableData: noFSTableData})\n }\n else {\n //trait fieldset data\n if (rData.ObservationData != undefined) {\n for (let obj of mergedObj) {\n for (let newObj of rData.ObservationData) {\n if (obj.EZID == newObj.EZID) {\n Object.assign(obj, newObj);\n break;\n }\n }\n }\n }\n\n //property fieldset data\n if (rData.PropertyData != undefined) {\n for (let obj of mergedObj) {\n for (let newObj of rData.PropertyData) {\n if (obj.EZID == newObj.EZID) {\n Object.assign(obj, newObj);\n break;\n }\n }\n }\n }\n }\n\n //re-adjust column sort order if any columns are removed while fieldset are swtiched\n this.updateSortColumns(currentFields, sortColumnList);\n\n //removed filter applied if column no longer exists in result set from server.\n this.updateFilterColumns(currentFields);\n\n //final mergedobj ,and fields state update\n this.setState({\n propertyFieldsetLabels: pNewFieldLabels,\n propertyColSelected: propertyFields,\n propertyfieldColsRemoved: [],\n traitFieldsetLabels: tNewFieldLabels,\n traitColSelected: traitFields,\n traitfieldColsRemoved: [],\n sortColumnList: sortColumnList,\n\n firstColSortList: sortColumnList,\n /* secondColSortList: secondColSortList,\n thirdColSortList: thirdColSortList,*/\n mainTableData: mergedObj,\n fields: currentFields,\n fieldsInfo: fieldsInfo,\n\n });\n }\n })\n .catch((response) => {\n this.errorHandler(response);\n })\n }\n break;\n case \"COLUMN_SELECTION\": {\n\n this.toggleColumn();\n\n let etc = [], ezidz = [];\n\n //extract unique Entity Type Code from available records in data grid.\n this.state.mainTableData.forEach((row) => {\n if (etc.indexOf(row.EntityTypeCode) < 0)\n etc.push(row.EntityTypeCode);\n });\n //group ezid of records according to their entity Type code like a,b,c| e,f,g|i,j,k\n if (etc.length >= 1) {\n for (let i = 0; i < etc.length; i++) {\n let ezidtemp = [];\n this.state.mainTableData.forEach((row) => {\n if (row.EntityTypeCode == etc[i])\n ezidtemp.push(row.EZID)\n })\n ezidz.push(ezidtemp.join(\",\"));\n }\n }\n\n let tCols = [], pCols = [];\n\n let updatedTraitColSelected = this.state.traitColSelected.filter((t) => {\n return action.args.traitfieldColsRemoved.indexOf(t) == -1\n }),\n updatedPropertyColSelected = this.state.propertyColSelected.filter((t) => {\n return action.args.propertyfieldColsRemoved.indexOf(t) == -1\n });\n\n //final Trait cols\n tCols = updatedTraitColSelected.concat(action.args.otherTColsToAdd);\n //final propertyCols\n pCols = updatedPropertyColSelected.concat(action.args.otherPColsToAdd);\n\n //total fields/columns before\n let totalCols = this.state.traitColSelected.concat(this.state.propertyColSelected, this.state.otherPropertyCols, this.state.otherTraitCols);\n //total fields/columns after\n let newTotalCols = tCols.concat(pCols);\n //columns being removed in this action\n let colsToRemove = totalCols.filter((f) => newTotalCols.indexOf(f) == -1);\n\n // check if columns to remove are included in sorting and set flag for sorting reset\n let fCol = this.state.firstSortColumn,\n sCol = this.state.secondSortColumn,\n tCol = this.state.thirdSortColumn,\n sortColRemovalFlag = false,\n columnSortData = this.state.columnSortData;\n\n\n //loop to find new Sorting column List\n let newSortColumnList = {};\n\n this.state.columnsList.forEach((f) => {\n if (newTotalCols.indexOf(f.TraitID) > -1) {\n newSortColumnList[f.TraitID] = f.ColumnLabel;\n }\n })\n\n if (colsToRemove.indexOf(fCol) || colsToRemove.indexOf(sCol) || colsToRemove.indexOf(tCol)) {\n //set flag to send sorting option.\n sortColRemovalFlag = true;\n\n let sortData = this.updateSortColumns(newTotalCols.concat(this.state.noFSfields), Object.assign({}, newSortColumnList, this.state.noFSFieldLabels));\n\n //no sort columns assigned;\n if (Object.keys(sortData).length == 0) {\n columnSortData = {\"s[0].sc\": \"EZID\", \"s[0].so\": \"asc\"}\n }\n else {\n columnSortData = sortData\n }\n }\n\n // check if columns to remove has filter applied on them\n let filterColumnsToRemove = [], newFilterData = this.state.filterApplied, fQuery = [];\n colsToRemove.forEach((f) => {\n if (newFilterData[f] != undefined) {\n delete newFilterData[f]\n }\n });\n\n fQuery = this.getFilterQueries(newFilterData);\n\n this.setState({\n filterApplied: newFilterData,\n filterQuery: fQuery\n })\n\n //parameter for navigation\n let args = {\n \"etcs\": encodeURIComponent(etc.join(\"|\")),\n \"ezids\": newTotalCols.length > 0 ? encodeURIComponent(ezidz.join(\"|\")) : '',\n \"tcols\": tCols.join(\",\"),\n \"pcols\": pCols.join(\",\"),\n \"ezid\": '',\n \"level\": -1,\n \"etc\": this.entityTypeCode.toLowerCase() != \"bat\" ? this.entityTypeCode : \"BAT\",\n 'tfsid': '',\n 'pfsid': ''\n };\n\n let data = {\n nav: args,\n sort: true,\n sortData: columnSortData,\n }\n if (fQuery.length > 0) {\n data['filter'] = true\n data['filterData'] = fQuery;\n }\n else {\n data['filter'] = false\n }\n\n axios.post(config.url, this.getData(data), {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n\n let rData = response.data;\n //without scroll or filter data\n let mergedObj = this.state.noFSTableData.concat([]),\n currentFields = this.state.noFSfields,\n noFSTableData;\n\n //no col response\n if (rData.Fields.length == 0) {\n //reset all data\n let sortColumnList = Object.assign({}, this.state.noFSFieldLabels),\n newMainTableData = this.state.noFSTableData;\n noFSTableData = this.state.noFSTableData;\n\n if (rData.FinalData) {\n newMainTableData = rData.FinalData;\n //extrating base columns set from new Response Data.\n noFSTableData = rData.FinalData.map((rd) => {\n return {\n \"EZID\": rd.EZID,\n \"EntityTypeCode\": rd.EntityTypeCode,\n \"Name\": rd.Name,\n \"ChildRows\": rd.ChildRows || 0,\n \"Level\": rd.Level\n }\n });\n this.setState({noFSTableData: noFSTableData})\n }\n\n this.setState({\n mainTableData: newMainTableData,\n fields: this.state.noFSfields,\n traitFieldsetValue: null,\n traitFieldsetLabels: {},\n propertyFieldsetLabels: {},\n traitColSelected: [],\n propertyColSelected: [],\n sortColumnList: sortColumnList,\n firstColSortList: sortColumnList,\n secondColSortList: {},\n thirdColSortList: {},\n totalRecords: rData.TotalRecords\n })\n }\n else {\n\n //extracting property and trait fields and preserving them in state\n let traitFields = [],\n tNewFieldLabels = [],\n propertyFields = [],\n pNewFieldLabels = [],\n fieldsInfo = {};\n\n rData.Fields.forEach((f) => {\n if (f.Property) {\n if (this.state.otherPropertyCols.indexOf(f.TraitID) < 0)\n propertyFields.push(f.TraitID);\n pNewFieldLabels[f.TraitID] = f.ColumnLabel;\n }\n else {\n if (this.state.otherTraitCols.indexOf(f.TraitID) < 0)\n traitFields.push(f.TraitID)\n tNewFieldLabels[f.TraitID] = f.ColumnLabel\n }\n\n fieldsInfo[f.TraitID] = f;\n\n //get current fields\n currentFields = currentFields.concat(f.TraitID)\n });\n\n this.setState({\n traitFieldsetLabels: tNewFieldLabels,\n traitColSelected: traitFields,\n previousTraitColSelected: traitFields,\n traitfieldColsRemoved: [],\n propertyFieldsetLabels: pNewFieldLabels,\n propertyColSelected: propertyFields,\n propertyfieldColsRemoved: [],\n fieldsInfo: fieldsInfo\n });\n\n\n //response of request with filter and/or sort data\n if (rData.FinalData) {\n mergedObj = rData.FinalData;\n\n\n //extrating base columns set from new Response Data.\n noFSTableData = rData.FinalData.map((rd) => {\n return {\n \"EZID\": rd.EZID,\n \"EntityTypeCode\": rd.EntityTypeCode,\n \"Name\": rd.Name,\n \"ChildRows\": rd.ChildRows || 0,\n \"Level\": rd.Level\n }\n });\n this.setState({noFSTableData: noFSTableData})\n\n\n }\n //response of normal request without filter and/or sort data\n else {\n\n //check if trait fieldset data is present, if yes merge it with NO Fieldset Table Data\n if (rData.ObservationData != undefined) {\n //Trait columns being added hereafter\n for (let obj of mergedObj) {\n for (let newObj of rData.ObservationData) {\n if (obj.EZID == newObj.EZID) {\n Object.assign(obj, newObj);\n break;\n }\n }\n }\n }\n\n //check if property fieldset data is present, if yes merge it with NO Fieldset Table Data\n if (rData.PropertyData != undefined) {\n for (let obj of mergedObj) {\n for (let newObj of rData.PropertyData) {\n if (obj.EZID == newObj.EZID) {\n Object.assign(obj, newObj);\n break;\n }\n }\n }\n }\n\n }\n //final mergedobj ,and fields state update\n this.setState({\n mainTableData: mergedObj,\n fields: currentFields,\n totalRecords: rData.TotalRecords\n\n });\n }\n })\n .catch((response) => {\n this.errorHandler(response);\n })\n // }\n //}\n }\n break;\n case \"SORT_DATA_FETCH\": {\n\n if (this.columnSort)\n this.toggleColSort();\n let tCols = this.state.traitColSelected.concat(this.state.otherTraitCols),\n pCols = this.state.propertyColSelected.concat(this.state.otherPropertyCols);\n let args = {\n etcs: '',\n ezid: '',\n ezids: '',\n tfsid: '',\n pfsid: '',\n tcols: tCols.join(\",\"),\n pcols: pCols.join(\",\"),\n level: -1,\n etc: this.entityTypeCode.toLowerCase() != \"bat\" ? this.entityTypeCode : \"BAT\"\n\n };\n\n axios.post(config.url, this.getData({\n nav: args,\n sort: true,\n sortData: action.args,\n filter: true\n }), {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n\n let rData = response.data, noFSTableData;\n\n //extrating base columns set from new Response Data.\n noFSTableData = rData.FinalData.map((rd) => {\n return {\n \"EZID\": rd.EZID,\n \"EntityTypeCode\": rd.EntityTypeCode,\n \"Name\": rd.Name,\n \"ChildRows\": rd.ChildRows || 0,\n \"Level\": rd.Level\n }\n });\n this.setState({\n noFSTableData: noFSTableData,\n mainTableData: rData.FinalData,\n totalRecords: rData.TotalRecords\n })\n })\n .catch((response) => {\n this.errorHandler(response);\n })\n }\n break;\n case \"FILTER_DATA_FETCH\": {\n let tCols = this.state.traitColSelected.concat(this.state.otherTraitCols),\n pCols = this.state.propertyColSelected.concat(this.state.otherPropertyCols);\n\n\n //set etc to supplied value if enitityTypeCode is also included as filter col\n if (action.data.EntityTypeCode)\n this.entityTypeCode = action.data.EntityTypeCode.filterValue1;\n\n\n let args = {\n etcs: '',\n ezid: '',\n ezids: '',\n tfsid: '',\n pfsid: '',\n tcols: tCols.join(\",\"),\n pcols: pCols.join(\",\"),\n level: -1,\n etc: this.entityTypeCode.toLowerCase() != \"bat\" ? this.entityTypeCode : \"BAT\",\n pn: 1\n };\n\n axios.post(config.url, this.getData({\n nav: args,\n sort: true,\n filter: true,\n filterData: action.filter\n }), {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n\n let rData = response.data,\n noFSTableData;\n\n //extrating base columns set from new Response Data.\n noFSTableData = rData.FinalData.map((rd) => {\n return {\n \"EZID\": rd.EZID,\n \"EntityTypeCode\": rd.EntityTypeCode,\n \"Name\": rd.Name,\n \"ChildRows\": rd.ChildRows || 0,\n \"Level\": rd.Level\n }\n })\n\n this.setState({\n noFSTableData: noFSTableData,\n mainTableData: rData.FinalData,\n totalRecords: rData.TotalRecords,\n currentPage: 1,\n selectedRow: []\n })\n })\n .catch((response) => {\n this.errorHandler(response);\n })\n }\n break;\n case \"FETCH_TRIALBOOK_FS\": {\n\n axios.get(config.trialFieldsetListUrl + \"?cc=TO&module=TRL\", {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n let rData = response.data;\n this.setState({\n trialbookFSData: rData.Data,\n trialbookFields: rData.InitialFields.map((f) => f.ColumnLabel)\n })\n this.isHydratingData = false\n })\n .catch((response) => {\n this.errorHandler(response);\n })\n\n }\n break;\n case \"SEND_RECORDS_TO_ACTION\": {\n //handler for both trial and crossing records sending\n //getCount true: will get count only, false will get total record list\n let data = action.data.join(\"&\"),\n url = config.tempRecordListUrl;\n\n axios.post(url, data, {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n\n\n let data = response.data.Data;\n if (data.length) {\n switch (action.module) {\n case \"TRL\": {\n this.setState({trialbookRecordsCount: data[0].TotalCount})\n }\n break;\n case \"CRO\": {\n this.setState({\n crossingRecords: data,\n crossingRecordsCount: data.length,\n crossingFields: [\"EZID\", \"EntityTypeCode\", \"Name\"]\n })\n }\n break;\n default:\n break;\n }\n }\n\n })\n .catch((response) => {\n this.errorHandler(response);\n })\n }\n break;\n //add selected records to trial book\n case \"ADD_NEW_TRIALBOOK\": {\n\n let data = \"cc=TO&TrialName=\" + action.data.name;\n\n axios.post(config.createTrialUrl, data, {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n let newTrialbookFSData = this.state.trialbookFSData.concat(response.data.Data[0])\n this.setState({\n trialbookFSData: newTrialbookFSData\n },\n //needed to update the state of trialbook fieldset list and the selected index separately for the scroll to function properly to newly added selected index\n () => {\n this.setState({trialbookSelectedIndex: newTrialbookFSData.length - 1});\n })\n })\n .catch((response) => {\n this.errorHandler(response);\n })\n\n }\n break;\n case \"CREATE_NEW_TRAILENTRY\": {\n\n let module = \"TRL\",\n ezid = action.data.ezid,\n args = {\n cc: \"TO\",\n module: module,\n ezid: ezid\n }\n axios.post(config.createTrialEntryUrl, args, {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n\n let rData = response.data;\n this.setState({\n newTrialData: rData.Data,\n newTrialFields: rData.InitialFields.map((f) => f.ColumnLabel),\n newTrialEntryDetail: rData.TrialDetail,\n trialbookRecords: [],\n trialbookRecordsCount: null\n });\n browserHistory.push('/main/newTrialbook/' + ezid);\n\n })\n .catch((response) => {\n this.errorHandler(response);\n })\n\n\n }\n break;\n case \"CREATE_CROSSING\": {\n axios.post(config.createCrossingUrl, action.data.join(\"&\"), {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n\n\n //After success ful crossing\n let data = response.data.Data[0], msg, gender, body;\n\n if (data.Error != \"\") {\n gender = data.Error.split(\"x\");\n body =\n <span>Crossing could not be created with <i className=\"icon-female\"></i>{gender[0]} <i\n className=\"icon-cancel\"></i> <i className=\"icon-male\"></i>{gender[1]}</span>;\n msg = {\n title: \"Error\",\n body: body,\n error: true\n }\n }\n else if (data.Success != \"\") {\n gender = data.Success.split(\"x\");\n body = <span>Crossing created with <i className=\"icon-female\"></i>{gender[0]} <i\n className=\"icon-cancel\"></i> <i className=\"icon-male\"></i>{gender[1]}</span>;\n msg = {\n title: \"Success\",\n body: body,\n error: false\n }\n }\n\n let male = this.state.crossingMale.EZID,\n female = this.state.crossingFemale.EZID,\n newCrossingRecords = this.state.crossingRecords.filter((f) => {\n return f.EZID !== male && f.EZID !== female\n })\n\n this.setState({\n crossingRecords: newCrossingRecords,\n crossingRecordsCount: newCrossingRecords.length,\n crossingMale: {},\n crossingFemale: {}\n });\n this.messageHandler(msg);\n })\n .catch((response) => {\n this.errorHandler(response);\n })\n }\n break;\n case \"CREATE_BATCH\": {\n\n this.hideModal();\n\n axios.post(config.createBatchUrl, action.data.join(\"&\"), {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n\n if (response.data.toLowerCase() === \"success\") {\n let mainTableData = [], noFSTableData = [];\n mainTableData = this.state.mainTableData.filter((f) => {\n if (action.lotsSelected.indexOf(f.EZID) > -1) {\n f[\"ChildRows\"] = 1;\n }\n\n delete f.expanded;\n return f.Level == 0;\n });\n\n noFSTableData = this.state.noFSTableData.filter((f) => {\n delete f.expanded;\n return f.Level == 0;\n });\n //reset expanded state and removing child rows/records.\n this.setState({\n mainTableData: mainTableData,\n noFSTableData: noFSTableData,\n dataHistory: []\n });\n\n\n //show success message for batch created.\n let messageBody = this.state.selectedRow.length > 1 ? \"The batch records are created. You can expand the selected records to check for new batch being created.\" : \"The batch record is created. You can expand the selected record to check for new batch being created.\"\n let msg = {\n title: \"Success \",\n body: messageBody,\n callback: null,\n cancel: null,\n error: false\n }\n this.messageHandler(msg)\n\n }\n //if somehow the batch creation fails\n else if (response.data.toLowerCase() === \"fail\") {\n\n //show failure message for batch creation.\n let msg = {\n title: \"Error \",\n body: \"The batch records could not be created.\",\n callback: null,\n cancel: null,\n error: true\n }\n this.messageHandler(msg)\n\n }\n })\n .catch((response) => {\n this.errorHandler(response);\n })\n }\n break;\n case \"FETCH_ACTIONS_RECORD_LIST\": {\n\n //fetch list of records added to different modules eg, Trialbook, Crossing etc.\n axios.get(config.tempRecordListUrl + \"?CC=TO&getCount=false\", {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n\n let rData = response.data.Data,\n crossingData = [],\n trialData = [];\n\n if (rData.length) {\n rData.forEach((d) => {\n switch (d.Module) {\n case \"TRL\": {\n trialData.push(d);\n }\n break;\n case \"CRO\": {\n crossingData.push(d);\n }\n default:\n break;\n\n }\n })\n\n this.setState({\n trialbookRecordsCount: trialData.length,\n trialbookRecords: trialData,\n crossingRecordsCount: crossingData.length,\n crossingRecords: crossingData\n })\n }\n else {\n this.setState({\n trialbookRecordsCount: null,\n trialbookRecords: [],\n crossingRecordsCount: null,\n crossingRecords: []\n })\n }\n\n })\n .catch((response) => {\n this.errorHandler(response);\n })\n }\n break;\n case \"FETCH_TREEHIERARCHY\": {\n //typically reqeust server for the hierarchial data of selected Lot number.\n let url = config.hierarchyDataUrl + \"?EZID=\" + action.data.treeRootId\n axios.get(url, {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n //make root node parent null\n let rData = response.data;\n if (rData.length == 0) {\n\n let modalData = {\n title: \"Not Found\",\n body: \"No record found for search item '\" + action.data.treeRootId + \"'.\",\n callback: null,\n cancel: null,\n error: false\n }\n this.setState({\n modal: true,\n modalData: modalData\n })\n // browserHistory.push('/main/hierarchy/' + this.state.treeRootId);\n }\n else {\n\n\n this.setState({\n treeRootId: action.data.treeRootId,\n treeHierarchyData: rData\n });\n browserHistory.push('/main/hierarchy/' + action.data.treeRootId);\n }\n })\n .catch((response) => {\n this.errorHandler(response);\n })\n }\n break;\n case \"SEARCH_RECORD\": {\n\n let tCols = this.state.traitColSelected.concat(this.state.otherTraitCols),\n pCols = this.state.propertyColSelected.concat(this.state.otherPropertyCols);\n let args = {\n etcs: '',\n ezid: '',\n ezids: '',\n tfsid: '',\n pfsid: '',\n tcols: tCols.join(\",\"),\n pcols: pCols.join(\",\"),\n level: -1,\n };\n let data = this.getData({nav: args, sort: true, filter: true})\n let lastRowId = this.state.pageSize * this.state.currentPage;\n\n if (action.data.direction == \"P\") {\n lastRowId -= this.state.pageSize - 1;\n // this.fetchData({type: \"PAGINATION_FETCH\", args: {pn: pageNo}})\n }\n\n //adding query , direction and current record number of result set.\n data += \"&FTSValue=\" + action.data.query + \"&FindDir=\" + action.data.direction + \"&LastRowId=\" + lastRowId;\n\n axios.post(config.searchUrl, data,\n {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n\n\n if (response.data.Data == \"\") {\n let body = '';\n if (action.data.direction == \"\") {\n body = \"Sorry, no result found for '\" + action.data.query + \"'. Please try somthing else.\";\n }\n else if (action.data.direction == \"P\") {\n body = \"Sorry, no previous result found for '\" + action.data.query + \"'.\";\n }\n else if (action.data.direction == \"N\") {\n body = \"Sorry, no further result found for '\" + action.data.query + \"'. \";\n }\n let modalData = {\n title: \"Not Found\",\n body: body,\n callback: null,\n cancel: null,\n error: false\n }\n this.setState({\n modal: true,\n modalData: modalData\n })\n }\n else {\n let lastSearchedIndex = this.state.lastSearchedIndex,\n regEx = new RegExp(action.data.query, \"gi\"),\n fields = this.state.fields,\n selectedRow = [],\n localIndex;\n\n localIndex = response.data.Data.findIndex((row, index) => {\n for (let i = 0; i < fields.length; i++) {\n if (row[fields[i]] && row[fields[i]].toString().match(regEx) != null) {\n selectedRow.push(row.EZID);\n return true;\n }\n }\n });\n\n //extrating base columns set from new Response Data.\n let noFSTableData = response.data.Data.map((rd) => {\n return {\n \"EZID\": rd.EZID,\n \"EntityTypeCode\": rd.EntityTypeCode,\n \"Name\": rd.Name,\n \"ChildRows\": rd.ChildRows || 0,\n \"Level\": rd.Level\n }\n });\n\n this.setState({\n noFSTableData: noFSTableData,\n lastSearchedIndex: localIndex,\n selectedRow: selectedRow,\n mainTableData: response.data.Data,\n currentPage: response.data.PageNumber,\n });\n\n }\n //allow next search\n this.searching = false;\n })\n .catch((response) => {\n this.searching = false;\n this.errorHandler(response);\n })\n }\n break;\n case \"FETCH_FILTERED_BY_YEAR\": {\n this.toggleYear();\n axios.post(config.url, this.getData({\n nav: action.data,\n filter: true,\n sort: true\n }), {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n\n let rData = response.data;\n let mergedObj = rData.InitialData ? rData.InitialData : this.state.noFSTableData.concat([]),\n currentFields = this.state.noFSfields.concat([]),\n sortColumnList;\n\n //no col response\n if (rData.Fields.length == 0) {\n //reset all data\n sortColumnList = Object.assign({}, this.state.noFSFieldLabels);\n let currentFields = this.state.noFSfields;\n\n //re-adjust column sort order if any columns are removed while fieldset are swtiched\n this.updateSortColumns(currentFields, sortColumnList);\n\n\n //removed filter applied if column no longer exists in result set from server.\n this.updateFilterColumns(currentFields);\n\n let noFSTableData = rData.InitialData ? rData.InitialData : [];\n if (rData.FinalData) {\n //extrating base columns set from new Response Data.\n noFSTableData = rData.FinalData.map((rd) => {\n return {\n \"EZID\": rd.EZID,\n \"EntityTypeCode\": rd.EntityTypeCode,\n \"Name\": rd.Name,\n \"ChildRows\": rd.ChildRows || 0,\n \"Level\": rd.Level\n }\n });\n }\n\n this.setState({\n mainTableData: rData.FinalData ? rData.FinalData : noFSTableData.concat([]),\n noFSTableData: noFSTableData,\n fields: this.state.noFSfields,\n traitFieldsetLabels: {},\n propertyFieldsetLabels: {},\n traitColSelected: [],\n propertyColSelected: [],\n sortColumnList: this.state.noFSFieldLabels,\n fisrtColSortList: this.state.noFSFieldLabels,\n totalRecords: rData.TotalRecords,\n currentPage: 1\n })\n }\n else {\n //extracting property fields and preserving in state\n let propertyFields = [],\n pNewFieldLabels = [],\n traitFields = [],\n tNewFieldLabels = [],\n fieldsInfo = {};\n\n\n rData.Fields.forEach((f) => {\n if (f.Property) {\n if (this.state.otherPropertyCols.indexOf(f.TraitID) < 0)\n propertyFields.push(f.TraitID);\n pNewFieldLabels[f.TraitID] = f.ColumnLabel;\n } else {\n if (this.state.otherTraitCols.indexOf(f.TraitID) < 0)\n traitFields.push(f.TraitID)\n tNewFieldLabels[f.TraitID] = f.ColumnLabel\n }\n //bulid current field list\n currentFields.push(f.TraitID);\n //build fields information\n if (fieldsInfo[f.TraitID] == undefined)\n fieldsInfo[f.TraitID] = f;\n });\n\n\n let sortColumnList = Object.assign({}, this.state.noFSFieldLabels, pNewFieldLabels, tNewFieldLabels);\n let noFSTableData;\n if (rData.FinalData) {\n mergedObj = rData.FinalData;\n\n //extrating base columns set from new Response Data.\n noFSTableData = rData.FinalData.map((rd) => {\n return {\n \"EZID\": rd.EZID,\n \"EntityTypeCode\": rd.EntityTypeCode,\n \"Name\": rd.Name,\n \"ChildRows\": rd.ChildRows || 0,\n \"Level\": rd.Level\n }\n });\n this.setState({noFSTableData: noFSTableData})\n }\n else {\n noFSTableData = (rData.InitialData != undefined) ? rData.InitialData : this.state.noFSTableData.concat([]);\n //trait fieldset data\n if (rData.ObservationData != undefined) {\n for (let obj of mergedObj) {\n for (let newObj of rData.ObservationData) {\n if (obj.EZID == newObj.EZID) {\n Object.assign(obj, newObj);\n break;\n }\n }\n }\n }\n\n //property fieldset data\n if (rData.PropertyData != undefined) {\n for (let obj of mergedObj) {\n for (let newObj of rData.PropertyData) {\n if (obj.EZID == newObj.EZID) {\n Object.assign(obj, newObj);\n break;\n }\n }\n }\n }\n }\n\n //re-adjust column sort order if any columns are removed while fieldset are swtiched\n this.updateSortColumns(currentFields, sortColumnList);\n\n //removed filter applied if column no longer exists in result set from server.\n this.updateFilterColumns(currentFields);\n\n //final mergedobj ,and fields state update\n this.setState({\n propertyFieldsetLabels: pNewFieldLabels,\n propertyColSelected: propertyFields,\n propertyfieldColsRemoved: [],\n traitFieldsetLabels: tNewFieldLabels,\n traitColSelected: traitFields,\n traitfieldColsRemoved: [],\n sortColumnList: sortColumnList,\n\n firstColSortList: sortColumnList,\n /* secondColSortList: secondColSortList,\n thirdColSortList: thirdColSortList,*/\n mainTableData: mergedObj,\n fields: currentFields,\n fieldsInfo: fieldsInfo,\n totalRecords: rData.TotalRecords,\n currentPage: 1,\n noFSTableData: noFSTableData\n\n });\n }\n })\n .catch((response) => {\n this.errorHandler(response);\n })\n\n\n }\n break;\n case \"REMOVE_CROSSING_RECORDS\": {\n this.hideModal();\n\n let data = action.data.join(\"&\"),\n url = config.tempRecordListUrl;\n\n axios.post(url, data, {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n\n let data = response.data.Data,\n crossingMale = [],\n crossingFemale = [];\n\n //check for validity of selected male and female.\n if (Object.keys(this.state.crossingMale).length) {\n crossingMale = data.filter((f) => f.EZID === this.state.crossingMale.EZID)\n }\n if (this.state.crossingFemale.EZID) {\n crossingFemale = data.filter((f) => f.EZID === this.state.crossingFemale.EZID)\n }\n\n this.setState({\n crossingRecords: data,\n crossingRecordsCount: data.length,\n crossingFields: [\"EZID\", \"EntityTypeCode\", \"Name\"],\n crossingMale: crossingMale.length ? crossingMale[0] : {},\n crossingFemale: crossingFemale.length ? crossingFemale[0] : {},\n selectedCrossingList: []\n });\n })\n .catch((response) => {\n this.errorHandler(response);\n });\n\n\n }\n break;\n case \"CREATE_GROUP\": {\n\n /* let url = config.createGroupUrl,\n data = this.getAdminData({\"GroupName\": action.args.name, \"Remark\": action.args.remark});\n */\n\n\n /*\n //this was old way of doing it with group first created in frist request.\n axios.post(url, data, {withCredentials: true})\n .then((response) => {\n\n let rData = response.data;\n let newGroupWithGroupLineMapping = Object.assign({}, rData[0], {\n \"groupLines\": this.state.mySelection.map(mS => Object.assign({}, mS, {checked: true}))\n });\n let newGroups = this.state.newGroups.concat(newGroupWithGroupLineMapping);\n this.setState({\n newGroups: newGroups,\n createGroupModal: false\n })\n\n })\n .catch((response) => {\n this.errorHandler(response);\n });*/\n }\n break;\n case \"CREATE_GROUP_GROUPLINES\": {\n\n let url = config.createGroupAndGroupLinesUrl,\n data = action.args;\n\n axios.post(url, data, {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n\n let msg = {\n title: \"Success\",\n body: \"Group(s) are created with selected record(s).\",\n error: false\n };\n\n this.messageHandler(msg);\n this.setState({newGroups: []})\n })\n .catch((response) => {\n this.errorHandler(response);\n })\n\n }\n break;\n case \"FETCH_GROUPS\": {\n let url = config.getGroupsUrl;\n\n axios.get(url, {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n\n let rData = response.data;\n //injected expanded state to toggle grouplines.\n this.setState({groups: rData.map(g => Object.assign(g, {expanded: false}))});\n\n browserHistory.push('/main/groups/');\n })\n .catch((response) => {\n this.errorHandler(response);\n });\n }\n break;\n\n case \"FETCH_TOKEN\": {\n\n //if multiple requests are made in sequence and token fetch is\n if (this.isTokenValid()) {\n !!action.callback && action.callback();\n }\n else {\n //fetch user token first\n axios.get(config.tokenServiceUrl, {\n \"withCredentials\": true\n })\n .then((response) => {\n if (response.data.token) {\n\n localStorage.token = response.data.token;\n localStorage.expiresIn = response.data.expiresIn\n this.setState({\n token: response.data.token,\n issuedOn: response.data.issuedOn,\n expiresIn: response.data.expiresIn\n }, () => !!action.callback && action.callback())\n }\n })\n .catch((response) => {\n this.errorHandler(response);\n });\n }\n }\n break;\n case \"FETCH_COUNTRIES\": {\n\n axios.get(config.countryListUrl, {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n this.setState({countries: response.data})\n })\n .catch((response) => {\n this.errorHandler(response);\n });\n }\n break;\n case \"CREATE_TRIAL\": {\n\n let url = config.trialPlanningUrl;\n axios.post(url, action.data, {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n\n let rData = response.data,\n trialEZID = rData.ezid;\n\n //filter grouplines selected\n let selectedGroupLines = this.state.groups.filter(gL => (gL.EntityTypeCode !== \"GRP\" && gL.expanded));\n\n //generate payload for trial entries\n let payload = selectedGroupLines.map(l => {\n return {\n \"name\": l.Name,\n \"fileNumber\": '',\n \"cropCode\": \"TO\",\n 'trialEntryGuid': l.EZID,\n 'trialID': trialEZID\n }\n })\n\n //hide create trial modal\n this.setState({\n createTrialModal: false\n });\n\n //Chained request for adding grouplines to newly craeted trial.\n axios.post(config.createTrialLinesPlanningUrl, payload, {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n let msg = {\n title: \"Success\",\n body: \"Selected grouplines are added to newly created Trial\",\n error: false\n };\n this.messageHandler(msg);\n })\n .catch((response) => {\n this.errorHandler(response);\n });\n })\n .catch((response) => {\n this.errorHandler(response);\n });\n }\n break;\n case \"FETCH_GROUPLINES\": {\n\n let url = config.getGroupLinesUrl + \"?ezid=\" + action.args.groupEZID;\n axios.get(url, {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n\n let rData = response.data.map(d => Object.assign(d, {expanded: true}));\n\n let groups = this.state.groups;\n //push grouplines into respective groups object.\n let newGroup = groups.map(g => (g.EZID == action.args.groupEZID) ? Object.assign(g, {\n groupLines: rData,\n expanded: true\n }) : g);\n let selectedGroupIndex = newGroup.findIndex(g => g.EZID == action.args.groupEZID);\n newGroup.splice(selectedGroupIndex + 1, 0, ...rData);\n\n this.setState({\n groups: newGroup\n })\n })\n .catch((response) => {\n this.errorHandler(response);\n });\n }\n break;\n\n case \"FETCH_TRIALS\": {\n\n let url = config.trialPlanningUrl;\n axios.get(url, {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n this.setState({\n trials: response.data.map(t => Object.assign({}, t, {checked: false}))\n })\n browserHistory.push('/main/trials/');\n })\n .catch((response) => {\n this.errorHandler(response);\n });\n\n }\n break;\n case \"FETCH_TRIALLINES\": {\n\n let url = config.getTrialLinesPlanningUrl.replace(\"trialID\", action.data.trialID);\n axios.get(url, {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n this.setState({\n trialLines: response.data.map(tL => Object.assign({}, tL, {checked: false})),\n selectedTrialLineIndexes: []\n })\n browserHistory.push('/main/trials/' + action.data.trialID);\n })\n .catch((response) => {\n this.errorHandler(response);\n });\n\n }\n break;\n case \"MAKE_TRIALS_READY\": {\n\n let url = config.trialReadyPlanningUrl;\n\n axios.put(url, {ezids: action.data.ezids}, {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n\n let trials = this.state.trials;\n\n let msg = {\n title: \"Success\",\n body: \"Selected Trial(s) are set to ready state.\",\n error: false\n };\n\n this.messageHandler(msg);\n\n\n trials.forEach(t => {\n if (t.checked) {\n t.completed = true;\n t.checked = !t.checked;\n }\n });\n\n this.setState({\n trials: trials\n })\n })\n .catch((response) => {\n this.errorHandler(response);\n });\n\n }\n break;\n case \"TRIALLINE_NAMING\": {\n //from trialLines\n\n let url = config.trialLineNamingPlanningUrl;\n axios.put(url, action.data.payload, {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n\n //makeing ezid : name mapping for checking.\n let ezidNameMapped = {};\n response.data.forEach(r => ezidNameMapped[r.ezid] = r.name);\n\n let trialLines = this.state.trialLines.map(tL => {\n if (ezidNameMapped[tL.ezid] !== undefined) {\n return Object.assign({}, tL, {name: ezidNameMapped[tL.ezid]})\n }\n return tL\n });\n\n\n let msg = {\n title: \"Success\",\n body: \"Trial lines names are updated.\",\n error: false\n };\n this.messageHandler(msg);\n\n this.setState({\n trialLines: trialLines,\n trailLineNamingModal: false\n });\n\n })\n .catch((response) => {\n this.errorHandler(response);\n });\n }\n break;\n case \"TRIALLINE_NAMING_BYTRIALS\": {\n //from trials\n let url = config.trialLineNamingByTrialsPlanningUrl;\n axios.put(url, action.data.payload, {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n\n let msg = {\n title: \"Success\",\n body: \"Trial lines names are updated.\",\n error: false\n };\n this.messageHandler(msg);\n this.setState({\n trailLineNamingModal: false\n })\n this.makeTrialsReady();\n\n })\n .catch((response) => {\n this.errorHandler(response);\n });\n }\n break;\n case \"FETCH_TRIAL_PROPERTIES\": {\n let url = config.getTrialPropertiesPlanningUrl;\n axios.get(url, {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n\n this.setState({\n trialProperties: response.data,\n })\n\n\n })\n .catch((response) => {\n this.errorHandler(response);\n });\n }\n break;\n case \"CREATE_TRIAL_PROPERTIES\": {\n let url = config.getTrialPropertiesPlanningUrl;\n axios.post(url, action.data, {\n \"withCredentials\": true,\n headers: {\n 'enzauth': this.state.token\n }\n })\n .then((response) => {\n\n let trialProperties = this.state.trialProperties;\n trialProperties.push(response.data);\n\n this.setState({\n trialProperties: trialProperties,\n trialPropertyCreationModal: false\n })\n\n\n let msg = {\n title: \"Success\",\n body: \"New Trial Property \\\"\"+response.data.name +\"\\\" is created.\",\n error: false\n };\n\n this.messageHandler(msg);\n\n\n })\n .catch((response) => {\n this.errorHandler(response);\n });\n }\n break;\n default:\n //do nothing for now\n // console.log(\"Fetch data didn't match any case\")\n }\n }", "function ourReducer (draft, action) {\n switch (action.type) {\n case 'login':\n draft.loggedIn = true\n draft.user = action.data // save user info\n return\n case 'logout':\n draft.loggedIn = false\n return\n case 'flashMessage':\n draft.flashMessages.push(action.value)\n return\n case 'openSearch':\n draft.isSearchOpen = true\n return\n case 'closeSearch':\n draft.isSearchOpen = false\n return\n case 'toggleChat':\n draft.isChatOpen = !draft.isChatOpen\n return\n case 'closeChat':\n draft.isChatOpen = false\n return\n case 'incrementUnreadChatCount':\n draft.unreadChatCount++\n return\n case 'clearUnreadChatCount':\n draft.unreadChatCount = 0\n return\n }\n }", "function transactionReducer(state = initialState, action) {\n switch (action.type) {\n case actions.ADD_TRANSACTION: {\n return [\n ...state,\n {\n // All the details about the transaction\n id: action.payload.id,\n Address: action.payload.Address,\n Buyer: action.payload.Buyer,\n BuyerId: action.payload.BuyerId,\n Completion: action.payload.Completion,\n Floors: action.payload.Floors,\n HomeInspectionVoided: action.payload.HomeInspectionVoided,\n Pool: action.payload.Pool,\n SquareFt: action.payload.SquareFt,\n Stage: action.payload.Stage,\n BuyerData: null, // To store the Buyer Data\n // All the steps\n PreApproval: action.payload.PreApproval,\n FindAgent: action.payload.FindAgent,\n FindHome: action.payload.FindHome,\n EscrowTitle: action.payload.EscrowTitle,\n HomeInspection: action.payload.HomeInspection,\n HomeInsurance: action.payload.HomeInsurance,\n Closing: action.payload.Closing,\n },\n ];\n }\n case actions.REMOVE_ALL_TRANSACTIONS: {\n return initialState;\n }\n case actions.ADD_PREAPPROVAL_TASK: {\n state.map((transaction) => {\n if (transaction.id === action.tid) {\n transaction.PreApproval = action.step;\n }\n });\n\n return state;\n }\n case actions.ADD_FINDAGENT_TASK: {\n state.map((transaction) => {\n if (transaction.id === action.tid) {\n transaction.FindAgent = action.step;\n }\n });\n\n return state;\n }\n case actions.ADD_FINDHOME_TASK: {\n state.map((transaction) => {\n if (transaction.id === action.tid) {\n transaction.FindHome = action.step;\n }\n });\n\n return state;\n }\n case actions.ADD_HOMEINSPECTION_TASK: {\n state.map((transaction) => {\n if (transaction.id === action.tid) {\n transaction.HomeInspection = action.step;\n }\n });\n\n return state;\n }\n case actions.ADD_ESCROWTITLE_TASK: {\n state.map((transaction) => {\n if (transaction.id === action.tid) {\n transaction.EscrowTitle = action.step;\n }\n });\n\n return state;\n }\n case actions.ADD_HOMEINSURANCE_TASK: {\n state.map((transaction) => {\n if (transaction.id === action.tid) {\n transaction.HomeInsurance = action.step;\n }\n });\n\n return state;\n }\n case actions.ADD_CLOSING_TASK: {\n state.map((transaction) => {\n if (transaction.id === action.tid) {\n transaction.Closing = action.step;\n }\n });\n\n return state;\n }\n case actions.ADD_BUYER_INFO: {\n state.map((transaction) => {\n if (transaction.id === action.tid) {\n transaction.BuyerData = action.buyerData;\n }\n });\n\n return state;\n }\n default: {\n return state;\n }\n }\n}", "locationupdate(city){\n\n const reducer = function (state, action){\n if(action.type === \"JAIPUR\"){\n return action.favlocation;\n }\n if(action.type === \"NEW DELHI\"){\n return action.favlocation;\n }\n return state;\n }\n \n const store = createStore(reducer, city);\n\n store.subscribe(() => {\n console.log(\"Now favorite location is \"+ store.getState());\n })\n\n store.dispatch({type: city, favlocation: city});\n }", "function dispatch (action) {\n var entries = app.store.state.entries.concat(action)\n app.store.setState({entries: entries})\n}", "function editPokemonReducer(state, action) {\n console.log(\"EDIT_POKEMON\", action.payload); \n return state;\n}", "function componentReducer(state = INITIAL_STATE, action) {\n if(action.type===TOGGLE_CONTENT) {\n let componentState=state.find(componentState => componentState.name===action.event.componentName),\n updatedState={};\n if (componentState.buttonText === '-') {\n updatedState= Object.assign({},componentState,{\n contentPanelClassName: 'contentDisabled',\n buttonText: '+'\n });\n } else {\n updatedState=Object.assign({},componentState,{\n contentPanelClassName: 'contentEnabled',\n buttonText: '-'\n });\n }\n\n return state.map(componentState => componentState.name===action.event.componentName\n ? updatedState\n : componentState\n );\n }\n if(action.type===TOGGLE_PANEL) {\n let componentState=state.find(componentState => componentState.name===action.event.componentName),\n updatedState=undefined;\n console.log(JSON.stringify(componentState,null,2));\n console.log(JSON.stringify(action,null,2));\n if (componentState.panelAClassName === 'enabled' && action.event.panelName === 'panelB') {\n updatedState=Object.assign({},componentState,{\n \"panelAClassName\": \"disabled\",\n \"panelBClassName\": \"enabled\"\n });\n } else if (componentState.panelBClassName === 'enabled' && action.event.panelName === 'panelA') {\n updatedState=Object.assign({},componentState,{\n \"panelAClassName\": \"enabled\",\n \"panelBClassName\": \"disabled\"\n });\n }\n\n if(updatedState){\n return state.map(componentState => componentState.name===action.event.componentName\n ? updatedState\n : componentState\n );\n }\n }\n\n return state;\n}", "handleRowAction(event) {\n let actionName = event.detail.action.name;\n let selectedrow = event.detail.selectedrow;\n let row = event.detail.row;\n // eslint-disable-next-line default-case\n switch (actionName) {\n case 'View':\n this.viewCurrentRecord(row);\n break;\n\n case 'Delete':\n this.deleteCurrentRecord(row);\n break;\n\n case 'Msg':\n this.showSpecialMessageModal(row);\n break;\n }\n }", "_handleEditAction(isShareDetailActionSheet = false) {\n if (isShareDetailActionSheet) {\n if (!this.state.isShareDetailActionSheet) {\n //this.props.navigation.state.params.isheaderRightShow = false\n this.props.navigation.setParams({\n isheaderRightShow: false\n });\n this.setState({\n isShareDetailActionSheet: true\n }, () => {\n this.collapseElement()\n });\n\n }\n else {\n this.props.navigation.setParams({\n isheaderRightShow: true\n });\n this.setState({\n isShareDetailActionSheet: false\n }, () => {\n this.expandElement()\n });\n }\n } else {\n if (!this.state.isEditMode) {\n //this.props.navigation.state.params.isheaderRightShow = false\n // this.props.navigation.setParams({\n // isheaderRightShow: false\n // });\n this.setState({\n isEditMode: true\n }, function () {\n this.collapseElement()\n });\n\n }\n else {\n this.setState({\n isEditMode: false\n }, function () {\n this.expandElement()\n });\n }\n }\n\n }", "function mapDispatchToProps(dispatch) {\n return {\n\n //onNavigateTo(dest) {\n // dispatch(push(dest));\n //}\n\n handleLogoClick: () =>{\n //this.props.state = {asd :'123'}\n dispatch(replace({\n pathname:'/News',\n state:{scrollToTop:true}\n }))\n\n }\n\n\n //onIncreaseClick: () => dispatch(increaseAction),\n //onDecreaseClick: () => dispatch(decreaseAction)\n }\n}", "function dashboardReducer(state = initialState, action) {\n switch(action.type) {\n case HANDLE_CLICK:\n var pos;\n if (action.length > 10) {\n pos = Math.floor(Math.random() * action.length);\n } else if (action.name === \"back\") {\n pos = (action.pos - 1 + action.length ) % (action.length);\n } else {\n pos = action.pos % (action.length - 1);\n pos++;\n }\n return Object.assign({}, state, {\n img: action.list[pos],\n imgPos: pos,\n })\n case 'REQUEST_SUCCESS':\n return Object.assign({}, state, {\n loading: false,\n img: action.img,\n pictureList: action.pictureList,\n imgPos: 0,\n showPictures: true\n })\n default:\n return state;\n }\n}", "reduce(state, payload) {\n let {action, data} = payload;\n\n switch(action) {\n case 'move':\n state = state.updateIn(['currentRoom'], value => value += data);\n break;\n }\n\n return state;\n }", "function reducer(state, action) {\n state = state || initialState;\n action = action || {};\n\n switch(action.type) {\n /* *** TODO: Put per-action code here *** */\n case \"UPDATE_NOTEBOOK_LIST\":\n return Object.assign({}, state, { notebookList : action.notebookList });\n case \"TOGGLE_NOTES\":\n let notebookList = state.notebookList;\n notebookList = notebookList.map(item => {\n if(item.id == action.notebookId)\n item['showNotes'] = !item[\"showNotes\"];\n return item;\n });\n notebookList = _.cloneDeep(notebookList);\n return Object.assign({}, state, { notebookList });\n case \"TOGGLE_ADD_NOTES\":\n notebookList = state.notebookList;\n notebookList = notebookList.map(item => {\n if(item.id == action.notebookId)\n item['addNotes'] = !item[\"addNotes\"];\n return item;\n });\n notebookList = _.cloneDeep(notebookList);\n return Object.assign({}, state, { notebookList });\n case 'TOGGLE_EDIT_NOTEBOOK':\n notebookList = state.notebookList;\n notebookList = notebookList.map(item => {\n if(item.id == action.notebookId)\n item['editNotebook'] = !item[\"editNotebook\"];\n return item;\n });\n notebookList = _.cloneDeep(notebookList);\n return Object.assign({}, state, { notebookList });\n case \"SEARCH_DATA\":\n return Object.assign({}, state, { searchData : action.data });\n case \"TOGGLE_EDIT_COMPONENT\":\n return Object.assign({}, state, { showEditPopUp : action.flag, updateObj : action.obj });\n default: return state;\n }\n}", "function liftReducer(reducer, initialState) { // 87\n var initialLiftedState = { // 88\n committedState: initialState, // 89\n stagedActions: [INIT_ACTION], // 90\n skippedActions: {}, // 91\n currentStateIndex: 0, // 92\n monitorState: { // 93\n isVisible: true // 94\n }, // 95\n timestamps: [Date.now()] // 96\n }; // 97\n // 98\n /** // 99\n * Manages how the DevTools actions modify the DevTools state. // 100\n */ // 101\n return function liftedReducer(liftedState, liftedAction) { // 102\n if (liftedState === undefined) liftedState = initialLiftedState; // 103\n var committedState = liftedState.committedState; // 104\n var stagedActions = liftedState.stagedActions; // 105\n var skippedActions = liftedState.skippedActions; // 106\n var computedStates = liftedState.computedStates; // 107\n var currentStateIndex = liftedState.currentStateIndex; // 108\n var monitorState = liftedState.monitorState; // 109\n var timestamps = liftedState.timestamps; // 110\n // 111\n switch (liftedAction.type) { // 112\n case ActionTypes.RESET: // 113\n committedState = initialState; // 114\n stagedActions = [INIT_ACTION]; // 115\n skippedActions = {}; // 116\n currentStateIndex = 0; // 117\n timestamps = [liftedAction.timestamp]; // 118\n break; // 119\n case ActionTypes.COMMIT: // 120\n committedState = computedStates[currentStateIndex].state; // 121\n stagedActions = [INIT_ACTION]; // 122\n skippedActions = {}; // 123\n currentStateIndex = 0; // 124\n timestamps = [liftedAction.timestamp]; // 125\n break; // 126\n case ActionTypes.ROLLBACK: // 127\n stagedActions = [INIT_ACTION]; // 128\n skippedActions = {}; // 129\n currentStateIndex = 0; // 130\n timestamps = [liftedAction.timestamp]; // 131\n break; // 132\n case ActionTypes.TOGGLE_ACTION: // 133\n skippedActions = toggle(skippedActions, liftedAction.index); // 134\n break; // 135\n case ActionTypes.JUMP_TO_STATE: // 136\n currentStateIndex = liftedAction.index; // 137\n break; // 138\n case ActionTypes.SWEEP: // 139\n stagedActions = stagedActions.filter(function (_, i) { // 140\n return !skippedActions[i]; // 141\n }); // 142\n timestamps = timestamps.filter(function (_, i) { // 143\n return !skippedActions[i]; // 144\n }); // 145\n skippedActions = {}; // 146\n currentStateIndex = Math.min(currentStateIndex, stagedActions.length - 1);\n break; // 148\n case ActionTypes.PERFORM_ACTION: // 149\n if (currentStateIndex === stagedActions.length - 1) { // 150\n currentStateIndex++; // 151\n } // 152\n stagedActions = [].concat(stagedActions, [liftedAction.action]);\n timestamps = [].concat(timestamps, [liftedAction.timestamp]); // 154\n break; // 155\n case ActionTypes.SET_MONITOR_STATE: // 156\n monitorState = liftedAction.monitorState; // 157\n break; // 158\n case ActionTypes.RECOMPUTE_STATES: // 159\n stagedActions = liftedAction.stagedActions; // 160\n timestamps = liftedAction.timestamps; // 161\n committedState = liftedAction.committedState; // 162\n currentStateIndex = stagedActions.length - 1; // 163\n skippedActions = {}; // 164\n break; // 165\n default: // 166\n break; // 167\n } // 168\n // 169\n computedStates = recomputeStates(reducer, committedState, stagedActions, skippedActions);\n // 171\n return { // 172\n committedState: committedState, // 173\n stagedActions: stagedActions, // 174\n skippedActions: skippedActions, // 175\n computedStates: computedStates, // 176\n currentStateIndex: currentStateIndex, // 177\n monitorState: monitorState, // 178\n timestamps: timestamps // 179\n }; // 180\n }; // 181\n} // 182", "updateViewAfterAction(action) {\n\n this.getAllForMe(this.major, this.module, this.subject, this.soldierId)\n .then((res) => {\n if (res !== undefined) {\n let index;\n\n if (action === Action.Delete) {\n // update the stepper's index.\n if (res.length > 0) {\n index = res.length - 1;\n } else if (res.length <= 0) {\n index = 0;\n }\n this.setState({ \n reviews: res, amountRevs: res.length,\n currentNumberReview: index \n });\n\n } else if (action === Action.Create) {\n this.setState({ reviews: res, amountRevs: res.length, });\n\n } else if (action === Action.Update) {\n this.setState({ reviews: res, amountRevs: res.length, });\n }\n }\n });\n }", "function reducer(state,action){\n switch (action.type) {\n case 'update-item':\n const listUpdateEdit = state.list.map((item)=>{\n if(item.id ===action.item.id){\n return action.item\n }\n return item\n })\n return {...state, list:listUpdateEdit, item: {}}\n\n case 'delete-item':\n const listUpdate = state.list.filter((item)=>{\n return item.id!== action.id\n })\n return {...state, list:listUpdate}\n case 'update-list':\n return {...state, list:action.list}\n case 'edit-item':\n case 'edit-item-completed':\n return {...state,item:action.item}\n case 'add-item':\n const newList = state.list\n newList.push(action.item)\n return {...state,list:newList}\n default:\n return state;\n }\n }", "function showTable(state = initialState, action) {\n let nextState\n switch (action.type) {\n case 'MarkerCreated':\n nextState = { \n ...state, \n clicked : true, // make the clicked to false to detect that the marker is clicked \n }\n return nextState || state\n case 'MarkerSubmited':\n nextState = { \n ...state, \n clicked : false, // make the clicked to false to detect that the marker is clicked \n }\n return nextState || state\n case 'LineCreated':\n nextState = {\n ...state,\n clicked : true\n }\n return nextState || state\n case 'LineSubmited':\n nextState = {\n ...state,\n clicked : false\n }\n return nextState || state\n case 'PolygoneCreated':\n nextState = {\n ...state,\n clicked : true\n }\n return nextState || state\n case 'PolygoneSubmited':\n nextState = { \n ...state, \n clicked : false, // make the clicked to false to detect that the marker is clicked \n }\n return nextState || state\n default:\n return state\n }\n }", "send() { \n\n //let viewKey = this.perception.join();\n let action = this.foo();\n console.log('estado ',this.initialState);\n this.newPosition();\n console.log('position ',this.positions);\n //this.internalState = updatex(this.internalState, this.perception, action)\n return action;\n /*\n if (this.table[viewKey]) {\n return this.table[viewKey];\n } else {\n return this.table[\"default\"];\n }\n */\n\n }", "function mapDispatchToProps(dispatch){\n return {\n changeStatus: (id)=>{dispatch(actions.changeStatus(id))}\n }\n}", "getEditSale(data) {\n return dispatch => {\n dispatch({\n type: \"GET_EDIT_SALE\",\n payload: data\n });\n };\n }", "function commonReducer(state = initialState, action) {\n const { type, error, message, serverError } = action\n // const { status } = error.response\n if (serverError) {\n return {\n ...state,\n error: true,\n serverError: true,\n message:\n 'Our backend is experiencing some downtime. Please refresh, check back later or message an admin.',\n }\n } else if (error) {\n if (error.response && status == 401) {\n return {\n ...state,\n error: true,\n message: 'Your session expired. Please log back in.',\n }\n } else if (error.response && error.response.status == 403) {\n Swal.fire({\n title: 'Not authorized',\n html:\n 'You are not in the group of authorized users for this page. If you would like to request access, please email <a href=\"mailto:someone@yoursite.com?subject=Sample Receiving Site Access Request\">the Sample Receiving Team.</a>',\n type: 'info',\n\n animation: false,\n confirmButtonColor: '#007cba',\n confirmButtonText: 'Dismiss',\n })\n return {\n ...state,\n }\n } else {\n return {\n ...state,\n error: true,\n message: action.error.response\n ? action.error.response.data.message\n : action.error.message,\n }\n }\n } else if (message) {\n if (message == 'reset') {\n return {\n ...state,\n message: '',\n }\n } else {\n return {\n ...state,\n message: action.message,\n }\n }\n } else {\n switch (action.type) {\n case ActionTypes.SERVER_ERROR:\n\n // case ActionTypes.SET_ERROR_MESSAGE:\n // return {\n // ...state,\n // error: true,\n // message: action.payload.response.data.message,\n // }\n case ActionTypes.RESET_ERROR_MESSAGE:\n return {\n ...state,\n error: false,\n message: '',\n }\n\n case ActionTypes.RESET_MESSAGE:\n return {\n ...state,\n error: false,\n message: '',\n }\n\n // case ActionTypes.SET_MESSAGE:\n // return {\n // ...state,\n\n // message: payload.message,\n // }\n\n case ActionTypes.REQUEST_CHECK_VERSION:\n return {\n ...state,\n }\n\n case ActionTypes.RECEIVE_CHECK_VERSION_SUCCESS:\n return {\n ...state,\n versionValid: true,\n error: false,\n }\n\n case ActionTypes.RECEIVE_CHECK_VERSION_FAIL:\n return {\n ...state,\n error: action.error,\n message: action.message,\n\n versionValid: false,\n }\n\n default:\n return state\n }\n }\n}", "function ReduxUpdater() {\n const dispatch = useDispatch()\n return (\n <div>\n <button\n type=\"button\"\n onClick={() => {\n other.dispatch({ type: 'ADD' })\n }}\n >\n add\n </button>\n <button\n type=\"button\"\n onClick={() => {\n other.dispatch({ type: 'REMOVE' })\n }}\n >\n remove\n </button>\n </div>\n )\n}", "setCellStatus() {\n let cellStatus = this.state.status === DEAD? ALIVE:DEAD;\n\n store.dispatch(changeCell(this.state.row, this.state.column, cellStatus));\n\n //triggers parent Board to rerender so status from board object matches status from this cell\n this.state.renderBoard();\n\n this.setState ({\n status:cellStatus,\n });\n }", "toggleCompleteAll () {\n dispatcher.dispatch({\n actionType: constants.TOGGLE_COMPLETE_ALL\n })\n }", "onRowStoreRefresh({ action }) {\n switch (action) {\n case 'sort':\n case 'filter':\n case 'batch':\n // Will need to recreate grid cache after sort, filter, and any unspecified\n // set of operations encapsulated by a batch, and redraw everything\n this.dependencyGridCache = null;\n return this.scheduleDraw(true);\n }\n }", "function mapDispatchToProps(dispatch)\n {\n return {\n readUpdate: () => dispatch(readUpdate()),\n successUpdate: (id) => dispatch(failureUpdate(id)),\n failureUpdate: (payload) => dispatch(successUpdate(payload)) \n };\n }", "componentDidMount() {\n this.setState({\n ...this.props.store.detailReducer\n })\n this.props.dispatch({\n type: 'CLEAR_FORM_ERROR'\n })\n }", "function serviceReducer (state =initialState, action) {\n switch (action.type) {\n case ActionType.SET_WEATHER_DATA:\n let obj = JSON.parse(JSON.stringify(action.data));\n \n let updatedContent=Object.assign({},state.modelData.content,{\n bannerInfo:{\n icon:obj.weather[0].icon,\n tempDetails:{\n temp:obj.main.temp,\n main:obj.weather[0].main,\n description:obj.weather[0].description,\n wind:obj.wind\n }, \n weather:obj.weather[0],\n name:obj.name\n }, \n details:{\n ...state.modelData.content.details,\n report:{\n wind:obj.wind.speed,\n humidity:obj.main.humidity\n } \n } \n }); \n let updatedState=Object.assign({},state,{modelData:{content:{...updatedContent}}}); \n\n return { ...updatedState, coord: obj.coord, lat: obj.coord.lat, lon: obj.coord.lon,\n };\n case ActionType.SET_WEATHER_FORCAST_DATA:\n let foreCastDetails = JSON.parse(JSON.stringify(action.data));\n return { ...state,foreCastDetails};\n default:\n return state\n }\n }", "componentDidMount(){\n this.props.dispatch({type:'clearAppStatus'})\n this.props.dispatch({type:'reset'})\n }", "function rootReducer(state = initialState, action){\n if(action.type === ADD_QUOTE){\n return {\n ...state,\n quote: action.payload\n }\n }\n if(action.type === GET_CHARACTERS){\n return {\n ...state,\n characters: action.payload\n }\n }\n if(action.type === GET_CHARACTER_DETAIL){\n return {\n ...state,\n characterDetail: action.payload\n }\n }\n if(action.type === EMPTY_CHARACTER_DETAIL) {\n return {\n ...state,\n characterDetail:{}\n }\n }\n if(action.type === GET_EPISODES){\n return {\n ...state,\n episodes: action.payload\n }\n }\n if(action.type === GET_EPISODE_DETAIL){\n return {\n ...state,\n episodeDetail:action.payload\n }\n }\n if(action.type === EMPTY_EPISODE_DETAIL){\n return {\n ...state,\n episodeDetail:{}\n }\n }\n\n return state;\n\n}", "onEventStoreRefresh({ action }) {\n if (action === 'batch' && this.rowManager.rowCount) {\n this.currentOrientation.onEventDataset();\n // TODO: Run with transition?\n this.refresh();\n }\n }", "function addLoggingToDispatch(store) {\n return (next) => (action) => {\n console.log(\"old state\", store.getState()); // old state\n console.log(\"action\", action);\n next(action);\n console.log(\"dispatch in addLoggingToDispatch\", next);\n console.log(\"new state\", store.getState()); // new state\n }\n}", "executeAction(logEntry) {\n if (logEntry.action === 'place piece') {\n let cell = this.game.getCell(logEntry);\n this.redrawCell(cell)\n }\n\n //TODO handle other with redraw\n if (logEntry.action === 'sym move') {\n for (let move of logEntry.moves) {\n let sourceCell = this.game.getCell(move.source);\n this.redrawCell(sourceCell);\n let targetCell = this.game.getCell(move.target);\n this.redrawCell(targetCell);\n\n if (move.special && move.special === 'en-passant') {\n let destroyCell = this.game.getCell(move.target.x, move.source.y);\n this.redrawCell(destroyCell);\n }\n }\n\n // do special moves\n // for (let smove of logEntry.moves) {\n // if (smove.special === 'en-passant') {\n // this.getjqCell({x: smove.target.x, y: smove.source.y}).removeClass(smove.passantClass);\n // }\n // if (smove.special === 'promote') {\n // let targetJqCellFU = this.getjqCell(smove.target);\n // let player = this.game.getPlayer(smove.playerNumber);\n // targetJqCellFU.removeClass(new Pawn(player).class);\n // let pieceClass = PIECE_REGISTRY[smove.promotionPieceName];\n // targetJqCellFU.addClass(new pieceClass(player).class);\n // }\n // }\n }\n\n if (logEntry.action === 'gameEnd') {\n if (logEntry.winner === 0) {\n this.showNotification('Draw', 'The game ended in a draw.');\n\n } else if (logEntry.winner === this.localPlayer.number) {\n $('.message', this.html).addClass('win');\n this.showNotification('Winner', 'You won this game.');\n\n } else {\n $('.message', this.html).addClass('lose');\n this.showNotification('2nd Place', 'You lost this game');\n }\n }\n }", "function greetingReducer() {}", "function clientReducer(state, action) {\n switch(action.type){\n case ACTION_NAVIGATE:\n {\n const { url , navigateType , cache , mutable , forceOptimisticNavigation } = action;\n const { pathname , search } = url;\n const href = createHrefFromUrl(url);\n const pendingPush = navigateType === 'push';\n const isForCurrentTree = JSON.stringify(mutable.previousTree) === JSON.stringify(state.tree);\n if (mutable.mpaNavigation && isForCurrentTree) {\n return {\n // Set href.\n canonicalUrl: mutable.canonicalUrlOverride ? mutable.canonicalUrlOverride : href,\n pushRef: {\n pendingPush,\n mpaNavigation: mutable.mpaNavigation\n },\n // All navigation requires scroll and focus management to trigger.\n focusAndScrollRef: {\n apply: false\n },\n // Apply cache.\n cache: state.cache,\n prefetchCache: state.prefetchCache,\n // Apply patched router state.\n tree: state.tree\n };\n }\n // Handle concurrent rendering / strict mode case where the cache and tree were already populated.\n if (mutable.patchedTree && isForCurrentTree) {\n return {\n // Set href.\n canonicalUrl: mutable.canonicalUrlOverride ? mutable.canonicalUrlOverride : href,\n pushRef: {\n pendingPush,\n mpaNavigation: false\n },\n // All navigation requires scroll and focus management to trigger.\n focusAndScrollRef: {\n apply: true\n },\n // Apply cache.\n cache: mutable.useExistingCache ? state.cache : cache,\n prefetchCache: state.prefetchCache,\n // Apply patched router state.\n tree: mutable.patchedTree\n };\n }\n const prefetchValues = state.prefetchCache.get(href);\n if (prefetchValues) {\n // The one before last item is the router state tree patch\n const { flightData , tree: newTree , canonicalUrlOverride , } = prefetchValues;\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === 'string') {\n return {\n canonicalUrl: flightData,\n // Enable mpaNavigation\n pushRef: {\n pendingPush: true,\n mpaNavigation: true\n },\n // Don't apply scroll and focus management.\n focusAndScrollRef: {\n apply: false\n },\n cache: state.cache,\n prefetchCache: state.prefetchCache,\n tree: state.tree\n };\n }\n if (newTree !== null) {\n mutable.previousTree = state.tree;\n mutable.patchedTree = newTree;\n mutable.mpaNavigation = isNavigatingToNewRootLayout(state.tree, newTree);\n if (newTree === null) {\n throw new Error('SEGMENT MISMATCH');\n }\n const canonicalUrlOverrideHrefVal = canonicalUrlOverride ? createHrefFromUrl(canonicalUrlOverride) : undefined;\n if (canonicalUrlOverrideHrefVal) {\n mutable.canonicalUrlOverride = canonicalUrlOverrideHrefVal;\n }\n mutable.mpaNavigation = isNavigatingToNewRootLayout(state.tree, newTree);\n // TODO-APP: Currently the Flight data can only have one item but in the future it can have multiple paths.\n const flightDataPath = flightData[0];\n const flightSegmentPath = flightDataPath.slice(0, -3);\n // The one before last item is the router state tree patch\n const [treePatch, subTreeData, head] = flightDataPath.slice(-3);\n // Handles case where prefetch only returns the router tree patch without rendered components.\n if (subTreeData !== null) {\n if (flightDataPath.length === 3) {\n cache.status = CacheStates.READY;\n cache.subTreeData = subTreeData;\n cache.parallelRoutes = new Map();\n fillLazyItemsTillLeafWithHead(cache, state.cache, treePatch, head);\n } else {\n cache.status = CacheStates.READY;\n // Copy subTreeData for the root node of the cache.\n cache.subTreeData = state.cache.subTreeData;\n // Create a copy of the existing cache with the subTreeData applied.\n fillCacheWithNewSubTreeData(cache, state.cache, flightDataPath);\n }\n }\n const hardNavigate = // TODO-APP: Revisit if this is correct.\n search !== location.search || shouldHardNavigate(// TODO-APP: remove ''\n [\n '',\n ...flightSegmentPath\n ], state.tree, newTree);\n if (hardNavigate) {\n cache.status = CacheStates.READY;\n // Copy subTreeData for the root node of the cache.\n cache.subTreeData = state.cache.subTreeData;\n invalidateCacheBelowFlightSegmentPath(cache, state.cache, flightSegmentPath);\n // Ensure the existing cache value is used when the cache was not invalidated.\n } else if (subTreeData === null) {\n mutable.useExistingCache = true;\n }\n const canonicalUrlOverrideHref = canonicalUrlOverride ? createHrefFromUrl(canonicalUrlOverride) : undefined;\n if (canonicalUrlOverrideHref) {\n mutable.canonicalUrlOverride = canonicalUrlOverrideHref;\n }\n return {\n // Set href.\n canonicalUrl: canonicalUrlOverrideHref ? canonicalUrlOverrideHref : href,\n // Set pendingPush.\n pushRef: {\n pendingPush,\n mpaNavigation: false\n },\n // All navigation requires scroll and focus management to trigger.\n focusAndScrollRef: {\n apply: true\n },\n // Apply patched cache.\n cache: mutable.useExistingCache ? state.cache : cache,\n prefetchCache: state.prefetchCache,\n // Apply patched tree.\n tree: newTree\n };\n }\n }\n // When doing a hard push there can be two cases: with optimistic tree and without\n // The with optimistic tree case only happens when the layouts have a loading state (loading.js)\n // The without optimistic tree case happens when there is no loading state, in that case we suspend in this reducer\n // forceOptimisticNavigation is used for links that have `prefetch={false}`.\n if (forceOptimisticNavigation) {\n const segments = pathname.split('/');\n // TODO-APP: figure out something better for index pages\n segments.push('');\n // Optimistic tree case.\n // If the optimistic tree is deeper than the current state leave that deeper part out of the fetch\n const optimisticTree = createOptimisticTree(segments, state.tree, true, false, href);\n // Copy subTreeData for the root node of the cache.\n cache.status = CacheStates.READY;\n cache.subTreeData = state.cache.subTreeData;\n // Copy existing cache nodes as far as possible and fill in `data` property with the started data fetch.\n // The `data` property is used to suspend in layout-router during render if it hasn't resolved yet by the time it renders.\n const res = fillCacheWithDataProperty(cache, state.cache, // TODO-APP: segments.slice(1) strips '', we can get rid of '' altogether.\n segments.slice(1), ()=>fetchServerResponse(url, optimisticTree));\n // If optimistic fetch couldn't happen it falls back to the non-optimistic case.\n if (!(res == null ? void 0 : res.bailOptimistic)) {\n mutable.previousTree = state.tree;\n mutable.patchedTree = optimisticTree;\n mutable.mpaNavigation = isNavigatingToNewRootLayout(state.tree, optimisticTree);\n return {\n // Set href.\n canonicalUrl: href,\n // Set pendingPush.\n pushRef: {\n pendingPush,\n mpaNavigation: false\n },\n // All navigation requires scroll and focus management to trigger.\n focusAndScrollRef: {\n apply: true\n },\n // Apply patched cache.\n cache: cache,\n prefetchCache: state.prefetchCache,\n // Apply optimistic tree.\n tree: optimisticTree\n };\n }\n }\n // Below is the not-optimistic case. Data is fetched at the root and suspended there without a suspense boundary.\n // If no in-flight fetch at the top, start it.\n if (!cache.data) {\n cache.data = createRecordFromThenable(fetchServerResponse(url, state.tree));\n }\n // Unwrap cache data with `use` to suspend here (in the reducer) until the fetch resolves.\n const [flightData, canonicalUrlOverride] = readRecordValue(cache.data);\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === 'string') {\n return {\n canonicalUrl: flightData,\n // Enable mpaNavigation\n pushRef: {\n pendingPush: true,\n mpaNavigation: true\n },\n // Don't apply scroll and focus management.\n focusAndScrollRef: {\n apply: false\n },\n cache: state.cache,\n prefetchCache: state.prefetchCache,\n tree: state.tree\n };\n }\n // Remove cache.data as it has been resolved at this point.\n cache.data = null;\n // TODO-APP: Currently the Flight data can only have one item but in the future it can have multiple paths.\n const flightDataPath = flightData[0];\n // The one before last item is the router state tree patch\n const [treePatch, subTreeData, head] = flightDataPath.slice(-3);\n // Path without the last segment, router state, and the subTreeData\n const flightSegmentPath = flightDataPath.slice(0, -4);\n // Create new tree based on the flightSegmentPath and router state patch\n const newTree = applyRouterStatePatchToTree(// TODO-APP: remove ''\n [\n '',\n ...flightSegmentPath\n ], state.tree, treePatch);\n if (newTree === null) {\n throw new Error('SEGMENT MISMATCH');\n }\n const canonicalUrlOverrideHref = canonicalUrlOverride ? createHrefFromUrl(canonicalUrlOverride) : undefined;\n if (canonicalUrlOverrideHref) {\n mutable.canonicalUrlOverride = canonicalUrlOverrideHref;\n }\n mutable.previousTree = state.tree;\n mutable.patchedTree = newTree;\n mutable.mpaNavigation = isNavigatingToNewRootLayout(state.tree, newTree);\n if (flightDataPath.length === 3) {\n cache.status = CacheStates.READY;\n cache.subTreeData = subTreeData;\n fillLazyItemsTillLeafWithHead(cache, state.cache, treePatch, head);\n } else {\n // Copy subTreeData for the root node of the cache.\n cache.status = CacheStates.READY;\n cache.subTreeData = state.cache.subTreeData;\n // Create a copy of the existing cache with the subTreeData applied.\n fillCacheWithNewSubTreeData(cache, state.cache, flightDataPath);\n }\n return {\n // Set href.\n canonicalUrl: canonicalUrlOverrideHref ? canonicalUrlOverrideHref : href,\n // Set pendingPush.\n pushRef: {\n pendingPush,\n mpaNavigation: false\n },\n // All navigation requires scroll and focus management to trigger.\n focusAndScrollRef: {\n apply: true\n },\n // Apply patched cache.\n cache: cache,\n prefetchCache: state.prefetchCache,\n // Apply patched tree.\n tree: newTree\n };\n }\n case ACTION_SERVER_PATCH:\n {\n const { flightData , previousTree , overrideCanonicalUrl , cache , mutable } = action;\n // When a fetch is slow to resolve it could be that you navigated away while the request was happening or before the reducer runs.\n // In that case opt-out of applying the patch given that the data could be stale.\n if (JSON.stringify(previousTree) !== JSON.stringify(state.tree)) {\n // TODO-APP: Handle tree mismatch\n console.log('TREE MISMATCH');\n // Keep everything as-is.\n return state;\n }\n if (mutable.mpaNavigation) {\n return {\n // Set href.\n canonicalUrl: mutable.canonicalUrlOverride ? mutable.canonicalUrlOverride : state.canonicalUrl,\n // TODO-APP: verify mpaNavigation not being set is correct here.\n pushRef: {\n pendingPush: true,\n mpaNavigation: mutable.mpaNavigation\n },\n // All navigation requires scroll and focus management to trigger.\n focusAndScrollRef: {\n apply: false\n },\n // Apply cache.\n cache: state.cache,\n prefetchCache: state.prefetchCache,\n // Apply patched router state.\n tree: state.tree\n };\n }\n // Handle concurrent rendering / strict mode case where the cache and tree were already populated.\n if (mutable.patchedTree) {\n return {\n // Keep href as it was set during navigate / restore\n canonicalUrl: mutable.canonicalUrlOverride ? mutable.canonicalUrlOverride : state.canonicalUrl,\n // Keep pushRef as server-patch only causes cache/tree update.\n pushRef: state.pushRef,\n // Keep focusAndScrollRef as server-patch only causes cache/tree update.\n focusAndScrollRef: state.focusAndScrollRef,\n // Apply patched router state\n tree: mutable.patchedTree,\n prefetchCache: state.prefetchCache,\n // Apply patched cache\n cache: cache\n };\n }\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === 'string') {\n return {\n // Set href.\n canonicalUrl: flightData,\n // Enable mpaNavigation as this is a navigation that the app-router shouldn't handle.\n pushRef: {\n pendingPush: true,\n mpaNavigation: true\n },\n // Don't apply scroll and focus management.\n focusAndScrollRef: {\n apply: false\n },\n // Other state is kept as-is.\n cache: state.cache,\n prefetchCache: state.prefetchCache,\n tree: state.tree\n };\n }\n // TODO-APP: Currently the Flight data can only have one item but in the future it can have multiple paths.\n const flightDataPath = flightData[0];\n // Slices off the last segment (which is at -4) as it doesn't exist in the tree yet\n const flightSegmentPath = flightDataPath.slice(0, -4);\n const [treePatch, subTreeData, head] = flightDataPath.slice(-3);\n const newTree = applyRouterStatePatchToTree(// TODO-APP: remove ''\n [\n '',\n ...flightSegmentPath\n ], state.tree, treePatch);\n if (newTree === null) {\n throw new Error('SEGMENT MISMATCH');\n }\n const canonicalUrlOverrideHref = overrideCanonicalUrl ? createHrefFromUrl(overrideCanonicalUrl) : undefined;\n if (canonicalUrlOverrideHref) {\n mutable.canonicalUrlOverride = canonicalUrlOverrideHref;\n }\n mutable.patchedTree = newTree;\n mutable.mpaNavigation = isNavigatingToNewRootLayout(state.tree, newTree);\n // Root refresh\n if (flightDataPath.length === 3) {\n cache.status = CacheStates.READY;\n cache.subTreeData = subTreeData;\n fillLazyItemsTillLeafWithHead(cache, state.cache, treePatch, head);\n } else {\n // Copy subTreeData for the root node of the cache.\n cache.status = CacheStates.READY;\n cache.subTreeData = state.cache.subTreeData;\n fillCacheWithNewSubTreeData(cache, state.cache, flightDataPath);\n }\n return {\n // Keep href as it was set during navigate / restore\n canonicalUrl: canonicalUrlOverrideHref ? canonicalUrlOverrideHref : state.canonicalUrl,\n // Keep pushRef as server-patch only causes cache/tree update.\n pushRef: state.pushRef,\n // Keep focusAndScrollRef as server-patch only causes cache/tree update.\n focusAndScrollRef: state.focusAndScrollRef,\n // Apply patched router state\n tree: newTree,\n prefetchCache: state.prefetchCache,\n // Apply patched cache\n cache: cache\n };\n }\n case ACTION_RESTORE:\n {\n const { url , tree } = action;\n const href = createHrefFromUrl(url);\n return {\n // Set canonical url\n canonicalUrl: href,\n pushRef: state.pushRef,\n focusAndScrollRef: state.focusAndScrollRef,\n cache: state.cache,\n prefetchCache: state.prefetchCache,\n // Restore provided tree\n tree: tree\n };\n }\n // TODO-APP: Add test for not scrolling to nearest layout when calling refresh.\n // TODO-APP: Add test for startTransition(() => {router.push('/'); router.refresh();}), that case should scroll.\n case ACTION_REFRESH:\n {\n const { cache , mutable } = action;\n const href = state.canonicalUrl;\n const isForCurrentTree = JSON.stringify(mutable.previousTree) === JSON.stringify(state.tree);\n if (mutable.mpaNavigation && isForCurrentTree) {\n return {\n // Set href.\n canonicalUrl: mutable.canonicalUrlOverride ? mutable.canonicalUrlOverride : state.canonicalUrl,\n // TODO-APP: verify mpaNavigation not being set is correct here.\n pushRef: {\n pendingPush: true,\n mpaNavigation: mutable.mpaNavigation\n },\n // All navigation requires scroll and focus management to trigger.\n focusAndScrollRef: {\n apply: false\n },\n // Apply cache.\n cache: state.cache,\n prefetchCache: state.prefetchCache,\n // Apply patched router state.\n tree: state.tree\n };\n }\n // Handle concurrent rendering / strict mode case where the cache and tree were already populated.\n if (mutable.patchedTree && isForCurrentTree) {\n return {\n // Set href.\n canonicalUrl: mutable.canonicalUrlOverride ? mutable.canonicalUrlOverride : href,\n // set pendingPush (always false in this case).\n pushRef: state.pushRef,\n // Apply focus and scroll.\n // TODO-APP: might need to disable this for Fast Refresh.\n focusAndScrollRef: {\n apply: false\n },\n cache: cache,\n prefetchCache: state.prefetchCache,\n tree: mutable.patchedTree\n };\n }\n if (!cache.data) {\n // Fetch data from the root of the tree.\n cache.data = createRecordFromThenable(fetchServerResponse(new URL(href, location.origin), [\n state.tree[0],\n state.tree[1],\n state.tree[2],\n 'refetch', \n ]));\n }\n const [flightData, canonicalUrlOverride] = readRecordValue(cache.data);\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === 'string') {\n return {\n canonicalUrl: flightData,\n pushRef: {\n pendingPush: true,\n mpaNavigation: true\n },\n focusAndScrollRef: {\n apply: false\n },\n cache: state.cache,\n prefetchCache: state.prefetchCache,\n tree: state.tree\n };\n }\n // Remove cache.data as it has been resolved at this point.\n cache.data = null;\n // TODO-APP: Currently the Flight data can only have one item but in the future it can have multiple paths.\n const flightDataPath = flightData[0];\n // FlightDataPath with more than two items means unexpected Flight data was returned\n if (flightDataPath.length !== 3) {\n // TODO-APP: handle this case better\n console.log('REFRESH FAILED');\n return state;\n }\n // Given the path can only have two items the items are only the router state and subTreeData for the root.\n const [treePatch, subTreeData, head] = flightDataPath;\n const newTree = applyRouterStatePatchToTree(// TODO-APP: remove ''\n [\n ''\n ], state.tree, treePatch);\n if (newTree === null) {\n throw new Error('SEGMENT MISMATCH');\n }\n const canonicalUrlOverrideHref = canonicalUrlOverride ? createHrefFromUrl(canonicalUrlOverride) : undefined;\n if (canonicalUrlOverride) {\n mutable.canonicalUrlOverride = canonicalUrlOverrideHref;\n }\n mutable.previousTree = state.tree;\n mutable.patchedTree = newTree;\n mutable.mpaNavigation = isNavigatingToNewRootLayout(state.tree, newTree);\n // Set subTreeData for the root node of the cache.\n cache.status = CacheStates.READY;\n cache.subTreeData = subTreeData;\n fillLazyItemsTillLeafWithHead(cache, state.cache, treePatch, head);\n return {\n // Set href, this doesn't reuse the state.canonicalUrl as because of concurrent rendering the href might change between dispatching and applying.\n canonicalUrl: canonicalUrlOverrideHref ? canonicalUrlOverrideHref : href,\n // set pendingPush (always false in this case).\n pushRef: state.pushRef,\n // TODO-APP: might need to disable this for Fast Refresh.\n focusAndScrollRef: {\n apply: false\n },\n // Apply patched cache.\n cache: cache,\n prefetchCache: state.prefetchCache,\n // Apply patched router state.\n tree: newTree\n };\n }\n case ACTION_PREFETCH:\n {\n const { url , serverResponse } = action;\n const [flightData, canonicalUrlOverride] = serverResponse;\n if (typeof flightData === 'string') {\n return state;\n }\n const href = createHrefFromUrl(url);\n // TODO-APP: Currently the Flight data can only have one item but in the future it can have multiple paths.\n const flightDataPath = flightData[0];\n // The one before last item is the router state tree patch\n const [treePatch] = flightDataPath.slice(-3);\n const flightSegmentPath = flightDataPath.slice(0, -3);\n const newTree = applyRouterStatePatchToTree(// TODO-APP: remove ''\n [\n '',\n ...flightSegmentPath\n ], state.tree, treePatch);\n // Patch did not apply correctly\n if (newTree === null) {\n return state;\n }\n // Create new tree based on the flightSegmentPath and router state patch\n state.prefetchCache.set(href, {\n flightData,\n // Create new tree based on the flightSegmentPath and router state patch\n tree: newTree,\n canonicalUrlOverride\n });\n return state;\n }\n // This case should never be hit as dispatch is strongly typed.\n default:\n throw new Error('Unknown action');\n }\n}", "function reducer (state = initialState, action) {\n switch (action.type) {\n case CHANGE_FORM:\n return {\n ...state,\n formState: action.newFormState\n }\n case LOGIN_REQUEST:\n return {\n ...state,\n // formState: action.data,\n loggedIn: true\n }\n case LOGOUT:\n localStorage.removeItem(\"token\");\n return {\n ...state,\n formState: {\n username: '',\n password: ''\n },\n loggedIn: false\n }\n case GET_SELF:\n return {\n ...state,\n ListOfFriends: ['Timeline'].concat(action.data.friends),\n posts: action.data.posts,\n name: action.data.userName\n };\n case GET_ALL_USERS:\n return {\n ...state,\n ListOfPeople: action.data.users\n }\n case SET_AUTH:\n return {\n ...state,\n loggedIn: action.newAuthState\n }\n case SENDING_REQUEST:\n return {\n ...state,\n currentlySending: action.sending\n }\n case REQUEST_ERROR:\n return {\n ...state,\n error: action.error\n }\n case CLEAR_ERROR:\n return {\n ...state,\n error: ''\n }\n case REGISTER_REQUEST:\n return {\n ...state,\n formState: action.data\n }\n case ADD_NEWSFEED:\n return {\n ...state,\n posts: state.posts.concat(action.text)\n }\n case DELETE_POST:\n return {\n ...state,\n posts: state.posts.filter(post => {\n return post._id !== action.id;\n })\n }\n case CHANGE_NAME:\n return {\n ...state,\n name: action.name\n }\n case CHANGE_PASSWORD:\n return {\n ...state,\n formState: {\n ...state.formState,\n password: action.password\n }\n }\n case ADD_FRIEND:\n return {\n ...state,\n ListOfFriends: state.ListOfFriends.concat(action.name)\n }\n case DELETE_FRIEND:\n return {\n ...state,\n ListOfFriends: state.ListOfFriends.filter(function (e) {\n return e !== action.name\n })\n }\n default:\n return state\n }\n}", "function reducer(state, action) {\n\n if (typeof state === 'undefined') {\n state = {\n previousPage: false,\n currentPage: 'PRE_MENU',\n musicStatus: 'OFF',\n currentMusicSource: false,\n sfxStatus: 'OFF',\n currentSfxSource: false,\n activeGameState: {},\n isGamePaused: false,\n autoPause: 'ON',\n activeTowerSlot: false,\n isBuildMenuOpen: false,\n battleState: 'BATTLE_OFF',\n\t\t\t\tpauseStatus: 'PAUSE_OFF',\n isOptionsPanelOpened: false,\n animationendListened: []\n };\n return state\n }\n\n switch (action.type) {\n case 'MENU_CHANGE':\n return Object.assign({}, state, {\n currentPage: action.payload.currentPage,\n previousPage: action.payload.previousPage,\n lastAction: MENU_CHANGE\n })\n case 'MUSIC_ON':\n return Object.assign({}, state, {\n musicStatus: action.payload.status,\n currentMusicSource: action.payload.src,\n lastAction: MUSIC_ON\n })\n case 'MUSIC_OFF':\n return Object.assign({}, state, {\n musicStatus: action.payload.status,\n currentMusicSource: action.payload.src,\n lastAction: MUSIC_OFF\n })\n case 'SFX_ON':\n return Object.assign({}, state, {\n sfxStatus: action.payload.status,\n lastAction: SFX_ON\n })\n case 'SFX_OFF':\n return Object.assign({}, state, {\n sfxStatus: action.payload.status,\n lastAction: SFX_OFF\n })\n case 'GAME_LOAD':\n return Object.assign({}, state, {\n savedData: action.payload.savedData,\n lastAction: GAME_LOAD\n })\n case 'GAME_SAVE':\n return Object.assign({}, state, {\n savedData: action.payload.savedData,\n lastAction: GAME_SAVE\n })\n case 'UNUSED_SAVESLOT':\n return Object.assign({}, state, {\n saveSlottoInit: action.payload.saveSlottoInit,\n lastAction: UNUSED_SAVESLOT\n })\n case 'GAME_DELETE':\n return Object.assign({}, state, {\n gameSlot: action.payload.gameSlot,\n lastAction: GAME_DELETE\n })\n case 'GAME_DELCONF':\n return Object.assign({}, state, {\n deleteConfirmation: action.payload.delConf,\n lastAction: GAME_DELCONF\n })\n case 'GET_GAMEDATA':\n return Object.assign({}, state, {\n activeSlot: action.payload.activeSlot,\n lastAction: GET_GAMEDATA\n })\n case 'GAMEDATA_LOADED':\n return Object.assign({}, state, {\n activeGameState: action.payload.activeGameState,\n lastAction: GAMEDATA_LOADED\n })\n case 'BATTLEPANEL_ON':\n return Object.assign({}, state, {\n selectedMap: action.payload.selectedMap,\n lastAction: BATTLEPANEL_ON\n })\n case 'BATTLEPANEL_OFF':\n return Object.assign({}, state, {\n selectedMap: undefined,\n lastAction: BATTLEPANEL_OFF\n })\n case 'BATTLE_ON':\n return Object.assign({}, state, {\n battleState: action.payload.battleState,\n lastAction: BATTLE_ON\n })\n case 'DIFFICULTY_CHANGE':\n return Object.assign({}, state, {\n activeGameState: action.payload.activeGameState,\n towerTypes: action.payload.towerTypes,\n lastAction: DIFFICULTY_CHANGE\n })\n case 'PLAYPAUSE_CHANGE':\n return Object.assign({}, state, {\n isGamePaused: action.payload.isGamePaused,\n lastAction: PLAYPAUSE_CHANGE,\n })\n case 'AUTOPAUSE_CHANGE':\n return Object.assign({}, state, {\n autoPause: action.payload.autoPause,\n lastAction: AUTOPAUSE_CHANGE\n })\n case 'TOWER_CLICKED':\n return Object.assign({}, state, {\n activeTowerSlot: action.payload.activeTowerSlot,\n clickedSlotHTML: action.payload.clickedSlotHTML,\n isBuildMenuOpen: action.payload.isBuildMenuOpen,\n towerSlotToBuild: action.payload.towerSlotToBuild,\n lastAction: TOWER_CLICKED\n })\n case 'TOWER_UNCLICKED':\n return Object.assign({}, state, {\n activeTowerSlot: action.payload.activeTowerSlot,\n isBuildMenuOpen: action.payload.isBuildMenuOpen,\n lastAction: TOWER_UNCLICKED\n })\n case 'BUILDBUTTON_CLICKED':\n return Object.assign({}, state, {\n towerToBuild: action.payload.towerToBuild,\n lastAction: BUILDBUTTON_CLICKED\n })\n case 'BUILD_START':\n return Object.assign({}, state, {\n activeGameState: action.payload.activeGameState,\n lastAction: BUILD_START\n })\n case 'OPTIONS_OPEN':\n return Object.assign({}, state, {\n isOptionsPanelOpened: action.payload.isOptionsPanelOpened,\n isGamePaused: action.payload.isGamePaused,\n manualPaused: action.payload.manualPaused,\n lastAction: OPTIONS_OPEN\n })\n case 'OPTIONS_CLOSE':\n return Object.assign({}, state, {\n isOptionsPanelOpened: action.payload.isOptionsPanelOpened,\n isGamePaused: action.payload.isGamePaused,\n lastAction: OPTIONS_CLOSE\n })\n case 'MANUALPAUSE_OFF':\n return Object.assign({}, state, {\n manualPaused: action.payload.manualPaused,\n lastAction: MANUALPAUSE_OFF\n })\n case 'TOWERBUILD_FINISHED':\n return Object.assign({}, state, {\n activeGameState: action.payload.activeGameState,\n lastAction: TOWERBUILD_FINISHED\n })\n case 'RESTART':\n return Object.assign({}, state, {\n activeGameState: action.payload.activeGameState,\n lastAction: RESTART\n })\n case 'EVENTLISTENER_CHANGE':\n return Object.assign({}, state, {\n animationendListened: action.payload.animationendListened,\n lastAction: EVENTLISTENER_CHANGE\n })\n default:\n return state\n }\n }", "renderContent(data) {\n \tconst rowData = data.item;\n let baseColor;\n let iconToDisplay;\n\t\tlet itemSuspictionColor;\n // give a differente backgroundColor to the notifications already clicked\n let index;\n if (this.state.existingList && this.state.existingList.length > 0) {\n index = this.state.existingList.map((single) => {return single._id}).indexOf(rowData._id);\n }\n // display the right icon according to the theme\n switch (rowData.theme) {\n case 'tabac':\n iconToDisplay = tabac;\n break;\n case 'sport':\n iconToDisplay = sport;\n break;\n case 'nutrition':\n iconToDisplay = food;\n break;\n case 'relax':\n iconToDisplay = relax;\n break;\n default: iconToDisplay = tabac;\n }\n // display the right back color according to the argument\n switch (rowData.action) {\n case 'bet':\n case 'chalAccepted':\n case 'chalMatched':\n case 'challengeReactivated':\n case 'pendingChallenge':\n \t// give the right color to the board\n baseColor = color3;\n\t\t\t\t// give the right color to clicked notifs\n\t\t\t\tif (\n\t\t\t\t\t(\n\t\t\t\t\t\tthis.state.existingList\n\t\t\t\t\t\t&& this.state.existingList[index]\n\t\t\t\t\t\t&& this.state.existingList[index].clicked\n\t\t\t\t\t\t&& this.state.existingList[index].clicked === true\n\t\t\t\t\t)\n\t\t\t\t\t|| ((\n\t\t\t\t\t\trowData.action === 'chalAccepted'\n\t\t\t\t\t\t|| rowData.action === 'chalMatched'\n\t\t\t\t\t\t|| rowData.action === 'pendingChallenge'\n\t\t\t\t\t\t) && rowData.player === this.props.userId\n\t\t\t\t\t)\n\t\t\t\t\t|| (rowData.action === 'pendingChallenge' && rowData.used === true)\n\t\t\t\t) {\n\t\t\t\t\titemColor = color16;\n\t\t\t\t} else {\n\t\t\t\t\titemColor = white;\n\t\t\t\t}\n break;\n case 'challengeFreezed':\n case 'challFinished':\n \t// give the right color to the board\n baseColor = color4;\n\t\t\t\t// give the right color to clicked notifs\n\t\t\t\tif (\n\t\t\t\t\tthis.state.existingList\n\t\t\t\t\t&& this.state.existingList[index]\n\t\t\t\t\t&& this.state.existingList[index].clicked\n\t\t\t\t\t&& this.state.existingList[index].clicked === true\n\t\t\t\t) {\n\t\t\t\t\titemColor = color15;\n\t\t\t\t} else {\n\t\t\t\t\titemColor = white;\n\t\t\t\t}\n break;\n case 'avatar':\n case 'chalRefused':\n case 'endStage':\n case 'endProgram':\n \t// give the right color to the board\n baseColor = color2;\n\t\t\t\t// give the right color to clicked notifs\n\t\t\t\tif (\n\t\t\t\t\t(\n\t\t\t\t\t\tthis.state.existingList\n\t\t\t\t\t\t&& this.state.existingList[index]\n\t\t\t\t\t\t&& this.state.existingList[index].clicked\n\t\t\t\t\t\t&& this.state.existingList[index].clicked === true\n\t\t\t\t\t)\n\t\t\t\t\t|| rowData.action === 'chalRefused'\n\t\t\t\t\t|| rowData.action === 'endStage'\n\t\t\t\t\t|| rowData.action === 'endProgram'\n\t\t\t\t) {\n\t\t\t\t\titemColor = color14;\n\t\t\t\t} else {\n\t\t\t\t\titemColor = white;\n\t\t\t\t}\n break;\n case 'onBoardingWelcome':\n case 'onBoarding1':\n case 'onBoarding2':\n case 'morningIncentive':\n \t// give the right color to the board\n baseColor = color9;\n\t\t\t\t// give the right color to clicked notifs\n\t\t\t\tif (\n\t\t\t\t\t(\n\t\t\t\t\t\tthis.state.existingList\n\t\t\t\t\t\t&& this.state.existingList[index]\n\t\t\t\t\t\t&& this.state.existingList[index].clicked\n\t\t\t\t\t\t&& this.state.existingList[index].clicked === true\n\t\t\t\t\t)\n\t\t\t\t\t|| rowData.action === 'onBoarding2'\n\t\t\t\t) {\n\t\t\t\t\titemColor = color13;\n\t\t\t\t} else {\n\t\t\t\t\titemColor = white;\n\t\t\t\t}\n break;\n case 'freeze':\n case 'suspect':\n \t// give the right color to the board\n baseColor = color1;\n\t\t\t\t// give the right color to clicked notifs\n\t\t\t\tif (\n\t\t\t\t\t(\n\t\t\t\t\t\tthis.state.existingList\n\t\t\t\t\t\t&& this.state.existingList[index]\n\t\t\t\t\t\t&& this.state.existingList[index].clicked\n\t\t\t\t\t\t&& this.state.existingList[index].clicked === true\n\t\t\t\t\t)\n\t\t\t\t\t|| rowData.action === 'suspect'\n\t\t\t\t) {\n\t\t\t\t\titemColor = color11;\n\t\t\t\t} else {\n\t\t\t\t\titemColor = white;\n\t\t\t\t}\n break;\n default: baseColor = color1;\n }\n const fondAdapted = {\n alignSelf: 'stretch',\n justifyContent: 'center',\n marginTop: 2,\n marginHorizontal: 26,\n marginVertical: 15,\n borderRadius: 8,\n backgroundColor: baseColor\n };\n const imgAdapted = {\n width: imgWidth,\n height: imgWidth,\n borderWidth: 3,\n borderColor: baseColor,\n borderRadius: imgWidth / 2,\n marginBottom: 5\n };\n const innerBox = {\n \tflex: 1,\n flexDirection: 'row',\n alignSelf: 'center',\n justifyContent: 'space-between',\n \tmarginHorizontal: 10,\n paddingVertical: 17,\n \tbackgroundColor: itemColor,\n paddingHorizontal: 10\n };\n // make the notification clickable when it is not in a challenge detail\n if (rowData.action === 'pendingChallenge' && rowData.player === this.props.userId) {\n\n // ---------------------- informs the challenger of the pending Challenge he made ----------------//\n\n return (\n <View\n style={fondAdapted}\n >\n <View style={innerBox}>\n <View style={imgAdapted}>\n <Image\n source={rowData.opponentImage ? { uri: rowData.opponentImage, isStatic: true } : defaultUser}\n style={styles.image}\n />\n </View>\n <View style={styles.listBox}>\n <View style={styles.iconTheme}><Image source={iconToDisplay} style={styles.imageIcon}/></View>\n\t \t<Text style={styles.txtTime}>{timerNotifs(rowData.currentTime, rowData.date).toUpperCase()} :</Text>\n <Text style={styles.txt}>\n Vous avez defié <Text style={styles.bold}>{rowData.opponentFirstName} {rowData.opponentFamilyName}</Text>\n </Text>\n {rowData.bonus && rowData.bonus > 0 ?\n \tthis.bonus(rowData.bonus)\n \t:\n \tnull\n }\n <Text style={styles.txt}>Votre défi attend d'être accepté</Text>\n </View>\n </View>\n </View>\n );\n\n // pending challenges wher the user is opponent and the challenge is not older that the time limit for validation\n } else if (rowData.action === 'pendingChallenge' && (rowData.currentTime - new Date(rowData.date).getTime()) > rowData.oldMax) {\n\n // ---------------------- informs the opponent of a pending Challenge ----------------//\n\n return (\n <View\n style={fondAdapted}\n >\n <View style={innerBox}>\n <View style={imgAdapted}>\n <Image\n source={rowData.playerImage ? { uri: rowData.playerImage, isStatic: true } : defaultUser}\n style={styles.image}\n />\n </View>\n <View style={styles.listBox}>\n <View style={styles.iconTheme}><Image source={iconToDisplay} style={styles.imageIcon}/></View>\n\t \t<Text style={styles.txtTime}>{timerNotifs(rowData.currentTime, rowData.date).toUpperCase()} :</Text>\n <Text style={styles.txt}>\n Le défi que <Text style={styles.bold}>{rowData.playerFirstName} {rowData.playerFamilyName}</Text> vous a lancé ne peut plus être accepté car le temps limite a été dépassé.\n </Text>\n </View>\n </View>\n </View>\n );\n } else if (rowData.action === 'avatar') {\n\n // ---------------------- informs the opponent of a pending Challenge ----------------//\n\n return (\n <TouchableOpacity\n style={fondAdapted}\n onPress={() => {\n \tmarkSingleNotif(rowData._id, rowData.date, () => {\n \t\tActions.bonusMain();\n \t\tthis.handleRefresh();\n \t});\n }}\n >\n <View style={innerBox}>\n <View style={imgAdapted}>\n <Image\n source={rowData.playerImage ? { uri: rowData.playerImage, isStatic: true } : defaultUser}\n style={styles.image}\n />\n </View>\n <View style={styles.listBox}>\n\t \t<Text style={styles.txtTimeNoIcon}>{timerNotifs(rowData.currentTime, rowData.date).toUpperCase()} :</Text>\n <Text style={styles.txt}>\n <Text style={styles.bold}>Vous</Text> venez d'enregistrer votre avatar{\"\\n\"}\n {rowData.bonus && rowData.bonus > 0 ?\n \tthis.bonus(rowData.bonus)\n \t:\n \tnull\n }\n </Text>\n </View>\n </View>\n </TouchableOpacity>\n );\n } else if (rowData.action === 'onBoardingWelcome') {\n\n // ---------------------- welcome message ----------------//\n\n return (\n <TouchableOpacity\n style={fondAdapted}\n onPress={() => {\n \tmarkSingleNotif(rowData._id, rowData.date, () => {\n\t \tif (this.props.origin === 'main' || this.props.origin === 'chall') {\n\t \t Actions.tutorial({format: 'tuto'});\n\t \t} else {\n\t \t Actions.tutorialNot({format: 'tuto'});\n\t \t}\n \t\tthis.handleRefresh();\n \t});\n }}\n >\n <View style={innerBox}>\n <View style={imgAdapted}>\n <Image\n source={rowData.playerImage ? { uri: rowData.playerImage, isStatic: true } : defaultUser}\n style={styles.image}\n />\n </View>\n <View style={styles.listBox}>\n <Text style={styles.txt}>\n <Text style={styles.bold}>Bienvenue sur Tricky !</Text> Êtes-vous prêt à relever les défis ?\n </Text>\n <Text style={styles.txtClickable}>{'Besoin d\\'aide ?'.toUpperCase()}</Text>\n </View>\n </View>\n </TouchableOpacity>\n );\n } else if (rowData.action === 'onBoarding1') {\n\n // ---------------------- incentive tue user to launch a challenge ----------------//\n\n return (\n <TouchableOpacity\n style={fondAdapted}\n onPress={() => {\n \tmarkSingleNotif(rowData._id, rowData.date, () => {\n \t Actions.challenge({ idProgram: this.props.idProgram });\n \t\tthis.handleRefresh();\n \t});\n }}\n >\n <View style={innerBox}>\n <View style={imgAdapted}>\n <Image\n source={rowData.playerImage ? { uri: rowData.playerImage, isStatic: true } : defaultUser}\n style={styles.image}\n />\n </View>\n <View style={styles.listBox}>\n <Text style={styles.txt}>\n <Text style={styles.bold}>Lancez</Text> votre premier défi à un collègue, et tentez de doubler votre mise !\n </Text>\n <Text style={styles.txtClickable}>{'Je commence !'.toUpperCase()}</Text>\n </View>\n </View>\n </TouchableOpacity>\n );\n } else if (rowData.action === 'onBoarding2') {\n\n // ---------------------- incentive tue user to launch a challenge ----------------//\n\n return (\n <View\n style={fondAdapted}\n >\n <View style={innerBox}>\n <View style={imgAdapted}>\n <Image\n source={rowData.playerImage ? { uri: rowData.playerImage, isStatic: true } : defaultUser}\n style={styles.image}\n />\n </View>\n <View style={styles.listBox}>\n <Text style={styles.txt}>\n <Text style={styles.bold}>Sur Tricky</Text> en lançant des défis à vos collègues vous les incitez à prendre soin de leur santé.{\"\\n\"}\n Si vous misez bien vous gagnez des points qui pourront être convertibles en <Text style={styles.bold}>chèque cadeau</Text> !\n </Text>\n </View>\n </View>\n </View>\n );\n } else if (rowData.action === 'morningIncentive') {\n\n // ---------------------- incentive tue user to launch a challenge ----------------//\n\n return (\n <TouchableOpacity\n style={fondAdapted}\n onPress={() => {\n \tmarkSingleNotif(rowData._id, rowData.date, () => {\n \t\tActions.challenge({ idProgram: this.props.idProgram });\n \t\tthis.handleRefresh();\n \t});\n }}\n >\n <View style={innerBox}>\n <View style={imgAdapted}>\n <Image\n source={rowData.playerImage ? { uri: rowData.playerImage, isStatic: true } : defaultUser}\n style={styles.image}\n />\n </View>\n <View style={styles.listBox}>\n <Text style={styles.txt}>\n <Text style={styles.bold}>Bonjour {rowData.playerFirstName},</Text> aujourd'hui tu as {rowData.amount ? rowData.amount : '--'} Tricks soit XXX Euros à la fin de cette partie !\n </Text>\n <Text style={styles.txtClickable}>{'J\\'augmente mes Tricks...'.toUpperCase()}</Text>\n </View>\n </View>\n </TouchableOpacity>\n );\n } else if (rowData.action === 'chalRefused') {\n\n // ---------------------- informs the opponent of a pending Challenge ----------------//\n\n return (\n <View\n style={fondAdapted}\n >\n <View style={innerBox}>\n <View style={imgAdapted}>\n <Image\n source={rowData.playerImage ? { uri: rowData.playerImage, isStatic: true } : defaultUser}\n style={styles.image}\n />\n </View>\n <View style={styles.listBox}>\n <View style={styles.iconTheme}><Image source={iconToDisplay} style={styles.imageIcon}/></View>\n\t \t<Text style={styles.txtTime}>{timerNotifs(rowData.currentTime, rowData.date).toUpperCase()} :</Text>\n { this.props.userId === rowData.player ?\n <Text style={styles.txt}><Text style={styles.bold}>{this.selfDetector(this.props.userId, rowData.opponent, rowData.opponentFirstName, rowData.opponentFamilyName)}</Text> a réfusé le défi que vous avez lancé</Text>\n :\n null\n }\n { this.props.userId === rowData.opponent ?\n <Text style={styles.txt}><Text style={styles.bold}>Vous</Text> avez réfusé le défi lancé par {this.selfDetector(this.props.userId, rowData.player, rowData.playerFirstName, rowData.playerFamilyName)}</Text>\n :\n null\n }\n </View>\n </View>\n </View>\n );\n } else if (rowData.action === 'endStage') {\n\n // ---------------------- informs the opponent of a pending Challenge ----------------//\n\n return (\n <View\n style={fondAdapted}\n >\n <View style={innerBox}>\n <View style={imgAdapted}>\n <Image\n source={rowData.playerImage ? { uri: rowData.playerImage, isStatic: true } : defaultUser}\n style={styles.image}\n />\n </View>\n <View style={styles.listBox}>\n\t \t<Text style={styles.txtTimeNoIcon}>{timerNotifs(rowData.currentTime, rowData.date).toUpperCase()} :</Text>\n <Text style={styles.txt}>\n <Text style={styles.bold}>Congratulations !</Text> La premiere partie du jeu est <Text style={styles.bold}>terminée</Text>{\"\\n\"}\n Vos Tricks ont été réinitialisés et votre gagne calculé.{\"\\n\"}\n Allez voir dans la <Text style={styles.bold}>page boutique</Text> le montant que vous avez <Text style={styles.bold}>gagné !</Text>\n </Text>\n </View>\n </View>\n </View>\n );\n } else if (rowData.action === 'endProgram') {\n\n // ---------------------- informs the opponent of a pending Challenge ----------------//\n\n return (\n <View\n style={fondAdapted}\n >\n <View style={innerBox}>\n <View style={imgAdapted}>\n <Image\n source={rowData.playerImage ? { uri: rowData.playerImage, isStatic: true } : defaultUser}\n style={styles.image}\n />\n </View>\n <View style={styles.listBox}>\n\t \t<Text style={styles.txtTimeNoIcon}>{timerNotifs(rowData.currentTime, rowData.date).toUpperCase()} :</Text>\n <Text style={styles.txt}>\n <Text style={styles.bold}>Congratulations !</Text> Le programme du jeu est arrivé à sa <Text style={styles.bold}>fin.</Text>{\"\\n\"}\n Votre gagne final a été calculé.{\"\\n\"}\n Allez voir dans la <Text style={styles.bold}>page boutique</Text> le montant que vous avez <Text style={styles.bold}>gagné !</Text>\n </Text>\n </View>\n </View>\n </View>\n );\n\n // assign a clickable or not clickable container\n } else if (\n \tthis.props.notClickable\n \t&& this.props.notClickable === true\n \t&& (rowData.action !== 'freeze' && rowData.action !== 'suspect')\n ) {\n \treturn (\n <View\n style={fondAdapted}\n >\n \t { this.basicContent(rowData, imgAdapted, innerBox, iconToDisplay) }\n </View>\n \t);\n } else if (rowData.action === 'pendingChallenge' && rowData.used === true) {\n \treturn (\n <View\n style={fondAdapted}\n >\n \t { this.basicContent(rowData, imgAdapted, innerBox, iconToDisplay) }\n </View>\n \t);\n } else if (rowData.action !== 'freeze' && rowData.action !== 'suspect') {\n \treturn (\n <TouchableOpacity\n style={fondAdapted}\n onPress={() => {\n \tmarkSingleNotif(rowData._id, rowData.date, () => {\n \tthis.props.selectNotif(rowData.challengeId, rowData.action);\n \t\tthis.handleRefresh();\n \t});\n }}\n >\n \t { this.basicContent(rowData, imgAdapted, innerBox, iconToDisplay) }\n </TouchableOpacity>\n \t);\n\n } else if (rowData.action === 'freeze' || rowData.action === 'suspect') {\n \treturn (\n <TouchableOpacity\n style={fondAdapted}\n onPress={() => {\n \tmarkSingleNotif(rowData._id, rowData.date, () => {\n \t\tif (rowData.action === 'freeze') {\n\t\t \t// check if the freeze as been already jugged\n\t\t \tif (!rowData.used || rowData.used !== true) {\n\t\t \tif (this.props.origin === 'main' || this.props.origin === 'chall') {\n\t\t \t\tActions.dettFreeze({ idFreeze: rowData.freezeId, freezer: rowData.freezer, accusedId: rowData.accused, idChallenge: rowData.challengeId, image: rowData.image, comment: rowData.comment ? rowData.comment : null });\n\t\t \t} else {\n\t\t \t\tActions.dettFreezeNot({ idFreeze: rowData.freezeId, freezer: rowData.freezer, accusedId: rowData.accused, idChallenge: rowData.challengeId, image: rowData.image, comment: rowData.comment ? rowData.comment : null });\n\t\t \t}\n\t\t \t} else {\n\t\t \tif (this.props.origin === 'main' || this.props.origin === 'chall') {\n\t\t Actions.dettFreeze({ idFreeze: rowData.freezeId, freezer: rowData.freezer, accusedId: rowData.accused, idChallenge: rowData.challengeId, image: rowData.image, updated: true, comment: rowData.comment ? rowData.comment : null });\n\t\t } else {\n\t\t \tActions.dettFreezeNot({ idFreeze: rowData.freezeId, freezer: rowData.freezer, accusedId: rowData.accused, idChallenge: rowData.challengeId, image: rowData.image, updated: true, comment: rowData.comment ? rowData.comment : null });\n\t\t }\n\t\t \t}\n \t\t} else if (rowData.action === 'suspect') {\n\t\t this.props.selectNotif(rowData.challengeId, rowData.action);\n \t\t}\n \t\tthis.handleRefresh();\n \t});\n }}\n >\n \t { this.basicContent(rowData, imgAdapted, innerBox, iconToDisplay) }\n </TouchableOpacity>\n \t);\n }\n }", "function server_messages(state = { orderedSets: {}, server: {}, messages: '> ' }, action) {\n //console.log (`store: reducer called with ${JSON.stringify(action)}`)\n let ret = {}\n switch (action.type) {\n case 'LEFT': \n ret = { orderedSets: {}, server: {}}\n break\n case 'JOINED':\n // http://redux.js.org/docs/recipes/UsingObjectSpreadOperator.html\n ret = {server: {name: action.name, server: action.server, interval: action.interval}}\n break\n case 'UPDATEKEY':\n if (!state.orderedSets[action.key]) { \n ret = {orderedSets: { ...state.orderedSets, [action.key]: [action]}}\n } else {\n let updt_idx = state.orderedSets[action.key].findIndex((e) => e.id === action.id);\n if (updt_idx >=0) {\n // https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/splice\n ret = {orderedSets: update (state.orderedSets, {[action.key]: {$splice:[[updt_idx, 1, action]]}})}\n } else {\n ret = {orderedSets: update (state.orderedSets, {[action.key]: {$push:[action]}})}\n }\n }\n break\n case 'REMOVEKEY':\n if (state.orderedSets[action.key]) { \n let rm_idx = state.orderedSets[action.key] && state.orderedSets[action.key].findIndex((e) => e.id === action.id);\n if (rm_idx >=0) {// perform 1 splice, at position existing_idx, remove 1 element\n ret = {orderedSets: update (state.orderedSets, {[action.key]: {$splice: [[rm_idx, 1]]}})}\n }\n }\n break\n default:\n console.log (`unknown mesg ${action.key}`)\n }\n // update(this.state.alldatafromserver, {$push: [server_data]})}\n return { ...state, ...ret, messages: state.messages + JSON.stringify(action) + '\\n> '}\n}", "function reducer(state, action){ // assume state = { name: 'NAVS', isVisible: false}\n switch(action.type){\n case 'Test_action' :\n return {...state, isVisible: true}\n default: return state\n }\n}", "function dispatch() {\n state = update(state, this)\n console.log(state)\n refreshDOM()\n}", "function gameboardReducer(state = initialGameboardEmpty, { type, payload }) {\n let stateDeepCopy = JSON.parse(JSON.stringify(state));\n let freshBoard;\n let positions;\n switch (type) {\n case INITIAL_GAMESTATE:\n positions = Object.keys(payload.gameboardPieces);\n for (let x = 0; x < positions.length; x++) {\n stateDeepCopy[positions[x]].pieces = payload.gameboardPieces[positions[x]];\n }\n return stateDeepCopy;\n case NEW_ROUND:\n case PLACE_PHASE:\n if (payload.gameboardPieces) {\n //this would happen on the 1st event (from executeStep)\n freshBoard = JSON.parse(JSON.stringify(initialGameboardEmpty));\n positions = Object.keys(payload.gameboardPieces);\n for (let x = 0; x < positions.length; x++) {\n freshBoard[positions[x]].pieces = payload.gameboardPieces[positions[x]];\n }\n return freshBoard;\n } else {\n return stateDeepCopy; //TODO: return at the bottom instead? (be consistent)\n }\n case PIECES_MOVE:\n //TODO: consolidate this with initial gamestate (or change)\n freshBoard = JSON.parse(JSON.stringify(initialGameboardEmpty));\n positions = Object.keys(payload.gameboardPieces);\n for (let x = 0; x < positions.length; x++) {\n freshBoard[positions[x]].pieces = payload.gameboardPieces[positions[x]];\n }\n return freshBoard;\n case SLICE_CHANGE:\n freshBoard = JSON.parse(JSON.stringify(initialGameboardEmpty));\n positions = Object.keys(payload.gameboardPieces);\n for (let x = 0; x < positions.length; x++) {\n freshBoard[positions[x]].pieces = payload.gameboardPieces[positions[x]];\n }\n return freshBoard;\n case NO_MORE_EVENTS:\n if (payload.gameboardPieces) {\n //this would happen on the 1st event (from executeStep)\n freshBoard = JSON.parse(JSON.stringify(initialGameboardEmpty));\n positions = Object.keys(payload.gameboardPieces);\n for (let x = 0; x < positions.length; x++) {\n freshBoard[positions[x]].pieces = payload.gameboardPieces[positions[x]];\n }\n return freshBoard;\n } else {\n return stateDeepCopy;\n }\n case REMOTE_SENSING_SELECTED:\n freshBoard = JSON.parse(JSON.stringify(initialGameboardEmpty));\n positions = Object.keys(payload.gameboardPieces);\n for (let x = 0; x < positions.length; x++) {\n freshBoard[positions[x]].pieces = payload.gameboardPieces[positions[x]];\n }\n return freshBoard;\n case RAISE_MORALE_SELECTED:\n freshBoard = JSON.parse(JSON.stringify(initialGameboardEmpty));\n positions = Object.keys(payload.gameboardPieces);\n for (let x = 0; x < positions.length; x++) {\n freshBoard[positions[x]].pieces = payload.gameboardPieces[positions[x]];\n }\n return freshBoard;\n case EVENT_BATTLE:\n //TODO: refactor, done twice? (event_refuel...)\n if (payload.gameboardPieces) {\n //this would happen on the 1st event (from executeStep)\n freshBoard = JSON.parse(JSON.stringify(initialGameboardEmpty));\n positions = Object.keys(payload.gameboardPieces);\n for (let x = 0; x < positions.length; x++) {\n freshBoard[positions[x]].pieces = payload.gameboardPieces[positions[x]];\n }\n return freshBoard;\n } else {\n return stateDeepCopy;\n }\n case COMBAT_PHASE:\n case OUTER_PIECE_CLICK_ACTION:\n case INNER_PIECE_CLICK_ACTION:\n case EVENT_REFUEL:\n if (payload.gameboardPieces) {\n //this would happen on the 1st event (from executeStep)\n freshBoard = JSON.parse(JSON.stringify(initialGameboardEmpty));\n positions = Object.keys(payload.gameboardPieces);\n for (let x = 0; x < positions.length; x++) {\n freshBoard[positions[x]].pieces = payload.gameboardPieces[positions[x]];\n }\n return freshBoard;\n } else {\n return stateDeepCopy;\n }\n case REFUEL_RESULTS:\n const { fuelUpdates } = payload;\n\n for (let y = 0; y < fuelUpdates.length; y++) {\n //need to find the piece on the board and update it, would be nice if we had the position...\n let thisFuelUpdate = fuelUpdates[y];\n let { pieceId, piecePositionId, newFuel } = thisFuelUpdate;\n for (let x = 0; x < stateDeepCopy[piecePositionId].pieces.length; x++) {\n if (stateDeepCopy[piecePositionId].pieces[x].pieceId === pieceId) {\n stateDeepCopy[piecePositionId].pieces[x].pieceFuel = newFuel;\n break;\n }\n }\n }\n\n return stateDeepCopy;\n case PIECE_PLACE:\n stateDeepCopy[payload.positionId].pieces.push(payload.newPiece);\n return stateDeepCopy;\n case CLEAR_BATTLE:\n //remove pieces from the masterRecord that won?\n const { masterRecord, friendlyPieces, enemyPieces } = payload.battle;\n\n for (let x = 0; x < masterRecord.length; x++) {\n let currentRecord = masterRecord[x];\n let { targetId, win } = currentRecord;\n if (targetId && win) {\n //need to remove the piece from the board...\n let potentialPieceToRemove1 = friendlyPieces.find(battlePiece => {\n return battlePiece.piece.pieceId === targetId;\n });\n let potentialPieceToRemove2 = enemyPieces.find(battlePiece => {\n return battlePiece.piece.pieceId === targetId;\n });\n\n //don't know if was enemy or friendly (wasn't in the masterRecord (could change this to be more efficient...))\n let battlePieceToRemove = potentialPieceToRemove1 || potentialPieceToRemove2;\n let { pieceId, piecePositionId } = battlePieceToRemove.piece;\n\n stateDeepCopy[piecePositionId].pieces = stateDeepCopy[piecePositionId].pieces.filter(piece => {\n return piece.pieceId !== pieceId;\n });\n }\n }\n\n return stateDeepCopy;\n default:\n return stateDeepCopy;\n }\n}", "handleAction(rec) {\r\n this.props.handleToDoActions(rec, this.props.record);\r\n }", "function useReducerReplacement() {\n const dispatcher = resolveDispatcher();\n function reducerWithTracker(state, action) {\n const newState = reducer(state, action);\n timeTravelLList.tail.value.actionDispatched = true;\n window.postMessage({\n type: 'DISPATCH',\n data: {\n state: newState,\n action,\n },\n });\n return newState;\n }\n return dispatcher.useReducer(reducerWithTracker, initialArg, init);\n}", "handleUndo(){\n if(this.state.changeLog[0]){\n let tempChangeLog = this.state.changeLog.slice();\n let lastItem = tempChangeLog.pop();\n \n let tempUndoLog = this.state.undoLog.slice();\n tempUndoLog.push(lastItem);\n let row = lastItem[0];\n let column = lastItem[1];\n let tempTable = this.state.table.slice();\n tempTable[row].splice(column,1,lastItem[0][2]);\n this.setState({table: tempTable, undoLog: tempUndoLog, changeLog:tempChangeLog});\n socket.emit('dataOut', {table: this.state.table, id: this.props.match.params.id, styles: this.state.styles})\n axios.put('/save-sheet', {table: this.state.table, styles: this.state.styles, id: this.props.match.params.id})\n\n\n \n }\n }", "buttonFormatter(cell, row, enumObject, index){\n if(this.state.showExtraRow && index === 0){\n return (\n //for bulk remove and delete\n <ButtonGroup>\n <Button bsStyle=\"warning\" bsSize=\"xsmall\" type=\"submit\" title=\"Remove selected targets from this session\" onClick={() => this.handleRemoveTargetsFromSession(this.state.selectedRows)}>\n <Glyphicon glyph=\"minus\" />\n </Button>\n <Button bsStyle=\"danger\" bsSize=\"xsmall\" type=\"submit\" title=\"Delete selected targets from everywhere\" onClick={() => this.handleDeleteTargets(this.state.selectedRows)}>\n <Glyphicon glyph=\"remove\" />\n </Button> \n </ButtonGroup>\n );\n }\n return (\n //single target delete and remove\n <ButtonGroup>\n <Button bsStyle=\"warning\" bsSize=\"xsmall\" type=\"submit\" title=\"Remove target from this session\" onClick={() => this.handleRemoveTargetsFromSession([this.state.data[index].id])}>\n <Glyphicon glyph=\"minus\" />\n </Button>\n <Button bsStyle=\"danger\" bsSize=\"xsmall\" type=\"submit\" title=\"Delete target from everywhere\" onClick={() => this.handleDeleteTargets([this.state.data[index].id])}>\n <Glyphicon glyph=\"remove\" />\n </Button> \n </ButtonGroup>\n );\n }", "function genericReducer(state = {}, {type, payload}) {\n switch (type) {\n case \"update\":\n return payload;\n default:\n return state;\n }\n}", "function mapDispatchToProps(dispatch) {\n return {\n fetchData: (data) => dispatch({\n 'type': 'fetchData',\n 'data': data\n }),\n reset_reader: (data) => dispatch({'type': 'reset_reader'}),\n restart: (data) => dispatch({'type': 'restart'}),\n toggle_useGsheet: ()=> dispatch({\n 'type': 'toggle_useGsheet'\n })\n }\n}", "onCellClick({\n grid,\n column,\n record,\n target\n }) {\n if (!target.classList.contains('b-action-item') || grid.readOnly) {\n return;\n }\n\n let actionIndex = target.dataset.index; // index may be set in a parent node if user used an html string in his custom renderer\n // and we take care to set this property to support onClick handler\n\n if (!actionIndex) {\n actionIndex = target.parentElement.dataset && target.parentElement.dataset.index;\n }\n\n const action = column.actions[actionIndex],\n actionHandler = action && action.onClick;\n\n if (actionHandler) {\n this.callback(actionHandler, column, [{\n record,\n action\n }]);\n }\n }", "goHandler(replacement) {\n const { toks } = this.props;\n const { focusedId } = this.state;\n const item = toks[focusedId];\n const replacementItem = Object.assign({}, item, { t: replacement });\n this.props.dispatch({\n type: 'GO',\n payload: {\n replacement: replacementItem,\n index: focusedId,\n }\n });\n }", "function mapDispatchToProps(dispatch){\n return {\n updateStates(info) {\n dispatch(actualizacion(info));\n }\n }\n}", "toggle (state, payload) {\n // Check if this row/col exists already\n if (state.list.filter(data => data.row === payload.row && data.col === payload.col).length > 0) {\n // It does exist, so remove it\n state.list = state.list.filter(data => data.row !== payload.row || data.col !== payload.col)\n } else {\n // This is a new row/col so add it\n state.list.push({ row: payload.row, col: payload.col })\n }\n }", "handleActions(action){\n\t\tswitch(action.type){\n\t\t\tcase \"VIEW_ACTION\":\n\t\t\t\tconsole.log(this.data);\n\t\t\t\tbreak;\n\t\t\tcase \"FILTER_SEARCH\":\n\t\t\t\tthis.bugSearch(action.searchParameters);\n\t\t\t\tbreak;\n\t\t\tcase \"UPDATE_BUGS\":\n\t\t\t\tthis.update(action.dbId, action.issueId, action.date, action.priority, action.summary, action.severity, action.description, action.reporter, action.assignedUser, action.status);\n\t\t\t\tbreak;\n\t\t\tcase \"FILTER_BUGS\":\n\t\t\t\tthis.filter(action.filterText);\n\t\t\t\tbreak;\n\t\t\tcase \"CLEAR_FILTER\":\n\t\t\t\tthis.clearFilter();\n\t\t\t\tbreak;\n\t\t\tcase \"NEW_BUG\":\n\t\t\t\tthis.newBug(action.id, action.issueId, action.date, action.priority, action.summary, action.severity, action.description, action.reporter, action.assignedUser, action.status);\n\t\t\t\tbreak;\n\t\t\tcase \"SORT\":\n\t\t\t\tthis.sort(action.field);\n\t\t\t\tbreak;\n\t\t\tcase \"OUTPUT\":\n\t\t\t\tthis.filter(action.filter);\n\t\t\t\tthis.bugSearch(action.searchText);\n\t\t\t\tthis.sort(action.sort);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}", "function mapDispatchToProps(dispatch) {\n return {\n openModal: () => {\n dispatch({ type: \"OPEN\", status: true })\n },\n deleteUser: (item) => {\n dispatch({ type: \"DELETE\", userData: item })\n }\n }\n}", "function Board () {\n const [grid, dispatch] = useReducer(reducer, generatePuzzle());\n const [selectedNum, setSelectedNum] = useState(1);\n const [checked, setChecked] = useState('');\n\n function updateCell (payload) {\n dispatch({ type: 'update', payload: payload });\n }\n\n return (\n <div className='container'>\n <div className='grid-sudoku'>\n {grid.map((col, i) => (\n <div className='col-s' key={i}>\n {grid[i].map((cell, j) => {\n // if input cell\n if (grid[i][j] === '.') {\n const updatePayload = [grid, i, j, selectedNum];\n return (\n <Cell className='cell-s' key={Math.random()} val=' ' onClick={() => updateCell(updatePayload)} />\n );\n }\n // if previously edited cell\n if (Number.isInteger(grid[i][j])) {\n const updatePayload = [grid, i, j, selectedNum];\n return (\n <Cell className='cell-s' key={Math.random()} val={grid[i][j]} onClick={() => updateCell(updatePayload)} />\n );\n }\n // if default cell\n return (\n <Cell className='cell-s def' key={Math.random()} val={grid[i][j]} />\n );\n })}\n </div>\n ))}\n </div>\n <MappingNums setSelectedNum={setSelectedNum} />\n <div className='menu'>\n <button\n className={`menu-btn ${checked ? 'green' : checked === '' ? 'black' : 'red'}`}\n onClick={() => setChecked(validatePuzzle(grid))}\n >check progress\n </button>\n <button className='menu-btn' onClick={() => { dispatch({ type: 'reset' }); }}>new board</button>\n <button className='menu-btn' onClick={() => dispatch({ type: 'solve' })}>solve</button>\n </div>\n <p role='img' aria-label='' className='bottomText'>\n Click main title to change games &#128070;\n </p>\n </div>\n );\n}", "handleAddToggle() {\n this.props.dispatch(topicActions.toggleAddTopic());\n }", "function applyActions () {\n let state = store.getState()\n let actions = store.getActions()\n for (let i = 0; i < actions.length; i++) {\n state = sizeChartReducer(state, actions[i])\n }\n store = mockStore({\n ...state,\n })\n }", "_Click() {\n const action1= { type: \"TOGGLE_BG\", value: this.state.bg }\n this.props.dispatch(action1)\n const action2 = { type: \"TOGGLE_INS\", value: this.state.ins }\n this.props.dispatch(action2)\n const action3 = { type: \"TOGGLE_WEI\", value: this.state.wei }\n this.props.dispatch(action3)\n const action4 = { type: \"TOGGLE_MED\", value: this.state.med }\n this.props.dispatch(action4)\n const action5 = { type: \"TOGGLE_ACT\", value: this.state.act }\n this.props.dispatch(action5)\n const action6 = { type: \"TOGGLE_CAR\", value: this.state.car }\n this.props.dispatch(action6)\n const action7 = { type: \"TOGGLE_CAL\", value: this.state.cal }\n this.props.dispatch(action7)\n\n if((this.state.bg&&this.falseBegin)||(this.state.bg&&!this.props.param.endInit)){\n this.props.navigation.navigate(\"BloodGlucose\")\n }else{\n console.log(this.falseBegin)\n const action8 = {type :\"TOGGLE_END\", value:true}\n this.props.dispatch(action8)\n //AS it's the last action, we reset the stack in order to prevent user to go back\n this.props.navigation.dispatch(resetAction);\n }\n\n }", "handleRefresh() {\n const p = this.props;\n p.dispatch( actions.itemsView.retrieve(this.meta().itemType, 'refresh') );\n }", "function mapDispatchToProps(dispatch) {\n //const actionMap = { loadInitTreeData: bindActionCreators(fetchTreeData, dispatch) };\n //return actionMap;\nreturn bindActionCreators(actionCreators, dispatch);\n}", "function undoable(reducer) {\n\t var rawConfig = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n\t __DEBUG__ = rawConfig.debug;\n\n\t var config = {\n\t initialState: rawConfig.initialState,\n\t initTypes: parseActions(rawConfig.initTypes, ['@@redux/INIT', '@@INIT']),\n\t limit: rawConfig.limit,\n\t filter: rawConfig.filter || function () {\n\t return true;\n\t },\n\t undoType: rawConfig.undoType || ActionTypes.UNDO,\n\t redoType: rawConfig.redoType || ActionTypes.REDO,\n\t jumpToPastType: rawConfig.jumpToPastType || ActionTypes.JUMP_TO_PAST,\n\t jumpToFutureType: rawConfig.jumpToFutureType || ActionTypes.JUMP_TO_FUTURE\n\t };\n\t config.history = rawConfig.initialHistory || createHistory(config.initialState);\n\n\t if (config.initTypes.length === 0) {\n\t console.warn('redux-undo: supply at least one action type in initTypes to ensure initial state');\n\t }\n\n\t return function (state, action) {\n\t debugStart(action, state);\n\t var res = undefined;\n\t switch (action.type) {\n\t case config.undoType:\n\t res = undo(state);\n\t debug('after undo', res);\n\t debugEnd();\n\t return res ? updateState(state, res) : state;\n\n\t case config.redoType:\n\t res = redo(state);\n\t debug('after redo', res);\n\t debugEnd();\n\t return res ? updateState(state, res) : state;\n\n\t case config.jumpToPastType:\n\t res = jumpToPast(state, action.index);\n\t debug('after jumpToPast', res);\n\t debugEnd();\n\t return res ? updateState(state, res) : state;\n\n\t case config.jumpToFutureType:\n\t res = jumpToFuture(state, action.index);\n\t debug('after jumpToFuture', res);\n\t debugEnd();\n\t return res ? updateState(state, res) : state;\n\n\t default:\n\t res = reducer(state && state.present, action);\n\n\t if (config.initTypes.some(function (actionType) {\n\t return actionType === action.type;\n\t })) {\n\t debug('reset history due to init action');\n\t debugEnd();\n\t return wrapState(_extends({}, state, createHistory(res)));\n\t }\n\n\t if (config.filter && typeof config.filter === 'function') {\n\t if (!config.filter(action, res, state && state.present)) {\n\t debug('filter prevented action, not storing it');\n\t debugEnd();\n\t return wrapState(_extends({}, state, {\n\t present: res\n\t }));\n\t }\n\t }\n\n\t var history = state && state.present !== undefined ? state : config.history;\n\t var updatedHistory = insert(history, res, config.limit);\n\t debug('after insert', { history: updatedHistory, free: config.limit - length(updatedHistory) });\n\t debugEnd();\n\n\t return wrapState(_extends({}, state, updatedHistory));\n\t }\n\t };\n\t}", "function reducer(action) {\n console.log(action);\n switch (action) {\n case 'reset':\n setContacts([]);\n break;\n case 'supp':\n contacts.shift();\n setContacts(contacts);\n break;\n case 'random':\n random();\n break;\n case 'reload':\n reaload();\n break;\n }\n }", "renderAdminRecords()\n \t{\n \t\tif(this.state.displayAdminSearch)\n \t\t{\t//if admin searches user \n \t\t\tif(this.state.DocType == \"user\" )\n\t \t\t{\n\t \t\t\treturn this.state.adminReviews.map((review, index) => {\n\t \n\t\t return (\n\t\t <div className = \"ReviewDiv\">\n\n\t\t \t\t\t\t<h1>{review.username}</h1>\n\t\t \t\t\t\t<h3>Admin user : {String(review.admin)}</h3>\n\n\t\t \t\t\t\t\n\t\t \t\t\t\t<hr/>\n\t\t \t\t\t\t\n\t\t \t\t\t\t<div className = \"MyActions\">\n\t\t\t \t<button id = {review._id} onClick = {this.GoToEditUser.bind(this)} >edit</button>\n\t\t\t \t<button id = {review._id} onClick = {this.deleteReview.bind(this)} >delete</button>\n\t\t\t </div>\n\n\t\t \t\t\t</div>\n\t\t )\n\t\t })\n\t \t\t}\n\t \t\telse \n\t \t\t{//if admin searches records\n\t \t\t\treturn this.state.adminReviews.map((review, index) => {\n\t \n\t\t return (\n\t\t <div className = \"ReviewDiv\">\n\n\t\t \t\t\t\t<h1>{review.title}</h1>\n\t\t \t\t\t\t<h3>{review.category}</h3>\n\t\t \t\t\t\t<h3>{review.genre}</h3>\n\t\t \t\t\t\t<p>\n\t\t \t\t\t\t {review.review}\n\t\t \t\t\t\t</p>\n\t\t \t\t\t\t\t\n\t\t \t\t\t\t\tUser : {review.username}\n\t\t \t\t\t\t\t<br/>\n\t\t \t\t\t\t\tMy rating : {review.rating} /10\n\t\t \t\t\t\t\n\t\t \t\t\t\t<hr/>\n\t\t \t\t\t\t\n\t\t \t\t\t\t<div className = \"MyActions\">\n\t\t\t \t<button id = {review._id} onClick = {this.GoToEditReview.bind(this)} >edit</button>\n\t\t\t \t<button id = {review._id} onClick = {this.deleteReview.bind(this)} >delete</button>\n\t\t\t </div>\n\n\t\t \t\t\t</div>\n\t\t )\n\t\t })\n\t \t\t}\n \t\t} \n }", "function App() {\n _s();\n\n const initialState = {\n loggedIn: Boolean(localStorage.getItem(\"DevAppToken\")),\n flashMessage: [],\n user: {\n username: localStorage.getItem(\"DevAppUser\"),\n token: localStorage.getItem(\"DevAppToken\"),\n avatar: localStorage.getItem(\"DevAppAvatar\"),\n id: localStorage.getItem(\"DevAppId\")\n },\n task: null,\n tasks: [],\n completed: [],\n categories: []\n };\n\n function ourReducer(draft, action) {\n switch (action.type) {\n case \"id\":\n draft.id = action.data;\n return;\n\n case \"login\":\n draft.loggedIn = true;\n draft.user = action.data;\n return;\n\n case \"flashMessage\":\n draft.flashMessage.push(action.value);\n return;\n\n case \"logout\":\n draft.loggedIn = false;\n return;\n\n case \"task\":\n draft.task = action.data;\n return;\n\n case \"tasks\":\n draft.tasks = action.data;\n return;\n\n case \"deleteTask\":\n draft.tasks = draft.tasks.filter(task => task._id !== action.data);\n return;\n\n case \"completed\":\n draft.completed = action.data;\n return;\n\n case \"deleteCompleted\":\n draft.completed = draft.completed.filter(task => task._id !== action.data);\n return;\n\n case \"complete\":\n draft.task.completed = true;\n return;\n\n case \"addCategory\":\n draft.categories = draft.categories.concat(action.data);\n return;\n }\n }\n\n const [state, dispatch] = Object(use_immer__WEBPACK_IMPORTED_MODULE_2__[\"useImmerReducer\"])(ourReducer, initialState);\n Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useEffect\"])(() => {\n if (state.loggedIn) {\n localStorage.setItem(\"DevAppUser\", state.user.username);\n localStorage.setItem(\"DevAppToken\", state.user.token);\n localStorage.setItem(\"DevAppAvatar\", state.user.avatar);\n localStorage.setItem(\"DevAppId\", state.user.id);\n } else {\n localStorage.removeItem(\"DevAppAvatar\");\n localStorage.removeItem(\"DevAppToken\");\n localStorage.removeItem(\"DevAppUser\");\n localStorage.removeItem(\"DevAppId\");\n }\n }, [state.loggedIn]);\n return /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_19__[\"jsxDEV\"])(_StateContext__WEBPACK_IMPORTED_MODULE_7__[\"default\"].Provider, {\n value: state,\n children: /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_19__[\"jsxDEV\"])(_DispatchContext__WEBPACK_IMPORTED_MODULE_8__[\"default\"].Provider, {\n value: dispatch,\n children: /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_19__[\"jsxDEV\"])(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"BrowserRouter\"], {\n children: /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_19__[\"jsxDEV\"])(react__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"], {\n children: [/*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_19__[\"jsxDEV\"])(_components_FlashMessages__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 102,\n columnNumber: 13\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_19__[\"jsxDEV\"])(_components_Navbar__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 103,\n columnNumber: 13\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_19__[\"jsxDEV\"])(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Route\"], {\n exact: true,\n path: \"/\",\n component: _components_Blogen__WEBPACK_IMPORTED_MODULE_18__[\"default\"]\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 104,\n columnNumber: 13\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_19__[\"jsxDEV\"])(\"section\", {\n className: \"container\",\n children: /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_19__[\"jsxDEV\"])(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Switch\"], {\n children: [/*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_19__[\"jsxDEV\"])(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Route\"], {\n exact: true,\n path: \"/dashboard\",\n component: _components_Dashboard__WEBPACK_IMPORTED_MODULE_9__[\"default\"]\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 108,\n columnNumber: 17\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_19__[\"jsxDEV\"])(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Route\"], {\n exact: true,\n path: \"/register\",\n component: _components_Register__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 109,\n columnNumber: 17\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_19__[\"jsxDEV\"])(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Route\"], {\n exact: true,\n path: \"/login\",\n component: _components_Login__WEBPACK_IMPORTED_MODULE_5__[\"default\"]\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 110,\n columnNumber: 17\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_19__[\"jsxDEV\"])(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Route\"], {\n exact: true,\n path: \"/add-task\",\n component: _components_Task__WEBPACK_IMPORTED_MODULE_10__[\"default\"]\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 111,\n columnNumber: 17\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_19__[\"jsxDEV\"])(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Route\"], {\n exact: true,\n path: \"/tasks\",\n component: _components_Tasks__WEBPACK_IMPORTED_MODULE_11__[\"default\"]\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 112,\n columnNumber: 17\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_19__[\"jsxDEV\"])(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Route\"], {\n exact: true,\n path: \"/categories\",\n component: _components_Categories__WEBPACK_IMPORTED_MODULE_12__[\"default\"]\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 113,\n columnNumber: 17\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_19__[\"jsxDEV\"])(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Route\"], {\n exact: true,\n path: \"/categories/:category\",\n component: _components_CategoryItem__WEBPACK_IMPORTED_MODULE_13__[\"default\"]\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 114,\n columnNumber: 17\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_19__[\"jsxDEV\"])(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Route\"], {\n exact: true,\n path: \"/tasks/:id/edit\",\n component: _components_EditTask__WEBPACK_IMPORTED_MODULE_14__[\"default\"]\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 115,\n columnNumber: 17\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_19__[\"jsxDEV\"])(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Route\"], {\n exact: true,\n path: \"/completed\",\n component: _components_CompletedTasks__WEBPACK_IMPORTED_MODULE_15__[\"default\"]\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 116,\n columnNumber: 17\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_19__[\"jsxDEV\"])(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Route\"], {\n exact: true,\n path: \"/profile\",\n component: _components_Profile__WEBPACK_IMPORTED_MODULE_16__[\"default\"]\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 117,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 107,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 106,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 101,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 100,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 99,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 98,\n columnNumber: 5\n }, this);\n}", "function reducer(state, action) {\n\n\tstate = state || initialState;\n\tconsole.log('Notebook reducer state: ' + JSON.stringify(state).replace(/<\\//g, \"<\\\\/\"));\n\taction = action || {};\n\tconsole.log('Actions called' + action.type);\n\tswitch (action.type) {\n\n\t\tcase INSERT:\n\t\t\t{\n\t\t\t\tvar unsortedNotebooks = _.concat(state.notebooks, action.notes);\n\n\t\t\t\tvar visibleNotebooks = _.orderBy(unsortedNotebooks, 'createdAt', 'desc');\n\n\t\t\t\t// Return updated state\n\t\t\t\treturn _.assign({}, state, { visibleNotebooks: visibleNotebooks });\n\t\t\t}\n\n\t\tcase LOAD:\n\t\t\t{\n\t\t\t\tconsole.log('Load called with notebooks: ' + action.nbdata);\n\t\t\t\treturn _.assign({}, state, { notebooks: action.nbdata });\n\t\t\t}\n\n\t\tcase CHANGE:\n\t\t\t{\n\t\t\t\tvar _visibleNotebooks = _.clone(state.notebooks);\n\t\t\t\tvar changedIndex = _.findIndex(state.visibleNotebooks, { id: action.notebook.id });\n\t\t\t\tvisibleNotes[changedIndex] = action.notebook;\n\t\t\t\treturn _.assign({}, state, { visibleNotes: visibleNotes });\n\t\t\t}\n\n\t\t// Removes a single notes from the visible notes list\n\t\tcase REMOVE:\n\t\t\t{\n\t\t\t\tvar _visibleNotebooks2 = _.reject(state.notebooks, { id: action.id });\n\t\t\t\treturn _.assign({}, state, { visibleNotebooks: _visibleNotebooks2 });\n\t\t\t}\n\n\t\tcase UPDATE:\n\t\t\t{\n\n\t\t\t\treturn _.assign({}, state, { activeNotebookId: action.data });\n\t\t\t}\n\n\t\tdefault:\n\t\t\treturn state;\n\t}\n}", "reduce(state, payload) {\n let {action, data} = payload;\n\n switch(action) {\n case 'moveTo':\n state = state.withMutations(s => {\n s = s.set('isMoving', true);\n s = s.set('movingTo', [data[0], data[1]]);\n });\n break;\n case 'stopMoving':\n state = state.withMutations(s => {\n let movingTo = s.get('movingTo');\n s = s.set('x', movingTo[0]);\n s = s.set('z', movingTo[1]);\n s = s.set('isMoving', false);\n s = s.set('movingTo', null);\n });\n break;\n case 'turnTo':\n state = state.withMutations(s => {\n s = s.set('isTurning', true);\n s = s.set('turningTo', data);\n });\n break;\n case 'stopTurning':\n state = state.withMutations(s => {\n s = s.set('isTurning', false);\n s = s.set('dir', s.get('turningTo'));\n });\n break;\n case 'turn':\n state = state.updateIn(['dir'], dir => {\n dir = (dir + data)%4;\n if(dir < 0) {\n dir = 4 + dir;\n }\n return dir;\n })\n break;\n case 'inventory':\n state = state.updateIn(['inventory'], inventory => inventory.push(1));\n break;\n }\n\n return state;\n }", "async function updateActions() {\n // Let's go ahead and fade out our content and display our loader\n // while the new data is being loaded.\n hidePanel(panel.elements.content, panel.elements.loader, async function() {\n // Update our panel data to reflect the newest instance.\n panel.data = await grabData($(this).closest(\"tr\").data(\"pk\"));\n // Once the panel data is updated, we can re-run our actions\n // setup function to change the enabled/disabled actions.\n setupActionsOptions();\n\n // Display the panel now that new data is setup and available.\n // Actions have now been setup based on instance selected.\n showPanel(panel.elements.content, panel.elements.loader);\n });\n }", "function deleteTransactions(id){ // id received as a parameter when the user deletes the transaction\n dispatch({\n type: 'DELETE_TRANSACTIONS', //action type to pass on AppReducer.js\n payload: id // passing data (payload) i.e id to AppReducer.js\n })\n}", "refreshGlobalTimerWhenAction(){\n var newStore = store.getState();\n newStore.state.refreshTime = this.props.globalTimerInterval;\n store.dispatch({\n type: 'UPDATE_OBJECT',\n payload: {\n refreshTime: newStore.state.refreshTime\n }\n })\n }", "refreshGlobalTimerWhenAction(){\n var newStore = store.getState();\n newStore.state.refreshTime = this.props.globalTimerInterval;\n store.dispatch({\n type: 'UPDATE_OBJECT',\n payload: {\n refreshTime: newStore.state.refreshTime\n }\n })\n }", "function reducer(state = null, action) {\n\n switch(action.type) {\n case SET_DETAIL_SELECTED:\n return action.data;\n case UNSET_DETAIL_SELECTED:\n return null;\n default :\n return state;\n }\n\n}", "_dispatchSearchResults(value) {\r\n let action = {\r\n type: PeopleSearch_State_Action_1.peopleSearchActionTypes.SEARCH,\r\n payload: {\r\n data: !!value.data.results ? value.data.results : []\r\n }\r\n };\r\n this._storeAccess.dispatchAction(action);\r\n }", "function mapDispatchToProps(dispatch) {\n return bindActionCreators({ latestdata }, dispatch)\n}", "function App() {\n\n const [{ selectedId, chatsListData, chatsDetails }, dispatch] = useReducer(reducer, {\n selectedId: 0,\n chatsListData: CHATS_LIST_DATA,\n chatsDetails: CHATS_DETAILS\n })\n\n return (\n <DispatchContext.Provider value={dispatch}>\n <Container fluid className='vh-100 d-inline-block'>\n <Jumbotron className='h-100'>\n <Row className=' h-100'>\n <Col className='h-100 d-inline-block' md={4}>\n <div className='my-3'>\n <SearchBox />\n </div>\n <div className='my-3'>\n <ChatsList data={chatsListData} />\n </div>\n \n </Col>\n <Col className='align-bottom' md={8}>\n <Chat id={selectedId} chatsDetails={chatsDetails} />\n </Col>\n </Row>\n </Jumbotron>\n </Container>\n {/* <div>\n <ChatsList data={CHATS_LIST_DATA} />\n <Chat id={selectedId} />\n </div> */}\n </DispatchContext.Provider>\n );\n}", "reducer(state, action) {\n const nextState = toggleReducer(state, action);\n if (count > 5 && action.type === toggleActionTypes.toggle) {\n return state;\n }\n setCount((c) => c + 1);\n return nextState;\n }", "function reducer(){\n\n}", "function liftReducer(reducer, initialState) {\n\t var initialLiftedState = {\n\t committedState: initialState,\n\t stagedActions: [INIT_ACTION],\n\t skippedActions: {},\n\t currentStateIndex: 0,\n\t monitorState: {\n\t isVisible: true\n\t },\n\t timestamps: [Date.now()]\n\t };\n\t\n\t /**\n\t * Manages how the DevTools actions modify the DevTools state.\n\t */\n\t return function liftedReducer(liftedState, liftedAction) {\n\t if (liftedState === undefined) liftedState = initialLiftedState;\n\t var committedState = liftedState.committedState;\n\t var stagedActions = liftedState.stagedActions;\n\t var skippedActions = liftedState.skippedActions;\n\t var computedStates = liftedState.computedStates;\n\t var currentStateIndex = liftedState.currentStateIndex;\n\t var monitorState = liftedState.monitorState;\n\t var timestamps = liftedState.timestamps;\n\t\n\t switch (liftedAction.type) {\n\t case ActionTypes.RESET:\n\t committedState = initialState;\n\t stagedActions = [INIT_ACTION];\n\t skippedActions = {};\n\t currentStateIndex = 0;\n\t timestamps = [liftedAction.timestamp];\n\t break;\n\t case ActionTypes.COMMIT:\n\t committedState = computedStates[currentStateIndex].state;\n\t stagedActions = [INIT_ACTION];\n\t skippedActions = {};\n\t currentStateIndex = 0;\n\t timestamps = [liftedAction.timestamp];\n\t break;\n\t case ActionTypes.ROLLBACK:\n\t stagedActions = [INIT_ACTION];\n\t skippedActions = {};\n\t currentStateIndex = 0;\n\t timestamps = [liftedAction.timestamp];\n\t break;\n\t case ActionTypes.TOGGLE_ACTION:\n\t skippedActions = toggle(skippedActions, liftedAction.index);\n\t break;\n\t case ActionTypes.JUMP_TO_STATE:\n\t currentStateIndex = liftedAction.index;\n\t break;\n\t case ActionTypes.SWEEP:\n\t stagedActions = stagedActions.filter(function (_, i) {\n\t return !skippedActions[i];\n\t });\n\t timestamps = timestamps.filter(function (_, i) {\n\t return !skippedActions[i];\n\t });\n\t skippedActions = {};\n\t currentStateIndex = Math.min(currentStateIndex, stagedActions.length - 1);\n\t break;\n\t case ActionTypes.PERFORM_ACTION:\n\t if (currentStateIndex === stagedActions.length - 1) {\n\t currentStateIndex++;\n\t }\n\t stagedActions = [].concat(stagedActions, [liftedAction.action]);\n\t timestamps = [].concat(timestamps, [liftedAction.timestamp]);\n\t break;\n\t case ActionTypes.SET_MONITOR_STATE:\n\t monitorState = liftedAction.monitorState;\n\t break;\n\t case ActionTypes.RECOMPUTE_STATES:\n\t stagedActions = liftedAction.stagedActions;\n\t timestamps = liftedAction.timestamps;\n\t committedState = liftedAction.committedState;\n\t currentStateIndex = stagedActions.length - 1;\n\t skippedActions = {};\n\t break;\n\t default:\n\t break;\n\t }\n\t\n\t computedStates = recomputeStates(reducer, committedState, stagedActions, skippedActions);\n\t\n\t return {\n\t committedState: committedState,\n\t stagedActions: stagedActions,\n\t skippedActions: skippedActions,\n\t computedStates: computedStates,\n\t currentStateIndex: currentStateIndex,\n\t monitorState: monitorState,\n\t timestamps: timestamps\n\t };\n\t };\n\t}", "syncDataLoading() {\n this.props.actions.getConfig();\n this.props.actions.getColorSwatch();\n this.props.actions.getPaymentOnline();\n this.props.actions.getShippingOnline();\n this.props.actions.getCategory();\n this.props.actions.getListOrderStatuses();\n // this.props.actions.getTaxRate();\n // this.props.actions.getTaxRule();\n }", "async componentDidMount() {\n\n // receive updates on spreadsheet from other users\n this.socket.on('RECEIVE_MESSAGE', function(data){\n addMessage(data);\n });\n\n const addMessage = data => {\n // ignore if these actions come from this user itself\n if (data.socketID === socket_id) {\n return;\n }\n\n let change_table = data.data\n for (var x = 0; x < change_table.length; x++) {\n\n // [table_name, change_type, update_value, update_attribute, search_attribute1, search_attribute2, y_coord, x_coord] for cell changes\n // [table_name, change_type, operation, direction, search_attribute, socket_id] for remove row\n // [table_name, change_type, operation, value, search_attribute, socket_id] for insert row\n if (change_table[x][1] === \"layout_change\") {\n if (change_table[x][5] === socket_id) {\n continue;\n } else {\n process_layout_changes(change_table[x]);\n continue;\n }\n }\n\n // Extract data\n let table = change_table[x][0]; // table corresponds to this change \n let value = change_table[x][2] // 1 --> actual value\n\n // reflect each update to its corresponding table\n try { // [table_name, change_type, update_value, update_attribute, search_attribute1, search_attribute2, y_coord, x_coord] for cell changes\n let x_coord = change_table[x][7];\n\n if (table === \"monthly_expense\") {\n for (var i = 0; i < monthly_expense_display.length; i++) {\n if ((monthly_expense_display[i][0] === change_table[x][4] && change_table[x][4] !== \"\") || (monthly_expense_display[i][1] === change_table[x][5] && change_table[x][5] !== \"\")) {\n monthly_expense_display[i][x_coord] = value;\n }\n }\n \n } else if (table === \"check_book\") {\n for (var i = 0; i < check_book_display.length; i++) {\n if ((check_book_display[i][0] === change_table[x][4] && change_table[x][4] !== \"\") || (check_book_display[i][1] === change_table[x][5] && change_table[x][5] !== \"\")) {\n check_book_display[i][x_coord] = value;\n }\n }\n \n } else if (table === \"check_book2\") {\n for (var i = 0; i < check_book2_display.length; i++) {\n if ((check_book2_display[i][0] === change_table[x][4] && change_table[x][4] !== \"\") || (check_book2_display[i][1] === change_table[x][5] && change_table[x][5] !== \"\")) {\n check_book2_display[i][x_coord] = value;\n }\n }\n \n } else if (table === \"check_book3\") {\n for (var i = 0; i < check_book3_display.length; i++) {\n if ((check_book3_display[i][0] === change_table[x][4] && change_table[x][4] !== \"\") || (check_book3_display[i][1] === change_table[x][5] && change_table[x][5] !== \"\")) {\n check_book3_display[i][x_coord] = value;\n }\n }\n \n } else if (table === \"allowance\") {\n for (var i = 0; i < allowance_display.length; i++) {\n if ((allowance_display[i][0] === change_table[x][4] && change_table[x][4] !== \"\") || (allowance_display[i][1] === change_table[x][5] && change_table[x][5] !== \"\")) {\n allowance_display[i][x_coord] = value;\n }\n }\n \n }\n } catch (error) {\n console.log(error);\n }\n }\n };\n\n const process_layout_changes = curr_changes => {\n console.log(\"the new layout change is: \", curr_changes);\n // [table_name, change_type, operation, direction, search_attribute, socket_id] for remove row\n // [table_name, change_type, operation, value, search_attribute, socket_id, y_coord] for insert row\n\n // get the current table for current change to process\n let table_instance = \"\";\n let table = \"\";\n let headers = \"\";\n if (curr_changes[0] === \"monthly_expense\") {\n table_instance = this.hotTableComponent.current.hotInstance;\n table = monthly_expense_display;\n headers = monthly_expense_col_headers;\n } else if (curr_changes[0] === \"check_book\") {\n table_instance = this.hotTableComponent1.current.hotInstance;\n table = check_book_display;\n headers = check_book_col_headers;\n } else if (curr_changes[0] === \"check_book2\") {\n table_instance = this.hotTableComponent2.current.hotInstance;\n table = check_book2_display;\n headers = check_book2_col_headers;\n } else if (curr_changes[0] === \"check_book3\") {\n table_instance = this.hotTableComponent3.current.hotInstance;\n table = check_book3_display;\n headers = check_book3_col_headers;\n } else if (curr_changes[0] === \"allowance\") {\n table_instance = this.hotTableComponent4.current.hotInstance;\n table = allowance_display;\n headers = allowance_col_headers;\n }\n\n if (curr_changes[2] === \"remove_r\") {\n // search for the row to delete\n for (var index = 0; index < table.length; index++) {\n if (table[index][0] === curr_changes[4]) {\n pending_changes.incoming = true;\n layout_changes.incoming = true;\n table_instance.alter('remove_row', index, 1);\n break;\n }\n }\n\n } else if (curr_changes[2] === \"insert_r\") {\n\n // find the column for writing in the first value\n for (var j = 0; j < headers.length; j++) {\n if (headers[j] === curr_changes[4]) {\n table[curr_changes[6]][j] = curr_changes[3];\n }\n }\n }\n }\n\n transaction_button = <Button size='lg' className='display-button' color=\"primary\" onClick={this.start_transaction} >Start Transaction</Button>\n\n // FIRST COMPONENT REF ========================================================================================\n this.hotTableComponent.current.hotInstance.addHook('afterChange', function(chn, src) {\n if (src === 'edit') {\n console.log(chn);\n\n try {\n // call check_cell_change if original and new data differ\n if (chn[0][2] !== chn[0][3] && (chn[0][3] === null || (chn[0][3].charAt(0) !== \"*\" && chn[0][3] !== \"-----\") )) {\n console.log(\"differ!\");\n chn_copy = chn;\n if (chn_copy[0][3] === null) {\n chn_copy[0][3] = \"\";\n }\n change_detected = true;\n\n // remove currently editing state\n current_i = -1;\n current_j = -1;\n currently_editing = false;\n }\n }\n catch (err) {\n console.log(err);\n }\n }\n });\n\n this.hotTableComponent.current.hotInstance.addHook('afterBeginEditing', function(row, col) {\n\n // record the currently editing location and state. \n current_i = row;\n current_j = col;\n });\n\n this.hotTableComponent.current.hotInstance.addHook('afterSelection', function(row, column, row2, column2, preventScrolling, selectionLayerLevel) {\n\n // record the currently editing location and state. \n select_i = row;\n select_j = column;\n currently_editing = true;\n });\n\n this.hotTableComponent.current.hotInstance.addHook('beforeCreateRow', function(data, coords) {\n return false;\n });\n\n this.hotTableComponent.current.hotInstance.addHook('afterCreateRow', function(index, amount, source) {\n if (layout_changes.incoming === true) {\n layout_changes.incoming = false\n } else {\n if (source === \"ContextMenu.rowBelow\") {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"insert_r\", \"below\", index, \"monthly_expense\"]);\n } else {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"insert_r\", \"above\", index, \"monthly_expense\"]);\n }\n }\n });\n\n this.hotTableComponent.current.hotInstance.addHook('beforeCreateCol', function(data, coords) {\n return false;\n });\n\n this.hotTableComponent.current.hotInstance.addHook('afterCreateCol', function(index, amount, source) {\n if (layout_changes.incoming === true) {\n layout_changes.incoming = false;\n } else {\n if (source === \"ContextMenu.columnRight\") {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"insert_c\", \"right\", index, \"monthly_expense\"]);\n } else {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"insert_c\", \"left\", index, \"monthly_expense\"]);\n }\n }\n });\n\n this.hotTableComponent.current.hotInstance.addHook('beforeRemoveRow', function(index, amount) {\n // prevent remove row if not in a transaction\n if (!in_transaction) {\n return false;\n }\n\n // [table_name, change_type, operation, direction, search_attribute]\n if (pending_changes.incoming === true) {\n pending_changes.incoming = false;\n } else {\n let temp = []\n temp[0] = \"monthly_expense\";\n temp[1] = \"layout_change\";\n temp[2] = \"remove_r\";\n temp[3] = null;\n temp[4] = monthly_expense_display[index][0];\n temp[5] = socket_id;\n pending_changes.data.push(temp);\n }\n });\n\n this.hotTableComponent.current.hotInstance.addHook('afterRemoveRow', function(index, amount, physicalRows, source) {\n console.log(\"after remove row index: \", index);\n if (layout_changes.incoming === true) {\n layout_changes.incoming = false;\n } else {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"remove_r\", null, index, \"monthly_expense\"]);\n }\n });\n\n this.hotTableComponent.current.hotInstance.addHook('beforeRemoveCol', function(index, amount) {\n return false;\n });\n\n this.hotTableComponent.current.hotInstance.addHook('afterRemoveCol', function(index, amount, physicalRows, source) {\n if (layout_changes.incoming === true) {\n layout_changes.incoming = false;\n } else {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"remove_c\", null, index, \"monthly_expense\"]);\n }\n });\n\n // SECOND COMPONENT REF ========================================================================================\n this.hotTableComponent1.current.hotInstance.addHook('afterChange', function(chn, src) {\n if (src === 'edit') {\n console.log(chn);\n \n try {\n // call check_cell_change if original and new data differ\n if (chn[0][2] !== chn[0][3] && (chn[0][3] === null || (chn[0][3].charAt(0) !== \"*\" && chn[0][3] !== \"-----\") )) {\n console.log(\"differ!\");\n chn_copy = chn;\n if (chn_copy[0][3] === null) {\n chn_copy[0][3] = \"\";\n }\n change_detected = true;\n\n // remove currently editing state\n current_i = -1;\n current_j = -1;\n currently_editing = false;\n }\n }\n catch (err) {\n console.log(err)\n }\n }\n });\n\n this.hotTableComponent1.current.hotInstance.addHook('afterBeginEditing', function(row, col) {\n\n // record the currently editing location and state. \n current_i = row;\n current_j = col;\n });\n\n this.hotTableComponent1.current.hotInstance.addHook('afterSelection', function(row, column, row2, column2, preventScrolling, selectionLayerLevel) {\n\n // record the currently editing location and state. \n select_i = row;\n select_j = column;\n currently_editing = true;\n });\n\n this.hotTableComponent1.current.hotInstance.addHook('beforeCreateRow', function(data, coords) {\n return false;\n });\n\n this.hotTableComponent1.current.hotInstance.addHook('afterCreateRow', function(index, amount, source) {\n if (layout_changes.incoming === true) {\n layout_changes.incoming = false;\n } else {\n if (source === \"ContextMenu.rowBelow\") {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"insert_r\", \"below\", index, \"check_book\"]);\n } else {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"insert_r\", \"above\", index, \"check_book\"]);\n }\n }\n });\n\n this.hotTableComponent1.current.hotInstance.addHook('beforeCreateCol', function(data, coords) {\n return false;\n });\n\n this.hotTableComponent1.current.hotInstance.addHook('afterCreateCol', function(index, amount, source) {\n if (layout_changes.incoming === true) {\n layout_changes.incoming = false;\n } else {\n if (source === \"ContextMenu.columnRight\") {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"insert_c\", \"right\", index, \"check_book\"]);\n } else {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"insert_c\", \"left\", index, \"check_book\"]);\n }\n }\n });\n\n this.hotTableComponent1.current.hotInstance.addHook('beforeRemoveRow', function(index, amount) {\n // prevent remove row if not in a transaction\n if (!in_transaction) {\n return false;\n }\n\n // [table_name, change_type, operation, direction, search_attribute]\n if (pending_changes.incoming === true) {\n pending_changes.incoming = false;\n } else {\n let temp = []\n temp[0] = \"check_book\";\n temp[1] = \"layout_change\";\n temp[2] = \"remove_r\";\n temp[3] = null;\n temp[4] = check_book_display[index][0];\n temp[5] = socket_id;\n pending_changes.data.push(temp);\n }\n });\n\n this.hotTableComponent1.current.hotInstance.addHook('afterRemoveRow', function(index, amount, physicalRows, source) {\n if (layout_changes.incoming === true) {\n layout_changes.incoming = false;\n } else {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"remove_r\", null, index, \"check_book\"]);\n }\n });\n\n this.hotTableComponent1.current.hotInstance.addHook('beforeRemoveCol', function(index, amount) {\n return false;\n });\n\n this.hotTableComponent1.current.hotInstance.addHook('afterRemoveCol', function(index, amount, physicalRows, source) {\n if (layout_changes.incoming === true) {\n layout_changes.incoming = false;\n } else {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"remove_c\", null, index, \"check_book\"]);\n }\n });\n\n // THIRD COMPONENT REF ========================================================================================\n this.hotTableComponent2.current.hotInstance.addHook('afterChange', function(chn, src) {\n if (src === 'edit') {\n console.log(chn);\n\n try {\n // call check_cell_change if original and new data differ\n if (chn[0][2] !== chn[0][3] && (chn[0][3] === null || (chn[0][3].charAt(0) !== \"*\" && chn[0][3] !== \"-----\") )) {\n console.log(\"differ!\");\n chn_copy = chn;\n if (chn_copy[0][3] === null) {\n chn_copy[0][3] = \"\";\n }\n change_detected = true;\n\n // remove currently editing state\n current_i = -1;\n current_j = -1;\n currently_editing = false;\n }\n }\n catch (err) {\n console.log(err);\n }\n }\n });\n\n this.hotTableComponent2.current.hotInstance.addHook('afterBeginEditing', function(row, col) {\n\n // record the currently editing location and state. \n current_i = row;\n current_j = col;\n });\n\n this.hotTableComponent2.current.hotInstance.addHook('afterSelection', function(row, column, row2, column2, preventScrolling, selectionLayerLevel) {\n\n // record the currently editing location and state. \n select_i = row;\n select_j = column;\n currently_editing = true;\n });\n\n this.hotTableComponent2.current.hotInstance.addHook('beforeCreateRow', function(data, coords) {\n return false;\n });\n\n this.hotTableComponent2.current.hotInstance.addHook('afterCreateRow', function(index, amount, source) {\n if (layout_changes.incoming === true) {\n layout_changes.incoming = false;\n } else {\n if (source === \"ContextMenu.rowBelow\") {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"insert_r\", \"below\", index, \"check_book2\"]);\n } else {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"insert_r\", \"above\", index, \"check_book2\"]);\n }\n }\n });\n\n this.hotTableComponent2.current.hotInstance.addHook('beforeCreateCol', function(data, coords) {\n return false;\n });\n\n this.hotTableComponent2.current.hotInstance.addHook('afterCreateCol', function(index, amount, source) {\n if (layout_changes.incoming === true) {\n layout_changes.incoming = false;\n } else {\n if (source === \"ContextMenu.columnRight\") {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"insert_c\", \"right\", index, \"check_book2\"]);\n } else {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"insert_c\", \"left\", index, \"check_book2\"]);\n }\n }\n });\n\n this.hotTableComponent2.current.hotInstance.addHook('beforeRemoveRow', function(index, amount) {\n // prevent remove row if not in a transaction\n if (!in_transaction) {\n return false;\n }\n\n // [table_name, change_type, operation, direction, search_attribute]\n if (pending_changes.incoming === true) {\n pending_changes.incoming = false;\n } else {\n let temp = []\n temp[0] = \"check_book2\";\n temp[1] = \"layout_change\";\n temp[2] = \"remove_r\";\n temp[3] = null;\n temp[4] = check_book2_display[index][0];\n temp[5] = socket_id;\n pending_changes.data.push(temp);\n }\n });\n\n this.hotTableComponent2.current.hotInstance.addHook('afterRemoveRow', function(index, amount, physicalRows, source) {\n if (layout_changes.incoming === true) {\n layout_changes.incoming = false;\n } else {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"remove_r\", null, index, \"check_book2\"]);\n }\n });\n\n this.hotTableComponent2.current.hotInstance.addHook('beforeRemoveCol', function(index, amount) {\n return false;\n });\n\n this.hotTableComponent2.current.hotInstance.addHook('afterRemoveCol', function(index, amount, physicalRows, source) {\n if (layout_changes.incoming === true) {\n layout_changes.incoming = false;\n } else {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"remove_c\", null, index, \"check_book2\"]);\n }\n });\n\n // FOURTH COMPONENT REF ========================================================================================\n this.hotTableComponent3.current.hotInstance.addHook('afterChange', function(chn, src) {\n if (src === 'edit') {\n console.log(chn);\n \n try {\n // call check_cell_change if original and new data differ\n if (chn[0][2] !== chn[0][3] && (chn[0][3] === null || (chn[0][3].charAt(0) !== \"*\" && chn[0][3] !== \"-----\") )) {\n console.log(\"differ!\");\n chn_copy = chn;\n if (chn_copy[0][3] === null) {\n chn_copy[0][3] = \"\";\n }\n change_detected = true;\n\n // remove currently editing state\n current_i = -1;\n current_j = -1;\n currently_editing = false;\n }\n }\n catch (err) {\n console.log(err);\n }\n }\n });\n\n this.hotTableComponent3.current.hotInstance.addHook('afterBeginEditing', function(row, col) {\n\n // record the currently editing location and state. \n current_i = row;\n current_j = col;\n });\n\n this.hotTableComponent3.current.hotInstance.addHook('afterSelection', function(row, column, row2, column2, preventScrolling, selectionLayerLevel) {\n\n // record the currently editing location and state. \n select_i = row;\n select_j = column;\n currently_editing = true;\n });\n\n this.hotTableComponent3.current.hotInstance.addHook('beforeCreateRow', function(data, coords) {\n return false;\n });\n\n this.hotTableComponent3.current.hotInstance.addHook('afterCreateRow', function(index, amount, source) {\n if (layout_changes.incoming === true) {\n layout_changes.incoming = false;\n } else {\n if (source === \"ContextMenu.rowBelow\") {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"insert_r\", \"below\", index, \"check_book3\"]);\n } else {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"insert_r\", \"above\", index, \"check_book3\"]);\n }\n }\n });\n\n this.hotTableComponent3.current.hotInstance.addHook('beforeCreateCol', function(data, coords) {\n return false;\n });\n\n this.hotTableComponent3.current.hotInstance.addHook('afterCreateCol', function(index, amount, source) {\n if (layout_changes.incoming === true) {\n layout_changes.incoming = false;\n } else {\n if (source === \"ContextMenu.columnRight\") {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"insert_c\", \"right\", index, \"check_book3\"]);\n } else {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"insert_c\", \"left\", index, \"check_book3\"]);\n }\n }\n });\n\n this.hotTableComponent3.current.hotInstance.addHook('beforeRemoveRow', function(index, amount) {\n // prevent remove row if not in a transaction\n if (!in_transaction) {\n return false;\n }\n\n // [table_name, change_type, operation, direction, search_attribute]\n if (pending_changes.incoming === true) {\n pending_changes.incoming = false;\n } else {\n let temp = []\n temp[0] = \"check_book3\";\n temp[1] = \"layout_change\";\n temp[2] = \"remove_r\";\n temp[3] = null;\n temp[4] = check_book3_display[index][0];\n temp[5] = socket_id;\n pending_changes.data.push(temp);\n }\n });\n\n this.hotTableComponent3.current.hotInstance.addHook('afterRemoveRow', function(index, amount, physicalRows, source) {\n if (layout_changes.incoming === true) {\n layout_changes.incoming = false;\n } else {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"remove_r\", null, index, \"check_book3\"]);\n }\n });\n\n this.hotTableComponent3.current.hotInstance.addHook('beforeRemoveCol', function(index, amount) {\n return false;\n });\n\n this.hotTableComponent3.current.hotInstance.addHook('afterRemoveCol', function(index, amount, physicalRows, source) {\n if (layout_changes.incoming === true) {\n layout_changes.incoming = false;\n } else {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"remove_c\", null, index, \"check_book3\"]);\n }\n });\n\n // FIFTH COMPONENT REF ========================================================================================\n this.hotTableComponent4.current.hotInstance.addHook('afterChange', function(chn, src) {\n if (src === 'edit') {\n console.log(chn);\n \n try {\n // call check_cell_change if original and new data differ\n if (chn[0][2] !== chn[0][3] && (chn[0][3] === null || (chn[0][3].charAt(0) !== \"*\" && chn[0][3] !== \"-----\") )) {\n console.log(\"differ!\");\n chn_copy = chn;\n if (chn_copy[0][3] === null) {\n chn_copy[0][3] = \"\";\n }\n change_detected = true;\n\n // remove currently editing state\n current_i = -1;\n current_j = -1;\n currently_editing = false;\n }\n }\n catch (err) {\n console.log(err);\n }\n }\n });\n\n this.hotTableComponent4.current.hotInstance.addHook('afterBeginEditing', function(row, col) {\n\n // record the currently editing location and state. \n current_i = row;\n current_j = col;\n });\n\n this.hotTableComponent4.current.hotInstance.addHook('afterSelection', function(row, column, row2, column2, preventScrolling, selectionLayerLevel) {\n\n // record the currently editing location and state. \n select_i = row;\n select_j = column;\n currently_editing = true;\n });\n\n this.hotTableComponent4.current.hotInstance.addHook('beforeCreateRow', function(data, coords) {\n return false;\n });\n\n this.hotTableComponent4.current.hotInstance.addHook('afterCreateRow', function(index, amount, source) {\n if (layout_changes.incoming === true) {\n layout_changes.incoming = false;\n } else {\n if (source === \"ContextMenu.rowBelow\") {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"insert_r\", \"below\", index, \"allowance\"]);\n } else {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"insert_r\", \"above\", index, \"allowance\"]);\n }\n }\n });\n\n this.hotTableComponent4.current.hotInstance.addHook('beforeCreateCol', function(data, coords) {\n return false;\n });\n\n this.hotTableComponent4.current.hotInstance.addHook('afterCreateCol', function(index, amount, source) {\n if (layout_changes.incoming === true) {\n layout_changes.incoming = false;\n } else {\n if (source === \"ContextMenu.columnRight\") {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"insert_c\", \"right\", index, \"allowance\"]);\n } else {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"insert_c\", \"left\", index, \"allowance\"]);\n }\n }\n });\n\n this.hotTableComponent4.current.hotInstance.addHook('beforeRemoveRow', function(index, amount) {\n // prevent remove row if not in a transaction\n if (!in_transaction) {\n return false;\n }\n\n // [table_name, change_type, operation, direction, search_attribute]\n if (pending_changes.incoming === true) {\n pending_changes.incoming = false;\n } else {\n let temp = []\n temp[0] = \"allowance\";\n temp[1] = \"layout_change\";\n temp[2] = \"remove_r\";\n temp[3] = null;\n temp[4] = allowance_display[index][0];\n temp[5] = socket_id;\n pending_changes.data.push(temp);\n }\n });\n\n this.hotTableComponent4.current.hotInstance.addHook('afterRemoveRow', function(index, amount, physicalRows, source) {\n if (layout_changes.incoming === true) {\n layout_changes.incoming = false;\n } else {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"remove_r\", null, index, \"allowance\"]);\n }\n });\n\n this.hotTableComponent4.current.hotInstance.addHook('beforeRemoveCol', function(index, amount) {\n return false;\n });\n\n this.hotTableComponent4.current.hotInstance.addHook('afterRemoveCol', function(index, amount, physicalRows, source) {\n if (layout_changes.incoming === true) {\n layout_changes.incoming = false;\n } else {\n layout_changes.layout_changed = true;\n layout_changes.changes.push([\"remove_c\", null, index, \"allowance\"]);\n }\n });\n }", "function mapActionToProps(dispatch) { return bindActionCreators({ ConfirmProductInfoAction, }, dispatch); }", "function mapDispatchToProps(dispatch) {\n return bindActionCreators({\n set_user_details,\n receive_login_response,\n show_app_notification,\n delete_app_notification,\n update_dates_dict,\n update_working_dates_dict\n }, dispatch)\n}", "function mapDispatchToProps(dispatch) {\n return {\n updateSelectedApplicant: (event) => dispatch(updateSelectedApplicant(event))\n }\n}", "function mapDispatchToProps(dispatch) {\n return {\n saveOfferIndex: (offerIndex) => dispatch({type: 'saveOfferIndex',offerIndex:offerIndex})\n }\n}", "function ReducerCounter3() {\n const [count, dispatch] = useReducer(reducer, initialState);\n const [count2 , dispatchTwo ] = useReducer(reducer , initialState);\n\n return (\n <div>\n <div>\n <div>Count one - {count}</div>\n <button\n onClick={() => {\n dispatch(\"increment\");\n }}\n >\n +\n </button>\n <button\n onClick={() => {\n dispatch(\"decrement\");\n }}\n >\n -\n </button>\n <button\n onClick={() => {\n dispatch(\"reset\");\n }}\n >\n Reset\n </button>\n </div>\n <div>\n <div>Count two - {count2}</div>\n <button\n onClick={() => {\n dispatch(\"increment\");\n }}\n >\n +\n </button>\n <button\n onClick={() => {\n dispatchTwo(\"decrement\");\n }}\n >\n -\n </button>\n <button\n onClick={() => {\n dispatchTwo(\"reset\");\n }}\n >\n Reset\n </button>\n </div>\n </div>\n );\n}", "handleRowAction(event) {\n\n const row = event.detail.row;\n\n console.log(JSON.stringify(event.detail.action));\n if(event.detail.action.label==='Show') {\n console.log('clicked View button');\n this.record = row;\n this.openModal();\n }\n\n }", "function mapDispatchToProps(StoreDispatch){\n console.log('mapDispatchToProps ');\n return{//we are returning object literal { onIncrementClick: value, onDecrementtClick: otherValue };\n //':' assigns a function as a property of an object literal. \n onIncrementClick: () => {\n const action = { type: Actions.INCREMENT_REQUESTED};\n StoreDispatch(action);\n },\n onDecrementtClick: () => {\n const action = { type: Actions.DECREMENT_REQUESTED};\n StoreDispatch(action);\n }\n }\n}", "handle( action, id, rowIndex ) {\n if ( action.type == 'GET' ) {\n document.location = action.url;\n } else if ( action.type == 'DELETE' ) {\n axios.delete( action.url ).then( result => {\n this.result.data.splice( rowIndex, 1 );\n tendooApi.SnackBar.show( result.data.message );\n }).catch( error => {\n tendooApi.SnackBar.show( error.response.data.message );\n });\n }\n }" ]
[ "0.5890872", "0.586496", "0.5763221", "0.5671196", "0.56536806", "0.5645852", "0.56282604", "0.55577123", "0.5553955", "0.5542347", "0.5538781", "0.55339533", "0.54689723", "0.5417787", "0.5406585", "0.5401427", "0.5400274", "0.5392186", "0.5391098", "0.53639126", "0.5363891", "0.5350151", "0.5349888", "0.53486836", "0.5345846", "0.53432226", "0.53408146", "0.5327248", "0.532386", "0.53053427", "0.5290562", "0.52884674", "0.52798826", "0.52793896", "0.52651834", "0.52340317", "0.5232116", "0.522911", "0.5225744", "0.522048", "0.521395", "0.5201901", "0.52014154", "0.51952356", "0.51859957", "0.51846856", "0.51827943", "0.5173932", "0.51676995", "0.51586306", "0.5154755", "0.5152943", "0.51437706", "0.51375353", "0.5130341", "0.5128561", "0.5122248", "0.51149064", "0.5112067", "0.5108556", "0.5084083", "0.508163", "0.50774276", "0.5073396", "0.5068055", "0.50545794", "0.50545245", "0.5053113", "0.5050077", "0.50473434", "0.5042727", "0.50421745", "0.5041273", "0.5037607", "0.5035232", "0.50326467", "0.50264186", "0.50257975", "0.5021039", "0.50193715", "0.5018135", "0.5016002", "0.5016002", "0.50095737", "0.50083923", "0.500512", "0.4997103", "0.49912858", "0.4988313", "0.49847144", "0.4980309", "0.49801496", "0.49799526", "0.497376", "0.4970048", "0.49663332", "0.49622622", "0.4956826", "0.49566862", "0.49550423" ]
0.5664812
4
Coodinates and size use 'tuples' instead of objects. Comparing tuples is less computing than deep isEquals on objects The pattern is [0] is x, [1], is y
function DataProvider({ children, initialData }) { // Default table state const [state, dispatch] = React.useReducer( reducer, initialData || { mouseDown: false, coordinates: [0, 0], selection_coordinates: [0, 0], size: [4, 3], tableData: [ ['Kiril', 'wants', 'to work', '@BranchLabs'], [1, 2, 3, 100], ['', '=SUM(A2:D3)', '=SUM(A2, A2)'], ], }, ); return ( <DataStateContext.Provider value={state}> <DataDispatchContext.Provider value={dispatch}> {children} </DataDispatchContext.Provider> </DataStateContext.Provider> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "equals(x,y){\n let point = new Point(x,y); //this will handle the 'x' being numbers, array, a simple object, or another Point \n return (this.x === point.x && this.y === point.y); \n }", "isEqual(x, y) {\n return this.x === x && this.y === y;\n }", "equals(...args) \r\n {\r\n let a, b;\r\n if (args[0] instanceof Vector2D) \r\n {\r\n a = args[0].x || 0;\r\n b = args[0].y || 0;\r\n } \r\n else if (args[0] instanceof Array) \r\n {\r\n a = args[0][0] || 0;\r\n b = args[0][1] || 0;\r\n } \r\n else \r\n {\r\n a = args[0] || 0;\r\n b = args[1] || 0;\r\n }\r\n return this.x === a && this.y === b;\r\n }", "function objectsAreIdentical( objs ){\n\t\n\tvar identical = true; \n\tvar length0 = getObjectLength( objs[0] );\n\tvar length1 = getObjectLength( objs[1] );\n\tvar isObj0, isObj1;\n\t\n\tif ( length0 !== length1 ){\n\t\tidentical = false;\n\t}\n\t\n\telse if ( objs[0].isColor && objs[1].isColor ){\n\t\tif ( !objs[0].equals( objs[1] ) ) { identical = false; }\n\t}\n\t\n\telse if ( !objs[0].isColor && !objs[1].isColor ){\n\t\tfor ( var k in objs[0] ){\n\t\t\tif ( !objs[1].hasOwnProperty( k ) ){\n\t\t\t\tidentical = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor ( var k in objs[1] ){\n\t\t\tif ( !objs[0].hasOwnProperty( k ) ){\n\t\t\t\tidentical = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor ( var k in objs[0] ){\n\t\t\tif ( objs[0][k] !== objs[1][k] ){\n\t\t\t\tidentical = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tdebug.master && debug.generalUtils && console.log( 'objectsAreIdentical(): ', identical );\n\treturn identical;\n}", "function sameExactShape(a, b) {\n\treturn JSON.stringify(a) === JSON.stringify(b)\n}", "equals(other) {\n return this.x == other.x && this.y == other.y;\n }", "function iterableEquality(a, b) {\n if (\n typeof a !== 'object' ||\n typeof b !== 'object' ||\n Array.isArray(a) ||\n Array.isArray(b) ||\n a === null ||\n b === null\n ) {\n return undefined\n }\n if (a && b && a.constructor !== b.constructor) {\n // check if the object are natives and then shallow equal them\n return a.sketchObject && b.sketchObject && a.sketchObject == b.sketchObject\n }\n\n if (a.size !== undefined) {\n if (a.size !== b.size) {\n return false\n } else if (isA('Set', a)) {\n var allFound = true\n for (var aValue of a) {\n if (!b.has(aValue)) {\n allFound = false\n break\n }\n }\n if (allFound) {\n return true\n }\n } else if (isA('Map', a)) {\n var allFound = true\n for (var aEntry of a) {\n if (\n !b.has(aEntry[0]) ||\n !equals(aEntry[1], b.get(aEntry[0]), [iterableEquality])\n ) {\n allFound = false\n break\n }\n }\n if (allFound) {\n return true\n }\n }\n }\n\n if (Object.keys(a).length !== Object.keys(a).length) {\n return false\n }\n\n var aKeys = Object.keys(a).sort()\n var bKeys = Object.keys(b).sort()\n\n for (var i = 0; i < aKeys.length; i += 1) {\n var aKey = aKeys[i]\n var bKey = bKeys[i]\n if (aKey !== bKey || !equals(a[aKey], b[bKey], [iterableEquality])) {\n return false\n }\n }\n\n return true\n}", "function compareTwoVertices(a,b) {\r\n return a.id - b.id;\r\n}", "function sc_isEqual(o1, o2) {\n return ((o1 === o2) ||\n\t (sc_isPair(o1) && sc_isPair(o2)\n\t && sc_isPairEqual(o1, o2, sc_isEqual)) ||\n\t (sc_isVector(o1) && sc_isVector(o2)\n\t && sc_isVectorEqual(o1, o2, sc_isEqual)));\n}", "function sameShape(a, b) {\n return JSON.stringify(a) === JSON.stringify(b)\n}", "equals(vec){\n return this.x === vec.x && this.y === vec.y;\n }", "function pointEq(a, b) {\n return a.x === b.x && a.y === b.y;\n}", "function isEqual(obj1, obj2) {\n var shallow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n // https://github.com/mapbox/mapbox-gl-js/pull/5979/files#diff-fde7145050c47cc3a306856efd5f9c3016e86e859de9afbd02c879be5067e58f\n var refSet = new Set();\n function deepEqual(a, b) {\n var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var circular = refSet.has(a);\n (0,_warning__WEBPACK_IMPORTED_MODULE_0__/* [\"default\"] */ .ZP)(!circular, 'Warning: There may be circular references');\n if (circular) {\n return false;\n }\n if (a === b) {\n return true;\n }\n if (shallow && level > 1) {\n return false;\n }\n refSet.add(a);\n var newLevel = level + 1;\n if (Array.isArray(a)) {\n if (!Array.isArray(b) || a.length !== b.length) {\n return false;\n }\n for (var i = 0; i < a.length; i++) {\n if (!deepEqual(a[i], b[i], newLevel)) {\n return false;\n }\n }\n return true;\n }\n if (a && b && (0,_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_1__/* [\"default\"] */ .Z)(a) === 'object' && (0,_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_1__/* [\"default\"] */ .Z)(b) === 'object') {\n var keys = Object.keys(a);\n if (keys.length !== Object.keys(b).length) {\n return false;\n }\n return keys.every(function (key) {\n return deepEqual(a[key], b[key], newLevel);\n });\n }\n // other\n return false;\n }\n return deepEqual(obj1, obj2);\n}", "function deepEqual(x, y){\n //console.log('x '+x+'y '+y);\n//if x equals y in value and typeof then return true\n if(x===y){\n return true;\n//if x and y are both objects then\n }else if (typeof(x)===\"object\" && typeof(y)===\"object\"){\n // x = {here: \"an\", abhi: \"neely\"}\n // y = {here: \"an\", abhi: \"neely\"}\n//for loop through the properties and values of x and y (property names and values should be the same if they are equal)\n for(var key in x) {\n x_value = x[key];\n y_value = y[key];\n //console.log('xvalue '+x_value +'yvalue '+ y_value);\n////recursive function to see if the values inside the object are objects and equal and will return true and false\n return deepEqual(x_value, y_value);\n }\n } else {\n return false;\n }\n}", "isFood() {\n return arraysEqual(this.props.food, [this.props.X, this.props.Y]);\n }", "function compareTwoCoordPositions(object1coord1, object1coord2, object2coord1, object2coord2) {\n return (Grid.vectorEquals(object1coord1, object2coord1) && Grid.vectorEquals(object1coord2, object2coord2))\n || (Grid.vectorEquals(object1coord1, object2coord2) && Grid.vectorEquals(object1coord2, object2coord1));\n}", "hashable() {\n return [this.x, this.y].toString()\n }", "function deepEqual(object1, object2) {\n //for each element in the object, make a comparison\n //figure out how to traverse the object\n\n //if one of the objects is null then return false\n if(object1 === null || object2 === null) {\n return false;\n }\n //find out if they are pointing to the same place in memory\n if (object1 === object2 && object1 !== null) {\n return true;\n }\n\n //count the number of properties, if they are not the same then return false\n //figure out how to count the number of properties\n\n // if the types are the same and the values of the properties are the same then return true. Do I access the properties by naming them with 'here' and 'object' or does it need to be more generic than that?\n if (typeof object1 === typeof object2) {\n\n }\n\n\n}", "function compare_pair(object1,object2)\r\n {\r\n if(object1['age']==object2['age']){\r\n console.log(true);\r\n } \r\n else {\r\n console.log(false);\r\n } \r\n }", "function isEqual(obj1, obj2) {\n var shallow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n // https://github.com/mapbox/mapbox-gl-js/pull/5979/files#diff-fde7145050c47cc3a306856efd5f9c3016e86e859de9afbd02c879be5067e58f\n var refSet = new Set();\n function deepEqual(a, b) {\n var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var circular = refSet.has(a);\n (0,_warning__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(!circular, 'Warning: There may be circular references');\n if (circular) {\n return false;\n }\n if (a === b) {\n return true;\n }\n if (shallow && level > 1) {\n return false;\n }\n refSet.add(a);\n var newLevel = level + 1;\n if (Array.isArray(a)) {\n if (!Array.isArray(b) || a.length !== b.length) {\n return false;\n }\n for (var i = 0; i < a.length; i++) {\n if (!deepEqual(a[i], b[i], newLevel)) {\n return false;\n }\n }\n return true;\n }\n if (a && b && (0,_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(a) === 'object' && (0,_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(b) === 'object') {\n var keys = Object.keys(a);\n if (keys.length !== Object.keys(b).length) {\n return false;\n }\n return keys.every(function (key) {\n return deepEqual(a[key], b[key], newLevel);\n });\n }\n // other\n return false;\n }\n return deepEqual(obj1, obj2);\n}", "function assertEquals(obj1, obj2) {\n checkEquals(obj1, obj2, \"(top)\");\n\n function checkEquals(obj1, obj2, objName) {\n var t1 = typeFunctions.type(obj1);\n var t2 = typeFunctions.type(obj2);\n\n if (t1 != t2) {\n throw new Exception(\"at \" + objName + \" \" + t1 + \" .vs. \" + t2);\n }\n switch (t1) {\n case \"object\":\n for (var name in obj1) {\n if (hasValue(obj1[name]) && !hasValue(obj2[name])) {\n throw new Exception(name + \".\" + namet1 + \" .is missing\");\n }\n }\n for (var name in obj2) {\n if (hasValue(obj2[name]) && !hasValue(obj1[name])) {\n throw new Exception(name + \".\" + namet1 + \" .is missing\");\n }\n checkEquals(obj1[name], obj2[name], objName + \".\" + name);\n }\n break;\n\n case 'array':\n if (obj1.length != obj2.length) {\n throw new Exception(\"different array lengths at \" + objName);\n }\n obj1.forEach(function(row, index) {\n checkEquals(row, obj2[index], objName + \"[\" + index + \"]\");\n })\n break;\n\n default:\n if (obj1 != obj2) {\n throw new Exception(\"at \" + objName + \" \" + obj1 + \" .vs. \" + obj2);\n }\n break;\n }\n }\n}", "equals(other) {\n return (\n this.batchID === other.batchID &&\n this.vertexID === other.vertexID &&\n this.indexID === other.indexID\n )\n }", "function test2() {\n let pieces = [I,O,L,J,T,S,Z]\n for (const Shape of pieces) {\n let piece = new Shape();\n if (!piece.coords.equals(piece.getOrigCoords())) {\n return false\n }\n }\n return true\n}", "function pointEqual(a, b) {\n return a && b && a[0] === b[0] && a[1] === b[1];\n}", "function pointEqual(a, b) {\n return a && b && a[0] === b[0] && a[1] === b[1];\n}", "cofactorEqual(q) {\r\n const t1 = new CachedGroupElement();\r\n const t2 = new CompletedGroupElement();\r\n const t3 = new ProjectiveGroupElement();\r\n q.toCached(t1);\r\n t2.sub(this, t1); // t2 = (P - Q)\r\n t2.toProjective(t3); // t3 = (P - Q)\r\n t3.double(t2); // t2 = [2](P - Q)\r\n t2.toProjective(t3); // t3 = [2](P - Q)\r\n t3.double(t2); // t2 = [4](P - Q)\r\n t2.toProjective(t3); // t3 = [4](P - Q)\r\n t3.double(t2); // t2 = [8](P - Q)\r\n t2.toProjective(t3); // t3 = [8](P - Q)\r\n // Now we want to check whether the point t3 is the identity.\r\n // In projective coordinates this is (X:Y:Z) ~ (0:1:0)\r\n // ie. X/Z = 0, Y/Z = 1\r\n // <=> X = 0, Y = Z\r\n const zero = new Uint8Array(32);\r\n const xBytes = new Uint8Array(32);\r\n const yBytes = new Uint8Array(32);\r\n const zBytes = new Uint8Array(32);\r\n t3.X.toBytes(xBytes);\r\n t3.Y.toBytes(yBytes);\r\n t3.Z.toBytes(zBytes);\r\n return ArrayHelper.equal(zero, xBytes) && ArrayHelper.equal(yBytes, zBytes);\r\n }", "equals(other) {\n return (this.x == other.x && this.y == other.y)\n }", "equals(_point) {\n return this.x === _point.x && this.y === _point.y;\n }", "function isEqualObjects(x, y, depth)\n\t{\n\t\tvar rtnValue = false;\n\n\t\twhile (!rtnValue)\n\t\t{\n\t\t\tif (x === null || x === undefined || y === null || y === undefined)\n\t\t\t{\n\t\t\t\trtnValue = (x === y); \t\t\t\t//not both null or undefined\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (x.constructor !== y.constructor)\n\t\t\t\treturn false;\t\t\t\t\t\t//not both same constructor\n\n\t\t\tif (typeof(x) == 'number' && isNaN(x) && isNaN(y))\n\t\t\t\treturn true;\t\t\t\t\t\t//required because NaN === NaN is false\n\n\t\t\t// if they are functions, they should exactly refer to same one (because of closures)\n\t\t\t// NO: same name and script except comments (if comment stripper available)\n\t\t\tif (x instanceof Function)\n\t\t\t{\n\t\t\t\t//if (!x.name && x.name != y.name && x !== y)\n\t\t\t\tif (x.name !== y.name)\n\t\t\t\t\tbreak;\n\n\t\t\t\tif ((x + '').trim() !== (y + '').trim())\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// if they are regexps, they should exactly refer to same one\n\t\t\t// (it is hard to better equality check on current ES)\n\t\t\t// NO -- only check flags and source patter properties -- NOT lastIndex\n\t\t\tif (x instanceof RegExp)\n\t\t\t{\n\t\t\t\treturn x.global == y.global && x.ignoreCase == y.ignoreCase\n\t\t\t\t\t&& x.multiline == y.multiline && x.source == y.source;\n\t\t\t\t//return x === y;\n\t\t\t}\n\n\t\t\tif (x === y || x.valueOf() === y.valueOf())\n\t\t\t\treturn true;\t\t\t\t\t\t\t//both same object ??\n\n\t\t\tif (x instanceof Array)\n\t\t\t{\n\t\t\t\tif (x.length !== y.length)\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Date: date and time zone besides owner properties (e.g. EZ.date)\n\t\t\tif (x instanceof Date)\n\t\t\t{\n\t\t\t\tif (x.getTime() != y.getTime())\n\t\t\t\t\tbreak;\t\t\t\t\t\t//different dates\n\t\t\t}\n\n\t\t\t// not Object: if they are strictly equal, they both need to be object at least\n\t\t\tif (!(x instanceof Object) || !(y instanceof Object))\n\t\t\t\tbreak;\n\n\n\t\t\tif (getType(x) != getType(y))\n\t\t\t\tbreak;\n\n\t\t\t//------------------------------------------\n\t\t\t// embedded object properties equality check\n\t\t\t//------------------------------------------\n\t\t\tvar keys = Object.keys(x);\n\t\t\tvar keysOther = Object.keys(y);\n\t\t\tif (getType(x) != 'array')\n\t\t\t{\n\t\t\t\tkeys.sort();\n\t\t\t\tkeysOther.sort();\n\t\t\t}\n\t\t\tif (keys.join('.') != keysOther.join('.'))\n\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t//keys DO NOT must match\n\t\t\t\tif (!showDiff)\n\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t//quit if not logging diff\n\n\t\t\t\tif (getType(x) == 'array')\t\t\t\t\t//use highest # of keys\n\t\t\t\t\tkeys = x.length < y.length ? keysOther : keys;\n\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tkeysOther.forEach(function(key)\t\t\t//get combined list of keys\n\t\t\t\t\t{\n\t\t\t\t\t\tif (keys.indexOf(key) == -1)\n\t\t\t\t\t\t\tkeys.push(key);\n\t\t\t\t\t});\n\t\t\t\t\tkeys.sort();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tkeys.every(function(key)\t\t\t\t\t\t//for every key until false returned . . .\n\t\t\t{\n\t\t\t\t//if (EZ.test.debug('EZequals')) debugger;\n\n\t\t\t\tdotName.push(key);\n\t\t\t\tdo\t\t\t\t\t\t\t\t\t\t\t//for function or object properties . . .\n\t\t\t\t{\n\t\t\t\t\tif (!(x[key] instanceof Object))\n\t\t\t\t\t{\n\t\t\t\t\t\trtnValue = isEqualObjects(x[key], y[key], depth+1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (x[key] == y[key])\n\t\t\t\t\t\treturn true;\t\t\t\t\t\t\t//equal if same Object\n\n\t\t\t\t\te = getObjectIdx;\n\t\t\t\t\t/*\n\t\t\t\t\tif (!showDiff && EZ.test && EZ.test.running != 'EZequals')\n\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t//skip repeat logic UNLESS TESTING\n\n\t\t\t\t\tvar i = getObjectIdx('x', x[key]);\t\t//index of processed x Objects\n\t\t\t\t\tif (matchedObj.x[i].includes(y[key]))\n\t\t\t\t\t\treturn true;\t\t\t\t\t\t\t//previously matched y[key]\n\t\t\t\t\tif (unmatchedObj.x[i].includes(y[key]))\n\t\t\t\t\t\treturn false || showDiff;\t\t\t\t//previously did NOT match y[key]\n\n\t\t\t\t\tvar j = getObjectIdx('y', y[key]);\t\t//index of processed y Objects\n\t\t\t\t\tif (matchedObj.y[j].includes(x[key]))\n\t\t\t\t\t\treturn true;\t\t\t\t\t\t\t//previously matched x[key]\n\t\t\t\t\tif (unmatchedObj.y[j].includes(x[key]))\n\t\t\t\t\t\treturn false || showDiff;\t\t\t\t//previously did NOT match y[key]\n\t\t\t\t\t*/\n\n\t\t\t\t\trtnValue = isEqualObjects(x[key], y[key], depth+1);\n\n\t\t\t\t\t//if (!isEqual)\n\t\t\t\t\t//\tlogDiff(x[key], y[key]);\n\n\t\t\t\t\t/*\n\t\t\t\t\tif (isEqual)\n\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t//objects match -- remember for future\n\t\t\t\t\t\tmatchedObj.x[i].push(y[key]);\n\t\t\t\t\t\tmatchedObj.y[j].push(x[key]);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t//remember NOT matched\n\t\t\t\t\t\tunmatchedObj.x[i].push(y[key]);\n\t\t\t\t\t\tunmatchedObj.y[j].push(x[key]);\n\t\t\t\t\t\treturn || showDiff;\t\t\t\t//previously did NOT match y[key]\n\t\t\t\t\t}\n\t\t\t\t\t*/\n\t\t\t\t}\n\t\t\t\twhile (false)\n\n\t\t\t\tdotName.pop();\n\t\t\t\treturn rtnValue || showDiff;\n\t\t\t});\n\t\t\tif (rtnValue)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\tbreak;\n\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//log if showDiff enabled\n\t\twhile (!rtnValue && showDiff)\t// )\n\t\t{\n\t\t\tif (getType(x) == getType(x)\n\t\t\t&& typeof(x) == 'object' && typeof(y) == 'object')\n\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t//already reported\n\n\t\t\tif (showDiff !== true)\t\t\t\t\t\t\t//heading if not true\n\t\t\t{\n\t\t\t\tconsole.log(showDiff);\n\t\t\t\tshowDiff = true;\n\t\t\t}\n\t\t\tvar key = dotName.join('.');\n\t\t\tkey = key ? '.' + key : '';\n\t\t\tkey = key.replace(/\\.(\\d+)\\b/, '[$1]');\n\t\t\tvar msg = typeof(x) != typeof(y) && x != null && y != null\n\n\t\t\t\t\t? 'typeof(x' + key + '):\\t' + typeof(x) + '\\n'\n\t\t\t\t\t+ 'typeof(y' + key + '):\\t' + typeof(y)\n\n\t\t\t\t\t: 'x' + key + ':\\t' + x + '\\n'\n\t\t\t\t\t+ 'y' + key + ':\\t' + y;\n\n\t\t\tconsole.log('\\t' + msg.replace(/:\\t/g, ': ').replace(/\\n/g, ' \\t '));\n\t\t\t//console.log('\\t' + msg);\n\n\t\t\tmsg = msg.split('\\n');\n\t\t\tEZ.equals.log.push(msg[0], msg[1], ' ');\t//{key:dotName, x:x, y:y}\n\t\t\tbreak;\n\t\t}\n\t\treturn rtnValue;\n\t}", "function Same_coord(x1, y1, x2, y2, same) {\n if (same === 'same') {\n return ((x1 === x2) && (y1 === y2)) ? true : false;\n } else {\n return ((x1+same > x2) && (x1-same < x2) && (y1+same > y2)\n && (y1-same < y2)) ? true : false;\n }\n}", "function supersetArray(x,y){\n first=objectOne(x) \n second=objectTwo(y)\n combined=object(x,y)\n\n lFirst=Object.keys(first).length\n lSecond=Object.keys(second).length\n lCombined=Object.keys(combined).length\n\n if(lCombined==lFirst){\n return true;\n }\n else{\n return false;\n }\n}", "function sameLength(g1,g2) {\n return g1.hasOwnProperty('coordinates') ?\n g1.coordinates.length === g2.coordinates.length\n : g1.length === g2.length;\n}", "function deepEqual(obj1, obj2) {\n // Your code here\n}", "equals(other) {\n return this.x == other.x && this.y == other.y;\n }", "function pointEqual$1(a, b) {\n return a && b && a[0] === b[0] && a[1] === b[1];\n}", "deepEqual(a, b) {\n // If two \n if(a === b) {\n return true\n }; \n\n // Check for any condition that would cause args not to be equal\n if(a === null || b === null || typeof a != 'object' || typeof b != 'object') {\n return false\n };\n\n // Check for equality in number of properties and properties themselves\n var propsA = 0, \n propsB = 0;\n\n for(var prop in a) {\n propsA += 1;\n\n for (var prop in b) {\n propsB += 1;\n if (!(prop in a) || !this.deepEqual(a[prop], b[prop])) {\n return false;\n }\n }\n }\n\n return propsInA == propsInB;\n }", "function $i__NM$$fbjs$lib$shallowEqual__is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n // Added the nonzero y check to make Flow happy, but it is redundant\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n}", "equals(other) {\n\t\tlet ms = super.equals(other);\n\t\tif (typeof ms == 'boolean') return ms;\n\t\t// use smallest item in set as its 'id', store in set's root location\n\t\tlet id1 = new Int32Array(this.n+1).fill(this.n+1);\n\t\tlet id2 = new Int32Array(this.n+1).fill(this.n+1);\n\n\t\tfor (let i = 1; i <= this.n; i++) {\n\t\t\tlet r1 = this.findroot(i); id1[r1] = Math.min(i, id1[r1]);\n\t\t\tlet r2 = ms.findroot(i); id2[r2] = Math.min(i, id2[r2]);\n\t\t}\n\t\tfor (let i = 1; i < this.n; i++) {\n\t\t\tif (id1[this.findroot(i)] != id2[ms.findroot(i)]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn ms;\n\t}", "function equalPoints(point1, point2) {\r\n\treturn (point1.x == point2.x) && (point1.y == point2.y)\r\n}", "function same(arr1, arr2) {\n // assign arr1 to object1 {number: frequency}\n // assign arr2 to object2 {sqrt(number ^ 2) : frequency}\n let arr1Obj = {};\n let arr2Obj = {};\n for (let i = 0; i < arr1.length; i++) {\n arr1[i] === arr1Obj[arr1[i]] ? arr1Obj[arr1[i]]++ : (arr1Obj[arr1[i]] = 1);\n }\n for (let i = 0; i < arr2.length; i++) {\n Math.sqrt(arr2[i]) === arr2Obj[arr2[i]]\n ? arr2Obj[Math.sqrt(arr2[i])]++\n : (arr2Obj[Math.sqrt(arr2[i])] = 1);\n }\n console.log(arr1Obj);\n console.log(arr2Obj);\n return shallowEqual(arr1Obj, arr2Obj);\n}", "function isEqualObjects(x, y, depth)\n\t{\n\t\tif (x === null || x === undefined || y === null || y === undefined)\n\t\t\treturn x === y; \t\t\t\t\t//not both null or undefined\n\n\t\tif (x.constructor !== y.constructor)\n\t\t\treturn false;\t\t\t\t\t\t//not both same constructor\n\n\t\tif (typeof(x) == 'number' && isNaN(x) && isNaN(y))\n\t\t\treturn true;\t\t\t\t\t\t//required because NaN === NaN is false\n\n\t\t// if they are functions, they should exactly refer to same one (because of closures)\n\t\t// NO: same name and script except comments (if comment stripper available)\n\t\tif (x instanceof Function)\n\t\t{\n\t\t\t//if (!x.name && x.name != y.name && x !== y)\n\t\t\tif (x.name !== y.name)\n\t\t\t\treturn false;\n\n\t\t\tif ((x + '').trim() !== (y + '').trim())\n\t\t\t\treturn false;\n\t\t}\n\n\t\t// if they are regexps, they should exactly refer to same one\n\t\t// (it is hard to better equality check on current ES)\n\t\t// NO -- only check flags and source patter properties -- NOT lastIndex\n\t\tif (x instanceof RegExp)\n\t\t{\n\t\t\treturn x.global == y.global && x.ignoreCase == y.ignoreCase\n\t\t\t\t&& x.multiline == y.multiline && x.source == y.source;\n\t\t\t//return x === y;\n\t\t}\n\n\t\tif (x === y || x.valueOf() === y.valueOf())\n\t\t\treturn true;\t\t\t\t\t\t\t//both same object ??\n\n\t\tif (x instanceof Array && x.length !== y.length)\n\t\t\treturn false;\n\n\t\t// Date: date and time zone besides owner properties (e.g. EZ.date)\n\t\tif (x instanceof Date)\n\t\t{\n\t\t\tif (x.getTime() != y.getTime())\n\t\t\t\treturn false;\t\t\t\t\t\t//different dates\n\t\t}\n\t\t\n\t\t// not Object: if they are strictly equal, they both need to be object at least\n\t\tif (!(x instanceof Object) || !(y instanceof Object))\n\t\t\treturn false;\n\n\t\t//------------------------------------------\n\t\t// embedded object properties equality check\n\t\t//------------------------------------------\n\t\tvar keys = Object.keys(x).concat(Object.keys(y)).removeDups();\n\t\tvar is = keys.every(function(i)\t\t\t\t\t//use is as debugger convenience\n\t\t{\n\t\t\treturn i in x && i in y && typeof(x[i]) == typeof(y[i]);\n\t\t})\n\t\tif (!is && !showDiff)\t\t\t\t\t\t\t//quit if keys do not match\n\t\t\treturn false;\n\n\t\t//if (EZ.test.debug('EZequals')) debugger;\n\t\tis = keys.every(function(key)\n\t\t{\n\t\t\twhile (x[key] instanceof Object)\t\t\t//for function or object properties . . .\n\t\t\t{\t\t\t\n\t\t\t\tif (x[key] == y[key]) return true;\t\t//same Object\n\t\t\t\t\n\t\t\t\tif (!showDiff && EZ.test.running != 'EZequals') \n\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t//skip repeat logic UNLESS TESTING\n\t\t\t\t//if (true) break;\n\n\t\t\t\tvar i = getObjectIdx('x', x[key]);\t\t//index of processed x Objects\n\t\t\t\tif (matchedObj.x[i].includes(y[key]))\n\t\t\t\t\treturn true;\t\t\t\t\t\t//...previously matched y[key]\n\t\t\t\tif (unmatchedObj.x[i].includes(y[key]))\n\t\t\t\t\treturn false;\t\t\t\t\t\t//...previously did NOT match y[key]\n\n\t\t\t\tvar j = getObjectIdx('y', y[key]);\t\t//index of processed y Objects\n\t\t\t\tif (matchedObj.y[j].includes(x[key]))\n\t\t\t\t\treturn true;\t\t\t\t\t\t//...previously matched x[key]\n\t\t\t\tif (unmatchedObj.y[j].includes(x[key]))\n\t\t\t\t\treturn false;\t\t\t\t\t\t//...previously did NOT match x[key]\n\n\t\t\t\tdotName.push(key);\n\t\t\t\tvar isEqual = isEqualObjects(x[key], y[key], depth+1);\n\t\t\t\tdotName.pop();\n\t\t\t\tif (isEqual)\n\t\t\t\t{\t\t\t\t\t\t\t\t\t\t//objects match -- remember for future\n\t\t\t\t\tmatchedObj.x[i].push(y[key]);\t\t\t\t\n\t\t\t\t\tmatchedObj.y[j].push(x[key]);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\t\t\t\t\t\t\t\t\t//remember NOT matched\n\t\t\t\t\tunmatchedObj.x[i].push(y[key]);\n\t\t\t\t\tunmatchedObj.y[j].push(x[key]);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar isEqual = isEqualObjects(x[key], y[key], depth+1);\n\t\t\tif (!isEqual && showDiff)\n\t\t\t{\n\t\t\t\tvar msg = 'x.' + key + ': ' + x[key] + '\\t\\ty.' + key + ': ' + y[key];\n\t\t\t\tconsole.log(msg);\n\t\t\t}\n\t\t\treturn isEqual;\n\t\t});\n\t\treturn is;\n\t}", "function _equals(_x4, _x5) {\n var _again = true;\n\n _function: while (_again) {\n var a = _x4,\n b = _x5;\n _again = false;\n\n if (a === b || a !== a && b !== b) {\n // true for NaNs\n return true;\n }\n\n if (!a || !b) {\n return false;\n }\n\n // There is probably a cleaner way to do this check\n // Blame TDD :)\n if (a && typeof a.constructor === 'function' && a.constructor.unionFactory === Union) {\n if (!(b && typeof b.constructor === 'function' && b.constructor.unionFactory === Union)) {\n return false;\n }\n if (a.constructor !== b.constructor) {\n return false;\n }\n if (a.name !== b.name) {\n return false;\n }\n _x4 = a.payload;\n _x5 = b.payload;\n _again = true;\n continue _function;\n }\n\n // I hate this block. Blame immutablejs :)\n if (typeof a.valueOf === 'function' && typeof b.valueOf === 'function') {\n a = a.valueOf();\n b = b.valueOf();\n if (a === b || a !== a && b !== b) {\n return true;\n }\n if (!a || !b) {\n return false;\n }\n }\n if (typeof a.equals === 'function' && typeof b.equals === 'function') {\n return a.equals(b);\n }\n return false;\n }\n}", "function equal$1(a,b){// START: fast-deep-equal es6/index.js 3.1.1\nif(a===b)return true;if(a&&b&&typeof a=='object'&&typeof b=='object'){if(a.constructor!==b.constructor)return false;var length,i,keys;if(Array.isArray(a)){length=a.length;if(length!=b.length)return false;for(i=length;i--!==0;)if(!equal$1(a[i],b[i]))return false;return true;}// START: Modifications:\n// 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n// to co-exist with es5.\n// 2. Replace `for of` with es5 compliant iteration using `for`.\n// Basically, take:\n//\n// ```js\n// for (i of a.entries())\n// if (!b.has(i[0])) return false;\n// ```\n//\n// ... and convert to:\n//\n// ```js\n// it = a.entries();\n// while (!(i = it.next()).done)\n// if (!b.has(i.value[0])) return false;\n// ```\n//\n// **Note**: `i` access switches to `i.value`.\nvar it;if(hasMap&&a instanceof Map&&b instanceof Map){if(a.size!==b.size)return false;it=a.entries();while(!(i=it.next()).done)if(!b.has(i.value[0]))return false;it=a.entries();while(!(i=it.next()).done)if(!equal$1(i.value[1],b.get(i.value[0])))return false;return true;}if(hasSet&&a instanceof Set&&b instanceof Set){if(a.size!==b.size)return false;it=a.entries();while(!(i=it.next()).done)if(!b.has(i.value[0]))return false;return true;}// END: Modifications\nif(hasArrayBuffer&&ArrayBuffer.isView(a)&&ArrayBuffer.isView(b)){length=a.length;if(length!=b.length)return false;for(i=length;i--!==0;)if(a[i]!==b[i])return false;return true;}if(a.constructor===RegExp)return a.source===b.source&&a.flags===b.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===b.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===b.toString();keys=Object.keys(a);length=keys.length;if(length!==Object.keys(b).length)return false;for(i=length;i--!==0;)if(!Object.prototype.hasOwnProperty.call(b,keys[i]))return false;// END: fast-deep-equal\n// START: react-fast-compare\n// custom handling for DOM elements\nif(hasElementType&&a instanceof Element)return false;// custom handling for React/Preact\nfor(i=length;i--!==0;){if((keys[i]==='_owner'||keys[i]==='__v'||keys[i]==='__o')&&a.$$typeof){// React-specific: avoid traversing React elements' _owner\n// Preact-specific: avoid traversing Preact elements' __v and __o\n// __v = $_original / $_vnode\n// __o = $_owner\n// These properties contain circular references and are not needed when\n// comparing the actual elements (and not their owners)\n// .$$typeof and ._store on just reasonable markers of elements\ncontinue;}// all other properties should be traversed as usual\nif(!equal$1(a[keys[i]],b[keys[i]]))return false;}// END: react-fast-compare\n// START: fast-deep-equal\nreturn true;}return a!==a&&b!==b;}// end fast-deep-equal", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function areSetsEqual(a, b, isEqual, meta) {\r\n var isValueEqual = a.size === b.size;\r\n if (isValueEqual && a.size) {\r\n a.forEach(function (aValue) {\r\n if (isValueEqual) {\r\n isValueEqual = false;\r\n b.forEach(function (bValue) {\r\n if (!isValueEqual) {\r\n isValueEqual = isEqual(aValue, bValue, meta);\r\n }\r\n });\r\n }\r\n });\r\n }\r\n return isValueEqual;\r\n}", "function equals(p1, p2) {\n\t return p1.x === p2.x && p1.y === p2.y;\n\t}", "function equals(p1, p2) {\n\t return p1.x === p2.x && p1.y === p2.y;\n\t}", "function equals(p1, p2) {\n\t return p1.x === p2.x && p1.y === p2.y;\n\t}", "function equals(p1, p2) {\n\t return p1.x === p2.x && p1.y === p2.y;\n\t}", "function equals(p1, p2) {\n\t return p1.x === p2.x && p1.y === p2.y;\n\t}", "function equals( p1, p2 ) {\n\n\treturn p1.x === p2.x && p1.y === p2.y;\n\n}", "function equals( p1, p2 ) {\n\n\treturn p1.x === p2.x && p1.y === p2.y;\n\n}", "function equals( p1, p2 ) {\n\n\treturn p1.x === p2.x && p1.y === p2.y;\n\n}", "function equals( p1, p2 ) {\n\n\treturn p1.x === p2.x && p1.y === p2.y;\n\n}", "function equals( p1, p2 ) {\n\n\treturn p1.x === p2.x && p1.y === p2.y;\n\n}", "equals(other: Face) {\n return this.index === other.index;\n // return this.polyhedron === other.polyhedron && this.index === other.index;\n }", "function same(arr1, arr2) {\n if (arr1.length !== arr2.length) return false; // O(1)\n\n let count1 = {};\n let count2 = {};\n\n for (let val of arr1) {\n count1[val] === undefined ? count1[val] = 1 : count1[val]++;\n }\n\n for (let val of arr2) {\n count2[val] === undefined ? count2[val] = 1 : count2[val]++;\n }\n\n for (let key in count1) {\n let square = key ** 2;\n if (count2[square] === undefined) return false;\n if (count2[square] !== count1[key]) return false;\n }\n \n return true;\n }", "areInSameSet(firstIndex, secondIndex) {\n return this.getRepresentative(firstIndex) === this.getRepresentative(secondIndex);\n }", "equals(path, another) {\n return path.length === another.length && path.every((n, i) => n === another[i]);\n }", "equals(path, another) {\n return path.length === another.length && path.every((n, i) => n === another[i]);\n }", "static samePos(a, b) {\r\n return a && b && a.x === b.x && a.y === b.y && a.w === b.w && a.h === b.h;\r\n }", "function objectsEqual(obj1, obj2) {\n let obj1Keys = Object.keys(obj1);\n let obj1Values = Object.values(obj1);\n let obj2Keys = Object.keys(obj2);\n let obj2Values = Object.values(obj2);\n\n if (obj1Keys.length !== obj2Keys.length || obj1Values.length !== obj2Values.length) {\n return false;\n }\n\n for (let i = 0; i < obj1Keys.length; i += 1) {\n if (obj1Keys[i] !== obj2Keys[i]) {\n return false;\n }\n }\n\n for (let i = 0; i < obj1Values.length; i += 1) {\n if (obj1Values[i] !== obj2Values[i]) {\n return false;\n }\n }\n\n return true;\n}", "function objects_hold_same_values(o1, o2)\n{\n\tif (typeof(o1) != typeof(o2))\n\t\treturn false;\n\t\t\n\tswitch (typeof(o1))\n\t{\n\t\tcase \"number\":\n\t\t\tif (isNaN(o1) && isNaN(o2))\n\t\t\t\treturn true;\n\t\t\treturn o1 == o2;\n\t\tbreak;\n\t\tcase \"boolean\":\n\t\t\treturn o1 == o2;\n\t\tbreak;\n\t\tcase \"string\": \n\t\t\tif (o1 != null && o2 != null && o1.length != o2.length)\n\t\t\t\treturn false;\n\t\t\treturn o1 == o2;\n\t\tbreak;\n\t\tcase \"object\": /* also, arrays */\n\t\t\tif (o1 != null && o2 != null && o1.length != o2.length)\n\t\t\t\treturn false;\n\t\t\tvar i;\n\t\t\tfor (i in o1)\n\t\t\t{\n\t\t\t\tif(!objects_hold_same_values(o1[i], o2[i]))\n\t\t\t\treturn false;\n\t\t\t}\n\t\tbreak;\n\t\tdefault:\n\t\t\treturn o1 == o2;\n\t\tbreak;\n\t}\n\n\treturn true;\n}", "function pointsEqual(a, b) {\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}", "shouldComponentUpdate(nextProps) {\n const nonPointsAreEqual = Object.keys(propTypes).every(\n // eslint-disable-next-line react/destructuring-assignment\n prop => prop === 'points' || this.props[prop] === nextProps[prop],\n );\n const { points } = this.props;\n const pointsAreEqual =\n nextProps.points.length === points.length &&\n nextProps.points.every(point => points.indexOf(point) > -1);\n\n return !(pointsAreEqual && nonPointsAreEqual);\n }", "function arrayEqual (array1, array2) {\n // if the other array is a falsy value, return\n if (!array2)\n return false;\n \n // compare lengths - can save a lot of time\n if (array1.length != array2.length)\n return false;\n \n for (var i = 0, l=array1.length; i < l; i++) {\n // Check if we have nested arrays\n if (array1[i] instanceof Array && array2[i] instanceof Array) {\n // recurse into the nested arrays\n if (!array1[i].compare(array2[i]))\n return false;\n }\n else if (array1[i] != array2[i]) {\n // Warning - two different object instances will never be equal: {x:20} != {x:20}\n return false;\n }\n }\n return true;\n}", "function equalArrays(array1, array2) {\n // if the other array is a falsy value, return\n if (!array1 || !array2)\n return false;\n\n // compare lengths - can save a lot of time\n if (array1.length != array2.length)\n return false;\n\n for (var i = 0, l=array1.length; i < l; i++) {\n // Check if we have nested arrays\n if (array1[i] instanceof Array && array2[i] instanceof Array) {\n // recurse into the nested arrays\n if (!equalArrays(array1[i],array2[i]))\n return false;\n }\n else if (array1[i] != array2[i]) {\n // Warning - two different object instances will never be equal: {x:20} != {x:20}\n return false;\n }\n }\n return true;\n}", "function equalArrays(array1, array2) {\n // if the other array is a falsy value, return\n if (!array1 || !array2)\n return false;\n\n // compare lengths - can save a lot of time\n if (array1.length != array2.length)\n return false;\n\n for (var i = 0, l=array1.length; i < l; i++) {\n // Check if we have nested arrays\n if (array1[i] instanceof Array && array2[i] instanceof Array) {\n // recurse into the nested arrays\n if (!equalArrays(array1[i],array2[i]))\n return false;\n }\n else if (array1[i] != array2[i]) {\n // Warning - two different object instances will never be equal: {x:20} != {x:20}\n return false;\n }\n }\n return true;\n}", "static isEquivalent(a, b) \n {\n // Create arrays of property names\n var aProps = Object.getOwnPropertyNames(a);\n var bProps = Object.getOwnPropertyNames(b);\n \n // If number of properties is different,\n // objects are not equivalent\n if (aProps.length != bProps.length) {\n return false;\n }\n \n for (var i = 0; i < aProps.length; i++) {\n var propName = aProps[i];\n \n // If values of same property are not equal,\n // objects are not equivalent\n if (a[propName] !== b[propName]) {\n return false;\n }\n }\n \n // If we made it this far, objects\n // are considered equivalent\n return true;\n }", "function areEqualMappings(a, b) {\n\t return (\n\t // sorted by selectivity\n\t a.generatedColumn == b.generatedColumn &&\n\t a.originalColumn == b.originalColumn &&\n\t a.name == b.name &&\n\t a.generatedLine == b.generatedLine &&\n\t a.originalLine == b.originalLine &&\n\t a.source == b.source\n\t );\n\t}", "function objectEqual(a, b, memos) {\n if (typeof a.equal == 'function') {\n memos.push([a, b])\n return a.equal(b, memos)\n }\n var ka = getEnumerableProperties(a)\n var kb = getEnumerableProperties(b)\n var i = ka.length\n\n // same number of properties\n if (i !== kb.length) return false\n\n // although not necessarily the same order\n ka.sort()\n kb.sort()\n\n // cheap key test\n while (i--) if (ka[i] !== kb[i]) return false\n\n // remember\n memos.push([a, b])\n\n // iterate again this time doing a thorough check\n i = ka.length\n while (i--) {\n var key = ka[i]\n if (!equal(a[key], b[key], memos)) return false\n }\n\n return true\n}", "function objectEqual(a, b, memos) {\n if (typeof a.equal == 'function') {\n memos.push([a, b])\n return a.equal(b, memos)\n }\n var ka = getEnumerableProperties(a)\n var kb = getEnumerableProperties(b)\n var i = ka.length\n\n // same number of properties\n if (i !== kb.length) return false\n\n // although not necessarily the same order\n ka.sort()\n kb.sort()\n\n // cheap key test\n while (i--) if (ka[i] !== kb[i]) return false\n\n // remember\n memos.push([a, b])\n\n // iterate again this time doing a thorough check\n i = ka.length\n while (i--) {\n var key = ka[i]\n if (!equal(a[key], b[key], memos)) return false\n }\n\n return true\n}", "function compare(object_1, object_2) {\n // if the first value of the first object is equal to the first value of the second object or if the second value of the first object is equal to the second value of the second object, then return true \n if (Object.values(object_1)[0] == Object.values(object_2)[0] || Object.values(object_1)[1] == Object.values(object_2)[1]) {\n return true;\n // else return false \n } else {\n return false;\n }\n}", "function pointsEqual (a, b) {\n for (var i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false\n }\n }\n return true\n}", "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0; )\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && a instanceof Map && b instanceof Map) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && a instanceof Set && b instanceof Set) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (\n hasArrayBuffer &&\n ArrayBuffer.isView(a) &&\n ArrayBuffer.isView(b)\n ) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0; ) if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp)\n return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf)\n return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString)\n return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0; )\n if (!Object.prototype.hasOwnProperty.call(b, keys[i]))\n return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0; ) {\n if (\n (keys[i] === '_owner' ||\n keys[i] === '__v' ||\n keys[i] === '__o') &&\n a.$$typeof\n ) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n }", "function pointsEqual (a, b) {\n for (var i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}", "function deepEqual(actual, expected) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n\n // 7.3. Other pairs that do not both pass typeof value == \"object\",\n // equivalence is determined by ==.\n } else if (typeof actual != 'object' && typeof expected != 'object') {\n return actual == expected;\n\n // 7.4. For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical \"prototype\" property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected);\n }\n }", "function equal_to(x, y) {\r\n // CONVERT TO PRIMITIVE TYPE\r\n x = x.valueOf();\r\n y = y.valueOf();\r\n // DO COMPARE\r\n if (x instanceof Object && x.equals instanceof Function)\r\n return x.equals(y);\r\n else\r\n return x === y;\r\n}", "function objectEqual(a, b, memos) {\n if (typeof a.equal == 'function') {\n memos.push([a, b]);\n return a.equal(b, memos)\n }\n var ka = getEnumerableProperties(a);\n var kb = getEnumerableProperties(b);\n var i = ka.length;\n\n // same number of properties\n if (i !== kb.length) return false\n\n // although not necessarily the same order\n ka.sort();\n kb.sort();\n\n // cheap key test\n while (i--) if (ka[i] !== kb[i]) return false\n\n // remember\n memos.push([a, b]);\n\n // iterate again this time doing a thorough check\n i = ka.length;\n while (i--) {\n var key = ka[i];\n if (!equal(a[key], b[key], memos)) return false\n }\n\n return true\n}", "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (areBothNaN(a, b))\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (areBothNaN(a, b))\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "function pointsEqual(a, b) {\n for (var i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n }" ]
[ "0.6290267", "0.6260589", "0.61123323", "0.5978917", "0.59072614", "0.58694106", "0.58287996", "0.5819145", "0.57871133", "0.5767569", "0.5752272", "0.5707228", "0.56802756", "0.56797785", "0.5677025", "0.56700313", "0.5666203", "0.5652008", "0.56501937", "0.56400305", "0.5598218", "0.5592495", "0.55783683", "0.5551683", "0.5551683", "0.554854", "0.55370367", "0.5522005", "0.5509118", "0.54913217", "0.54895926", "0.548251", "0.54545987", "0.54380953", "0.54342574", "0.5420206", "0.53971726", "0.5385443", "0.5379749", "0.53774846", "0.5373854", "0.53688145", "0.53632826", "0.5338468", "0.5338468", "0.5338468", "0.5338468", "0.5338468", "0.5338468", "0.5338468", "0.5338468", "0.5338468", "0.5338468", "0.5338468", "0.5338468", "0.5338468", "0.5338468", "0.5338468", "0.5338468", "0.5338468", "0.5338468", "0.5338468", "0.5338468", "0.5322321", "0.52958286", "0.52958286", "0.52958286", "0.52958286", "0.52958286", "0.52869284", "0.52869284", "0.52869284", "0.52869284", "0.52869284", "0.52819073", "0.5278413", "0.52637136", "0.52610016", "0.52610016", "0.52542573", "0.52420026", "0.5240229", "0.52374053", "0.52267", "0.52181965", "0.521553", "0.521553", "0.52152795", "0.52123606", "0.5204802", "0.5204802", "0.5201996", "0.5195182", "0.51950145", "0.5192699", "0.51894015", "0.5185491", "0.51852524", "0.5182388", "0.5182388", "0.51810354" ]
0.0
-1
Unless the value starts with an equals sign, return cell value
function parseFomula(table, value) { if (value && value.length > 0 && value.charAt(0) === '=') { // This is called when there is a comma between variable names Excel.on('callCellValue', function(cellCoord, done) { // using label let row = cellCoord.row.index; let column = cellCoord.column.index; done(get(table, `[${row}][${column}]`, undefined)); }); // This is called when there is a range between variable names Excel.on('callRangeValue', function(startCellCoord, endCellCoord, done) { // A value like A1 would convert to [1][0] // Iterate over all values and collect them let collection = []; // Iterate over rows first for (let r = startCellCoord.row.index; r <= endCellCoord.row.index; r++) { for ( let c = startCellCoord.column.index; c <= endCellCoord.column.index; c++ ) { let contents = get(table, `[${r}][${c}]`, null); collection.push(contents); } } if (collection) { done(collection); } }); value = Excel.parse(value.substring(1)); if (value.result) value = value.result; else value = value.error; } return value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getExcelComparison(value) {\n return value === '' ? 'NULL' : 'EQUAL';\n }", "getExcelComparison(value) {\n return value === '' ? 'NULL' : 'EQUAL';\n }", "getExcelComparison(value) {\n return value === '' ? 'EMPTY' : 'EQUAL_CASE_SENSITIVE';\n }", "getExcelComparison(value) {\n return value === '' ? 'EMPTY' : 'EQUAL_CASE_SENSITIVE';\n }", "function getsymbolOflineleft(tmp){\n\ttmp = tmp.replace(/ /g,'');\n\treturn tmp.substring(0,tmp.indexOf(\"=\"));\n}", "function getValueLocator(Value) {\n return Value.slice(Value.lastIndexOf(\"value=\") + 7, Value.lastIndexOf(\"value=\") + 8);\n}", "function getValueFromSelector (keyHeader, keyCol, keyVal, offsetCol) {\n var value = \"\";\n var sh = \"\";\n if (keyHeader === \"feeCode\") {\n sh = workbook.Sheets[\"FEE_HEADER\"];\n } else if (keyHeader === \"productCode\") {\n sh = workbook.Sheets[\"PRODUCT_HEADER\"];\n } else if (keyHeader === \"cfsCode\") {\n sh = workbook.Sheets[\"CFS_HEADER\"];\n } else if (keyHeader === \"rfsCode\") {\n sh = workbook.Sheets[\"RFS_HEADER\"];\n } else if (keyHeader === \"formulaCode\") {\n sh = workbook.Sheets[\"FORMULA_HEADER\"];\n }\n\n if(sh !== \"\"){\n var range = XLSX.utils.decode_range(sh['!ref']); // get the range\n for (var R = range.s.r; R <= range.e.r; ++R) {\n for (var C = range.s.c; C <= range.e.c; ++C) {\n var cellref = XLSX.utils.encode_cell({c: C, r: R}); // construct A1 reference for cell\n if (sh[cellref]) { // if cell doesn't exist, move on\n var cell = sh[cellref];\n if (C === keyCol) {\n if (cell.v === keyVal) {\n value = sh[XLSX.utils.encode_cell({c: C + offsetCol, r: R})].v;\n }\n }\n }\n }\n }\n }\n return value;\n}", "function funcInEqualOperator(val){\r\n if(val != '12'){\r\n return \"It is not Equal\";\r\n }\r\n return \"Equal\";\r\n}", "function isEquation(row){\n for(var i = 0; i < row.length; i++){\n var cur = row[i]\n if(cur.text == \"=\"){\n return i;\n }\n }\n return -1;\n}", "function lightCell(cellString){ \n var col = convertColumn(cellString);\n var row = Number(cellString.substring(1))-1;\n if (col < countColumns() && row >= 0 && row < countRows()) {\n var cellValue = GRID[row][col]; \n return cellValue;\n } else {\n return false\n } \n}", "function getViewCell(row, col) {\n var cellValue;\n try {\n var cell = query.getCell(row, col);\n cellValue = (cell===undefined) ? '' : cell.getValue();\n if (cellValue===undefined) {\n cellValue = '';\n }\n } catch (err) {\n cellValue = '';\n }\n return cellValue;\n\n}", "function InputValue(value){\n\t\tif(value.match(/[-+*\\/.]|[0-9]/g)){\n\t\t\tnewValue += value;\n\t\t\t_render();\n\t\t}\n\t\telse if(value == '='){\n\t\t\tevaluate();\n\t\t}\n\t\telse if(value == 'c'){\n\t\t\tnewValue = \"\";\n\t\t\t_render();\n\t\t}\n\t\telse\n\t\t\tconsole.log(\"Invalid!\");\n\t}", "function sVal(symbol){\n if(symbol == '+' || symbol == '-'){\n return 0;\n }else if (symbol == '*' || symbol == '/'){\n return 1;\n }\n}", "function cellCompareStr(cellString, str){ \n var cellValue = lightCell(cellString); \n var result = cellValue == str;\n return result;\n}", "function matchEqual() {\n\t\tvar pattern = /^=/;\n\t\tvar x = lexString.match(pattern);\n\t\tif(x !== null) {\n\t\t\treturn true;\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function val (str, key) {\n if (str.match && str.match(/^-?\\d+(?:\\.\\d+)?$/)) return +str;\n return (magicValues[key] && magicValues[key][str]) ||\n magicValues.all[str] || str;\n }", "function getVal(str) {\n var firstChar = str.slice(0, 1);\n var $element;\n\n if (firstChar === '#') {\n $element = $cache(str);\n } else {\n // Don't use cache here since selected input may change\n $element = $('input[name=' + str + ']:radio:checked');\n }\n\n return $element.val();\n}", "function formatTableCellValue(cell) {\n\tlet string = cell.replace(/^\"|\"/g, '');\n\treturn escapeHtml(string);\n}", "function extractArgumentValue(argument) {\n if (!argument.includes(\"=\")) {\n return true;\n }\n var argumentValue = \"\";\n var index = argument.indexOf('=');\n for (var ii = index + 1; ii < argument.length; ii++) {\n argumentValue += argument[ii];\n }\n return argumentValue;\n}", "function get_cell(row, col) {\n return $(`.col[row='${row}'][col='${col}']`)\n }", "function isCurrent(cellString){ \n var current = '~';\n return cellCompareStr(cellString, current);\n}", "function WQueryField(keycol, keyval, rqstcol)\n{\n for (var irow = this.currow; irow < this.rows; irow++)\n {\n if (this.WGetItem(irow, keycol) == keyval)\n {\n this.WSetRow(irow);\n return this.WGetCol(rqstcol);\n }\n }\n return \"\";\n}", "function isEqualFormula_(formula) {\n return formula.length > 0 && formula[0] == \"=\";\n}", "function evaluateExpression(exp) {\n if (exp[0] !== \"=\") {\n return exp;\n }\n\n exp = exp.substring(1, exp.length);\n\n if (/^SUM/.test(exp)) {\n exp = expandSUM(exp);\n }\n\n exp = exp.replace(/[A-Z]+\\d+/g, getValueByCellName);\n\n return new Function(\"return \" + exp)();\n }", "parseValue() {\n\t\t\tif ( this.char === Parser.END ) {\n\t\t\t\tthrow this.error( new TomlError( 'Key without value' ) );\n\t\t\t} else if ( this.char === CHAR_QUOT ) {\n\t\t\t\treturn this.next( this.parseDoubleString );\n\t\t\t}\n\n\t\t\tif ( this.char === CHAR_APOS ) {\n\t\t\t\treturn this.next( this.parseSingleString );\n\t\t\t} else if ( this.char === CHAR_HYPHEN || this.char === CHAR_PLUS ) {\n\t\t\t\treturn this.goto( this.parseNumberSign );\n\t\t\t} else if ( this.char === CHAR_i ) {\n\t\t\t\treturn this.next( this.parseInf );\n\t\t\t} else if ( this.char === CHAR_n ) {\n\t\t\t\treturn this.next( this.parseNan );\n\t\t\t} else if ( isDigit( this.char ) ) {\n\t\t\t\treturn this.goto( this.parseNumberOrDateTime );\n\t\t\t} else if ( this.char === CHAR_t || this.char === CHAR_f ) {\n\t\t\t\treturn this.goto( this.parseBoolean );\n\t\t\t} else if ( this.char === CHAR_LSQB ) {\n\t\t\t\treturn this.call( this.parseInlineList, this.recordValue );\n\t\t\t} else if ( this.char === CHAR_LCUB ) {\n\t\t\t\treturn this.call( this.parseInlineTable, this.recordValue );\n\t\t\t} else {\n\t\t\t\tthrow this.error( new TomlError( 'Unexpected character, expecting string, number, datetime, boolean, inline array or inline table' ) );\n\t\t\t}\n\t\t}", "function GetFormula(tbValue)\n{\n var pattern = /[:|\\(|\\)]/;\n var ar = tbValue.split(pattern);\n var sum = ar[0].toUpperCase();\n \n if (ar.length < 3)\n return null;\n else if (sum !== \"=SUM\")\n return null;\n else\n return ar;\n}", "function isCurrent(str){\n if (lightCell(str) == \"~\"){\n return true;\n } else {\n return false;\n }\n}", "_getCellValue(cellRef) {\n const tab = this.vals.get(cellRef.get('tabId'))\n if ( !tab ) {\n return null;\n }\n\n return tab.getIn([cellRef.get('rowIdx'), cellRef.get('colIdx')]);\n }", "getTrueValue () {\n var val = this.getValue ();\n if (!val) return;\n if (val === NULL_CHARACTER) return null;\n return val;\n }", "function getValue(sheet,row,column){\n return sheet.getRange(row,column).getValue();\n}", "function getHyperCellValue(a, b) {\n var cellvalue = $('a', 'tr:nth-child(' + a + ') td.coinformat:nth-child(' + b + ')').text();\n cellvalue = cellvalue.replace(\",\", \"\");\n cellvalue = (parseFloat(cellvalue)).toFixed(6);\n return cellvalue;\n}", "function extractX(cellString) {\n let letters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".split(\"\");\n let colChar = cellString.charAt(0);\n let col = letters.indexOf(colChar);\n return col + 1;\n}", "function NullCheck (cell) {\n if (cell) {\n return cell;\n } else {\n return \"-\";\n }\n}", "function cell(sheet, range){\n return sheet.getRange(range)\n .getCell(1,1)\n .getValue();\n}", "static getValue(value, escapeChar) {\n let escaped = false;\n const skip = util_1.Util.findLeadingNonWhitespace(value, escapeChar);\n if (skip !== 0 && value.charAt(skip) === '#') {\n // need to skip over comments\n escaped = true;\n }\n value = value.substring(skip);\n let first = value.charAt(0);\n let last = value.charAt(value.length - 1);\n let literal = first === '\\'' || first === '\"';\n let inSingle = (first === '\\'' && last === '\\'');\n let inDouble = false;\n if (first === '\"') {\n for (let i = 1; i < value.length; i++) {\n if (value.charAt(i) === escapeChar) {\n i++;\n }\n else if (value.charAt(i) === '\"' && i === value.length - 1) {\n inDouble = true;\n }\n }\n }\n if (inSingle || inDouble) {\n value = value.substring(1, value.length - 1);\n }\n let commentCheck = -1;\n let escapedValue = \"\";\n let start = 0;\n parseValue: for (let i = 0; i < value.length; i++) {\n let char = value.charAt(i);\n switch (char) {\n case escapeChar:\n if (i + 1 === value.length) {\n escapedValue = escapedValue + escapeChar;\n break parseValue;\n }\n char = value.charAt(i + 1);\n if (char === ' ' || char === '\\t') {\n whitespaceCheck: for (let j = i + 2; j < value.length; j++) {\n let char2 = value.charAt(j);\n switch (char2) {\n case ' ':\n case '\\t':\n break;\n case '\\r':\n j++;\n case '\\n':\n escaped = true;\n i = j;\n continue parseValue;\n default:\n if (!inDouble && !inSingle && !literal) {\n if (char2 === escapeChar) {\n // add the escaped character\n escapedValue = escapedValue + char;\n // now start parsing from the next escape character\n i = i + 1;\n }\n else {\n // the expectation is that this j = i + 2 here\n escapedValue = escapedValue + char + char2;\n i = j;\n }\n continue parseValue;\n }\n break whitespaceCheck;\n }\n }\n }\n if (inDouble) {\n if (char === '\\r') {\n escaped = true;\n i = i + 2;\n }\n else if (char === '\\n') {\n escaped = true;\n i++;\n }\n else if (char !== '\"') {\n if (char === escapeChar) {\n i++;\n }\n escapedValue = escapedValue + escapeChar;\n }\n continue parseValue;\n }\n else if (inSingle || literal) {\n if (char === '\\r') {\n escaped = true;\n i = i + 2;\n }\n else if (char === '\\n') {\n escaped = true;\n i++;\n }\n else {\n escapedValue = escapedValue + escapeChar;\n }\n continue parseValue;\n }\n else if (char === escapeChar) {\n // double escape, append one and move on\n escapedValue = escapedValue + escapeChar;\n i++;\n }\n else if (char === '\\r') {\n escaped = true;\n // offset one more for \\r\\n\n i = i + 2;\n }\n else if (char === '\\n') {\n escaped = true;\n i++;\n start = i;\n }\n else {\n // any other escapes are simply ignored\n escapedValue = escapedValue + char;\n i++;\n }\n break;\n case ' ':\n case '\\t':\n if (escaped && commentCheck === -1) {\n commentCheck = i;\n }\n escapedValue = escapedValue + char;\n break;\n case '\\r':\n i++;\n case '\\n':\n if (escaped && commentCheck !== -1) {\n // rollback and remove the whitespace that was previously appended\n escapedValue = escapedValue.substring(0, escapedValue.length - (i - commentCheck - 1));\n commentCheck = -1;\n }\n break;\n case '#':\n // a newline was escaped and now there's a comment\n if (escaped) {\n if (commentCheck !== -1) {\n // rollback and remove the whitespace that was previously appended\n escapedValue = escapedValue.substring(0, escapedValue.length - (i - commentCheck));\n commentCheck = -1;\n }\n newlineCheck: for (let j = i + 1; j < value.length; j++) {\n switch (value.charAt(j)) {\n case '\\r':\n j++;\n case '\\n':\n i = j;\n break newlineCheck;\n }\n }\n continue parseValue;\n }\n default:\n if (escaped) {\n escaped = false;\n commentCheck = -1;\n }\n escapedValue = escapedValue + char;\n break;\n }\n }\n return escapedValue;\n }", "function BOT_wordIsEqu(word) {\r\n\tif(word == \"eq\") return(true) \r\n}", "'=' ({ attr, value, insensitive }) {\n return attr === value\n }", "function getValueFromCell(row, column)\n{\n return $('#metadataFormTable')[0].rows[row+1].cells[column+1].childNodes[0].value;\n}", "parseValue() {\n if (this.char === Parser.END) {\n throw this.error(new TomlError('Key without value'));\n } else if (this.char === CHAR_QUOT) {\n return this.next(this.parseDoubleString);\n }\n\n if (this.char === CHAR_APOS) {\n return this.next(this.parseSingleString);\n } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {\n return this.goto(this.parseNumberSign);\n } else if (this.char === CHAR_i) {\n return this.next(this.parseInf);\n } else if (this.char === CHAR_n) {\n return this.next(this.parseNan);\n } else if (isDigit(this.char)) {\n return this.goto(this.parseNumberOrDateTime);\n } else if (this.char === CHAR_t || this.char === CHAR_f) {\n return this.goto(this.parseBoolean);\n } else if (this.char === CHAR_LSQB) {\n return this.call(this.parseInlineList, this.recordValue);\n } else if (this.char === CHAR_LCUB) {\n return this.call(this.parseInlineTable, this.recordValue);\n } else {\n throw this.error(new TomlError('Unexpected character, expecting string, number, datetime, boolean, inline array or inline table'));\n }\n }", "function inValNS(e){\n var l = e.length;\n if(l == 0){ return true; }\n else{\n for(i = 0; i < l; i++){ if(e.charAt(i) == \" \"){ return true; break; } }\n return false;\n }\n}", "function parse_FormulaValue(blob) {\n\tvar b;\n\tif(__readUInt16LE(blob,blob.l + 6) !== 0xFFFF) return [parse_Xnum(blob),'n'];\n\tswitch(blob[blob.l]) {\n\t\tcase 0x00: blob.l += 8; return [\"String\", 's'];\n\t\tcase 0x01: b = blob[blob.l+2] === 0x1; blob.l += 8; return [b,'b'];\n\t\tcase 0x02: b = blob[blob.l+2]; blob.l += 8; return [b,'e'];\n\t\tcase 0x03: blob.l += 8; return [\"\",'s'];\n\t}\n}", "function parse_FormulaValue(blob) {\n\tvar b;\n\tif(__readUInt16LE(blob,blob.l + 6) !== 0xFFFF) return [parse_Xnum(blob),'n'];\n\tswitch(blob[blob.l]) {\n\t\tcase 0x00: blob.l += 8; return [\"String\", 's'];\n\t\tcase 0x01: b = blob[blob.l+2] === 0x1; blob.l += 8; return [b,'b'];\n\t\tcase 0x02: b = blob[blob.l+2]; blob.l += 8; return [b,'e'];\n\t\tcase 0x03: blob.l += 8; return [\"\",'s'];\n\t}\n}", "function parse_FormulaValue(blob) {\n\tvar b;\n\tif(__readUInt16LE(blob,blob.l + 6) !== 0xFFFF) return [parse_Xnum(blob),'n'];\n\tswitch(blob[blob.l]) {\n\t\tcase 0x00: blob.l += 8; return [\"String\", 's'];\n\t\tcase 0x01: b = blob[blob.l+2] === 0x1; blob.l += 8; return [b,'b'];\n\t\tcase 0x02: b = blob[blob.l+2]; blob.l += 8; return [b,'e'];\n\t\tcase 0x03: blob.l += 8; return [\"\",'s'];\n\t}\n}", "function parse_FormulaValue(blob) {\n\tvar b;\n\tif(__readUInt16LE(blob,blob.l + 6) !== 0xFFFF) return [parse_Xnum(blob),'n'];\n\tswitch(blob[blob.l]) {\n\t\tcase 0x00: blob.l += 8; return [\"String\", 's'];\n\t\tcase 0x01: b = blob[blob.l+2] === 0x1; blob.l += 8; return [b,'b'];\n\t\tcase 0x02: b = blob[blob.l+2]; blob.l += 8; return [b,'e'];\n\t\tcase 0x03: blob.l += 8; return [\"\",'s'];\n\t}\n}", "function matchUrlQueryParamValue(str){var match=str.match(QUERY_PARAM_VALUE_RE);return match?match[0]:'';}", "function getCellValue(row, index) {\n var getValue = $(row).children('td').eq(index).html();\n return getValue\n}", "handleOperator(e) {\n let prevVal = this.state.prevVal;\n\n if (prevVal === \"\") {\n this.setState({\n prevVal: this.state.curVal + e.target.value,\n curVal: \"0\"\n });\n } else if (this.state.curVal === \"0\" && /[+\\-*/]$/.test(prevVal)) {\n this.setState({\n prevVal: prevVal.replace(/[+\\-*/]$/, e.target.value),\n curVal: \"0\"\n });\n } else if (prevVal.includes(\"=\")) {\n this.setState({\n prevVal: this.state.curVal + e.target.value,\n curVal: \"0\"\n });\n } else {\n this.setState({\n prevVal: prevVal + this.state.curVal + e.target.value,\n curVal: \"0\"\n });\n }\n }", "function getValue(token, escaper) {\n // The token could be a column, a parameter, or a number.\n if (token.type === 'column')\n return escaper.escapeFullyQualifiedColumn(token.value);\n else if (token.type === 'parameter') {\n // Find the value in the params list (the leading colon is removed).\n const paramKey = token.value.substring(1);\n const value = params[paramKey];\n\n if (value === undefined)\n throw new ConditionError(`Replacement value for parameter \"${paramKey}\" not present.`);\n }\n\n return token.value;\n }", "function getFirstChar() {\n index = 0;\n c = expr.charAt(0);\n }", "function escapeColumnValue(s) {\n if (typeof s === \"string\") {\n return s.replace(/&(?![a-zA-Z]{1,8};)/g, \"&amp;\");\n } else {\n return s;\n }\n }", "get stringValue() {}", "function getColumnLetter() {\n Logger.log(\n SpreadsheetApp.getActiveSpreadsheet()\n .getActiveSheet().getRange('A1:C10')\n .getCell(3, 3).getA1Notation()\n .slice(0, 1));\n}", "'^=' ({ attr, value, insensitive }) {\n return attr.startsWith(value)\n }", "'~=' ({ attr, value, insensitive }) {\n return (attr.match(/\\w+/g) || []).includes(value)\n }", "function cd_getTagValue(tag, str) {\n\tvar r = \"\";\n\tvar pos = str.toLowerCase().indexOf(tag, 0);\n\tvar taglen = tag.length;\n\t\n\t// make sure tag is a whole word\n\twhile (pos >= 0 && !(pos == 0 && (str.charAt(taglen) == \" \" || str.charAt(taglen) == \"=\") ||\n\t\tpos > 0 && str.charAt(pos - 1) == \" \" && (str.charAt(pos + taglen) == \" \" || str.charAt(pos + taglen) == \"=\")) ) {\n\t\tpos += taglen;\n\t\tpos = str.toLowerCase().indexOf(tag, pos);\n\t}\n\n\tif (pos >= 0) {\t\t\n\t\t// skip the space chars following tag\n\t\tpos += taglen;\n\t\twhile (str.charAt(pos) == \" \")\n\t\t\tpos++;\n\t\t\n\t\t// following char must be '='\n\t\tif (str.charAt(pos) == \"=\") {\n\t\t\tpos++;\n\t\t\t\n\t\t\t// skip the space chars following '='\n\t\t\twhile (str.charAt(pos) == \" \")\n\t\t\t\tpos++;\n\t\t\t\n\t\t\tvar p2 = pos;\n\t\t\tif (str.charAt(pos) == \"\\\"\") {\n\t\t\t\tpos++;\n\t\t\t\tp2 = str.indexOf(\"\\\"\", pos);\n\t\t\t}\n\t\t\telse if (str.charAt(pos) == \"\\'\") {\n\t\t\t\tpos++;\n\t\t\t\tp2 = str.indexOf(\"\\'\", pos);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tp2 = str.indexOf(\" \", pos);\n\t\t\t}\n\t\t\t\n\t\t\tif (pos > p2)\n\t\t\t\tp2 = str.length - 1;\n\n\t\t\tr = str.substring(pos, p2);\n\t\t}\n\t}\n\t\n\treturn r;\n}", "function getCellValue(tr, idx) {\n\t\treturn tr.children[idx].textContent; // idx indexes the columns of the tr\n\t\t// row\n\t}", "function WQueryLField(keycol, keyval, rqstcol)\n{\n for (var irow = this.currow; irow < this.rows; irow++)\n {\n var mykey = this.WGetItem(irow, keycol)\n if (mykey.indexOf(keyval, 0) >= 0)\n {\n this.WSetRow(irow);\n return this.WGetCol(rqstcol);\n }\n }\n return \"\";\n}", "function cellValue(myData, a, c, b, i, j){\n\tvar value = \"\";\n\tif(i<c && j>=b)\n\t\tvalue = generateCellValue(myData.axes[0].positions[j-b].members[i]);\n\telse if(i>=c && j<b){\n\t\tvar index = myData.axes.length > 1 ? 1 : 0;\n\t\tvalue = generateCellValue(myData.axes[index].positions[i-c].members[j]);\n\t}else if(i>=c && j>=b){\n\t\tvar currentOrdinal = (i-c)*a+(j-b);\n\t\tfor(var k = 0; k < myData.cells.length; k += 1)\n\t\t\tif(myData.cells[k].ordinal == currentOrdinal){\n\t\t\t\tvalue = myData.cells[k].formattedValue;\n\t\t\t\tbreak;\n\t\t\t}\n\t}\n\treturn value;\n}", "_getValueInCell(row, column) {\n const that = this,\n array = that.value,\n dimensionValues = that._coordinates,\n length = dimensionValues.length;\n let value;\n\n if (length === 1) {\n if (that._oneDimensionSpecialCase === false) {\n value = array[column + dimensionValues[0]];\n }\n else {\n value = array[row + dimensionValues[0]];\n }\n }\n else {\n const actualIndexes = dimensionValues.slice(0);\n\n if (that.arrayIndexingMode === 'LabVIEW') {\n actualIndexes[length - 1] += column;\n actualIndexes[length - 2] += row;\n }\n else {\n actualIndexes[0] += column;\n actualIndexes[1] += row;\n }\n\n const oneDimensionalArrayValue = array[actualIndexes[0]];\n\n if (oneDimensionalArrayValue !== undefined) {\n const twoDimensionalArrayValue = oneDimensionalArrayValue[actualIndexes[1]];\n\n if (twoDimensionalArrayValue !== undefined) {\n value = twoDimensionalArrayValue;\n\n if (length > 2) {\n for (let i = 2; i < length; i++) {\n if (value === undefined) {\n break;\n }\n\n value = value[actualIndexes[i]];\n }\n }\n }\n }\n }\n\n return value;\n }", "function Chekkey(value){\n var firstChar = value.substr(0,1);\n if(firstChar.toLowerCase() =='s')\n return true;\n else\n return false;\n}", "parseValue () {\n if (this.char === Parser.END) {\n throw this.error(new TomlError('Key without value'))\n } else if (this.char === CHAR_QUOT) {\n return this.next(this.parseDoubleString)\n } if (this.char === CHAR_APOS) {\n return this.next(this.parseSingleString)\n } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {\n return this.goto(this.parseNumberSign)\n } else if (this.char === CHAR_i) {\n return this.next(this.parseInf)\n } else if (this.char === CHAR_n) {\n return this.next(this.parseNan)\n } else if (isDigit(this.char)) {\n return this.goto(this.parseNumberOrDateTime)\n } else if (this.char === CHAR_t || this.char === CHAR_f) {\n return this.goto(this.parseBoolean)\n } else if (this.char === CHAR_LSQB) {\n return this.call(this.parseInlineList, this.recordValue)\n } else if (this.char === CHAR_LCUB) {\n return this.call(this.parseInlineTable, this.recordValue)\n } else {\n throw this.error(new TomlError('Unexpected character, expecting string, number, datetime, boolean, inline array or inline table'))\n }\n }", "getUnescapedValue() {\n if (this.valueRange === null) {\n return null;\n }\n let escaped = false;\n let rawValue = \"\";\n let value = this.document.getText().substring(this.document.offsetAt(this.valueRange.start), this.document.offsetAt(this.valueRange.end));\n rawLoop: for (let i = 0; i < value.length; i++) {\n let char = value.charAt(i);\n switch (char) {\n case this.escapeChar:\n for (let j = i + 1; j < value.length; j++) {\n switch (value.charAt(j)) {\n case '\\r':\n j++;\n case '\\n':\n escaped = true;\n i = j;\n continue rawLoop;\n case ' ':\n case '\\t':\n break;\n default:\n rawValue = rawValue + char;\n continue rawLoop;\n }\n }\n // this happens if there's only whitespace after the escape character\n rawValue = rawValue + char;\n break;\n case '\\r':\n case '\\n':\n break;\n case ' ':\n case '\\t':\n if (!escaped) {\n rawValue = rawValue + char;\n }\n break;\n case '#':\n if (escaped) {\n for (let j = i + 1; j < value.length; j++) {\n switch (value.charAt(j)) {\n case '\\r':\n j++;\n case '\\n':\n i = j;\n continue rawLoop;\n }\n }\n }\n else {\n rawValue = rawValue + char;\n }\n break;\n default:\n rawValue = rawValue + char;\n escaped = false;\n break;\n }\n }\n return rawValue;\n }", "function CLC_FindValueText(property_name, rule_string){\r\n //Get to the : of the desired rule\r\n var start = rule_string.indexOf(property_name+\":\");\r\n if (start == -1){\r\n start = rule_string.indexOf(property_name+\" \");\r\n }\r\n if (start == -1){\r\n return \"\";\r\n }\r\n var remaining = rule_string.substring((start+property_name.length), rule_string.length);\r\n\r\n //Remove the :\r\n start = remaining.indexOf(\":\");\r\n if (start == -1){\r\n return \"\";\r\n }\r\n remaining = remaining.substring(start+1, remaining.length);\r\n\r\n //Find the end of the value which is either ; or nothing\r\n var end = remaining.indexOf(\";\");\r\n if (end == -1){\r\n return remaining;\r\n }\r\n var value_text = remaining.substring(0,end);\r\n\r\n //Search again because the last occurrence takes precedence\r\n remaining = remaining.substring(end+1, remaining.length);\r\n var next_occurrence = (CLC_FindValueText(property_name, remaining));\r\n if (next_occurrence){\r\n value_text = next_occurrence;\r\n }\r\n return value_text;\r\n }", "getCellValue() {\n let cellData = {};\n cellData.cellName = this.props.cellName;\n cellData.cellValue = this.state.value;\n return cellData;\n }", "function matchUrlQueryParamValue(str) {\n var match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n }", "function getCellValue(v, h) {\n if (_self._state && _self._state.length) {\n if (v < 0 || v >= _self._state.length || h < 0 || h >= _self._state[0].length) {\n return false\n }\n return _self._state[v][h]\n }\n return false\n }", "function V(){var e;return dt.type!==Xe.Punctuator?!1:(e=dt.value,\"=\"===e||\"*=\"===e||\"/=\"===e||\"%=\"===e||\"+=\"===e||\"-=\"===e||\"<<=\"===e||\">>=\"===e||\">>>=\"===e||\"&=\"===e||\"^=\"===e||\"|=\"===e)}", "function getRelevant(itemValue) {\n var result = \"\";\n\n var writing = false;\n\n for (i = 0; i < itemValue.length; i++) {\n if (!writing) {\n if (itemValue.charAt(i) == ':') {\n i++;\n writing = true;\n }\n } else {\n result += itemValue.charAt(i);\n }\n }\n\n return result;\n}", "function matchUrlQueryParamValue(str) {\n const match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "function getValue(id) {\n return document.querySelector(id).value.replace(/\\s|\\(|\\)/g, \"\"); // Eliminate whitespaces, \"(\" & \")\" characters\n}", "function matchUrlQueryParamValue(str) {\n var match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "keyVal(key) {\n let start = key.indexOf(\"[\");\n if (start >= 0) {\n return key.substring(0, start);\n }\n else {\n return key;\n }\n }", "function WGet2KeyValue(acol, akey, bcol, bkey, rcol)\n{\n for (var irow = 0; irow < this.rows; irow++)\n {\n if ((this.WGetItem(irow, acol) == akey) && (this.WGetItem(irow, bcol) == bkey))\n return(this.WGetItem(irow, rcol));\n }\n return(\"\");\n}", "function partialMatch(srchStr, rowCellValue) {\n var srchStrNorm = srchStr.trim().toUpperCase()\n var isMatched = rowCellValue.toUpperCase().indexOf(srchStrNorm) > -1\n return isMatched\n }", "function refSheetCell(a, b, c, d) {\n\t if (a.type == \"sym\" &&\n\t b.type == \"punc\" && b.value == \"!\" &&\n\t (c.type == \"sym\" || c.type == \"rc\" || (c.type == \"num\" && c.value == c.value|0)) &&\n\t !(d.type == \"punc\" && d.value == \"(\" && !c.space))\n\t {\n\t skip(3);\n\t var x = toCell(c);\n\t if (!x || !isFinite(x.row)) {\n\t x = new NameRef(c.value);\n\t }\n\t return addPos(x.setSheet(a.value, true), a, c);\n\t }\n\t }", "function getCrossDataCol(rowHeadCount, col){\n\t//var secondTr = reportTable.rows[1];\n\tvar reportTable = document.getElementById(\"ftable\");//\\u53d6\\u5f97\\u7edf\\u8ba1\\u8868\n\treturn reportTable.rows[1].cells[col - rowHeadCount].getAttribute(\"value\");\n}", "function matchUrlQueryParamValue(str) {\n const match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "function matchUrlQueryParamValue(str) {\n const match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "function matchUrlQueryParamValue(str) {\n const match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "function matchUrlQueryParamValue(str) {\n const match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "function matchUrlQueryParamValue(str) {\n const match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "'$=' ({ attr, value, insensitive }) {\n return attr.endsWith(value)\n }", "function matchUrlQueryParamValue(str) {\n var match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "function matchUrlQueryParamValue(str) {\n var match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "function matchUrlQueryParamValue(str) {\n var match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "function matchUrlQueryParamValue(str) {\n var match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "function parseHammerValue(str, key) {\n\t if (str.match && str.match(/^-?\\d+(?:\\.\\d+)?$/)) return +str;\n\t return (aliases[key] && aliases[key][str]) ||\n\t aliases.all[str] || str;\n\t }", "set BackQuote(value) {}", "function getCellValue(row, index){\n\n //Returns children (cells in this case) of row equal to passed index parameter and the text in it.\n return $(row).children(\"td\").eq(index).text();\n }", "'|=' ({ attr, value, insensitive }) {\n return attr.startsWith(`${value}-`)\n }", "function matchAssign() {\n var token = lookahead(),\n op = token.value;\n\n if (token.type !== Token.Punctuator) {\n return false;\n }\n return op === '=' ||\n op === '*=' ||\n op === '/=' ||\n op === '%=' ||\n op === '+=' ||\n op === '-=' ||\n op === '<<=' ||\n op === '>>=' ||\n op === '>>>=' ||\n op === '&=' ||\n op === '^=' ||\n op === '|=';\n }", "function matchAssign() {\n var token = lookahead(),\n op = token.value;\n\n if (token.type !== Token.Punctuator) {\n return false;\n }\n return op === '=' ||\n op === '*=' ||\n op === '/=' ||\n op === '%=' ||\n op === '+=' ||\n op === '-=' ||\n op === '<<=' ||\n op === '>>=' ||\n op === '>>>=' ||\n op === '&=' ||\n op === '^=' ||\n op === '|=';\n }", "function matchAssign() {\n var token = lookahead(),\n op = token.value;\n\n if (token.type !== Token.Punctuator) {\n return false;\n }\n return op === '=' ||\n op === '*=' ||\n op === '/=' ||\n op === '%=' ||\n op === '+=' ||\n op === '-=' ||\n op === '<<=' ||\n op === '>>=' ||\n op === '>>>=' ||\n op === '&=' ||\n op === '^=' ||\n op === '|=';\n }", "function matchAssign() {\n var token = lookahead(),\n op = token.value;\n\n if (token.type !== Token.Punctuator) {\n return false;\n }\n return op === '=' ||\n op === '*=' ||\n op === '/=' ||\n op === '%=' ||\n op === '+=' ||\n op === '-=' ||\n op === '<<=' ||\n op === '>>=' ||\n op === '>>>=' ||\n op === '&=' ||\n op === '^=' ||\n op === '|=';\n }", "function matchAssign() {\n var token = lookahead(),\n op = token.value;\n\n if (token.type !== Token.Punctuator) {\n return false;\n }\n return op === '=' ||\n op === '*=' ||\n op === '/=' ||\n op === '%=' ||\n op === '+=' ||\n op === '-=' ||\n op === '<<=' ||\n op === '>>=' ||\n op === '>>>=' ||\n op === '&=' ||\n op === '^=' ||\n op === '|=';\n }", "function valToString(val) { return val != null ? val.toString().replace(/(~|\\/)/g, function (m) { return {'~':'~~', '/':'~2F'}[m]; }) : val; }", "function valToString(val) { return val != null ? val.toString().replace(/(~|\\/)/g, function (m) { return {'~':'~~', '/':'~2F'}[m]; }) : val; }", "function valToString(val) { return val != null ? val.toString().replace(/(~|\\/)/g, function (m) { return {'~':'~~', '/':'~2F'}[m]; }) : val; }", "function valToString(val) { return val != null ? val.toString().replace(/(~|\\/)/g, function (m) { return {'~':'~~', '/':'~2F'}[m]; }) : val; }", "function valToString(val) { return val != null ? val.toString().replace(/(~|\\/)/g, function (m) { return {'~':'~~', '/':'~2F'}[m]; }) : val; }" ]
[ "0.58228123", "0.58228123", "0.57137984", "0.57137984", "0.55758905", "0.55050266", "0.5436235", "0.53637177", "0.53631413", "0.53520656", "0.5285231", "0.52378154", "0.52045286", "0.51885796", "0.5161829", "0.51531744", "0.51241577", "0.5105807", "0.5091207", "0.5079587", "0.5069872", "0.5062195", "0.5052483", "0.502676", "0.49979794", "0.49934757", "0.49914697", "0.4983884", "0.4972305", "0.49358216", "0.4930978", "0.49173242", "0.49044785", "0.49040723", "0.49038154", "0.48949146", "0.4890309", "0.48879826", "0.4877862", "0.48691633", "0.4859516", "0.4859516", "0.4859516", "0.4859516", "0.48549345", "0.4846883", "0.48359743", "0.4816035", "0.48086032", "0.47882128", "0.47873017", "0.47872517", "0.4785538", "0.4783486", "0.47793928", "0.47747254", "0.47611183", "0.47591627", "0.4750463", "0.47390482", "0.4738505", "0.4737689", "0.472969", "0.47163045", "0.47085747", "0.47009477", "0.4677241", "0.46719533", "0.46557346", "0.4654445", "0.46499583", "0.46499097", "0.4648539", "0.46478015", "0.46430552", "0.46421617", "0.46393186", "0.46393186", "0.46393186", "0.46393186", "0.46393186", "0.46374062", "0.46325132", "0.46325132", "0.46325132", "0.46325132", "0.46281978", "0.4628012", "0.46168453", "0.46154872", "0.46075764", "0.46075764", "0.46075764", "0.46075764", "0.46075764", "0.4602514", "0.4602514", "0.4602514", "0.4602514", "0.4602514" ]
0.48834252
38
currently only support top level key
function getEntityNameKeyMap(structure) { const result = {}; for (const kk in structure) { const vv = structure[kk]; if (typeof vv === 'string') { if (types.isMap(vv)) { const info = types.getTypeInfo(vv); const entityName = info.entity; if (_entityNameType[entityName]) throw new Error(`Duplicate entity ${entityName}`); _entityNameType[entityName] = vv; result[entityName] = kk; delete structure[kk]; } } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function key(kind, key) {\n \n}", "function KeyValue() {}", "function KeyValue() {}", "function KeyValue() {}", "keyForRelationship(key) {\n return key; \n }", "objectKeyHandler (key, parentObject, parentKey, parentObjectArrayBool, iterCt) {\n return '\"' + key.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"') + '\":';\n }", "getKeyDefinition(key) { // eslint-disable-line class-methods-use-this\n return {};\n }", "function KeyValue() { }", "function KeyValue() { }", "function KeyValue(){}", "static HasKey() {}", "get(key) {\n let node = this.root;\n let i = 0;\n let sameletters = 0;\n while (node && i < key.length) {\n node = node.getNode(key[i]);\n sameletters = 0;\n // need to go one letter at a time\n while (node && key.charAt(i) && node.label.charAt(sameletters) == key.charAt(i)) {\n i++;\n sameletters++;\n }\n }\n return node ? node.value.get(key.substring(i - sameletters)) : undefined;\n }", "get key () {return this._p.key;}", "getMinKey () {\n return this.getMinKeyDescendant().key\n }", "key() { }", "get key () {return this._p.key;}", "get key() {\n return key;\n }", "get key() {\n return key;\n }", "function base(mkey) { return Parse(mkey).key || null }", "findNodeByKey (key) {\n return Tree.findEntry2 (key, this.rootEntry);\n }", "key(item) {\n return item;\n }", "getPlantData(key, subkey){\n germination.data.getKey(key);\n if(this.dataExists && this.key){\n let hasValue = subkey in this.key;\n if(!hasValue) { alert('SubKey Not Found'); return; };\n var object = this.key[subkey];\n return object;\n }\n }", "getKey(arg) {\n return typeof arg === 'object'\n ? this.selectId(arg)\n : arg;\n }", "_getKeyBase(key) {\n return key.split('.').slice(0, 2).join('.');\n }", "getMaxKey () {\n return this.getMaxKeyDescendant().key\n }", "get key() {\n return itKey;\n }", "function _getKey(key, context) {\n\t // istanbul ignore next\n\n\t var _this = this;\n\n\t var node = this.node;\n\t var container = node[key];\n\n\t if (Array.isArray(container)) {\n\t // requested a container so give them all the paths\n\t return container.map(function (_, i) {\n\t return _index2[\"default\"].get({\n\t listKey: key,\n\t parentPath: _this,\n\t parent: node,\n\t container: container,\n\t key: i\n\t }).setContext(context);\n\t });\n\t } else {\n\t return _index2[\"default\"].get({\n\t parentPath: this,\n\t parent: node,\n\t container: node,\n\t key: key\n\t }).setContext(context);\n\t }\n\t}", "function _getKey(key, context) {\n\t // istanbul ignore next\n\n\t var _this = this;\n\n\t var node = this.node;\n\t var container = node[key];\n\n\t if (Array.isArray(container)) {\n\t // requested a container so give them all the paths\n\t return container.map(function (_, i) {\n\t return _index2[\"default\"].get({\n\t listKey: key,\n\t parentPath: _this,\n\t parent: node,\n\t container: container,\n\t key: i\n\t }).setContext(context);\n\t });\n\t } else {\n\t return _index2[\"default\"].get({\n\t parentPath: this,\n\t parent: node,\n\t container: node,\n\t key: key\n\t }).setContext(context);\n\t }\n\t}", "retrieve(key) {\n \n }", "function defaultKeyGetter(item) {\n return item;\n}", "function defaultKeyGetter(item) {\n return item;\n}", "function defaultKeyGetter(item) {\n return item;\n}", "function defaultKeyGetter(item) {\n return item;\n}", "function defaultKeyGetter(item) {\n return item;\n}", "function _getKey(key, context) {\n // istanbul ignore next\n\n var _this = this;\n\n var node = this.node;\n var container = node[key];\n\n if (Array.isArray(container)) {\n // requested a container so give them all the paths\n return container.map(function (_, i) {\n return _index2[\"default\"].get({\n listKey: key,\n parentPath: _this,\n parent: node,\n container: container,\n key: i\n }).setContext(context);\n });\n } else {\n return _index2[\"default\"].get({\n parentPath: this,\n parent: node,\n container: node,\n key: key\n }).setContext(context);\n }\n}", "keys(key) {\n return state[`keys.${key}`] || [];\n }", "keyVal(key) {\n let start = key.indexOf(\"[\");\n if (start >= 0) {\n return key.substring(0, start);\n }\n else {\n return key;\n }\n }", "function warningWithoutKey() {\n var treeData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var keys = new Map();\n\n function dig(list) {\n var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n (list || []).forEach(function (treeNode) {\n var key = treeNode.key,\n children = treeNode.children;\n warningOnce$1(key !== null && key !== undefined, \"Tree node must have a certain key: [\".concat(path).concat(key, \"]\"));\n var recordKey = String(key);\n warningOnce$1(!keys.has(recordKey) || key === null || key === undefined, \"Same 'key' exist in the Tree: \".concat(recordKey));\n keys.set(recordKey, true);\n dig(children, \"\".concat(path).concat(recordKey, \" > \"));\n });\n }\n\n dig(treeData);\n}", "get key()\n\t{\n\t\tvar priv = PRIVATE.get(this);\n\t\treturn priv.key;\n\t}", "function singleKey(map) {\n var id, counter = 0, ret;\n for(id in map) {\n if(map.hasOwnProperty(id)) {\n if( counter !== 0) {\n ret = undefined;\n break;\n }\n counter++;\n ret = id;\n }\n }\n\n return ret;\n }", "function getkey (key) {\n const parsedKey = Number(key)\n\n return (\n isNaN(parsedKey) ||\n key.indexOf('.') !== -1 ||\n opts.object\n ) ? key\n : parsedKey\n }", "inOrder(){\n //if a left key exists, set key.left as current key \n if(this.left){\n this.left.inOrder();\n }\n //console here because the current key is the left most key\n console.log(this.key);\n if(this.right){\n this.right.inOrder();\n }\n }", "async getContainerKey(key, keys, depth) {\n const keyUnaliased = await this.unaliasKeyword(key, keys, depth);\n return keyUnaliased === '@none' ? null : keyUnaliased;\n }", "get key() {\n return this._key;\n }", "get key() {\n return this._key;\n }", "get key() {\n return this._key;\n }", "get key() {\n return this._key;\n }", "getKeyNote(){\n return this.#rootKey;\n }", "_get(key) { return undefined; }", "allKeys() {\n return null;\n }", "function warningWithoutKey() {\n var treeData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var keys = new Map();\n\n function dig(list) {\n var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n (list || []).forEach(function (treeNode) {\n var key = treeNode.key,\n children = treeNode.children;\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_rc_util_es_warning__[\"a\" /* default */])(key !== null && key !== undefined, \"Tree node must have a certain key: [\".concat(path).concat(key, \"]\"));\n var recordKey = String(key);\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_rc_util_es_warning__[\"a\" /* default */])(!keys.has(recordKey) || key === null || key === undefined, \"Same 'key' exist in the Tree: \".concat(recordKey));\n keys.set(recordKey, true);\n dig(children, \"\".concat(path).concat(recordKey, \" > \"));\n });\n }\n\n dig(treeData);\n}", "addableKeysForPath(path) {\n const keys = this.nestedKeysMap[path];\n const schema = this.jsonSchemaService.forPathString(path);\n // || schema.items.properties is to handle the keys when the path belongs to table-list.\n const schemaProps = schema.properties || schema.items.properties;\n const schemaKeys = Set(Object.keys(schemaProps)\n .filter(key => !schemaProps[key].hidden));\n const addableKeys = schemaKeys.subtract(keys);\n return addableKeys.size > 0 ? addableKeys : undefined;\n }", "function find(key) {\n let parent = unioned[key];\n if (parent == null) return key;\n parent = find(parent);\n unioned[key] = parent; // Path compression\n return parent;\n }", "addableKeysForPath(path) {\n const keys = this.nestedKeysMap[path];\n const schema = this.jsonSchemaService.forPathString(path);\n // || schema.items.properties is to handle the keys when the path belongs to table-list.\n const schemaProps = schema.properties || schema.items.properties;\n const schemaKeys = Set$1(Object.keys(schemaProps)\n .filter(key => !schemaProps[key].hidden));\n const addableKeys = schemaKeys.subtract(keys);\n return addableKeys.size > 0 ? addableKeys : undefined;\n }", "function warnOnInvalidKey(child,knownKeys){{if(typeof child!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}warning(false,'Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.%s',key,getCurrentFiberStackAddendum$7());break;default:break;}}return knownKeys;}", "get(key) {\n let index = this.hash(key);\n if (this.keyMap[index]) {\n for (let i = 0; i < this.keyMap[index].length; i++) {\n if (this.keyMap[index][i][0] === key) {\n return this.keyMap[index][i][1];\n }\n }\n }\n return undefined;\n }", "get(key) {\n let index = this._hash(key);\n if (this.keyMap[index]) {\n for (let i = 0; i < this.keyMap[index].length; i++) {\n if (this.keyMap[index][i][0] === key) {\n return this.keyMap[index][i];\n }\n }\n return undefined;\n }\n }", "changeKey(node, newKey) {\n this._treapDelete(node);\n let goLeft = newKey < node.key;\n node.key = newKey;\n\n let parent = node.parent;\n\n // was previously root, so has no parent\n if (parent === NIL) {\n parent = this.root;\n } else {\n if (goLeft) {\n while (parent !== this.root && node.key < parent.key) {\n parent = parent.parent;\n }\n } else {\n while (parent !== this.root && node.key > parent.key) {\n parent = parent.parent;\n }\n }\n }\n // insert will take care of getting new parent\n this._treeInsert(parent, node);\n this._heapFixUp(node);\n }", "get key() {\n return this._key\n }", "function warnOnInvalidKey(child,knownKeys){{if(typeof child!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}error('Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.',key);break;}}return knownKeys;}", "function warnOnInvalidKey(child,knownKeys){{if(typeof child!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}error('Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.',key);break;}}return knownKeys;}", "item(key)\n\t{\n\t\tkey = this.toString(key);\n\t\tif (!super.has(key))\n\t\t{\n\t\t\t/*if (isBrowser()) throw new Runtime.Exceptions.KeyNotFound(key);*/\n\t\t\tvar _KeyNotFound = use(\"Runtime.Exceptions.KeyNotFound\");\n\t\t\tthrow new _KeyNotFound(key);\n\t\t}\n\t\tvar val = super.get(key);\n\t\tif (val === null || val == undefined) return null;\n\t\treturn val;\n\t}", "function getkey (key) {\n var parsedKey = Number(key)\n\n return (\n isNaN(parsedKey) ||\n key.indexOf('.') !== -1 ||\n opts.object\n ) ? key\n : parsedKey\n }", "function warningWithoutKey() {\n var treeData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var keys = new Map();\n\n function dig(list) {\n var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n (list || []).forEach(function (treeNode) {\n var key = treeNode.key,\n children = treeNode.children;\n Object(rc_util_es_warning__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(key !== null && key !== undefined, \"Tree node must have a certain key: [\".concat(path).concat(key, \"]\"));\n var recordKey = String(key);\n Object(rc_util_es_warning__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(!keys.has(recordKey) || key === null || key === undefined, \"Same 'key' exist in the Tree: \".concat(recordKey));\n keys.set(recordKey, true);\n dig(children, \"\".concat(path).concat(recordKey, \" > \"));\n });\n }\n\n dig(treeData);\n}", "function warnOnInvalidKey(child,knownKeys,returnFiber){{if(_typeof(child)!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child,returnFiber);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}error('Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.',key);break;}}return knownKeys;}", "function warnOnInvalidKey(child,knownKeys){{if(_typeof(child)!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}error('Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.',key);break;}}return knownKeys;}", "function keyParent(mkey) {\n var path = keyToPath(mkey)\n , pathLen = path.length\n return pathLen === 1 ? null : path[pathLen - 2]\n}", "_get(key) {\n throw Error(\"Needs implementation\");\n }", "function warnOnInvalidKey(child,knownKeys,returnFiber){{if(typeof child!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child,returnFiber);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}error('Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.',key);break;}}return knownKeys;}", "function getkey (key) {\n var parsedKey = Number(key);\n\n return (\n isNaN(parsedKey) ||\n key.indexOf('.') !== -1 ||\n opts.object\n ) ? key\n : parsedKey\n }", "function warnOnInvalidKey(child,knownKeys){{if(_typeof(child)!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}warning$1(false,'Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.',key);break;default:break;}}return knownKeys;}", "function warnOnInvalidKey(child,knownKeys){{if(typeof child!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}warning$1(false,'Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.',key);break;default:break;}}return knownKeys;}", "function warnOnInvalidKey(child,knownKeys){{if((typeof child==='undefined'?'undefined':_typeof(child))!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}warning(false,'Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.%s',key,getCurrentFiberStackAddendum$7());break;default:break;}}return knownKeys;}", "getKey() {\n return this.key;\n }", "key(kind, name) {\n if (kind instanceof StoreModel) {\n let arg = [];\n if (kind.parent) arg.push(kind.parent);\n arg.push(kind.code);\n if (name) arg.push(name); // acts as an ID\n return this[store].key(arg);\n }\n if (kind instanceof Array) {\n return this[store].key(kind);\n }\n return this[store].key([kind, name]);\n }", "exists(key) {\n let found = true;\n let current = this._root;\n\n key.split(\".\").forEach((name) => {\n if(current && found) {\n if(current.hasOwnProperty(name)) {\n current = current[name];\n } else {\n found = false;\n }\n }\n });\n\n return(found);\n }", "function warnOnInvalidKey(child,knownKeys){{if((typeof child==='undefined'?'undefined':_typeof(child))!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_CALL_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}warning(false,'Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.%s',key,getCurrentFiberStackAddendum$1());break;default:break;}}return knownKeys;}", "function warnOnInvalidKey(child,knownKeys){{if((typeof child==='undefined'?'undefined':_typeof(child))!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_CALL_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}warning(false,'Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.%s',key,getCurrentFiberStackAddendum$1());break;default:break;}}return knownKeys;}", "function warnOnInvalidKey(child,knownKeys){{if((typeof child==='undefined'?'undefined':_typeof(child))!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_CALL_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}warning(false,'Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.%s',key,getCurrentFiberStackAddendum$1());break;default:break;}}return knownKeys;}", "getKey (path: string): mixed | string {\n return _.at(this.translations[this.locale], path)[0]\n }", "function addKeyToResult(node, depth){\n result +=\n result.length === 0 ? node.key\n : `\\n${' '.repeat(depth * 2)}${node.key}`;\n }", "keyForRelationship(key, type) {\n return this.keyForAttribute(key, type);\n }", "function getMapKey(value) {\n\t return value;\n\t}", "function getMapKey(value) {\n\t return value;\n\t}", "function getMapKey(value) {\n\t return value;\n\t}", "function getMapKey(value) {\n\t return value;\n\t}", "getMeta(key) {\n return this.meta[typeof key == \"string\" ? key : key.key];\n }", "get(key)\n {\n return this.map.get(key);\n }", "function getMapKey(value) {\n return value;\n}", "function getMapKey(value) {\n return value;\n}", "function getMapKey(value) {\n return value;\n}", "function getMapKey(value) {\n return value;\n}", "function getMapKey(value) {\n return value;\n}", "function getMapKey(value) {\n return value;\n}", "function getMapKey(value) {\n return value;\n}", "function getMapKey(value) {\n return value;\n}", "function getMapKey(value) {\n return value;\n}", "function getMapKey(value) {\n return value;\n}", "get(key, alternative=undefined) {\n let value = undefined;\n\n if(this.exists(key)) {\n let current = this._root;\n\n key.split(\".\").forEach((name) => {\n current = current[name];\n });\n value = current;\n } else {\n value = alternative;\n }\n\n return(value);\n }", "keyForAttribute(key) { return key; }", "function findObjectFromKey(upperObject,key){\n //get appropriate object\n\n len = Object.keys(upperObject).length\n var sub = \"\";\n for (var i = 0; i < len; i++) {\n sub = Object.keys(upperObject)[i]\n if (upperObject[sub].hasOwnProperty(key)) {\n var foundObject = upperObject[sub];\n }\n }\n return foundObject;\n}" ]
[ "0.6686956", "0.6650407", "0.6650407", "0.6650407", "0.66025525", "0.6590592", "0.65578055", "0.6551147", "0.6551147", "0.65368414", "0.6532133", "0.65270114", "0.6304066", "0.6298267", "0.6246117", "0.62417805", "0.62204987", "0.62007815", "0.61880344", "0.6163346", "0.613765", "0.61070377", "0.6089017", "0.6089009", "0.6081098", "0.6059568", "0.605915", "0.605915", "0.60506743", "0.603398", "0.603398", "0.603398", "0.603398", "0.603398", "0.5999601", "0.59910285", "0.5954765", "0.59389406", "0.5930599", "0.5929408", "0.5927793", "0.59230876", "0.59115654", "0.59043705", "0.59043705", "0.59043705", "0.59043705", "0.5888216", "0.58838636", "0.58812904", "0.5879224", "0.58743143", "0.58695805", "0.5834734", "0.5833307", "0.5826985", "0.5818745", "0.5806261", "0.5799087", "0.57985497", "0.57985497", "0.5797363", "0.57966477", "0.5787966", "0.5787482", "0.57860106", "0.57802755", "0.5777479", "0.57771844", "0.57737225", "0.5772373", "0.5771911", "0.5753626", "0.5747088", "0.57405436", "0.5734237", "0.57291603", "0.57291603", "0.57291603", "0.5724698", "0.57211983", "0.5719491", "0.5713138", "0.5713138", "0.5713138", "0.5713138", "0.57086146", "0.5701863", "0.5689817", "0.5689817", "0.5689817", "0.5689817", "0.5689817", "0.5689817", "0.5689817", "0.5689817", "0.5689817", "0.5689817", "0.568363", "0.56828904", "0.56826955" ]
0.0
-1
Basic functionality of Hello World with $() and document.write
function helloWorld() { $(document).ready(function(){ document.write("Hello World"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hello(){\r\n document.write(\"Hello World\");\r\n}", "function culc(){\n\tdocument.write('Hello ');\n}", "function sayHI(name,age){\r\n \r\n document.write(\"<h1>hello \" +name+ \"</h1>\");\r\n document.write(\"<p> your age is \"+age+\"</p>\")\r\n\r\n //alert(\"hey\")\r\n \r\n }", "function printHello() {\n console.log( \"Hello, World!\");\n }", "function sayHello() {\n\tconsole.log(\"Hello\");\n}", "function printHello(){\n console.log( \"Hello, World!\");\n}", "function sayHello() {\n console.log('Hello world!');\n}", "static function main(args : string[]) :void {\n\t\tlog \"Hello, world!\";\n\t\tdom.\n\t}", "function helloWorld() {\n\tconsole.log('Hello, World!');\n}", "function sayHello() {\n console.log(\"Hello World!!\");\n}", "function sayHello() {\n console.log('hello world');\n}", "function go(){\n\tdocument.write(\"This is a dummy function\");\n}", "function helloWorld() {\n console.log('hello javascript'); \n console.log('I like ruby more'); \n}", "function printHello(){\n console.log(\"Hello World\");\n}", "function hello() {\r\n\tconsole.log(\"Hello World!\");\r\n}", "function sayhello(){\nconsole.log('Hello World!')\n}", "function hello(){\r\n\tconsole.log(\"Hello World\");\r\n}", "function display() {\n document.write(\"Hello, user!\");\n}", "function sayHello() {\n console.log('Welcome to Javascript City!');\n}", "function sayHello() {\n console.log(\"Hello\");\n}", "function sayHello() {\n console.log(\"Hello!\");\n}", "function sayHello() {\n console.log(\"Hello!\");\n}", "function sayHello() {\n console.log('Hello!');\n}", "function sayHelloInTheConsole() {\n console.log(\"Hey there!\\nThanks for checking my console.\\n\");\n }", "function hello() {\n\treturn \"Hello, world!\"\n}", "function sayHello() {\r\n console.log(\"Hello\")\r\n}", "function sayHello() {\n console.log( 'Hello there!' );\n}", "function hello() {\n console.log(\"Hello, World\");\n}", "function startup()\r\n{\r\n\tconsole.log(\"#include<stdio.h> \\n void main()\");\r\n}", "function sayHello() {\n console.log('Hello');\n}", "function helloWorld() {\n console.log('Hello, World!');\n}", "function helloWorld() {\n console.log('Hello, World!');\n}", "function sayHello() {\n\tvar greeting = \"Hello \" + name;\n\tconsole.log(greeting);\n}", "function sayHello() {\n console.log(\"Hello\");\n}", "function sayHello() {\n console.log(\"Hello\");\n}", "sayHello ()\n {\n // Creating an element.\n const helloElement = document.createElement( \"P\" );\n // Fill in the text of the element (using template literal.)\n helloElement.textContent = `Hello, my name is ${this.name}!`;\n // Add the new element to the body of our webpage.\n document.body.appendChild( helloElement );\n }", "function sayHello() {\n console.log(\"Hello\");\n }", "function ninja(){\n $('h1').text('jQuery Ninja');\n}", "function sayHello() {\n console.log('Hello');\n}", "function sayHello(){\n console.log(\"hello!\");\n }", "function sayHello() {\n console.log(\"Hi\");\n}", "function hello() {\n console.log('hello world');\n }", "function printHello(){\n console.log(\"Hello\");\n}", "function sayHello() {\n console.log('Hello, ' + name);\n }", "function helloWorld(){\n\talert(\"Hello World!\\nAlex is pretty awesome.\");\n}", "function hello() {\n console.log(\"Hello, world!\");\n}", "function saludar() {\n document.write('hola')\n}", "function hello()\n{\n console.log('Hello World!');\n}", "function greetings(){\n console.log('Selamat belajar Javascript!');\n}", "function helloWorld() {\n console.log(\"Hello world!\");\n}", "function helloWorld() {\n console.log('Hello world!');\n}", "function sayHello() {\n console.log(\"Oh, Hello!\");\n}", "function sayHello (){\n console.log(\"hello\");\n}", "function sayHello() {\n console.log(\"Hi\");\n}", "function sayHello() {\n alert(\"Hello World!\");\n }", "function sayHello() {\n console.log('sayHello');\n}", "function sayHello(){\n console.log('hello');\n}", "function sayHello() {\n return \"Hello World !\";\n}", "function Greeting(f_name, l_name){\r\n document.write(\"Hello \"+f_name+\" \"+l_name);\r\n}", "function hello_world() {\n alert('hello world!')\n}", "function sayHi() {\n console.log(\"Hello\");\n}", "function sayHelloo() {\n alert(\"Hello World!\");\n}", "function introduction() {\n\tconsole.log(\"Welcome to Coding at Philz! Let's get started! \\n . \\n . \\n\");\n\tconsole.log(\"You are going to have to blend in! Let's hit your closet! \\n . \\n . \\n\")\t\n}", "function SayHello1(){\n console.log(\"hello world\");\n}", "function sayHello (){\n console.log('hello!');\n}", "function sayHello() {\n return \"Hello World!\";\n}", "function hello() {\n console.log('Hello world!')\n}", "function woo() { // This is the function declaration\n console.log('Wooooooo!!!!');\n alert('Wooooooo!!!!');\n document.write('Wooooooo!!!!');\n}", "function sayHello () {\n return \"Hello World!\";\n}", "function sayHello() {\n\talert('Hello World!');\n}", "function welcome() {\n console.log('Oh, Hello!');\n}", "function sayHello() {\r\n console.log(\"hello 1\");\r\n}", "function simpleGreeting() {\n console.log(\"Hello Betty\");\n}", "function greet(){\n\tconsole.log(\"Hello\");\n}", "function boom () {\n\talert(\"Boom!\");\n\tdocument.write(\"<h1>BOOM! Elegiste un area minada :D</h1>\");\n}", "function sayHi(){\n console.log('Hello');\n}", "function sayHello() {\n console.log('hello world .. this is my first function');\n}", "function helloWorld () {\n return \"Hello World\";\n}", "function sayHello(){\n return \"Hello World\"\n}", "function sayHello() {\n console.log(\"Hello\");\n\nconsole.log(sayHello());\n\n//needs a return, have a fnct is a preferred method that helps build big and prevents console from being written into the script\n\nreturn \"Hello\";\n}", "function sayHello() {\n alert('Hello World')\n}", "function printGreeting() {\n console.log(\"Oh, Hello!\");\n}", "function helloWorld() {\n return \"Hello World\";\n}", "function sayHi() {\n console.log('>> Hi')\n }", "function print() { console.log('Hello') }", "function sayHello () {\n console.log('hello');\n console.log('bye');\n}", "helloWorld () {\n console.log('hello world!')\n }", "function sayHello() {\n alert('Hello World!');\n}", "function greeting(){\n\tconsole.log(\"hello\");\n}", "function sayHello() {\n alert(\"Hello World!\");\n}", "function sayHello() {\n alert(\"Hello World!\");\n}", "function sayHello() {\n alert(\"Hello World!\");\n}", "function sayHello() {\n alert(\"Hello World\")\n}", "function ninja() {\n $('header h1').text('jQuery Ninja');\n }", "function sayHello() {}", "function sayHello() {\n alert(\"hello world\");\n}", "function sayHello(){\n alert(\"Hello World!\");\n}", "function helloWorld() {\n console.log('hello');\n}", "function helloWord() {\n console.log(\"hello\");\n}", "function hello() {\n console.log(\"hello world\");\n}" ]
[ "0.71509796", "0.6629475", "0.6383549", "0.62653023", "0.6218541", "0.6203375", "0.618212", "0.6179108", "0.61544067", "0.61503655", "0.6132916", "0.6129117", "0.61261255", "0.6088325", "0.60653365", "0.6028343", "0.60170573", "0.6006924", "0.59887403", "0.59865564", "0.5968378", "0.5968378", "0.5962959", "0.5952817", "0.59492517", "0.59464", "0.5945723", "0.59416926", "0.59387743", "0.59375274", "0.5928258", "0.5928258", "0.5927931", "0.5927496", "0.5927496", "0.5924397", "0.5922134", "0.5922017", "0.5921544", "0.59052855", "0.58864146", "0.58745074", "0.5857594", "0.5854901", "0.5853821", "0.5850778", "0.5848718", "0.58438367", "0.58434963", "0.58426046", "0.5841672", "0.58380604", "0.58341026", "0.58337367", "0.5833009", "0.58258414", "0.5814419", "0.5807035", "0.580679", "0.5793104", "0.5784814", "0.57765", "0.57715285", "0.57676804", "0.57660145", "0.57625324", "0.5753549", "0.5750665", "0.57499707", "0.57403785", "0.57393914", "0.5738497", "0.57345843", "0.57332003", "0.57288635", "0.57232606", "0.5719725", "0.5709789", "0.57084745", "0.57043386", "0.5703655", "0.57020545", "0.56983125", "0.5697292", "0.5695575", "0.56924623", "0.5690717", "0.56832415", "0.56817037", "0.5678051", "0.5678051", "0.5678051", "0.5677183", "0.56767553", "0.5667576", "0.56673837", "0.56584287", "0.56571996", "0.56545824", "0.56521726" ]
0.77814704
0
Alert window by clicking on the hyperlink
function alertClick() { $(document).ready(function() { $("a").click(function(event) { alert("JQUERY Site"); event.preventDefault(); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onClickUrl(urlLink) {\n //Alert.alert(\"clicked\");\n Linking.openURL(\"http://\"+urlLink);\n \n }", "function AlertTest()\n{\n Log.AppendFolder(\"Alert Test\");\n let page = Aliases.browser.Page;\n page.panelPage.panelDialogbox.link.Click();\n page.Alert.buttonOk.ClickButton();\n page.Wait();\n Log.PopLogFolder();\n}", "function display(){\n alert(\"I am a link!!\")\n}", "function onLinkClick(thewebsite)\n{\n if (networkstatus !== \"online\") {\n alert(\"Error: You are offline. Try again when you have a network connection.\");\n }\n else {\n var website = thewebsite;\n var win=window.open(website, '_blank');\n win.focus();\n return false;\n }\n}", "function displayMessage() {\n window.alert(\"I have been clicked\");\n}", "function clickme(){\n //the message in the pop up\n\t\talert('Hey, you clicked me!');\n\t}", "function opdrachtalertprompt()\n{\n //element id=\"alertinput\".\n //voor verduidelijking zie w3school link \"alerts\".\n\n\n\n}", "function callAlert(text, web) {\n if (web !== null) {\n alertify.alert(text[0], text[1]).set('label', 'OK');\n location.href = web;\n } else {\n alertify.alert(text[0], text[1]).set('label', 'OK');\n }\n\n}", "function openlink(upperCase){\n clickAnchor(upperCase,getItem(\"link\"));\n}", "function openAlert() {\n alert(\"Hello World\");\n}", "function confirmar_individual(mensaje,$link){\n var mensaje_final = \"<div style='padding: 20px;'><b style='color: #004040;font-size: medium;'>\"+mensaje+\"</b></div>\";\n\talertify.confirm(mensaje_final, function (e) {\n\t\tif (e) {\n location.href = $link;\n\t\t} else { \n alertify.error(\"Operaci&oacute;n cancelada\");\n \t} \n\t});\t \n}", "function $Alert(strMessage, strSize, strPopupId, strWindowType, strTitle)\n{\n\tVixen.Popup.Alert(strMessage, strSize, strPopupId, strWindowType, strTitle);\n}", "function pop_up(hyperlink, window_name){\n if (!window.focus) {\n return true;\n }\n var href = (typeof(hyperlink) == 'string' ? hyperlink : hyperlink.href);\n window.open(href, window_name, 'width=800,height=800,toolbar=no, scrollbars=yes');\n return false;\n}", "function clickTmb(e, title, text) {\n\te.preventDefault();\n\tconst href = e.target.href;\n\tSwal.fire({\n\t\ttitle,\n\t\ttext,\n\t\ticon: \"warning\",\n\t\tshowCancelButton: true,\n\t\tconfirmButtonColor: \"#3085d6\",\n\t\tcancelButtonColor: \"#d33\",\n\t\tcancelButtonText: \"No\",\n\t\tconfirmButtonText: \"Yes\",\n\t}).then((result) => {\n\t\tif (result.value) {\n\t\t\tdocument.location.href = href;\n\t\t}\n\t});\n}", "function clickme(){\r\n\r\n\t//message(alert) that will populate\r\n\talert('Hey, you clicked me!');\r\n\t}", "function showSceneLink() {\r\n var sceneLink = generateLink();\r\n CitydbUtil.showAlertWindow(\"OK\", \"Scene Link\", '<a href=\"' + sceneLink + '\" style=\"color:#c0c0c0\" target=\"_blank\">' + sceneLink + '</a>');\r\n}", "function genericOnClick(info, tab) {\n /*\n console.log(\"item \" + info.menuItemId + \" was clicked\");\n console.log(\"info: \" + JSON.stringify(info));\n console.log(\"tab: \" + JSON.stringify(tab));\n */\n var url = 'http://imzker.com/' + info.linkUrl.split(\"://\")[1];\n window.open(url);\n}", "function clickAlert() {\n alert(\"hello world\")\n}", "function popup(){\n window.alert(\"Thank you for your purchase!\")\n}", "function checkAlert() \n{ \n if (caboAlert.opened && caboAlert.win) \n { \n caboAlert.win.focus() \n }\n}", "function new_check_link (e, url) {\r\n var a = document.createElement('a');\r\n a.title = url || e.href;\r\n a.href= 'javascript:;';\r\n a.style.fontWeight = \"bold\";\r\n a.style.fontSize = \"small\";\r\n a.style.textDecoration = \"none\";\r\n a.appendChild(document.createTextNode('[C]'));\r\n a.addEventListener(\"click\", click, true);\r\n e.parentNode.insertBefore(a, e.nextSibling);\r\n}", "function openLinkNewWindow(link) {\n if (link.length) {\n link.click(function() {\n openWin(link.attr('href'));\n return false;\n });\n }\n}", "function showLink(value){\n\t\t\tif(value == 'ok'){\n\t\t\t\tif(KCI.util.Config.getHybrid() == true){\n\t\t\t\t\tif(KCI.app.getApplication().getController('Hybrid').cordovaCheck() == true){\n\t\t\t\t\t\t//hybrid childbrowser function\n\t\t\t\t\t\tKCI.app.getApplication().getController('Hybrid').doShowLink(button.getUrl());\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Google Analytics Tracking\n\t\t\t\t\t\tKCI.app.getApplication().getController('Hybrid').doTrackEvent('Link','View',button.getText());\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tKCI.app.getApplication().getController('Main').doShowExternal(button.getUrl());\n\t\t\t\t\t\n\t\t\t\t\t//Google Analytics Tracking\n\t\t\t\t\tKCI.app.getApplication().getController('Main').doTrackEvent('Link','View',button.getText());\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}", "function gradCertiClick(certi){\r\n\tconsole.log(certi);\r\n\t/*open appropriate link based on clicked certificate*/\r\n\tif(certi.textContent == \"Web Development Advanced certificate\"){\r\n\t\twindow.open(\"http://www.rit.edu/programs/web-development-adv-cert\");\r\n\t}else{\r\n\t\twindow.open(\"http://www.rit.edu/programs/networking-planning-and-design-adv-cert\");\r\n\t}\r\n}", "function dialogAlerter(){\n //Method to Open a Alertbox\nnavigator.notification.alert(\"This is an Alert box created using Notification Plugin\",alertExit,\"Alert Dialog\",\"Understood\");\n}", "function openLink(url, message)\n{\n if( typeof message === 'undefined' ) message = 'Opening link';\n\n var htmlString = '<script>window.open(\"'+url+'\");google.script.host.close();</script>';\n var htmlOutput = HtmlService.createHtmlOutput(htmlString).setSandboxMode(HtmlService.SandboxMode.IFRAME).setHeight(96);\n SpreadsheetApp.getUi().showModalDialog(htmlOutput, message); \n}", "function openLinkDialog() {\n const node = tinymce.activeEditor.selection.getNode();\n const href = node.getAttribute('href');\n\n if (href) {\n editor.execCommand(TinyMCEActionRegistrar.getEditorCommandFromUrl(href));\n }\n }", "function jsLinkClicked() {\n const url = this.getAttribute('data-linkto');\n window.open(url, '_blank');\n }", "function alertbox() {\n window.alert(\"Due to Covid-19 Restrictions, we only do deliveries within Nairobi at a fixed charge of 200Kshs.\");\n}", "function popup(){\r\n\talert(\"You opened a popup!\")\r\n\t}", "function clickAnchor(upperCase,anchor){\n if (\"href\" in anchor){\n if (upperCase)\n GM_openInTab(anchor.href);\n else\n window.location = anchor.href;\n }\n}", "function LPshowAAwindow(){\r\n if (LPCLOSE) window.open(\"https://sec1.liveperson.net/hc/\"+ lpNumber +\"/cmd/url/?site=\"+ lpNumber +\"&page=https://www.bofa.com?query=\"+LPlobApp+\"-xout-display\",\"LP\",\"location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=no,width=\"+LPpopUpWidth+\",height=\"+LPpopUpHeight);\r\n}", "function clickme(){\n\t\t//pop up with a message when the table is clicked\n\t\talert('Hey, you clicked me!');\n\t}", "function bsAlert(){return _callWithEmphasis(this, oj.div, 'alert', 'info', arguments)}", "function leave_alert(the_url) {\nvar the_path = the_url;\nvar the_confirm = \"You are about to leave the Union Planters website.\";\nthe_confirm += \"Any information, disclosures, or privacy statements \";\nthe_confirm += \"outside the Union Planters Web site are not the \";\nthe_confirm += \"responsibility of Union Planters.\\n\\n\";\nthe_confirm += \"If you wish to continue click the [OK] button, if not click the [Cancel] button.\";\n\nif (confirm(the_confirm))\t{\nwindow.open(the_path, 'new_window', config='height=400,width=600,toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,location=yes,directories=yes,status=yes,left=50,top=150');}\nelse { }}", "function setOnClickHandler(foundSecrets, prurl) {\r\n\r\n if (onLinkClickHasBeenSet)\r\n return;\r\n\r\n $(document).on('click', '.secretwarden-overview-link .label', function (e) {\r\n e.preventDefault();\r\n\r\n if (foundSecrets.length > 0)\r\n var dialog = AJS.dialog2($(com.cyanoth.secretwarden.overviewDialog({foundSecrets: foundSecrets, prurl: prurl})));\r\n else\r\n var dialog = AJS.dialog2($(com.cyanoth.secretwarden.noSecretsDialog()));\r\n\r\n dialog.show();\r\n });\r\n\r\n onLinkClickHasBeenSet = true;\r\n }", "function alert(browserWindow, message) {\n return __awaiter(this, void 0, void 0, function* () {\n // hello github 😇\n if (/for +security +reasons, +framing +is +not +allowed/i.test(message)) {\n return;\n }\n // build the dialog\n const dialog = yield Dialog_1.default.create();\n dialog.setTitle(`'${browserWindow.getHistory().getCurrent().uri}' says:`);\n dialog.setContentAsText(message || '');\n // dialog button\n yield addCloseButtonToDialog(dialog, 'OK');\n // render and open\n browserWindow.renderDialog(dialog);\n yield dialog.open();\n });\n}", "measurementClicked (){\n this.measurement.addEventListener('click',()=>{\n window.open(\"././links/measurement/measurement.htm\");\n },false);\n }", "function showAlert(title,message,redirect) {\n\tconsole.log(\"show alert (title,message,redirect)\");\n navigator.notification.alert(\n message, // message\n alertDismissed(redirect), // callback\n title, // title\n 'OK' // buttonName\n );\n}", "function clickAngry() {\n window.open(\"madboutu.html\", \"_self\");\n}", "function clickme(){\r\n\t\t// this function includes an alert, or a pop-up box with the following text when the function is called.\r\n\t\talert('Hey, you clicked me!');\r\n\t}", "function handleLinkClick(event) {\n\t\tvar linkLabel = event.currentTarget.id;\n\t\tvar url;\n\t\tswitch(linkLabel) {\n\t\t\tcase 'pivotal' :\n\t\t\t\turl = \"http://www.gopivotal.com/\";\n\t\t\t\twindow.open(url, '_blank');\n\t\t\t\tbreak;\n\t\t\tcase 'support' :\n\t\t\t\turl = \"https://support.gopivotal.com/hc/en-us\";\n\t\t\t\twindow.open(url, '_blank');\n\t\t\t\tbreak;\n\t\t\tcase 'feedback' :\n\t\t\t\turl = \"http://www.gopivotal.com/contact\";\n\t\t\t\twindow.open(url, '_blank');\n\t\t\t\tbreak;\n\t\t\tcase 'help' :\n\t\t\t\turl = \"../../static/docs/gpdb_only/index.html\";\n\t\t\t\twindow.open(url, '_blank');\n\t\t\t\tbreak;\n\t\t\tcase 'logout' :\n\t\t\t\tlogoutClick();\n\t\t\t\tbreak;\n\t\t}\n\t}", "function showAlert(message, alerttype, target) {\n\n showAlertWithSelector(message, alerttype, '#'+target);\n}", "function trackShatnerBoxClick(result) {\n var s = s_gi(s_account);\n var txt = 'ShatnerBoxClick_' + result;\n s.trackExternalLinks = false;\n s.linkTrackVars = 'prop6,eVar6';\n s.tl(this, 'o', txt);\n}", "function verCAlemana(){\n\tvar WindowObjectReference = window.open(\"https://www.facebook.com/Clinicaalemanadesantiago/\", \"clinica_alemana\", \"menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes\");\n}", "function alertBuyClick() {\n alert('Вы хотите купить ' + listFish[i].innerText + ' ?');\n }", "function linkHandler(evt) {\n if( confirm('Ok to stay on this page, Cancel to leave and go to nait') ) {\n //preventDefault stops the normal operation of the href.\n evt.preventDefault();\n \n } \n}", "function clickme(){\n\n\t\talert('Hey, you clicked me!');\n\t}", "async _navigateToJavascriptAlerts(){\n\t\tawait t\n\t\t.click(javascriptAlertsLink)\n\t\t.expect(getPageURL()).contains('javascript_alerts', {timeout:10000});\n\t}", "showHyperlinkDialog() {\n if (this.hyperlinkDialogModule && !this.isReadOnlyMode && this.viewer) {\n this.hyperlinkDialogModule.show();\n }\n }", "function onClick(link){\n \n}", "function handleClickedLink( url, view ) {\n\t// return true if the link was handled or to prevent other plugins or Colloquy from handling it\n\treturn false;\n}", "function handleHowExternalLinksOpen() {\n document.onclick = function (e) {\n e = e || window.event;\n var element = e.target || e.srcElement;\n var parentElements = document.getElementsByClassName('pane');\n for (var x = 0; x < parentElements.length; x++) {\n var parentElement = parentElements[x];\n\n if (element.tagName === 'A' && parentElement.contains(element)) {\n if (element.href.indexOf('http://') === 0 || element.href.indexOf('https://') === 0) {\n\n $log.info('Link is not internal. Opening in system browser.', element.href);\n window.open(element.href, \"_system\", \"location=yes\");\n }\n return false;\n\n }\n }\n }\n }", "function bsCnfHref(inpHref, msg) {\n var funcYes = function() {\n window.location.assign(inpHref.href);\n document.getElementById('dlgCnf').close();\n };\n bsShwCnf(msg, funcYes);\n}", "async open_link(name){\n await element(by.linkText(name)).click()\n\n }", "function showAlertMessage(mensaje) {\r\n\talert (mensaje);\r\n}", "function manuallinkClickIO(href,linkname,modal){\n\tif(modal){\n\t\tcmCreateManualLinkClickTag(href,linkname,modal_variables.CurrentURL);\n\t}else{\n\t\tcmCreateManualLinkClickTag(href,linkname,page_variables.CurrentURL);\n\t}\n}", "function showAlertBox\n(\n title,\n content,\n link\n)\n{ \n $('#alertBoxModal').modal('hide');\n $('#alertBox').html(loadContent(title,content,link));\n $('#alertBoxModal').modal({\n keyboard:true,\n backdrop: 'static',\n show:true\n });\n $('#alertBoxModal').css({'z-index':'99999',\n 'cursor':'pointer',\n 'marginTop' : '15%'});\n}", "function displayAlert(title, message){\n Alert.alert(title,message);\n}", "function onClick( event ) {\n for( var i = 0; i < _buttons.length; i++ ) {\n var button = _buttons[i];\n \n if( button.contains( event.layerX, event.layerY ) ) {\n actionPerformed( button.getActionCommand() );\n return;\n }\n }\n \n if( event.which == 1 ) {\n location.href = linkHref;\n }\n }", "function confirmLinkAction() {\r\n\t\t\t$('.reqconf').click(function(e) {\r\n\t\t\t\tPetolio.showConfirm($(e.currentTarget).attr('title'), function() {\r\n\t\t\t\t\tPetolio.go($(e.currentTarget).attr('href'));\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t});\r\n\t\t}", "function viewPoll() {\n $(\"#poll\").on(\"click\", function () {\n window.open(\"https://www.strawpoll.me/44308387\");\n });\n}", "function onGameCompletion() {\n //Clicks the anchor tag which displays the pop up\n const popUpLink = document.querySelector('.anchor');\n popUpLink.click();\n}", "function helpPopup(anchor) {\r\n\twindow.open(app_path_webroot_full+'index.php?action=help'+(anchor == null ? '' : '#'+anchor),'myWin','width=850, height=600, toolbar=0, menubar=0, location=0, status=0, scrollbars=1, resizable=1');\r\n}", "function clickHappy() {\n window.open(\"serotonine.html\", \"_self\");\n}", "function show_window_alerts(){\r\n\thide_alert();\r\n\tconst url = new URL(window.location.href);\r\n\tif ( url.searchParams.get(\"alert\") ){\r\n\t\tlet msg ='';\r\n\r\n\t\tswitch( url.searchParams.get(\"alert\") ){\r\n\t\t\tcase '0':\r\n\t\t\t\tmsg = \"הרשומה נוספה בהצלחה! מספר מזהה: \"+url.searchParams.get(\"id\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase '1':\r\n\t\t\t\tmsg = \"הפרטים עודכנו בהצלחה!\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '2':\r\n\t\t\t\tmsg = \"תלמיד מס' \"+url.searchParams.get(\"id\") +\"נמחק בהצלחה!\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '3':\r\n\t\t\t\tmsg = \"לא ניתן למחוק !\" +url.searchParams.get(\"err\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase '4':\r\n\t\t\t\tmsg = url.searchParams.get(\"err\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase '5':\r\n\t\t\t\tmsg = \"משתמש לא קיים!\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tshow_alert( msg );\r\n\t};\r\n}", "function handlelinkClick(e) {\n e.preventDefault();\n var copyText = window.location.href;\n\n document.addEventListener('copy', function (e) {\n e.clipboardData.setData('text/plain', copyText);\n e.preventDefault();\n }, true);\n\n document.execCommand('copy');\n alert('copied text: ' + copyText);\n }", "function showPopup() {\n alert('buy me');\n}", "onHelpClick() {\n Linking.openURL(helpURL);\n }", "function onClickTextEjercise6() {\n document\n .querySelector(\"#btn-alert\")\n .addEventListener(\"click\", () => alert(\"Hello world\"));\n}", "function ExtLinkClickThru(ext_id,openNewWin,url,form) {\r\n\t$.post(app_path_webroot+'ExternalLinks/clickthru_logging_ajax.php?pid='+pid, { url: url, ext_id: ext_id }, function(data){\t\t\r\n\t\tif (data != '1') {\r\n\t\t\talert(woops);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (!openNewWin) {\r\n\t\t\tif (form != '') {\r\n\t\t\t\t// Adv Link: Submit the form\r\n\t\t\t\t$('#'+form).submit();\r\n\t\t\t} else {\r\n\t\t\t\t// Simple Link: If not opening a new window, then redirect the current page\r\n\t\t\t\twindow.location.href = url;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}", "function clickWatcher(event) {\n var is_exist = $.contains(document, that.$wrapper[0]);\n if (is_exist) {\n var is_redirect = (this.href.indexOf(that.urls[\"backend_url\"]) >= 0);\n if (is_redirect && that.is_changed) {\n event.preventDefault();\n event.stopPropagation();\n var $link = $(this);\n showConfirm().then(function() {\n off();\n $link[0].click();\n });\n }\n } else {\n off();\n }\n }", "function clickSad() {\n window.open(\"feelinblue.html\", \"_self\");\n}", "function onExternalLinkClicked(link){\r\n //we are forcing all links in our docviewer to open in a new window.\r\n window.open(link);\r\n}", "function confirmDlg(msg, addr){\r\n\tif (confirm(msg)){\r\n\t\tgotoUrl(addr);\r\n\t}\r\n}", "function createAlert() {\n\tvar local_current_hash = 0;\n\n\tif ((local_current_hash = save_search()) != false) {\n\t\t// activation de l'alerte\n\t\tswitch_alert_from_search('', local_current_hash);\n\t\t$('#popupCreateAlert').popup('open');\n\t}\n\telse {\n\t\t$('#popupAlreadyExistsAlert').popup('open');\n\t}\n}", "function PopupWindowButtonClicked(popupLink) {\r\n popupWindow = window.open(popupLink, 'PopupWindow', 'scrollbars=yes,menubar=no,height=600,width=845,resizable=yes,toolbar=no,location=no,status=no,dependent=yes,replace=yes');\r\n popupWindow.focus();\r\n}", "function clickOnSubjectLink(subjLink, popup, dlg) {\n\n subjLink.on('click', function() {\n \n //make sure pop up closed\n popup.dialog(\"close\");\n \n //open the dialog\n dlg.dialog('open');\n \n //dialog background color based on assignment completeion\n if (dlg.hasClass(\"completed\")) {\n dlg.parent(\".ui-dialog\").css(\"background-color\", \"#7ECEFD\");\n }\n else {\n dlg.parent(\".ui-dialog\").css(\"background-color\", \"#FF7F66\");\n }\n });\n\n}", "function alert() {\r\n var a, msg, onClose, autoClose, i;\r\n\r\n // Process variable number of arguments.\r\n for (i = 0; i < arguments.length; i++) {\r\n a = arguments[i];\r\n if (typeof a === \"string\") {\r\n msg = a;\r\n } else if (typeof a === \"function\") {\r\n onClose = a;\r\n } else if (typeof a === \"number\") {\r\n autoClose = a;\r\n }\r\n }\r\n\r\n function onOpen(dialogEl) {\r\n // Add the alert message to the alert dialog. If wider than 320 pixels change new lines to <br>.\r\n dialogEl.focus().find(\".msg\").html(msg.replace(/\\n/g, (document.body.offsetWidth > 320 ? \"<br>\" : \" \")));\r\n checkEnter(\"alert\");\r\n }\r\n\r\n return open(\"alert\", onOpen, onClose, autoClose);\r\n }", "async amOnPageWithAlert(url) {\n\tlet browser = this.helpers ['WebDriverIO'];\n\tbrowser.amOnPage(url);\n\t}", "function showAlert() {\n alert (\"Hello world!\");\n }", "function clickLinkToGoToOtherPage(linkURL){\n //$('a[name=\" + linkName + \"]').click();\n window.location.href = linkURL;\n console.log('Link name is ', linkURL);\n console.log(\"Link cliked\");\n } // end callback;", "function alert(msg) {\n Components.classes[\"@mozilla.org/embedcomp/prompt-service;1\"]\n .getService(Components.interfaces.nsIPromptService)\n .alert(null, \"Webmonkey alert\", msg);\n}", "function showMessageRedirect(title,text,type,url){\n swal({\n title: title,\n text: text,\n type: type\n }).then(\n function () {\n window.location.href = url\n }\n )\n}", "click() {\n this._super(...arguments);\n window.open(this.get('href'), this.get('target') || '_self');\n return true;\n }", "function lb_alert(type, message) {\n bs_alert(\".featherlight .alert-box\", type, message)\n}", "function clickHandler(event) {\n \tconsole.log('event');\n \ttau.openPopup(popup);\n }", "imageClick(e) {\n e.preventDefault();\n\n if (this.item.link) {\n window.open(this.item.link, '_blank');\n } else {\n this.shadowRoot.querySelector('#image-dialog').open();\n\n HhAnalytics.trackDialogOpen(this.item.internalTitle);\n }\n }", "function simpleAlert(data){\n\t\t\tvar app = new Alert();\n\t\t\tif(!app.exist()){\n\t\t\t\tif(app.checkObj(data)){\n\t\t\t\t\tapp.load(data);\n\t\t\t\t\tapp.show();\n\t\t\t\t}else{\n\t\t\t\t\tconsole.log(\"Aconteceu algo :/\");\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tapp.close();\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\tif(app.checkObj(data)){\n\t\t\t\t\t\tapp.load(data);\n\t\t\t\t\t\tapp.show();\n\t\t\t\t\t}else{\n\t\t\t\t\t\tconsole.log(\"Aconteceu algo :/\");\n\t\t\t\t\t}\n\t\t\t\t},500);\n\t\t\t}\n\t\t}", "function esignExplainLink() {\r\n\t$.get(app_path_webroot+'Locking/esignature_explanation_popup.php', { }, function(data) {\r\n\t\tif (!$('#esignExplain').length) $('body').append('<div id=\"esignExplain\"></div>');\r\n\t\t$('#esignExplain').dialog('destroy');\r\n\t\t$('#esignExplain').html(data);\r\n\t\t$('#esignExplain').dialog({ bgiframe: true, title: 'What is an E-signature?', modal: true, width: 650, buttons: { Close: function() { $(this).dialog('close'); } } });\r\n\t});\r\n}", "function showMessage() {\r\n\r\n alert('APASA ESCAPE CA SA AFISEZI COMENTARIILE!');\r\n}", "function onClick(urlName){\n window.open(\n urlName,\n '_blank' //open in a new window.\n );\n \n}", "function goToWindow(link) {\n\nvar openWindow = window.open (link,\"Window\",\n\"width=700,height=440,toolbar=no,location=no,top=110,left=110,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes\");\nopenWindow.focus();\n}", "@api\n click() {\n const anchor = this.emailAnchor;\n if (anchor && anchor.click) {\n anchor.click();\n }\n }", "function popupHello() {\n alert(\"Hello \" + name); // add popupHello (); and for the browser to keep saying Hello Aslan\n}", "techniquesClicked (){\n this.techniques.addEventListener('click',()=>{\n window.open(\"././links/advance_techniques/techniques.htm\");\n },false);\n }", "function issue_called(text_for_alert){\n window.alert(text_for_alert);\n}", "function message(e) {\n\talert(\"You clicked me!\");\n}", "function popup(mylink, windowname, wid, ht)\n{\n\tif (! window.focus)return true;\n\tvar href;\n\tif (typeof(mylink) == 'string')\n\t\thref=mylink;\n\telse\n\t\thref=mylink.href;\n\targs = 'width=' + wid + ',height=' + ht + ',scrollbars=yes';\n\t// window.open(href, windowname, args);\n\twindow.open(href, '', args);\t// IE objects to a window name\n\treturn false;\n}", "function modalAlerts ($linkClicked, $modalToOpen) {\n $($linkClicked).on('click', function (e) {\n $($modalToOpen).modal('show')\n $(this).tooltip('hide')\n })\n }" ]
[ "0.7032143", "0.6783112", "0.6727856", "0.6571755", "0.65607226", "0.6511448", "0.64708066", "0.6244133", "0.62377304", "0.6230574", "0.6218623", "0.61951745", "0.6173466", "0.6168209", "0.61591595", "0.6146868", "0.6139022", "0.6132043", "0.6111123", "0.6094102", "0.60659444", "0.6029155", "0.6019402", "0.60174185", "0.6006496", "0.6006058", "0.5963045", "0.5943719", "0.59401643", "0.5913569", "0.5912896", "0.58983946", "0.5897943", "0.5897545", "0.5896885", "0.5894845", "0.58940303", "0.5892194", "0.5891234", "0.588868", "0.58848697", "0.5878905", "0.586962", "0.58668417", "0.58666956", "0.5855741", "0.585096", "0.584667", "0.5845971", "0.58272797", "0.58237696", "0.5822064", "0.58204895", "0.58062905", "0.58058107", "0.58037597", "0.5800933", "0.57881826", "0.5786745", "0.5780194", "0.5774455", "0.57726765", "0.5769", "0.5762386", "0.57620656", "0.5761505", "0.57589006", "0.5756632", "0.57532316", "0.57448405", "0.57362926", "0.5727509", "0.57223797", "0.5722144", "0.5720917", "0.5706578", "0.56972617", "0.5691861", "0.56913346", "0.56877154", "0.568738", "0.56826925", "0.5678491", "0.56759274", "0.5659671", "0.5652267", "0.56515473", "0.5645888", "0.5644663", "0.5638149", "0.56341094", "0.56334364", "0.5631162", "0.56306446", "0.5628928", "0.562589", "0.56243026", "0.56141", "0.56118447", "0.560609" ]
0.6225441
10
to verify the functionality of .hide()
function hideMethod() { $(function() { $("a").show(); $("a").click(function(event) { event.preventDefault(); $("a").hide("slow"); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hide() {}", "function displayMonitorError(){\r\n\t$(\".hide\").removeClass(\"hide\");\r\n}", "function xHide(e){return xVisibility(e,0);}", "function hideFailMessage() {\n $('#failMsg').hide();\n}", "afterHidden() {}", "hide() {\n var event = this.fireBeforeEvent_();\n if (!event.defaultPrevented) {\n this.element_.classList.remove(this.cssClasses_.VISIBLE);\n this.fireAfterEvent_();\n }\n }", "onHide() {}", "onHide() {}", "function inmueble_cerrarPopUp2(){\n\t$(\"#mascaraPrincipalNivel2\").hide();\n\t$(\"#inmueble_obtenerCoordenadas\").hide();\n\t$(\"#inmueble_subirImagen\").hide();\n\t$(\"#inmueble_subirVideo\").hide();\n}", "function inmueble_cerrarPopUp2(){\n\t$(\"#mascaraPrincipalNivel2\").hide();\n\t$(\"#inmueble_obtenerCoordenadas\").hide();\n\t$(\"#inmueble_subirImagen\").hide();\n\t$(\"#inmueble_subirVideo\").hide();\n}", "checkhide(e) {\n if (e.target == this.modal) {\n this.hide();\n }\n }", "function hide_view(hideme, showme) {\n if(hideme !== undefined) \n $('#' + hideme).hide(400);\n \n if(showme !== undefined)\n $('#' + showme).show('fast');\n \n}", "function deviElementHide(){\n $(\"#clickElement\").hide();\n}", "function hide() {\n $( \"#target\" ).hide();}", "hide() {\n this.isVisible = false;\n }", "_hide() {\n $.setDataset(this._target, { uiAnimating: 'out' });\n\n $.fadeOut(this._target, {\n duration: this._options.duration,\n }).then((_) => {\n $.removeClass(this._target, 'active');\n $.removeClass(this._node, 'active');\n $.removeDataset(this._target, 'uiAnimating');\n $.setAttribute(this._node, { 'aria-selected': false });\n $.triggerEvent(this._node, 'hidden.ui.tab');\n }).catch((_) => {\n if ($.getDataset(this._target, 'uiAnimating') === 'out') {\n $.removeDataset(this._target, 'uiAnimating');\n }\n });\n }", "hide() {\n\t\tconsole.log('[NonVisualComponent.hide] invoked');\n\t}", "function massHide(){\n $(\"#question, #timer, #picture, #question, #answers, #gameMessage, #tryAgain\").hide();\n}", "function alertErrorHide(){\r\n\t\terrorAlert.hide();\r\n\t\tworkingAlert.hide();\r\n\t}", "function hideStuff(){\n\t$('#layout').fadeOut();\n\tparent.$(\"#exclusionTableWrapper\").hide();\n\t// hide plate exclusion divs\n\t$('.excludedPlateContainer').hide();\n}", "function hideIfNotAccepted() {\r\n if (state.assignmentId == \"ASSIGNMENT_ID_NOT_AVAILABLE\") {\r\n console.log(\"Hiding if not accepted\");\r\n $('#experiment').hide();\r\n $(\"#hit-not-accepted\").show();\r\n return true;\r\n }\r\n return false;\r\n}", "function showHelp(){\n if($('#removeHidden').is(\":hidden\")){\n if(counter != 6){\n //user does not know to click blue dots\n $('#removeHidden').transition('fade');\n $('#contintueSim').css('margin-bottom', '10em');\n }\n }\n}", "render_hide() {\n this.element.fadeOut();\n this.visible = false;\n }", "onBeforeHide() {\n this.is_shown_ = false;\n }", "function hide(el) {\n $(el).addClass(\"hidden\");\n }", "alternHide(elem, view) {\n if ($(`#${elem}`).hasClass('hide')){\n\n $(`#${elem}`).removeClass('hide');\n console.log(\"Inside If\")\n } else {\n $(`#${elem}`).addClass('hide');\n $(`#${view}`).removeClass('hide');\n console.log(`#${elem}`)\n console.log(\"Out If\")\n }\n }", "hide(ele) {\n // make sure ele is a DOM element\n // we do this by checking if it has a display style property\n if (ele && typeof ele.style.display === 'string') {\n ele.style.display = 'none';\n } else {\n console.error('Error while trying to hide a non DOM object');\n }\n }", "function hide() {\n\t\t\tdiv.hide();\n\t\t\tEvent.stopObserving(div, 'mouseover', onMouseMove);\n\t\t\tEvent.stopObserving(div, 'click', onClick);\n\t\t\tEvent.stopObserving(document, 'click', hide);\n\t\t\tEvent.stopObserving(textarea, 'click', hide);\n\t\t\tEvent.stopObserving(textarea, 'keydown', onKeyDown);\n\t\t\tvisible = false;\n\t\t}", "function hide_info()\r\n{\r\n $('info_div').hide();// = 'hidden';\r\n}", "hide() {\n checkPresent(this.containerDiv, 'not present when hiding');\n // The visibility property must be a string enclosed in quotes.\n this.containerDiv.style.visibility = 'hidden';\n }", "function cheapFail() {\n $('#cheapErrMsg').hide();\n}", "function hideError() {\n error.hide();\n }", "function hideAnswer() {\n\t\t\t$answer_div.slideUp(\"fast\");\n\t\t\tif(menu_shown == false)\n\t\t\t{\n\t\t\t\tif($faq_overlay.hasClass('faq-overlay-dim')){\n\t\t\t\t\t$faq_overlay.toggleClass('faq-overlay-dim');\n\t\t\t\t}\n\t\t\t}\n\t\t\tfaq_answer_shown = false;\n\t\t}", "function cloak(val) {\n $(val).hide();\n }", "function hide(event) { event.target.style.visibility = \"hidden\"; }", "function _hidden() {}", "function _hideMessages(){\n $(errorClassContainer).hide(); \n }", "function hideError() {\n\t$( \"div#errorMessage\" ).css('display', 'none');\n}", "hide() {\n if (this.div) {\n // The visibility property must be a string enclosed in quotes.\n this.div.style.visibility = \"hidden\";\n }\n }", "function hide(){\n $('.form-group').hide();\n $('#playAgain').hide();\n $('#time').hide();\n $('#done').hide();\n\n}", "hide(){\r\n this.greeting.hide();\r\n this.input.hide();\r\n this.button.hide();\r\n }", "function _hideOtherButtons(hide){\n\t\t\t$('.btn_addremove').show();\n\t\t\t$('.btn_download').show();\n\t\t\t$('.btn_delete').show();\n\t\t\t\n\t\t\t/*if (hide) {\n\t\t\t\t$('.btn_addremove').hide();\n\t\t\t\t$('.btn_download').hide();\n\t\t\t\t$('.btn_delete').hide();\n\t\t\t}*/\n\t\t}", "function hidden(el) {\n return matchingAttr('hidden', '')(el) || el.style.display === 'none';\n }", "afterHidden() {\n return this._onHide;\n }", "hide() {\n if (this[$visible]) {\n this[$visible] = false;\n this[$updateVisibility]({ notify: true });\n }\n }", "hide() {\n if (this.div) {\n // The visibility property must be a string enclosed in quotes.\n this.div.style.visibility = 'hidden';\n }\n }", "onHide() {\n\t}", "function unhide(el) {\n $(el).removeClass(\"hidden\");\n }", "function unhideHtml () {\n $('.error').prop('hidden',true);\n $('main').prop('hidden',false);\n $('.slideshow').prop('hidden',true);\n}", "function hideResults() {\n $(\"#answer-holder\").hide();\n $(\"#restart-holder\").hide();\n $('#correct-result').hide();\n $('#incorrect-result').hide();\n $('#unanswered-result').hide();\n $('#restart-result').hide();\n }", "function hideHints(){\n\t\t\t\t$(\"#posibilidadescontainer\").fadeOut('slow');\n\t\t\t}", "function hidetableau() {\n console.log(\"hiding viz\");\n viz.hide();\n}", "hide (element){\n element.style.display = \"none\";\n }", "function stopHide(e) {\n e.stopPropagation();\n}", "function hideInterface(){\n\t$('.user-info').css('display', 'none');\n\t$('.user-info').css('opacity', '0');\n\t$('.user-tracks').css('display', 'none');\n\t$('.user-tracks').css('opacity', '0');\n\t$('.current-user').css('display', 'none');\t\n\t$('.current-user').css('opacity', '0');\n\t$('.data-display').css('visibility', 'hidden');\n\t$('.data-display').css('opacity', '0');\n}", "get isHide() {\n return this.isStage(STAGE.hidden);\n }", "isHide() {\n return this.x < 0\n }", "function hideTodoPopup() { \r\n var $todoContainer = $(\"#todo-container\");\r\n var $todoCounter = $(\"#todo-link-done-counter\");\r\n var isVisible = $todoContainer.is(\":visible\");\r\n if(isVisible) {\r\n $todoContainer.hide();\r\n $todoCounter.css({\"display\": \"inline\"});\r\n BRW_sendMessage({command: \"changeTodoContainerVisible\", \"val\": !isVisible});\r\n }\r\n}", "function inmueble_cerrarPopUp(){\n\t$(\"#backImage\").hide();\n\t$(\"#inmueble_abrirModificarImagenes\").hide();\n\t$(\"#inmueble_abrirModificarVideos\").hide();\n\t$(\"#inmueble_abrirModificarTransacciones\").hide();\n}", "function hideThePage() {\n $('#show').css('visibility', 'visible');\n $('div').hide('slide', {}, 2500);\n $('#show').show('fold', {}, 2500);\n}", "function hideThePage() {\n $('#show').css('visibility', 'visible');\n $('div').hide('slide', {}, 2500);\n $('#show').show('fold', {}, 2500);\n}", "check() {\n // neither end is a bar which isn't in a collapsed group? then hide\n if ((!this.renderedFromProtein.expanded || (this.renderedFromProtein.inCollapsedGroup())) &&\n (this.renderedToProtein ? (!this.renderedToProtein.expanded || this.renderedToProtein.inCollapsedGroup()) : false)) {\n this.hide();\n return false;\n }\n\n // either end manually hidden? then hide\n if (this.renderedFromProtein.participant.hidden === true ||\n (this.renderedToProtein && this.renderedToProtein.participant.hidden === true)) {\n this.hide();\n return false;\n }\n\n // no crosslinks passed filter? then hide\n if (this.crosslink.filteredMatches_pp.length > 0) {\n this.show();\n return true;\n } else {\n this.hide();\n return false;\n }\n }", "function hide() {\n\n\t\t$('.minicolors-focus').each( function() {\n\n\t\t\tvar minicolors = $(this),\n\t\t\t\tinput = minicolors.find('.minicolors-input'),\n\t\t\t\tpanel = minicolors.find('.minicolors-panel'),\n\t\t\t\tsettings = input.data('minicolors-settings');\n\n\t\t\tpanel.fadeOut(settings.hideSpeed, function() {\n\t\t\t\tif( settings.hide ) settings.hide.call(input.get(0));\n\t\t\t\tminicolors.removeClass('minicolors-focus');\n\t\t\t});\n\n\t\t});\n\t}", "hide() {\n if (\n $.getDataset(this._target, 'uiAnimating') ||\n !$.hasClass(this._target, 'active') ||\n !$.triggerOne(this._node, 'hide.ui.tab')\n ) {\n return;\n }\n\n this._hide();\n }", "function askQuestionsHide(){\n $(\"#quesBtn\").hide();\n $(\"#ans1\").hide();\n $(\"#ans2\").hide();\n $(\"#ans3\").hide();\n $(\"#ans4\").hide();\n }", "function hideWhenClicked(){\n $('#hide_this').click(function(){\n $(this).hide();\n });\n}", "function hide_book_title_field_error_alert() {\n// var get_book_title_list_form_alert = document.getElementById(\"get_book_title_list_form_alert\");\n// get_book_title_list_form_alert.style.setProperty(\"display\", \"none\");\nif (document.getElementById(\"get_book_title_list_form_alert\").style.getPropertyValue(\"display\") === \"block\") {\n $('#get_book_title_list_form_alert').slideUp();\n }\n}", "_hide() {\n this.panelElem.addClass(\"hidden\");\n }", "function hide()\n\t{\n\t\t// TODO jQuery.hide function is problematic after Jmol init\n\t\t// Reloading the PDB data throws an error message (Error: Bad NPObject as private data!)\n\t\t// see https://code.google.com/p/gdata-issues/issues/detail?id=4820\n\n\t\t// So, the current workaround is to reposition instead of hiding\n\t\tif (_container != null)\n\t\t{\n\t\t\t//_container.hide();\n\t\t\tvar currentTop = parseInt(_container.css('top'));\n\n\t\t\tif (currentTop > 0)\n\t\t\t{\n\t\t\t\t_prevTop = currentTop;\n\t\t\t}\n\n\t\t\t_container.css('top', -9999);\n\t\t}\n\t}", "hide() {\n this.elem.classList.add(\"hiding\");\n setTimeout(() => this.elem.classList.add(\"noDisplay\"), 184);\n this.isHidden = true;\n }", "hide() {\n this.visible = false;\n this.closed.emit();\n }", "function hideTab(clicked, $hide, $show) {\n\t\t\t$hide.animate(hideFx, hideFx.duration || baseDuration, function() { //\n\t\t\t\t$hide.addClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.\n\t\t\t\tif ($.browser.msie && hideFx.opacity)\n\t\t\t\t\t$hide[0].style.filter = '';\n\t\t\t\tif ($show)\n\t\t\t\t\tshowTab(clicked, $show, $hide);\n\t\t\t});\n\t\t}", "hide() {\n // console.log('hiding', this.$element.data('yeti-box'));\n var _this = this;\n this.template.stop().attr({\n 'aria-hidden': true,\n 'data-is-active': false\n }).fadeOut(this.options.fadeOutDuration, function() {\n _this.isActive = false;\n _this.isClick = false;\n if (_this.classChanged) {\n _this.template\n .removeClass(_this._getPositionClass(_this.template))\n .addClass(_this.options.positionClass);\n\n _this.usedPositions = [];\n _this.counter = 4;\n _this.classChanged = false;\n }\n });\n /**\n * fires when the tooltip is hidden\n * @event Tooltip#hide\n */\n this.$element.trigger('hide.zf.tooltip');\n }", "function hide() {\n toogle = 'hide'\n\n }", "function hide(el) {\n\t\tel.style.display = 'none';\n\t}", "function hideTodoPopupClickHandler() { \r\n var $todoContainer = $(\"#todo-container\");\r\n var $todoCounter = $(\"#todo-link-done-counter\");\r\n var isVisible = $todoContainer.is(\":visible\");\r\n if(isVisible) {\r\n $todoContainer.fadeOut(250);\r\n $todoCounter.css({\"display\": \"inline\"});\r\n BRW_sendMessage({command: \"changeTodoContainerVisible\", \"val\": !isVisible});\r\n }\r\n}", "function hideErrorAlerts()\n {\n $(\"#dvPersonalDetailsAlert\").hide();\n $(\"#dvCarDetailsAlert\").hide();\n $(\"#dvQuoteDetailsAlert\").hide();\n }", "function hide()\n\t{\n\t\t$(\"#city-screen\").hide();\n\t\tconsole.log(\"hide\")\n\t}", "function plugin_hidden_isHidden(elem){\n return jQuery(elem.parentNode).children('div.hiddenBody')[0].style.display === \"none\";\n}", "function disappear(element) {\n $(element).css({ 'display': 'none' });\n }", "function hide_it() {\r\n\targ=hide_it.arguments;\r\n\tfor(i=0;i<arg.length;i++) {\r\n\t\t_z = _ge(arg[i]);\r\n if (_z) _z.className='hideit';\r\n\t}\r\n}", "function processHide(){\n \n // Check if we have to destroy the loader (it happens when the counter is equal to 0)\n if( decreaseCounter() === 0){ // If countNbCall == 0 decreaseCounter() returns -1\n\n // We set a param to know that the animation to hide has begin\n waitForAnimation.isAnimated = nbLoadingElements;\n\n // We animate the loader to make it disappear\n $loadingBar.fadeOut(speed, function(){\n // This will be called as many times as there are elements in the $loading element\n // We set a param to know that the animation to hide is finished\n waitForAnimation.isAnimated--;\n\n // We destroy the loader element\n $(this).remove();\n\n // Reset the initial position of the loader parent\n $parentSelector.css(\"position\", previousCssPosition);\n\n // If all loaders have been destroyed, we reset the $loadingBar variable\n if (waitForAnimation.isAnimated === 0) {\n $loadingBar = undefined;\n }\n\n // If a callback is defined, we call it\n if(params.callbackOnHiding && typeof(params.callbackOnHiding) === \"function\"){\n params.callbackOnHiding();\n }\n\n // During destroying, calls can be made to show the loader. So we let's the loader disappear and then we show it again\n callStack();\n });\n }\n else{\n callStack();\n }\n }", "hideHandler(){\n\t\tvar items = this.props.hey.questions.present;\n\t\tlet counter = this.props.hey.counter.present;\n\t\tconst increment = this.props.increment;\n\t\tif(items[counter]!==undefined){\n\t\t\tif(items[counter].hide===1){\n\t\t\t\tthis.props.action({id:counter,data:'hiding'});\n\t\t\t\tthis.props.increment();\n\t\t\t}\n\t\t}\t\t\n\t}", "function inmueble_cerrarPopUp(){\n\t$(\"#backImage\").hide();\n\t$(\"#inmueble_abrirModificarImagenes\").hide();\n\t$(\"#inmueble_abrirModificarVideos\").hide();\n\t$(\"#inmueble_abrirModificarTransacciones\").hide();\n\t$(\"#inmueble_abrirModificarUsuario\").hide();\n\t$(\"#inmueble_popupIframe\").hide();\n}", "function startHidden() {\n $(\"#hider\").hide();\n }", "function init(){\n $(\"#hide\").hide();\n $(\"#hide-button\").hide();\n $(\"#hide-go\").hide();\n }", "abortDelayedHide() {\n this.clearTimeout('hide');\n }", "abortDelayedHide() {\n this.clearTimeout('hide');\n }", "hide () {\n this.showing = false\n this.element ? this.element.update(this) : null\n }", "function hide() {\n$('.minicolors-focus').each( function() {\nvar minicolors = $(this),\ninput = minicolors.find('.minicolors-input'),\npanel = minicolors.find('.minicolors-panel'),\nsettings = input.data('minicolors-settings');\npanel.fadeOut(settings.hideSpeed, function() {\nif( settings.hide ) settings.hide.call(input.get(0));\nminicolors.removeClass('minicolors-focus');\n});\n});\n}", "hide() {\n this._id && clearTimeout(this._id);\n this.el.classList.remove('show');\n }", "function hideStuff() {\n\thideInv();\n}", "function showHide()\r\n{\r\n var showHides = jQ(\"fieldset.showHide\");\r\n for(var x=0; x<showHides.size(); x++)\r\n {\r\n showHide = showHides.eq(x);\r\n legend = showHide.children(\"legend\");\r\n legendText = legend.text();\r\n legend.html(\"Hide \" + legendText);\r\n legend.css(\"cursor\", \"pointer\");\r\n legend.css(\"color\", \"blue\");\r\n //div = showHide.children(\"div\")\r\n show = jQ(\"<span style='cursor:pointer;color:blue;padding-left:1ex;'>Show \" + legendText + \"</span>\");\r\n showHide.wrap(\"<div/>\");\r\n showHide.before(show);\r\n showHide.hide();\r\n function showFunc(event)\r\n {\r\n target = jQ(event.target);\r\n target.hide();\r\n target.next().show();\r\n }\r\n function hideFunc(event)\r\n {\r\n target = jQ(event.target).parent();\r\n target.hide();\r\n target.prev().show();\r\n }\r\n show.click(showFunc);\r\n legend.click(hideFunc);\r\n }\r\n showHides = jQ(\"div.showHideToggle\");\r\n showHides.each(function() {\r\n var showHideDiv = jQ(this);\r\n var toggleText = showHideDiv.find(\"input[@name='toggleText']\").val();\r\n var contentDiv = showHideDiv.find(\">div\");\r\n var cmd = showHideDiv.find(\">span.command\");\r\n cmd.click(function(){ contentDiv.toggleClass(\"hidden\"); var t=cmd.html(); cmd.html(toggleText); toggleText=t; });\r\n });\r\n}", "forceHide() {\n this.__count = 0;\n this.hide();\n }", "function hideTrivia () {\n $('#question').hide();\n $('#a1').hide();\n $('#a2').hide();\n $('#a3').hide();\n $('#a4').hide();\n $('#timer').hide();\n $('#scores').hide();\n }", "isHidden() {\n return false;\n }", "function clickDivListaVerificacion(){\n $(\"#div_4\").click(function(){\n if( $('#items_lista_verificacion').is(\":visible\") ){\n $('#items_lista_verificacion').hide('fast');\n }else{\n mostrarDivListaVerificacion();\n }\n });\n}", "function clickDivListaVerificacion(){\n $(\"#div_4\").click(function(){\n if( $('#items_lista_verificacion').is(\":visible\") ){\n $('#items_lista_verificacion').hide('fast');\n }else{\n mostrarDivListaVerificacion();\n }\n });\n}", "function shouldPreviewElemBeHidden($elem) {\n var thisVisibility = $elem.attr('data-visibility');\n var parentVisibility = $elem.attr('data-parent-visibility');\n return thisVisibility === 'hidden' || thisVisibility === 'unset' && parentVisibility === 'hidden';\n}", "function vpb_display_description_hidden()\n{\n\t$('.vpb_description').slideUp('fast');\n\t$('.vpb_description_hidden').slideDown('slow');\n}" ]
[ "0.7387498", "0.69093287", "0.6894545", "0.68487304", "0.68344015", "0.6825782", "0.68006134", "0.68006134", "0.67375165", "0.67375165", "0.67227364", "0.6717378", "0.6692916", "0.66852695", "0.66804504", "0.6651273", "0.66434324", "0.66328937", "0.66311646", "0.6573241", "0.65477794", "0.65453655", "0.65437025", "0.6527038", "0.65177304", "0.65112895", "0.65072477", "0.6506425", "0.6503567", "0.6502474", "0.6500085", "0.6494735", "0.64918625", "0.6481876", "0.64706725", "0.64489263", "0.64439994", "0.64427716", "0.64334124", "0.6432388", "0.64272904", "0.6426724", "0.6414782", "0.6408988", "0.6405104", "0.6402896", "0.6394541", "0.63874227", "0.63820183", "0.63717467", "0.6370803", "0.6370667", "0.6367064", "0.6366417", "0.63519204", "0.63513756", "0.63509184", "0.6348538", "0.6348495", "0.63465047", "0.63465047", "0.6345489", "0.63438576", "0.6343084", "0.6340496", "0.6335927", "0.6335512", "0.63340724", "0.633254", "0.6326943", "0.6318566", "0.6310838", "0.6307626", "0.6296078", "0.6289812", "0.62883395", "0.628469", "0.6276966", "0.62763214", "0.627601", "0.6272714", "0.627113", "0.6268693", "0.6266415", "0.6261657", "0.6258567", "0.625687", "0.625687", "0.6255784", "0.62551373", "0.62527543", "0.62504464", "0.6239496", "0.6237924", "0.6218634", "0.62182117", "0.62161463", "0.62161463", "0.6210219", "0.62066716" ]
0.6308055
72
to verify the functionality of slideUp()
function slideupMethod() { $(function() { $("img").slideUp(1000); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function slideUP() {\n $( \"#target\" ).slideUp();}", "function slideUp(){\n\t// Gets the imported image ID\n\tvar image = document.getElementById('imported_image');\n\n\t// Detects if the element exists\n\tif (image) {\n\t\t// Detects if browser is IE7\n\t\tif (ie7) {\n\t\t\tvar topPosition = parseInt(image.currentStyle.marginTop);\n\t\t} else {\n\t\t\tvar topPosition = parseInt(image.style.top);\n\t\t}\n\n\t\t// Slides the imported image up (to be visible)\n\t\tif (topPosition > 5){\n\t\t\tif (ie7) {\n\t\t\t\timage.style.marginTop = topPosition - 5 + 'px';\n\t\t\t} else {\n\t\t\t\timage.style.top = topPosition - 5 + 'px';\n\t\t\t}\n\n\t\t\tsetTimeout(\n\t\t\t\tfunction(){\n\t\t\t\t\tslideUp();\n\t\t\t\t}\n\t\t\t\t,20\n\t\t\t);\n\t\t}\n\t}\n}", "function slideDown() {\n $( \"#target\" ).slideDown();}", "function Nav_slideUp_mUp() {\n $(this)\n \t.closest(navItemLevels)\n \t.removeClass('nav__item--show-sub');\n navbar_leave();\n }", "function slideUpAndRemove(callback) {\n callback.slideToggle(800, function() {\n //form container is removed after it has slid up\n $(this).remove();\n }); \n\n}", "function slideUp(el, speed, maxtime) {\n speed = speed || 0.2;\n maxtime = maxtime || 1;\n var curh = window.getComputedStyle(el).height;\n if (curh === \"0\") {\n return;\n }el.style.transition = \"none\";\n el.style.height = curh;\n var dur = parseInt(curh, 10) * speed / 100;\n if (dur > maxtime) dur = maxtime;\n el.style.overflow = \"hidden\";\n // trigger reflow\n window.getComputedStyle(el).height;\n el.style.transition = \"height \" + dur + \"s ease\";\n el.style.height = \"0\";\n afterTransition(el, function () {\n el.style.height = \"0\";\n el.style.transition = \"\";\n el.style.overflow = \"hidden\";\n });\n}", "function slideUpIn() {\n $(\"#login\").velocity(\"transition.slideUpIn\", 1250)\n}", "function w(e,t){k(e,function(){!Q.state.isVisible&&Q.props.appendTo.contains(Q.popper)&&t()})}", "closeUp() {\r\n\t\t$('.report').slideUp(); \r\n\t}", "function onSlideUpComplete() {\n $('.readmore').show();\n $('.readless').hide();\n }", "function slideDownAndUp() {\n\n // slideToggle Experiment\n $('#headerExperiment').click(function () {\n $('#cardBodyExperiment').slideToggle(\"slow\");\n });\n\n // slideToggle Experiment Text\n $('#headerExperimentText').click(function () {\n $('#cardBodyExperimentText').slideToggle(\"slow\");\n }); \n \n}", "function uviInfoToggle() {\n if ($('.row').hasClass('dropup')) {\n\n $('.uviMoreInfo').slideUp('fast');\n\n $('.row').removeClass('dropup');\n } else {\n $('.uviMoreInfo').slideDown('slow');\n\n $('.row').addClass('dropup');\n }\n}", "function slideDown($elem, minHeight, duration, easing, callback) {\n // NOTE: actual() only works properly when element is hidden\n var height = $elem.hide().actual('height');\n $elem.css('display', '');\n $elem.height(minHeight);\n $elem.animate({height: height}, duration, easing, function() {\n $elem.css('height', '');\n callback();\n });\n}", "function slideUpSettingsTab(el, ev) {\n ev.preventDefault();\n var $el = $(el);\n var pSect = $el.closest('section');\n var aActHr = $el.closest('[data-stcateg]');\n aActHr.removeClass('__active')\n .find('.user-settings_i_lk')\n .fadeIn();\n pSect.slideUp();\n}", "function topicUp() {\n\t$('#topic').stop().animate({opacity: 1.0}, 500).stop().animate({top:-$('#topic').height()+10}, 500, 'linear',function(){\n\t\tif($('#topic').hasClass('new')) {\n\t\t\t$('#topic').removeClass('new');\n\t\t}\n\t});\n}", "function DisplayErrorMessagePlaceHolder() {\r\n\r\n /* This function is action on .ready() \r\n \r\n 1 Checks if errorSummary_Board_Error li controls is greater than zero\r\n 2. If condition #1 is true slide down errorSummary (div html control)\r\n\r\n */\r\n\r\n if ($(\"#errorSummary_Board_Errors\").children(\"li\").length > 0) {\r\n\r\n $(\"#errorSummary\").slideDown(\"slow\", function () { });\r\n $(\"#error-summary-clear\").fadeIn(\"fast\");\r\n }\r\n\r\n}", "function slideToggle() {\n\tif ( $(this).css(\"display\") == \"none\" ) {\n\t\t$(this).stop(false, false).slideDown();\n\t} else {\n\t\t$(this).stop(false, false).slideUp();\n\t}\n}", "function drop(current, previous) {\n let top = current + \"Top\";\n let arrow = current + \"Drop\";\n let bottom = current + \"Bottom\";\n if (current != \"things\") {\n $(`#${top}`).hide();\n //$(`#${top}`).slideUp(\"slow\");\n // $(`#${top}`).animate({ marginLeft: \"2000px\" }, 1000);\n $(`#${arrow}`).hide();\n // $(`#${bottom}`).show();\n $(`#${bottom}`).fadeIn(\"slow\");\n // $(`#${bottom}`).css({display: \"flex\", \n // alignItems: \"safe center\",\n // backgroundColor: \"black\"});\n // if(current == 'about'){\n // $(`#${bottom}`).css({padding: \"20px 5px 5px 5px\"});\n // };\n }\n}", "function subHeaderSlideDown() {\n setTimeout(function () {\n $('#live-selected-container').css({\n \"top\": \"70px\",\n \"transition\": \"1s\"\n });\n }, 100)\n}", "function Removeplusimage_menu() {\n $('#cssmenu > ul > li > a').click(function () {\n $('#cssmenu li').removeClass('active');\n $(this).closest('li').addClass('active');\n var checkElement = $(this).next();\n if ((checkElement.is('ul')) && (checkElement.is(':visible'))) {\n //alert('1');\n $(this).closest('li').removeClass('active');\n checkElement.slideUp('normal');\n }\n if ((checkElement.is('ul')) && (!checkElement.is(':visible'))) {\n // alert('2');\n $('#cssmenu ul ul:visible').slideUp('normal');\n checkElement.slideDown('normal');\n }\n if ($(this).closest('li').find('ul').children().length == 0) {\n //alert('3');\n return true;\n } else {\n // alert('4');\n return false;\n }\n });\n}", "function settings_up(){\n\t\t$(\"#search_settings\").animate({\n\t\t\ttop: \"300px\"\n\t\t});\n\t\t$(\"#search_settings_icon\").fadeOut(200);\n\t\t$(\"#search_drop_icon\").fadeIn(200);\n\t\t$(\"#settings_blank\").fadeIn(300);\n\n\t}", "function HideThumbnails() { \n if (thumb_flag == 1) {\n $('#thumbnails').slideUp(function () {\n $('#ThumbPanelHideShow').html('<i class=\"fa fa-angle-double-up\"></i> <span>Show Thumbnails</span> <i class=\"fa fa-angle-double-up\"></i>');\n thumb_flag = 0;\n });\n\n }\n}", "function rmlcwrSlideUp(event) {\n var $menu_attach_wrapper = $('.menu-wrapper');\n\n // When hovering off, slide up the menus remove styling classes.\n if ($(\".menu-wrapper:hover\").length === 0) {\n $menu_attach_wrapper.slideUp('fast');\n }\n\n // Collapse menu items that don't collapse on menu drop down hoverout.\n $menu_attach_wrapper.mouseleave(function (event) {\n $menu_attach_wrapper.slideUp('fast');\n });\n }", "function boloDropDown(e) {\n if($(e).next().css('display') === 'none') {\n $(e).next().slideDown(200);\n }\n else {\n $(e).next().slideUp(200);\n }\n}", "function videosSection() {\n // alert(\"videos clicked\");\n $(\"#videos\").addClass(\"actively_selected\");\n $(\"#solo_images, #effects, #all_panel\").removeClass(\"actively_selected\").slideUp();\n $(\".actively_selected\").slideDown();\n}", "function soloImagesSection() {\n // alert(\"solo images clicked\");\n $(\"#solo_images\").addClass(\"actively_selected\");\n $(\"#all_panel, #effects, #videos\").removeClass(\"actively_selected\").slideUp();\n $(\".actively_selected\").slideDown();\n\n}", "function user_go_up()\r\n{\r\n\tif(starting_shot == true)\r\n\t{\r\n\t\tmove(\"up\", \"user\");\r\n\t\t//variable_content_viewer();\r\n\t\tdisplay();\r\n\t}\r\n\tif(user_navigate_allow == true)\r\n\t{\r\n\t\tmove(\"up\", \"user\");\r\n\t\t//variable_content_viewer();\r\n\t\tuser_navigate_allow = false;\r\n\t}\r\n}", "function subNav_slideUp(e) {\n $(this).removeClass('nav__item--show-sub');\n }", "function mouseUp() { }", "function bannerUp() {\n\tif (windowState == 'large') {\n\t\tvar yPos = $(\".home #footer-container\").height() + $(\".home #main-container .spotlight\").height();\n\t\t$(\".home #main-container .slide-text\").animate({\"bottom\": yPos}, \"fast\");\n\t}\n}", "function showProject(){\n $(this).next().slideToggle('fast', function(){\n if($(this).height() > 0) {\n $('html, body').animate({\n scrollTop: $(this).offset().top\n }, 1000);\n }\n });\n // if($(this).next().css(\"display\") === \"none\"){\n // $(this).next().slideDown();\n // } else{\n // $(this).next().slideUp();\n // }\n}", "function start(){\n $(\"#viewMenu\").slideUp();\n $(\"#viewGame\").slideDown();\n}", "function effectsSection() {\n // alert(\"effects clicked\");\n $(\"#effects\").addClass(\"actively_selected\");\n $(\"#solo_images, #all_panel, #videos\").removeClass(\"actively_selected\").slideUp();\n $(\".actively_selected\").slideDown();\n}", "hideErrorMessage(){\n \t$(this.element + \"Error\").slideUp();\n\t}", "function transitionThreeUp(){\n\n}", "function Navs_slideUp_mDn(e) {\n var main_nav__close = function() {\n setTimeout(function() {\n $('body').removeClass('show');\n }, 200);\n };\n e.stopPropagation();\n $(this)\n \t.closest(navItemLevels)\n \t.removeClass('nav__item--show-sub');\n main_nav__close();\n clearTimeout(main_nav__close);\n\n }", "function closeEmptyPanels(){\n\tif (detailsReadyToClose){\n\t\t$(\"#detailsContainer\").slideUp(\n\t\t\t{\n\t\t\t\tcomplete:function(){\n\t\t\t\t\t$(\"#detailsHeader\").html(\"Vessel details\");\n\t\t\t\t\tdetailsOpen = false;\n\t\t\t\t\t$(\"#detailsPanel\").removeClass(\"arrowUp\");\n\t\t\t\t\t$(\"#detailsPanel\").addClass(\"arrowDown\");\n\t\t\t\t\tcheckForPanelOverflow();\n\t\t\t\t\t$(\"#detailsContainer\").html(\"\");\n\t\t\t\t\tdetailsReadyToClose = false;\n\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n}", "function verticalSlideUp() {\n\t\t$(\".scroll-inner-container\").each(function () {\n\t\t\tlet id = makeid();\n\t\t\tvar div = $(this);\n\t\t\tdiv.stop();\n\t\t\t$(this).attr(\"id\", id);\n\t\t\tvar remHeight = div[0].scrollHeight - $(this).height();\n\t\t\tvar scrollableHeight = remHeight - div.scrollTop();\n\t\t\tvar pos = div.scrollTop();\n\t\t\tvar remainingTime = ((remHeight - pos) * 100) / 5; //here 5 is a speed\n\t\t\tdiv.animate(\n\t\t\t\t{\n\t\t\t\t\tscrollTop: remHeight,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tduration: remainingTime,\n\t\t\t\t\teasing: \"linear\",\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\t}", "function _checkForSlideOut(browserWidth) {\n if (browserWidth >= smallScreenSize) {\n _removeSlideOut();\n } else if (browserWidth < smallScreenSize) {\n _convertToSlideOut();\n }\n }", "function showNav(){//show nav for browsing\n document.getElementById(\"imgHide\").className=\"hidden\";\n $(\"div#browsed-div\").hide();\n $(\"#results-nav\").hide();\n document.getElementById(\"browsed-title\").className=\"hidden\";\n $(\"#browseNav\").slideDown(\"fast\",function(){\n document.getElementById(\"browsed-title\").className=\"span9\";\n document.getElementById(\"browsed-div\").className=\"span8 well\";\n $(\"div#browsed-div\").slideDown(\"normal\");\n $(\"#results-nav\").show();\n }) \n $(\"#results-nav\").removeClass();\n $(\"#results-nav\").addClass(\"span9 offset3\");\n\n}", "function slideComplete() {\r\n\r\n\t\t\t\t\t// Check for index wrap\r\n\t\t\t\t\tif (itemIndex > listMax + nOffset) itemIndex = nOffset;\t\t\r\n\t\t\t\t\tif (itemIndex < nOffset) itemIndex = listMax + nOffset;\t\r\n\r\n\t\t\t\t\t// Position new slide\r\n\t\t\t\t\t$('ul.slider',obj).css('margin-left',(itemIndex * slideX * -1));\r\n\r\n\t\t\t\t\t// Re-enable user controls\r\n\t\t\t\t\tready = true;\r\n\t\t\t\t}", "function HideGainedLife() {\n\tvar panel = $(\"#1UpPopup\");\n\tpanel.SetHasClass(\"Play1Up\", false);\n}", "onMoveUp() {\n if (this.state.selectedIndex > 0) {\n this.selectIndex(--this.state.selectedIndex);\n\n // User is at the start of the list. Should we cycle back to the end again?\n } else if (this.props.cycleAtEndsOfList) {\n this.selectIndex(this.state.items.length-1);\n }\n }", "function startGame(){\n $('#startPage').slideUp();\n console.log(\"hello\");\n questSelect();\n countDown();\n}", "gotoPageUp() {\n this.$moveByPage(-1, false);\n }", "function hideAlert()\n{\n var height = $(\"#alertContainer\").height();\n\n // Slide up, then hide and reset the position\n $(\"#alertContainer\").animate({\"top\": -1 * height}, 250, \"swing\", function() {\n $(\"#alertContainer\").hide();\n $(\"#alertContainer\").css(\"top\", 0);\n });\n}", "selectPageUp() {\n this.$moveByPage(-1, true);\n }", "function checkOffset() {\n if ($(\"#mainNav\").offset().top < 50) {\n $(\"#mainBanner\").slideDown(200);\n $( \"div#popInWindow\" ).slideUp(200);\n }\n else if(!$(window).scrollTop()) {\n $(\"#mainBanner\").show();\n $( \"div#popInWindow\" ).hide();\n }\n else {\n $(\"#mainBanner\").slideUp(200);\n $( \"div#popInWindow\" ).slideDown(600);\n }\n}", "function rmlcwrSlideDown(event) {\n // Slide up all menus, and remove all menu classes.\n rmlcwrSlideUp(event);\n\n $(this).closest('.accordion-content-wrapper').find('.menu-wrapper').slideDown('fast');\n }", "function MouseUpEvent() {}", "function hideElement(){\n $('#attendee_container').show(\"slide\", { direction: \"up\" }, 500);\n $('#attendee_1_wrap').hide('Slide');\n $('#attendee_2_wrap').hide('Slide');\n $('#attendee_3_wrap').hide('Slide');\n $('#attendee_4_wrap').hide('Slide');\n $('#attendee_5_wrap').hide('Slide');\n}", "function slideDown() {\n for (col of columns) {\n for (element of col) {\n element.style.top = parseFloat(element.style.top) + 0.15 + \"%\";\n //console.log(element.style.top);\n }\n\n }\n slidingCounter += 0.15;\n //reaches 9 in 60 transition (9/60=0.15)\n if (slidingCounter >= 9) {\n clearInterval(slidingID);\n //console.log(slidingCounter);\n slidingCounter = 0;\n checkLosing();\n }\n }", "function pageWrapper3Up(){\n\t$(\"#page-wrapper3-bg\").hide();\n\t$(\"#page-wrapper3\").animate({top:'+=150px'},125);\n\tsetTimeout(function(){\n\t\n\t\t//$(\"#page-wrapper2\").animate({top:'-1200px'},350);\n\t\t$(\"#page-wrapper3\").animate({top:'-1024px'},250);\n\t\t//$(\"#page-wrapper\").animate({top:'+=1024px'},200);\n\t\t//$(\"page-wrapper2\").hide();\n\t\t//$(\"#page-wrapper2\").animate({top:'+=1054px'},200);\n\t\t//$(\"#page-wrapper2\").animate({top:'-=50px'},200);\n\t});\n\t\n\t\t\n\t\t\n\n}", "function pageWrapper4Up(){\n\t$(\"#page-wrapper4-bg\").hide();\n\t$(\"#page-wrapper4\").animate({top:'+=150px'},125);\n\t\n\tsetTimeout(function(){\n\t\t//$(\"#page-wrapper2\").animate({top:'-1200px'},350);\n\t\t//$(\"#page-wrapper4\").animate({top:'-1024px'},600);\n\t\t$(\"#page-wrapper4\").animate({top:'-1024px'},250);\n\t\t//$(\"#page-wrapper\").animate({top:'+=1024px'},200);\n\t\t//$(\"page-wrapper2\").hide();\n\t\t//$(\"#page-wrapper2\").animate({top:'+=1054px'},200);\n\t\t//$(\"#page-wrapper2\").animate({top:'-=50px'},200);\n\t\t});\n\n}", "function slideIn(callback) {\n setX(upperPage(), 0, slideOpts(), callback);\n }", "function removenotif(j){\n $(\".notif\"+j).slideUp();\n}", "function runEffect(event) {\n //Page Id\n var pgId = $(this).data(\"info\");\n $('.page:not(#' + pgId + ')').slideUp(300, function () {\n setTimeout(function () {\n $('#' + pgId).slideDown('slow');\n }, 300);\n });\n }", "hideWrapUp() {\n this.showWrapUp = false;\n }", "mouseDownUp(start, end) {}", "function vpb_display_title_hidden()\n{\n\t$('.vpb_title').slideUp('fast');\n\t$('.vpb_title_hidden').slideDown('slow');\n}", "function ptoggles() {\r\n jQuery('.toggles > li').each(function(i){\r\n var photoggles=jQuery(this);\r\n photoggles.find('.toggle-content').slideUp(0);\r\n photoggles.find('.toggle-title').click(function(){\r\n var displ = photoggles.find('.toggle-content').css('display');\r\n if (displ==\"block\") {\r\n photoggles.find('.toggle-content').slideUp(300) \r\n } else {\r\n photoggles.find('.toggle-content').slideDown(300) \r\n }\r\n });\r\n });\r\n}", "function doShowSlide()\n {\n // check status if control bar is shown by key action do nothing\n if(getStatus() == 'shown') {\n return true;\n }\n setStatus('shown');\n var margin;\n \n //check if other slide effect is in action and set margin\n if($('#oc_flash-player').is(':animated')) {\n $('#oc_flash-player').stop();\n margin = '-='+ (_height + parseInt($('#oc_flash-player').css('marginBottom'))).toString() +'px';\n } else {\n margin = '-='+ _height.toString() +'px';\n }\n \n $('#oc_flash-player').animate({\n marginBottom: margin\n }, {\n duration: _time,\n specialEasing: 'swing' \n });\n if(!hideAPLogo)\n {\n doShowAdvLinkSlide();\n }\n }", "function slideDropdownBehavior() {\n showSlide(slideDropdown.selectedIndex);\n}", "function firstView(){\n\n $('.slideBox').on('click',function(){\n $('.slideBox').slideUp(1000, function(){\n $(this).remove();\n $('.veggie').show();\n $('.plot').show();\n });\n });\n}", "onMoveUpClick_() {\n /** @type {!CrActionMenuElement} */ (this.$.menu.get()).close();\n this.languageHelper.moveLanguage(\n this.detailLanguage_.state.language.code, /*upDirection=*/ true);\n settings.recordSettingChange();\n }", "function imageSlider() {\r\n\r\n $(\"img\").slideUp(0.1).slideDown(900);\r\n }", "function spMouseUpEvent(e) {\n\tif (!e) var e = window.event;\n\tif (e.target) targ = e.target;\n\telse if (e.srcElement) targ = e.srcElement;\n\tif (targ.nodeType == 3) // defeat Safari bug\n\t\ttarg = targ.parentNode;\n\n\tif (targ.id == \"spTopicBoxToggleLink_\" + spHpTopicBoxCurrentElement || targ.id == \"spTopicBoxToggleLinkMore_\" + spHpTopicBoxCurrentElement) {\n\t\tspStopMouseEvent();\n\t\treturn false;\n\t}\n\tif (spHpTopicBoxCurrentElement && targ.id == \"spSubjectBox_\"+spHpTopicBoxCurrentElement) {\n\t\treturn false;\n\t}\n\n\n\tvar isHpTopicboxDiv = false;\n\twhile(targ != null) {\n\t\tif (spHpTopicBoxCurrentElement && targ.id == \"spSubjectBox_\"+spHpTopicBoxCurrentElement) {\n\t\t\tisHpTopicboxDiv=true;\n\t\t\tbreak;\n\t\t}\n\t\ttarg = targ.parentNode;\n\t}\n\n\tif (!isHpTopicboxDiv) {\n\t\tspHpTopicBoxToggle(spHpTopicBoxCurrentElement, false);\n\t\tspStopMouseEvent();\n\t}\n\treturn false;\n}", "function spMouseUpEvent(e) {\n\tif (!e) var e = window.event;\n\tif (e.target) targ = e.target;\n\telse if (e.srcElement) targ = e.srcElement;\n\tif (targ.nodeType == 3) // defeat Safari bug\n\t\ttarg = targ.parentNode;\n\n\tif (targ.id == \"spTopicBoxToggleLink_\" + spHpTopicBoxCurrentElement || targ.id == \"spTopicBoxToggleLinkMore_\" + spHpTopicBoxCurrentElement) {\n\t\tspStopMouseEvent();\n\t\treturn false;\n\t}\n\tif (spHpTopicBoxCurrentElement && targ.id == \"spSubjectBox_\"+spHpTopicBoxCurrentElement) {\n\t\treturn false;\n\t}\n\n\n\tvar isHpTopicboxDiv = false;\n\twhile(targ != null) {\n\t\tif (spHpTopicBoxCurrentElement && targ.id == \"spSubjectBox_\"+spHpTopicBoxCurrentElement) {\n\t\t\tisHpTopicboxDiv=true;\n\t\t\tbreak;\n\t\t}\n\t\ttarg = targ.parentNode;\n\t}\n\n\tif (!isHpTopicboxDiv) {\n\t\tspHpTopicBoxToggle(spHpTopicBoxCurrentElement, false);\n\t\tspStopMouseEvent();\n\t}\n\treturn false;\n}", "function videoListUp(){\n $('.listUpWrap').hide();\n $('.listDropWrap').slideDown();\n $('.videoRowWrapper').velocity({\n 'height': '60%'\n }, 600);\n $('#listContentWrap').velocity({\n 'height': '40%'\n }, 600);\n $('.videoListRowWrapper').fadeIn(500, ()=>{\n $('#text-carousel').slideDown(800);\n $('.thRow').fadeIn(700);\n $('.listDropWrap').slideDown(700);\n });\n $('#mainVideo').velocity({\n 'width': '98vh',\n 'height': '55vh'\n }, 600);\n}", "function onSlideDownComplete() {\n $('.readmore').hide();\n $('.readless').show();\n }", "function noMorePortfolio($button) {\n\n $button.text('No more portfolio item');\n \n setTimeout(function() {\n $button.slideUp(300);\n },4000);\n\n }", "function fadeinup() {\n var time = 0;\n $(\".radio_select\" ).addClass(\"hide\").each(function( index ) {\n setTimeout(function(){\n openAnimate(\".radio_select:eq( \"+index+\" )\",'fadeInUp');\n },time+=200);\n });\n }", "function openUpwards(dropdown, container) {\n var offset = container.offset(),\n height = container.outerHeight(false),\n dropHeight = dropdown.outerHeight(false),\n $window = $(window),\n windowHeight = $window.height(),\n viewportBottom = $window.scrollTop() + windowHeight,\n dropTop = offset.top + height,\n enoughRoomBelow = dropTop + dropHeight <= viewportBottom,\n enoughRoomAbove = offset.top - dropHeight >= $window.scrollTop();\n\n // Default is below, if below is not enough, then show above.\n return !enoughRoomBelow && enoughRoomAbove;\n }", "function hideReviewBanner() {\n gReviewBanner\n .slideUp()\n .find(\".banner\")\n .slideUp();\n}", "function checkVisible()\n{\n\tcheckElementRunThough(\"slide-card\");\n\tcheckElementRunThough(\"cardSec\");\n}", "function display(event){\n //$(event.currentTarget).children(\"ul\").addClass(\"show\");\n //$(event.currentTarget).children(\"ul\").show();\n $(event.currentTarget).children(\"ul\").slideDown(\"fast\");\n}", "function slideout()\n{\n\tvar sliderOptions =\n\t{\n\t\tcurrentMargin: 0,\n\t\tmarginSpeed: -10\n\t};\n\tvar s = $(\"#ltitle\");\n\n\tif (s.width() >= 288)\n\t{\n\t\ts.css(\"right\", \"0px\");\n\t}\n}", "function slideNotice(text) {\n\t\t\t\t\t\t$('div#statusBar').html('<h3>' + text + '</h3>').slideDown();\n\t\t\t\t\t}", "function elementAttendee(){\n $('#attendee_container').show(\"slide\", { direction: \"up\" }, 500);\n $('#attendee_1_wrap').show(\"slide\", { direction: \"up\" }, 500);\n $('#attendee_2_wrap').show(\"slide\", { direction: \"up\" }, 500);\n $('#attendee_3_wrap').show(\"slide\", { direction: \"up\" }, 500);\n}", "function slideUpSomething(hiddenElements) {\n if (hiddenElements.length > 1) {\n for (var i = 0, n = hiddenElements.length; i < n; i++)\n $(hiddenElements[i]).slideUp();\n }\n else if (typeof(hiddenElements) === 'string')\n $(hiddenElements).slideUp();\n}", "slidePrev(object, slideView) {\n slideView.slidePrev(500);\n }", "function verticalSlideUp(){\n $(\".scroll-inner-container\").each(function(){\n let id = makeid();\n var div = $(this);\n div.stop();\n $(this).attr(\"id\",id);\n var remHeight = div[0].scrollHeight - $(this).height();\n var scrollableHeight = remHeight - div.scrollTop();\n var pos = div.scrollTop();\n var remainingTime = (remHeight - pos) * 100 / 5; //here 5 is a speed\n // console.log(\"pos : \"+ pos);\n div.animate({\n scrollTop:remHeight\n },{\n duration: remainingTime,\n easing: \"linear\",\n });\n });\n }", "function subNav_slideDown() {\n $(this).addClass('nav__item--show-sub');\n }", "function showSlide(callback) {\r\n dropDown.style.display = 'block';\r\n callback();\r\n }", "scrollUp() {\n if (this.currentOffset > 0) {\n this.currentOffset--\n this.goToThePage()\n }\n }", "function showBanner(){\n $('#banner').slideDown(2000);\n setTimeout(function(){$('#banner').slideUp(2000);},5000);\n}", "_documentUpHandler(event) {\n const that = this;\n\n that.removeAttribute('dragging-not-allowed');\n that.removeAttribute('show-locked-items');\n\n if (that.disabled) {\n delete that._dragDetails;\n delete that._collapseButtonPressed;\n return;\n }\n\n const target = that.enableShadowDOM ? event.originalEvent.composedPath()[0] : event.originalEvent.target;\n\n that._completeResizing();\n\n if (that._collapseButtonPressed &&\n target.closest('.' + that._collapseButtonPressed.target.classList[0]) === that._collapseButtonPressed.target) {\n if (that._collapseButtonPressed.item.collapsed) {\n that.expand(that._collapseButtonPressed.item);\n }\n else {\n that.collapse(that._collapseButtonPressed.item, that._collapseButtonPressed.farCollapse);\n }\n\n delete that._collapseButtonPressed;\n return;\n }\n }", "slideNext(object, slideView) {\n slideView.slideNext(500);\n }", "onPanUp(callback, isOnce = false) {\n this._panUpCallbacks.push([\n callback,\n isOnce\n ]);\n }", "function display2(event) {\n $(event.currentTarget).next().animate( {height: 'toggle'}, 'slow');\n}//end of display2", "function up() {\n\t\t\tmoveFocus(-1);\n\t\t}", "function up() {\n\t\t\tmoveFocus(-1);\n\t\t}", "function up() {\n\t\t\tmoveFocus(-1);\n\t\t}", "testDownKey() {\n popup.decorate(menu);\n popup.attach(anchor);\n popup.hide();\n assertFalse(popup.isVisible());\n events.fireKeySequence(anchor, KeyCodes.DOWN);\n assertTrue(popup.isVisible());\n assertEquals(0, popup.getHighlightedIndex());\n }", "function slideDownAndUp(){\n $('#findProfessor_chosen').css(\"width\", \"100%\");\n $('#ChooseDay1_chosen').css(\"width\", \"100%\");\n $('#ChooseDay2_chosen').css(\"width\", \"100%\");\n}", "function toggle_nav_button_up(){\n //mobile_nav_collapse.toggleClass(nav_expand);\n mobile_nav_collapse.removeClass(nav_expand);\n mobile_nav_collapse.addClass(nav_collapse);\n }", "showDevelopers(){\n $(\"#developerS\").slideToggle(\"fast\")\n }", "function jq_view_drop (element , self) {\n\t\n\t$( element ).fadeToggle( 400 );\n\n\tif (self!=null){\n\t\t$( self ).toggleClass( 'open' );\n\t}\n\telse{\n\t\t$( this ).toggleClass( 'open' );\n\t}\n}", "function shiftToTop() {\n var cur = ($('#Slider_VerticalList').position().top - $('#upButton').height()) + $('#Slider_VerticalList').outerHeight() - 15;\n // Checks if movement will cause the slidebar out of left edge\n if (cur > 0) {\n cur = 0;\n }\n $('#Slider_VerticalList').animate({top: cur}, {duration: 500, easing: \"swing\"});\n }", "function slideOutTopDiv()\n{\n\tblurOut = setTimeout(function(){\n\t\t\t// hide the top div\n\t\t\tdebugger;\n\t\t\tslideOutElem(\"logoSearchBox\",\"up\",showMenuBtn);\t\t\t\n\t},timeoutPeriod);\n}" ]
[ "0.7452803", "0.6884645", "0.66443825", "0.6621092", "0.63878685", "0.62967473", "0.62819624", "0.6248395", "0.62040436", "0.6198068", "0.61852044", "0.61774355", "0.6157214", "0.6141861", "0.61239046", "0.5958489", "0.59563714", "0.591659", "0.588146", "0.5874525", "0.58252245", "0.5786245", "0.5759955", "0.5736068", "0.5735096", "0.5713676", "0.5710605", "0.5686885", "0.56852335", "0.568127", "0.56542134", "0.56521386", "0.56437874", "0.5639651", "0.56350255", "0.56187433", "0.5615726", "0.5612429", "0.56104475", "0.5604592", "0.5603697", "0.56026024", "0.55839413", "0.55785704", "0.55780184", "0.55767137", "0.55766994", "0.5573757", "0.555726", "0.5553505", "0.5551831", "0.55462015", "0.55449563", "0.5523371", "0.5521791", "0.5505506", "0.5502484", "0.54886305", "0.548493", "0.5464684", "0.54614073", "0.5456441", "0.5455861", "0.54517514", "0.5451602", "0.5445581", "0.5442774", "0.5442774", "0.5441345", "0.54382825", "0.543417", "0.5430653", "0.54221797", "0.5418114", "0.5417573", "0.54148966", "0.5413026", "0.54057056", "0.5404538", "0.5403024", "0.54007155", "0.5399037", "0.5396865", "0.5395273", "0.5394655", "0.539159", "0.5386198", "0.53857005", "0.5384436", "0.5381519", "0.53745556", "0.53745556", "0.53745556", "0.53713804", "0.53700817", "0.5366571", "0.5366369", "0.5359775", "0.53550315", "0.53543663" ]
0.6959939
1
to verify the functionality of fadeout()
function fadeoutMethod() { $(function() { $("img").fadeOut(1000); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function teardownFade() {\n fader.removeClass('show fadeOut');\n }", "function fadeOut(a){return a.style.opacity=1,function b(){(a.style.opacity-=.1)<0?a.style.display=\"none\":requestAnimationFrame(b)}(),!0}", "function fadeOut() {\n $( \"#target\" ).fadeOut();}", "function fadeOut(el) {\n el.style.opacity = 1;\n el.style.display = \"none\";\n}", "function fadeOut() {\n transitionPlane.emit('fadeOut');\n setTimeout(setBackwards, 100);\n}", "function callback() {\n setTimeout(function() {\n $( \"#effect:visible\" ).removeAttr( \"style\" ).fadeOut();\n }, 1000 );\n }", "function exitTrading() {\n \"use strict\";\n\n $(\"#trading\").fadeOut(500, function () {\n updateDisplayNoAnimate();\n $(\"#main-content\").fadeIn(500);\n });\n}", "function fadeOut(elem) {\n if (typeof elem !== 'undefined') {\n var op = 1;\n var timer = setInterval(function () {\n if (op <= 0) {\n clearInterval(timer);\n elem.remove();\n } else {\n elem.style.opacity = op;\n elem.style.filter = 'alpha(opacity=' + op * 100 + \")\";\n op -= 0.1;\n }\n }, 30);\n }\n }", "function startFade() {\n fader.addClass('fadeOut');\n setTimeout(teardownFade, FADE_DURATION_MS);\n }", "function callback() {\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\t$( \"#effect:visible\" ).removeAttr( \"style\" ).fadeOut();\r\n\t\t\t}, 1000 );\r\n\t\t}", "function fadeOut(el){\n\t\t\n\t\t\t\t\tel.style.opacity = 1;\n\t\n\t\t\t\t\t(function fade() {\n\t\t\t\t\t\tif ((el.style.opacity -= 0.4) < 0) {\n\t\t\t\t\t\t\tel.style.opacity = 0;\n\t\t\t\t\t\t\tel.style.display = 'none';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twindow.requestAnimationFrame(fade);\n\t\t\t\t\t\t}\n\t\t\t\t\t})();\n\t\t\t\t}", "function fadeOut(){\r\n $(\"#avpArea\").fadeOut(1000);\r\n $(\"#rvpRegion\").fadeOut(1000);\r\n $(\"#ncProject\").fadeOut(1000);\r\n }", "function fadeOut(el){\n el.style.opacity = 1;\n (function fade(){\n if((el.style.opacity -= .05) < 0 ) {el.style.display = \"none\"; return;}\n requestAnimationFrame(fade);\n })(); \n}", "function cerrar_alert () {\n $('.alert').fadeOut('slow');\n}", "function fadeOut(el) {\n el.style.opacity = 1;\n\n (function fade() {\n if ((el.style.opacity -= .1) < 0) {\n // el.style.display = 'none';\n el.style.opacity = 0;\n el.classList.add('is-hidden');\n } else {\n requestAnimationFrame(fade);\n }\n })();\n }", "function callback(){\n\t\t\tsetTimeout(function(){\n\t\t\t\t$(\"#effect:visible\").removeAttr('style').hide().fadeOut();\n\t\t\t}, 1000);\n\t\t}", "static fadeOut(element)\n {\n element.style.opacity = 1;\n\n (function fade() {\n if ((element.style.opacity -= .1) < 0) {\n element.style.display = \"none\";\n } else {\n requestAnimationFrame(fade);\n }\n })();\n }", "function callback() {\n setTimeout(function() {\n $( \"#effect:visible\" ).removeAttr( \"style\" ).fadeOut();\n }, 1000 );\n}", "function callback() {\n setTimeout(function() {\n $( \"#effect:visible\" ).removeAttr( \"style\" ).fadeOut();\n }, 10000 );\n }", "function smartFadeOut(){\n // grab the desired fadeOutTime\n fadeOutTime = parseFloat($(\"#fade-out-time\").val());\n // default to 5 seconds if fadeOutTime could not be parsed or is negative\n fadeOutTime = fadeOutTime > 0 ? fadeOutTime * 1000 : 5000;\n // Increment the ID to cancel out any previous fade-outs\n let thisId = ++fadeOutID;\n setTimeout(\n function(){\n if(thisId == fadeOutID && $(\"#fade-out-check\").prop(\"checked\"))\n $(\"#name-underline-wrapper\").addClass(\"faded-out\"); \n }, fadeOutTime);\n}", "function animationFadeOutElement(selector, callback) {\n\t$(selector).animate({'opacity': '0'}, 1000, 'linear').promise().done(() => {\n\t\tif (callback) callback();\n\t});\n}", "function fade(fadeElem, cachedElem) {\n\t\topacityUp += 0.01;\n\t\topacityDown -= 0.01;\n\t\t\n\t\t\n\t\tfadeElem.style.opacity = opacityUp.toFixed(2); \n\t\tlastElem.style.opacity = opacityDown.toFixed(2);\n\t\n\t\tif (opacityUp.toFixed(2) == 1.00) \n\t\t {\n\t\t\t clearInterval(opct);\n\t\t\t lastElem.style.display = 'none';\n\t\t }\t\t \n\t }// end fade function\t ", "function showEnd() {\n $(\"#ui_3\").fadeOut(null, ()=>{\n $(\"#ui_end\").fadeIn();\n postLog();\n });\n}", "function isFading() {\n return ( fader.hasClass('show') || fader.hasClass('fadeOut') );\n }", "function callback() {\n\t\tsetTimeout(function() {\n\t\t\t\t$( \"#effect:visible\" ).removeAttr( \"style\" ).fadeOut();\n\t\t\t}, 100000 \n\t\t);\n\t}", "function\tcallback_ForTransition_SwitchDemoSet_DoneWithFadeOut( event )\n{\t\n//\talert( \"faded OUT (TRANSITION) \" + this.id );\t\t//\tDIAGNOSTICS\n\t\n\t\n//\tthis.style.visibility \t\t= 'hidden';\t\n//\tthis.style.display\t\t\t= 'none';\n\t\n\t\n\t/*** 01. Clean up transition and trigger. ***/\n\t$('#'+this.id).removeClass('fadeOut_Transition_DemoLayout');\n\tthis.removeEventListener( 'webkitTransitionEnd', callback_ForTransition_SwitchDemoSet_DoneWithFadeOut, false );\n\t/**********************************************/\n\t\n\t\n//\tthis.style.visibility \t\t= 'hidden';\t\n//\tthis.style.display\t\t\t= 'none';\n}", "function fadeOut(target) {\n\t$(target).animate({\n\t\topacity: 0\n\t}, 200);\n}", "function fadeThisOut(el) {\n\tel.style.opacity = 1;\n\n\t(function fade() {\n\t\tif ((el.style.opacity -= 0.07) < 0) {\n\t\t\tel.style.display = 'none';\n\t\t} else {\n\t\t\twindow.requestAnimationFrame(fade);\n\t\t}\n\t})();\n}// ~end Fade-out a div", "fadeOut(callback) {\n this.recipeWindow\n .animate(\n { opacity: [1, 0] },\n { duration: this.animationTime, easing: \"ease-out\" }\n )\n .finished.then(() => {\n this.hide(callback);\n });\n }", "function fadeOut(fadeIn) {\n var elem = document.getElementById(\"container\");\n var opacity = 10;\n var id = setInterval(frame, 120);\n function frame() {\n if (opacity == 0) {\n clearInterval(id);\n } else {\n opacity--;\n elem.style.opacity = opacity / 10;\n }\n }\n if(typeof fadeIn == 'function')\n fadeIn();\n}", "function fadeBackOut() {\n \tsetTimeout(function () {\n \t$('.body .signupPopup').fadeOut('slow');\n\t\t\t\t\t\t\t$('.body .signupPopupOverlay').fadeOut('slow');\n\t\t\t\t\t\t}, 2000);\n\t\t\t\t\t}", "function transitionOut() {\n var overlay = $(\"#transition-overlay\");\n overlay.fadeTo(\"slow\", 0, function () {\n overlay.css(\"pointer-events\", \"none\");\n userTransition = false;\n });\n}", "function outZone()\n{\n $('.slide-out-div').fadeOut(500);\t\n}", "function fadeOut(element) {\n element.style.opacity = 1;\n\n (function fade() {\n if ((element.style.opacity -= .1) < 0) {\n element.style.display = 'none';\n } else {\n requestAnimationFrame(fade);\n }\n })();\n }", "function fadeOut(el) {\n el.style.opacity = 1;\n (function fade() {\n if ((el.style.opacity -= 0.1) < 0) {\n el.style.display = \"none\";\n } else {\n requestAnimationFrame(fade);\n }\n })();\n}", "function fadeOut(target) {\n var sopac = 1;\n var fopac = 0;\n var elem = document.getElementById(target);\n var id = setInterval(frame, 10);\n var ms = 100;\n sopac = sopac * ms;\n\n function frame() {\n if ((sopac) === (fopac)) {\n clearInterval(id);\n elem = \"<p> <br> </p>\";\n } else {\n sopac -= 1;\n elem.style.opacity = sopac / ms;\n }\n }\n}", "function Disappear(bg_selector, status){\n //Adds the fade-out class to the icon, remove the fade-in class\n bg_selector.classList.remove(\"fade-in\");\n var name, arr;\n name = \"fade-out\";\n arr = bg_selector.className.split(\" \");\n if (arr.indexOf(name) == -1) {\n bg_selector.className += \" \" + name;\n }\n //console.log(\"Fades out\"); \n status = true;\n return status;\n }", "function fadeOut(element, callBack) {\n var removed = false;\n element.addClass('dg-css-fade-out');\n element.one('transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd', function (e) {\n if(!removed) {\n element.removeClass('dg-css-fade-out');\n removed = true;\n if (callBack !== undefined && can.isFunction(callBack)) {\n callBack();\n }\n }\n });\n setTimeout(function () {\n if(!removed) {\n element.removeClass('dg-css-fade-out');\n removed = true;\n if (callBack !== undefined && can.isFunction(callBack)) {\n callBack();\n }\n }\n }, TRANSITION_SPEED);\n}", "function fadedestroymodal() {\n\n var fadedcnt=0;\n\n // Fade out the popup\n popup.fadeOut(\n 100,\n function() { \n ++fadedcnt;\n if(2 == fadedcnt) {\n destroymodal(true); \n }\n }\n );\n\n // Fade out the background\n maskfade.fadeOut(\n 100,\n function() { \n ++fadedcnt;\n if(2 == fadedcnt) {\n destroymodal(true); \n }\n }\n );\n }", "function base_fadeOut(el){\n\tif (!el){ return false; }\n\tvar target = document.querySelectorAll(el);\n\tif ( target.length ){\n\t\tfor( t = 0; t<target.length; t++){\n\t\t\tif( target[t].classList.contains(\"fadeIn\") ){\n\t\t\t\ttarget[t].classList.remove(\"fadeIn\");\n\t\t\t}\n\t\t\tif( !target[t].classList.contains(\"fadeOut\") ){\n\t\t\t\ttarget[t].classList.add(\"fadeOut\");\n\t\t\t}\n\t\t}\n\t}else{\n\t\treturn false;\n\t}\n}", "function slowFadeOut(cual,lapse) {\r\n\tcual = cual; lapse = lapse;\r\n\tvoz.thisTimeout = window.setTimeout(\"fader('\" + cual + \"','hide','90','20','100')\",lapse);\r\n}", "function fadeAway(element,opacity) {\n if(opacity<=0) {\n element.parentNode.removeChild(element);\n return;\n }\n element.style.opacity=opacity;\n setTimeout(function() {\n fadeAway(element,opacity-0.05);\n },50);\n}", "function loadingFadeOut() {\n\t// Set an Interval to check if textures have loaded\n\tvar loadingID = setInterval(function() {\n\t\tif(fileLoader.isReady()) {\n\t\t\t$('#loadingTexturesOverlay').hide();\n\t\t\tclearInterval(loadingID);\n\t\t\tclearInterval(loadingEllipsisID);\n\t\t\tclearInterval(loadingSplashID);\n\t\t}\n\t}, 1000);\n}", "function fadeAlerts () {\n $('.messages.fade').fadeOut(400);\n\n}", "get fadeOut() {\n return this._fadeOut;\n }", "function cerrar(){ \n $(\"#loadMe\").animate({\"opacity\":\"0\"},1000,function(){$(\"#loadMe\").css(\"display\",\"none\");}); \n }", "function fadeOut() {\n //Algorithm:\n //1. Stop all running animations (first arg), including any fade animation and delay\n // Do not jump to the end of the animation (second arg). This prevents the message to abruptly\n // jump to opacity:0 or opacity:1\n //2. Wait <delay> ms before starting the fadeout\n //3. Start the fadeout with a duration of <duration> ms\n //4. Close the message at the end of the animation\n $this.stop(true, false).delay(delay).fadeOut(duration, function () {\n $this.closeMessage();\n });\n }", "function checkForEnd() {\n\t\tsetTimeout(function () {\n\t\t\t$(\"#content\").fadeOut(500, function () {\n\n\t\t\t\twindow.location = \"scene_pig3story.html\";\n\t\t\t});\n\t\t}, 2400);\n\t\tsetTimeout(function () {\n\t\t\t$(\"body\").removeClass(\"blackFade\");\n\t\t}, 1900);\n\t}", "function startFade(src_name, data) {\n $(\"body\").fadeOut(function () {});\n}", "function close()\n\t{\n\t\tthat.fadeOut(200, 0, fadeComplete);\n\t}", "function fadeAlert(id){\n\t\t$(id).fadeOut('slow', function() {\n\t\t\t$(id).remove();\n\t\t});\n\t}", "function animationFadeOutElementMS(selector, ms, callback) {\n\t$(selector).animate({'opacity': '0'}, ms, 'linear').promise().done(() => {\n\t\tif (callback) callback();\n\t});\n}", "setupFade(fadeTime, from, to, onFadeDone) {}", "function callback() {\r\n setTimeout(function () {\r\n $(\"#effect\").removeAttr(\"style\").hide().fadeIn();\r\n }, 1000);\r\n }", "function callback() {\r\n setTimeout(function () {\r\n $(\"#effect\").removeAttr(\"style\").hide().fadeIn();\r\n }, 1000);\r\n }", "function FADER() {\n $('.FADE').hide(0).delay(500).fadeIn(500);\n console.log('done');\n }", "function fadeOut(elem) {\n var fade = setInterval(function () {\n if (!elem.style.opacity) {\n elem.style.opacity = 1;\n } else {}\n if (elem.style.opacity > 0) {\n elem.style.opacity -= 0.1;\n } else {\n clearInterval(fade)\n elem.style.display = \"none\";\n }\n }, 50);\n}", "function FadeIn(element, callback) { StartShow(element, Config.Timer.Fade, Type.Fade, callback); }", "function CantFinishLook() {\n $('.create-finish').fadeOut(400);\n $('.create-finish').delay(1500).fadeIn(400);\n}", "function preloadFadeOut() {\n loaderStop();\n}", "function apcFadeOut()\n {\n $('#active__page_container')\n .addClass('animated fadeOut');\n }", "function checkElement(element) {\n \n if(element.cjFadeIn) {\n \n delete element.cjFadeIn;\n element.style.opacity = 1;\n element.style.visibility = \"visible\";\n \n }\n else if(element.cjFadeOut) {\n \n delete element.cjFadeOut; \n element.style.display = \"none\";\n \n }\n \n }", "function inZone()\n{\n $('.slide-out-div').fadeIn(500);\t\n}", "function fadeInFadeOut() {\n\t\tif($('nav').css(\"display\") == \"none\") {\n\t\t\t$('nav').show();\n\t\t\t$('nav').animate({\n\t\t\t\topacity: \"1\",\n\t\t\t\ttop: \"30px\"\n\t\t\t}, 250);\n\t\t} else {\n\t\t\t$('nav').animate({\n\t\t\t\topacity: \"0\",\n\t\t\t\ttop: \"20px\"\n\t\t\t}, 250).queue(function(){\n\t\t\t\t$('nav').hide();\n\t\t\t\t$(this).dequeue();\n\t\t\t});\n\t\t};\n\t}", "function loading_hide(){\n $('#loading3').fadeOut('fast');\n }", "function fadeOutEffect(selector, callback) {\n var fadeTarget = document.querySelector(selector);\n if (fadeTarget != null) {\n var fadeEffect = setInterval(function () {\n if (!fadeTarget.style.opacity) {\n fadeTarget.style.opacity = 1;\n }\n if (fadeTarget.style.opacity > 0) {\n fadeTarget.style.opacity -= 0.1;\n } else {\n clearInterval(fadeEffect);\n callback();\n }\n }, 20);\n }\n}", "function fadeOut(element, duration, timing, endHandler) {\n\t if (cssTransitionsSupported) {\n\t if (!timing) {\n\t timing = \"ease\";\n\t }\n\t setupTransition(element, \"opacity\", duration, timing);\n\t setOpacity(element, 0);\n\n\t element.addEventListener(\"webkitTransitionEnd\", $.proxy(function () {\n\t clearTransition(element);\n\t element.style.display = \"none\";\n\t setOpacity(element, 1);\n\t if (endHandler) {\n\t endHandler();\n\t }\n\t }, this), false);\n\t }\n\t else {\n\t //jQuery(element).animate({left: + x + \"px\"}), duration, 'linear', endHandler);\n\t }\n\t}", "fadeOut() {\n return new Promise((resolve, reject) => {\n let timer = this.fadeOutTime;\n renderLoop(() => {\n if (timer <= 0) {\n G.lock.sceneSwitch = false;\n resolve();\n return false;\n }\n this.calcRepaintItems();\n this.stage.alpha = --timer / this.fadeOutTime;\n });\n });\n }", "function fullScreenOut() {\n $($(this).children(\".img-cover\")[0]).fadeOut(240);\n}", "function fadeStuffs() {\n $(\".hidden\").fadeIn('slow', 'swing').removeClass('hidden');\n }", "function callback() {\n\t\tsetTimeout(function() {\n\t\t\t$( \"#effect\" ).removeAttr( \"style\" ).hide().fadeIn();\n\t\t\t}, 1000 \n\t\t);\n\t}", "fadeOut() {\n const self = this;\n // \"Unload\" Animation - onComplete callback\n TweenMax.to($(this.oldContainer), 0.4, {\n opacity: 0,\n onComplete: () => {\n this.fadeIn();\n }\n });\n }", "function writeToScreen(message, fadeout) {\n var pre = '';\n if (typeof(fadeout)==='undefined') fadeout = false;\n\n\n\n if (fadeout) {\n pre = '<p class=\"fadeout\" style=\"z-index: 9999;\">' + message + '</p>';\n\n output.append(pre);\n $('.fadeout').fadeOut(2000, function() {\n $(this).remove();\n });\n } else {\n pre = '<p>' + message + '</p>';\n output.append(pre);\n }\n\n\n}", "function fadeOut (element, cb) {\n if (element.style.opacity && element.style.opacity > 0.05) {\n element.style.opacity = element.style.opacity - 0.05\n } else if (element.style.opacity && element.style.opacity <= 0.1) {\n if (element.parentNode) {\n element.parentNode.removeChild(element)\n if (cb) cb()\n }\n } else {\n element.style.opacity = 0.9\n }\n setTimeout(() => fadeOut.apply(this, [element, cb]), 1000 / 30\n )\n}", "function invFade(obj)\n {\n obj.removeClass('invisible')\n .addClass('animated fadeIn')\n }", "function onAnimationEnd(e) {\n if ($element.hasClass('mos-hiding')) {\n // If it's a TransitionEvent and there is a timer, cancel it (otherwise the events will be fired twice)\n if (e && hideTimer) $timeout.cancel(hideTimer);\n\n $element.addClass('mos-hidden');\n $element.removeClass('mos-hiding');\n dispatch('onFinish');\n }\n }", "function OnFadeOut()\r\n{\r\n //Load html if this page is the webview.\r\n if( curPage==layWebView ) webView.LoadUrl( curUrl );\r\n \r\n //Fade in new content.\r\n setTimeout( function(){curPage.Animate(\"FadeIn\");}, 200 );\r\n}", "function loading_hide(){\n $('#loading2').fadeOut('fast');\n }", "function loading_hide(){\n $('#loading').fadeOut('fast');\n }", "_removeFadeOut() {\n const that = this,\n fadeOutItems = that.$.itemsContainer.getElementsByClassName('jqx-out');\n\n if (fadeOutItems.length) {\n for (let i = 0; i < fadeOutItems.length; i++) {\n fadeOutItems[i].classList.remove('jqx-out');\n }\n }\n }", "function callback() {\nsetTimeout(function() {\n $( \"#effect\" ).removeAttr( \"style\" ).hide().fadeIn();\n}, 1000 );\n}", "function loading_hide(){\n $('#loading').fadeOut('fast');\n }", "function fadeOut() {\n modal1.classList.remove('fade-in-modal')\n modal1.classList.add('fade-out-modal')\n backdrop.classList.remove('fade-in-back')\n backdrop.classList.add('fade-out-back')\n setTimeout(displayNone, 2000)\n}", "function animationFadeOutInElements(selector1, selector2, callback) {\n\tanimationFadeOutElement(selector1);\n\tanimationFadeInElement(selector2, () => {\n\t\tif (callback) callback();\n\t});\n}", "function loading_hide(ID) { \n$('#'+ID).fadeOut(); \n//$('#loading').fadeOut(); \n}", "function hide() {\n\t var time = arguments.length <= 0 || arguments[0] === undefined ? 200 : arguments[0];\n\t\n\t this.transition().duration(time).style('opacity', 0);\n\t }", "dialogFadeOut() {\r\n $('#dialog').fadeOut()\r\n }", "function fadeErrorDisplay(event){\n\tevent.preventDefault();\t\n\t$(\".errorDisplayOptions\").hide();\n\t$(\"#errorDisplay\").fadeOut(3000, function(){\n\t\t//allow the user to retrieve the message after fade out has completed\n\t\tretrieve(); \n\t});\n}", "function fade_out() {\n $(\"#answer\").html(\"\");\n}", "function apcFadeIn()\n {\n apc.addClass('fadeIn');\n setTimeout(function()\n {\n apc.removeClass(\"animated fadeOut fadeIn\");\n }, 800);\n }", "function loading_hide(){\n $('#loading6').fadeOut('fast');\n }", "function sfade(fin, inbetween){\n if (!fading) {\n fading = true;\n var cur = current_screen;\n current_screen=\"\";\n $(\"#\"+cur).fadeToggle(400, function () {\n if(inbetween) inbetween();\n current_screen=fin;\n $(\"#\"+fin).fadeToggle(400);\n fading = false;\n });\n }\t\n}", "playerFadeOut(activePlayerIndex) {\r\n $('#player' + activePlayerIndex).fadeTo(400, 0.2)\r\n }", "function animacaoJanela2() {\r\n $('#janela2').fadeOut(100);\r\n $('#janela2').fadeIn(100);\r\n}", "function allFadeOut(){\n $('.info').fadeOut();\n\n}", "function loading_hide(){\n $('#loading5').fadeOut('fast');\n }", "function colorFadeOutAnimation() {\n const colorFadeOut = anime({\n targets: '.team-section',\n opacity: [1, 0.8],\n easing: 'easeInOutQuad',\n duration: 300 \n });\n colorFadeOut.play();\n}", "function closeChangeCoverCatMenu(){\n $(\"#changeCPMenu\").fadeOut(\"fast\",function(){\n $(\"#changeCP\").fadeIn(\"fast\");\n });\n}", "function preloadFadeOut() {\n $(\".top__menu-btn-sandwich\").click(); \n fOnLoaderComplete();\n}", "function fadeOutAndCallback(image, callback){\n\tvar opacity = 1;\n\tvar timer = setInterval(function(){\n\t\tif(opacity < 0.1){\n\t\t\tclearInterval(timer);\n\t\t\tcallback(); // when done fading out, replace with new image\n\t\t}\n\t\timage.style.opacity = opacity; // image\n document.body.style.backgroundColor.opacity = opacity; // background\n\t\topacity -= 0.05;\n\t}, 50);\n}" ]
[ "0.7758483", "0.7170666", "0.6918584", "0.6901705", "0.689725", "0.6891727", "0.68677306", "0.6862373", "0.68529457", "0.6842583", "0.68419933", "0.6820198", "0.6814255", "0.6806423", "0.67969537", "0.67936957", "0.6783399", "0.6772745", "0.67649037", "0.67642057", "0.67582226", "0.6746141", "0.6744589", "0.6718854", "0.6711013", "0.6679945", "0.6661456", "0.66581285", "0.66577184", "0.6606604", "0.6595357", "0.6589156", "0.6587751", "0.65854573", "0.65783936", "0.6567664", "0.65621674", "0.65516603", "0.6544886", "0.653967", "0.653452", "0.6532869", "0.65281516", "0.65248305", "0.6523969", "0.6511926", "0.6491545", "0.64831144", "0.64787626", "0.64762414", "0.64670455", "0.6466323", "0.6460337", "0.6457721", "0.6457721", "0.64573807", "0.6443025", "0.6435193", "0.64264095", "0.64131224", "0.6406073", "0.64049035", "0.639801", "0.6397352", "0.6386318", "0.63858974", "0.63770324", "0.6360334", "0.6351574", "0.6343314", "0.6342651", "0.6336958", "0.6335843", "0.6332506", "0.6308415", "0.63077885", "0.6306156", "0.62956613", "0.6295405", "0.62918264", "0.62889415", "0.6287809", "0.6279373", "0.6277763", "0.62632155", "0.6252413", "0.62500304", "0.6238201", "0.6237782", "0.6233737", "0.62298506", "0.6229371", "0.6229246", "0.62120503", "0.62090135", "0.6204529", "0.6203865", "0.61988276", "0.61936253", "0.61924773" ]
0.66548246
29
to verify the functionality of on()
function clickMethod() { $(function() { $("p").show(); $("p").on("click", function() { console.log("paraghraph is clicked"); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "on() {\r\n throw new Error('Abstract method \"on\" must be implemented');\r\n }", "static on() {\n var args = Array.prototype.slice.apply(arguments);\n return _ee.on.apply(_ee, args);\n }", "onEvent() {\n \n }", "function on(){\n addEventToStorage( arguments[0], 'on' );\n return $element.on.apply( $element, params.apply( this, arguments ) );\n }", "on() {\n control.on.apply(this, [].slice.call(arguments));\n }", "on() {\n this.throwIfExited();\n\n this.phantomInstance.on.apply(this.phantomInstance, arguments);\n }", "function i(e,t){return[\"on\",\"once\"].forEach(function(n){t[n]=function(){return e[n].apply(e,arguments),t}}),e}", "onMistake() {\n\n }", "function callOnMe() { return 'called' }", "function On(e,t){for(var l in t)e[l]=t[l];return e}", "onAny() {}", "function setup_event (params) {\n return true;\n}", "function handler() {\n fired = true;\n }", "function onloevha() {\n}", "pressOn() {\n this.on.execute();\n this.history.push(this.on);\n }", "pressOn() {\n this.on.execute();\n this.history.push(this.on);\n }", "function on(t, e, n, r) {\n void 0 !== r && rn(t, e, n, r);\n}", "beforeHandlers (event) {\n\n }", "function on (event, cb) {\n emitter.on(event, cb)\n }", "function on (event, cb) {\n emitter.on(event, cb)\n }", "function on (event, cb) {\n emitter.on(event, cb)\n }", "onSwitch() {}", "onSwitch() {}", "onSwitch() {}", "_onTap(e) {}", "beforeHandling() {}", "on(...args){\n let emitter = privateMembers.get(this).emitter;\n emitter.on(...args);\n }", "on(...args){\n let emitter = privateMembers.get(this).emitter;\n emitter.on(...args);\n }", "handleEvent() {}", "handleEvent() {}", "_turnOn() {\n this.log.error('Rumble: Implement me: ' + this._turnOn().name);\n }", "on() {\n\t\tthis._lamps.on();\n\t}", "function click_on() {\n console.log('called click function');\n}", "on(event, fn) {\n\t\tthis.emitter.on(event, fn);\n\t}", "reportTo(onHandle = noop) {\n this.onHandle = onHandle;\n }", "get onEvent() {\n return this._onEvent;\n }", "on(ev, fn) {\n this.emitter.on(ev, fn);\n }", "onlog() {}", "onMessage() {}", "onMessage() {}", "onEnable() {}", "function handler(event) {\n Assert.ok(false, `Received unexpected event ${event.type}`);\n }", "function on(){return(on=Object.assign||function(g){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var A in e)Object.prototype.hasOwnProperty.call(e,A)&&(g[A]=e[A])}return g}).apply(this,arguments)}", "function yt(e,t){return function(r){var a=\"\";typeof r==\"string\"&&(a=Wu(\"on-\".concat(r)));for(var o=arguments.length,i=new Array(o>1?o-1:0),l=1;l<o;l++)i[l-1]=arguments[l];typeof e[a]==\"function\"?e[a].apply(e,i):t.apply(void 0,[r].concat(i))}}", "reflect (handler, event) {\n ( event = ( handler.match (/^on(.+)$/) || [] ) [1] )\n\n && Object.keys // ensure W3C on event\n ( HTMLElement.prototype )\n .includes ( handler )\n\n && this.on (event, this [handler])\n }", "before (instance, target) {\n\n }", "beforeJoining() {}", "function listening(){console.log(\"listening. . .\");}", "onOpen() {\n\t\t}", "on(data) {\n switch (data.type) {\n case ACTION_TYPES.CHANGE_GRAMMAR:\n this.onGrammar(data.grammar);\n break;\n case ACTION_TYPES.MOVE_CURSOR:\n this.onCursorMoved(data.cursor, data.user);\n break;\n case ACTION_TYPES.HIGHLIGHT:\n this.onHighlight(data.newRange, data.userId);\n break;\n case ACTION_TYPES.CHANGE_FILE:\n this.onChange(data.path, data.buffer);\n break;\n default:\n }\n }", "on(ev, cb) {\n this.evm.on(ev, cb);\n }", "onEvent() {\n const elements = document.querySelectorAll(\"[on]\");\n for (let i = 0; i < elements.length; i++) {\n const attr = elements[i].getAttribute(\"on\");\n const action = elements[i].getAttribute(\"action\");\n elements[i].addEventListener(attr, () => {\n eval(action);\n });\n }\n }", "onrecord() {}", "onReady() {}", "function assert(){\n called = true;\n }", "on(eventName, handler, fireOnBind = false) {\n super.on(eventName, handler);\n if (fireOnBind) {\n this.emit(eventName);\n }\n }", "OnActivated() {}", "afterHandling() {}", "on(eventName, handler) {\n // Note: this method only exists to define the types; we delegate the impl\n // to EventEmitter.\n return super.on(eventName, handler);\n }", "on (event, λ) {\n this.callbacks[event] = λ;\n }", "on(eventName, cb) {\n this._events.on(eventName, cb);\n }", "on(test, handler) {\n if (test == null) {\n throw TypeError('test must be provided');\n }\n\n if (!(test instanceof RegExp) &&\n typeof test != 'string' &&\n typeof test != 'function') {\n throw TypeError('test must be a regular expression, a string or a function');\n }\n\n if (handler == null) {\n throw TypeError('handler must be provided');\n }\n\n if (typeof handler != 'function') {\n throw TypeError('handler must be a function');\n }\n\n let handlers = this._events.get(test);\n\n if (handlers == null) {\n handlers = new Map();\n this._events.set(test, handlers);\n }\n\n handlers.set(handler, handler);\n }", "function mockCallBack() {\n}", "attachToClient(client) {\n // Must have an event name and handler\n if (!this.eventName || !this.handler) return false;\n client.on(this.eventName, (...args) => this.handler(client, ...args));\n return true;\n }", "setupNodeEvents(on, config) {\n // nothing\n }", "on(handler) {\n this.addEventListener(handler);\n }", "connected() {\n event();\n }", "handleEvents() {\n }", "on(event, cb) {\n this.conn.on(event, cb);\n }", "static _onListen () {\n debug('_onListen');\n\n TalkieActions.setActiveAnimation('receiving');\n }", "function onSomeAction(event, args) {\r\n // add logic\r\n }", "supports(eventName) {\n return true;\n }", "onTurn(handler) {\n return this.on('Turn', handler);\n }", "function test_event(event, t) {\n var counter = 0;\n\n function anon() {\n ++counter;\n\n if (counter === 1) {\n Fun.delay(anon, 500, this);\n anon.$Event.remove(\"go\");\n }\n }\n\n var sample_ev0 = $.Eventize(anon);\n\n var sample_ev1 = $.Eventize(function eventized() {\n ++counter;\n\n t.equal(counter, 2, \"[\" + event + \"]sample_ev1 error [\" + counter + \"] \");\n });\n\n // you can use normal functions if you dont want to stop/remove the listener from itself\n var sample_ev2 = function sample_ev2() {\n ++counter;\n\n t.equal(counter, 3, \"[\" + event + \"]sample_ev2 error [\" + counter + \"] \");\n };\n var once = 0;\n // you can use normal functions if you dont want to stop/remove the listener from itself\n var sample_once_ev3 = function sample_once_ev3() {\n t.equal(++once, 1, \"[\" + event + \"]sample_once_ev3 error [\" + once + \"] \");\n };\n\n var emitter = new $.Events();\n\n/*\nconsole.log(\n require(\"util\").inspect($.Events, {depth: 6, colors: true})\n );\nconsole.log(\n require(\"util\").inspect(emitter, {depth: 6, colors: true})\n );\n\nprocess.exit();\n*/\n\n t.equal(emitter.hasListeners(\"go\"), false, \"[\" + event + \"] should be at false listeners\");\n\n emitter.on(\"go\", sample_ev0);\n t.equal(emitter.hasListeners(\"go\"), 1, \"[\" + event + \"] should be at 1 listeners\");\n\n emitter.on(\"go\", sample_ev1);\n t.equal(emitter.hasListeners(\"go\"), 2, \"[\" + event + \"] should be at 2 listeners\");\n\n emitter.on(\"go\", sample_ev2);\n t.equal(emitter.hasListeners(\"go\"), 3, \"[\" + event + \"] should be at 3 listeners\");\n\n emitter.once(\"go\", sample_once_ev3);\n t.equal(emitter.hasListeners(\"go\"), 4, \"[\" + event + \"] should be at 4 listeners\");\n\n emitter.fireEvent(event);\n\n t.equal(counter, 3, \"[\" + event + \"]after emit error [\" + counter + \"] \");\n\n setTimeout(function () {\n t.equal(counter, 4, \"[\" + event + \"]after 1000ms error [\" + counter + \"] \");\n\n console.log(emitter.$__events);\n\n t.equal(emitter.hasListeners(\"go\"), 2, \"[\" + event + \"] should be at 2 listeners\");\n emitter.off(\"go\", sample_ev1);\n t.equal(emitter.hasListeners(\"go\"), 1, \"[\" + event + \"] should be at 1 listeners\");\n emitter.off(\"go\", sample_ev2);\n t.equal(emitter.hasListeners(\"go\"), false, \"[\" + event + \"] should be at 0 listeners\");\n\n emitter.fireEvent(event); //should no emit new events!\n\n t.end();\n }, 1000);\n }", "function onData(data) {\n\t\tconst probes = JSON.parse(data.body);\n\t\tconst keys = Object.keys(probes);\n\n\t\t// calls the functions to check which probes are on/off (return true/false)\n\t\tfindTrueProbes(probes, keys);\n\t\tfindFalseProbes(probes, keys);\n\t}", "on(eventType, callback) {\n super.on(eventType, callback);\n this.socket.on(eventType, callback);\n }", "handlerWillAdd (event, when, handler) {\n\n }", "function isAllHooksCalled (type, meta) {}", "function onevent(args) {\n console.log('connected')\n console.log(\"Event:\", args[0]);\n }", "on(listener, thisArgs, disposables) {\n return this.event(listener, thisArgs, disposables);\n }", "function onInit() {}", "event(x, y) {\n\t\tif (this.tap(x, y)) {\n\t\t\tif (this.callback) this.callback();\n\t\t}\n\t}", "call(onResult) {\n onResult();\n }", "on(eventName, callback) {\n if(!this.events[eventName]){\n this.events[eventName] = [callback];\n } else {\n this.events[eventName].push(callback);\n }\n }", "function tg(t,e,n){return il()(e)?DA.apply(void 0,Km(uu()(e).call(e,(function(e){var n,r;return\"object\"===Object(Ei[\"a\"])(e)?(n=e.event,r=e.selector):n=e,tg(t,n,r)})))):Zm((function(n){return t.on(e,n)}),(function(n){return t.un(e,n)}),n)}", "function test_notification_banner_service_event_should_be_shown_in_notification_bell() {}", "emit(eventName) {\r\n let fired = false;\r\n if (eventName in this.events === false) return fired;\r\n\r\n const list = this.events[eventName].slice();\r\n\r\n for (let i = 0; i < list.length; i++) {\r\n list[i].apply(this, Array.prototype.slice.call(arguments, 1));\r\n fired = true;\r\n }\r\n\r\n return fired;\r\n }", "function e(e) {\n return e && (\"function\" == typeof e.on || \"function\" == typeof e.addEventListener);\n }", "onOpen() { }", "onTrigger(eventType, handler) {\n this.internal.on(eventType, handler);\n }", "trigger(eventName) {\n if(this.events[eventName]){\n this.events[eventName].forEach(callback => {\n callback();\n })\n }\n }", "onConstructed() {}", "onConstructed() {}", "listener() {}", "function onevent(args) {\n console.log(\"Event:\", args[0]);\n }", "on(eventName, cb) {\n if (this.events[eventName]) {\n this.events[eventName].push(cb);\n } else {\n this.events[eventName] = [cb];\n }\n }", "on(type, fn, context = this) {\n\t\tif (!this.events[type]) {\n\t\t\tthis.events[type] = [];\n\t\t}\n\n\t\tthis.events[type].push([fn, context]);\n\t}", "function method_3(event) {\n QUnit.equal(event.data.value, 42, 'Hack with event data reception works.');\n\n o.dispatchEvent('trigger_4');\n }", "on_message(message) {\r\n }", "on_message(message) {\r\n }", "on_message(message) {\r\n }" ]
[ "0.7092111", "0.68560356", "0.6435595", "0.6402367", "0.6402291", "0.6383148", "0.63028854", "0.62865674", "0.6254449", "0.6221674", "0.62189764", "0.61673534", "0.61531276", "0.61391526", "0.6137059", "0.6137059", "0.61319375", "0.6127323", "0.6074456", "0.6074456", "0.6074456", "0.60618114", "0.60618114", "0.60618114", "0.6017042", "0.60027975", "0.5998186", "0.5998186", "0.599382", "0.599382", "0.5992221", "0.59627104", "0.589577", "0.5889703", "0.58753985", "0.58708644", "0.5859341", "0.5853764", "0.5852449", "0.5852449", "0.5851585", "0.5840657", "0.5835931", "0.5829203", "0.5824271", "0.5807777", "0.5803406", "0.57892096", "0.57846767", "0.5784349", "0.57755655", "0.5773222", "0.572649", "0.57260853", "0.5722508", "0.57192713", "0.57069284", "0.5702678", "0.569483", "0.5691448", "0.56888545", "0.5677778", "0.56544864", "0.5637746", "0.56300896", "0.5614218", "0.5604667", "0.5604645", "0.55747455", "0.557014", "0.5565847", "0.5565362", "0.5564987", "0.5557213", "0.55514574", "0.5550301", "0.5547797", "0.5544505", "0.5536818", "0.5529117", "0.5528517", "0.5525784", "0.5524562", "0.55185103", "0.5516838", "0.5515216", "0.55107313", "0.5472233", "0.5464923", "0.5461408", "0.54530734", "0.5449416", "0.5449416", "0.5445537", "0.54340214", "0.54340166", "0.54274243", "0.5425115", "0.5423544", "0.5423544", "0.5423544" ]
0.0
-1
to verify the functionality of one()
function oneMethod() { $(function() { $("p").show(); $("p").one("click",onemethodCheck); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function one() {\n console.log('function one was called');\n return false;\n}", "one(fn) {\n return this._one(fn);\n }", "one(fn) {\r\n return this._one(fn);\r\n }", "oneOf () { return this[ util.randomInt(this.length) ] }", "function oneOf(args) { }", "function one(){\n addEventToStorage( arguments[0], 'one' );\n return $element.one.apply( $element, params.apply( this, arguments ) );\n }", "static set one(value) {}", "function check() {}", "function any() {\n }", "one() {\n control.one.apply(this, [].slice.call(arguments));\n }", "function oneTruth(thing1,thing2){\n if(thing1 || thing2){return 'One is true.'}\n}", "function areAnyTrue(arg1, arg2) { //create the function with 2 arguments\n if (arg1 || arg2) { //set condition that one of the arguments needs to be true\n return \"One is true\" //only return if one of them are true\n }\n}", "function one() {\n return 1;\n}", "function one() {\n return 1;\n}", "function firstTrue(array) {\n for (var element of array) {\n if (args[1](element)){\n return element;\n }\n }\n return undefined;\n }", "function oneTrue(arg1, arg2){\n if(arg1 === true || arg2 === false){\n \treturn true;\n }\n}", "function oneTrue(thing1, thing2) {\n return thing1 || thing2\n// // if(thing1 === true || thing2 === true){\n// // return true\n// // } else {\n// // return false\n// // }\n}", "function trueOrFalse1() {\n\t\t \tconsole.log(eachone[count].option1.truth);\n\t\t \tif (eachone[count].option1.truth == true){\n\t\t \t\tcorrectAnswers++;\n\t\t \t\tguessedIt = true;\n\t\t \t} else {\n\t\t \t\tincorrectAnswers++;\n\t\t \t\tguessedIt = false;\n\t\t \t};\n\t\t}", "one(name, fn) {\n this.events.get(name).one(fn);\n }", "function _is_simple_same(question, answer, msg){\n\t_complete(question == answer, msg);\n }", "one(name, fn) {\r\n this.events.get(name).one(fn);\r\n }", "function once(fn){var called=false;return function(){var args=[],len=arguments.length;while(len--){args[len]=arguments[len];}if(called){return;}called=true;return fn.apply(this,args);};}", "function atleastOneIsTrue(arg1, arg2) {\n if (arg1 || arg2) { //checks if any of the arguments is true\n return \"true\";\n }\n}", "function $Teiw$export$isOneOf(a, b) {\n if (b === void 0) {\n b = [];\n }\n\n return b.some(function (v) {\n return a === v;\n });\n} //# sourceMappingURL=is-one-of.js.map", "function one(callback) {\n ///<summary>Execute a callback only once</summary>\n callback = callback || noop;\n\n if (callback._done) {\n return;\n }\n\n callback();\n callback._done = 1;\n }", "function one(){\n \n}", "function one$1() {\n var self = this;\n\n self.actual++;\n\n if (self.actual >= self.expected) {\n self.emit('done');\n }\n}", "function checkSingleResult(personArr) {\n if (personArr.length === 1) {\n return personArr[0];\n } else if (personArr.length > 1) {\n return personArr;\n } else {\n return undefined;\n }\n}", "other () { return true }", "other () { return true }", "function any (data) {\n if (array(data)) {\n return testArray(data, true);\n }\n\n assert.object(data);\n\n return testObject(data, true);\n }", "function one() {\n\t// this 'a' var only belongs to the one() fn\n\tvar a = 1;\n\tconsole.log(a);\n}", "function some(self) {\n return (0, _foldM.foldM_)(self, x => core.fail(O.some(x)), O.fold(() => core.fail(O.none), _succeed.succeed));\n}", "function oneOrMore(fn) {\n return function() {\n return fn.apply(null, toArray(arguments)).length > 0\n }\n }", "check(user_choice){\n return user_choice === this.answer;\n }", "static get one() {}", "function ok$1() {\n return true\n}", "function any (data) {\n if (array(data)) {\n return testArray(data, true);\n }\n\n assert.object(data);\n\n return testObject(data, true);\n }", "function single(a) {\n return new Take(Ex.succeed(A.single(a)));\n}", "function always () { return true }", "check(_p) {\n success.push('yes');\n }", "function one(){\n\treturn 4\n}", "function Event_IsSingleEvent(event1)\n{\n\t//default: its a single event\n\tvar bRes = true;\n\t//switch according to the event\n\tswitch (event1)\n\t{\n\t\tcase __NEMESIS_EVENT_DRAGDROP:\n\t\t\t//this is a double event\n\t\t\tbRes = false;\n\t\t\tbreak;\n\t}\n\t//return the result\n\treturn bRes;\n}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function _checkAi(){return true;}", "function check1() {\n\n}", "function Exact() {\r\n}", "function once(fn){var called=false;return function(){if(called){return;}called=true;return fn.apply(this,arguments);};}", "test() {\n return this.hexSHA1(\"abc\") === \"a9993e364706816aba3e25717850c26c9cd0d89d\";\n }", "first() {\n return this._first && this._first.value;\n }", "function any(func, array){\n for (var i=0; i<array.length; i++){\n\t if (func(array[i])) return true;\n }\n return false;\n }", "function returnTrue() {\n\t\t\treturn true;\n\t\t}", "function returnTrue() {\n\t\t\treturn true;\n\t\t}", "function returnTrue() {\n\t\t\treturn true;\n\t\t}", "function returnTrue() {\n\t\t\treturn true;\n\t\t}", "function any(func) {\n return function() {\n var params = getParams(arguments);\n var length = params.length;\n for (var i = 0; i < length; i++) {\n if (func.call(null, params[i])) {\n return true;\n }\n }\n return false;\n };\n }", "function any(func) {\n return function() {\n var params = getParams(arguments);\n var length = params.length;\n for (var i = 0; i < length; i++) {\n if (func.call(null, params[i])) {\n return true;\n }\n }\n return false;\n };\n }", "function any(func) {\n return function() {\n var params = getParams(arguments);\n var length = params.length;\n for (var i = 0; i < length; i++) {\n if (func.call(null, params[i])) {\n return true;\n }\n }\n return false;\n };\n }", "function is1(x){\r\n return x == 1;\r\n}", "function testAny(arr, fn) {\n for(var i=0;i<arr.length;i++) {\n if(fn(arr[i])) {\n return true;\n }\n }\n return false;\n }", "isOneOf(...posVals){\n\t\treturn this.addTest((obj) => {\n const isObjOneOfPosVals = posVals.some(\n posVal => Object.is(posVal, obj)\n );\n return new Validity(isObjectOfValidType,\n `${this.name} can only be one of ${posVals.join(', ')}`);\n }, 'isOneOf');\n\t}", "function testSingleBooleanStruct() {\n var single_bool = new structs.SingleBoolStruct();\n single_bool.value = true;\n\n var builder = new codec.MessageBuilder(\n 1, structs.SingleBoolStruct.encodedSize);\n builder.encodeStruct(structs.SingleBoolStruct, single_bool);\n var reader = new codec.MessageReader(builder.finish());\n var result = reader.decodeStruct(structs.SingleBoolStruct);\n\n // Use toEqual() instead of toBeTruthy() to make sure the field type is\n // actually boolean.\n expect(result.value).toEqual(true);\n }", "function once(fn){var called=false;return function(){if(!called){called=true;fn.apply(this,arguments);}};}", "function once(fn){var called=false;return function(){if(!called){called=true;fn.apply(this,arguments);}};}", "function CheckIfPatientExists(){\n\t\t\t\n\t\t\t\n\t\t\treturn true;\n\t\t}", "get any() {\n this.anyOne = true;\n return this;\n }", "function verifyInput(){\r\n}", "static validateAtLeastOne(expression) {\n FunctionUtils.validateArityAndAnyType(expression, 1, Number.MAX_SAFE_INTEGER);\n }", "function check() {\n console.log('checkcheck');\n return true;\n}", "function assert(){\n called = true;\n }", "function _isSet() {\n var l = arguments.length, a = arguments, a0 = a[0], i;\n if (l < 1) {\n throw new Error('Minimum 1 argument must be given');\n }\n if (Array.isArray(a0)) {\n // If first argument is an array, test each item of this array and return true only if all items exist\n for (i = 0; i < a0.length; i++) {\n if (!_isSet.call(this, a0[i])) {\n return false;\n }\n }\n return true;\n } else {\n // For other case, try to get value and test it\n try {\n var v = _get.apply(this, arguments);\n // Convert result to an object (if last argument is an array, _get return already an object) and test each item\n if (!Array.isArray(a[l - 1])) {\n v = {'totest': v};\n }\n for (i in v) {\n if (v.hasOwnProperty(i) && !(v[i] !== undefined && v[i] !== null)) {\n return false;\n }\n }\n return true;\n } catch (e) {\n return false;\n }\n }\n }", "function _isSet() {\n var l = arguments.length, a = arguments, a0 = a[0], i;\n if (l < 1) {\n throw new Error('Minimum 1 argument must be given');\n }\n if (Array.isArray(a0)) {\n // If first argument is an array, test each item of this array and return true only if all items exist\n for (i = 0; i < a0.length; i++) {\n if (!_isSet.call(this, a0[i])) {\n return false;\n }\n }\n return true;\n } else {\n // For other case, try to get value and test it\n try {\n var v = _get.apply(this, arguments);\n // Convert result to an object (if last argument is an array, _get return already an object) and test each item\n if (!Array.isArray(a[l - 1])) {\n v = {'totest': v};\n }\n for (i in v) {\n if (v.hasOwnProperty(i) && !(v[i] !== undefined && v[i] !== null)) {\n return false;\n }\n }\n return true;\n } catch (e) {\n return false;\n }\n }\n }", "function single() \r\n{\r\n\tif(arguments.length==2 && !arguments[1])\r\n\t\treturn;\r\n\treturn document.evaluate(\".\" + arguments[0], arguments[1] || document.body, null, 9, null).singleNodeValue\r\n}", "function testO (element) {\n return element === O\n }", "function any(func) {\n return function () {\n var params = getParams(arguments);\n var length = params.length;\n for (var i = 0; i < length; i++) {\n if (func.call(null, params[i])) {\n return true\n }\n }\n return false\n }\n }", "function _isSet() {\n var l = arguments.length, a = arguments, a0 = a[0];\n if (l < 1) {\n throw new Error('Minimum 1 argument must be given');\n }\n if ($.isArray(a0)) {\n // If first argument is an array, test each item of this array and return true only if all items exist\n for (var i = 0; i < a0.length; i++) {\n if (!_isSet.call(this, a0[i])) {\n return false;\n }\n }\n return true;\n } else {\n // For other case, try to get value and test it\n try {\n var v = _get.apply(this, arguments);\n // Convert result to an object (if last argument is an array, _get return already an object) and test each item\n if (!$.isArray(a[l - 1])) {\n v = {'totest': v};\n }\n for (var i in v) {\n if (!(v[i] !== undefined && v[i] !== null)) {\n return false;\n }\n }\n return true;\n } catch (e) {\n return false;\n }\n }\n }", "function once(fn){\n\tvar firstExecution = true;\n\tvar result;\n\treturn function(){\n\t\tif(firstExecution){\n\t\t\tresult = fn();\n\t\t\tfirstExecution = false;\n\t\t\treturn result;\n\t\t} else {\n\t\t\treturn result;\n\t\t}\n\t}\n}", "function testX(element) {\n return element === X\n }", "static isSingle(coordinates) {\n return !Array.isArray(coordinates[0]);\n }", "function guard(){}", "function TrueSpecification() {}", "onAny() {}", "function test1() {\n return getRandomPiece() instanceof Piece\n}", "function oneIsTrue (myThing1, myThing2) {\n if (myThing1 !== true && myThing2 !== true) {\n console.log(\"This program DOES NOT run\");\n } else if (myThing1 === true && myThing2 === true) {\n console.log(\"This program DOES NOT run\");\n } else {\n console.log(\"This program runs\");\n }\n}", "function ifMatched(element) {\n afterComparing(element);\n sound('two');\n $(element).addClass('matched')\n .click(false);\n }", "function sha1_vm_test(){\n\n return hex_sha1(\"abc\") == \"a9993e364706816aba3e25717850c26c9cd0d89d\";\n\n }", "function testSingleTypeCall() {\n for (let testCaseInput of validInputTestCases) {\n eval(`\n function opaqueClz32(argument) {\n return Math.clz32(argument);\n }\n noInline(opaqueClz32);\n noOSRExitFuzzing(opaqueClz32);\n\n for (let i = 0; i < 1e4; ++i) {\n if (!isIdentical(opaqueClz32(${testCaseInput[0]}), ${testCaseInput[1]})) {\n throw \"Failed testSingleTypeCall()\";\n }\n }\n if (numberOfDFGCompiles(opaqueClz32) > 1)\n throw \"We should have compiled a single clz32 for the expected type.\";\n `);\n }\n}", "function testFunction() {\n\t\t\treturn true;\n\t\t}" ]
[ "0.65560395", "0.65077335", "0.6274583", "0.6159583", "0.6136094", "0.6133988", "0.6098185", "0.6039732", "0.6035667", "0.5912889", "0.59050536", "0.58516306", "0.5789599", "0.5789599", "0.5768234", "0.57035094", "0.568982", "0.56515026", "0.56446433", "0.5578211", "0.55684215", "0.5542339", "0.55388045", "0.55182904", "0.5509768", "0.54935664", "0.5482768", "0.5480116", "0.547607", "0.547607", "0.5449658", "0.54476976", "0.54357857", "0.5404347", "0.54037607", "0.5402388", "0.53912747", "0.537601", "0.535567", "0.53521895", "0.5343737", "0.5325451", "0.53199565", "0.5318002", "0.5318002", "0.5318002", "0.5318002", "0.5318002", "0.5318002", "0.5318002", "0.5318002", "0.5318002", "0.5318002", "0.5318002", "0.5318002", "0.5318002", "0.5279361", "0.52746856", "0.52484953", "0.5239891", "0.52397174", "0.5231619", "0.5223509", "0.52175444", "0.52175444", "0.52175444", "0.52175444", "0.52076864", "0.52076864", "0.52076864", "0.52016026", "0.52009684", "0.5200254", "0.51961106", "0.51911825", "0.51911825", "0.51817536", "0.5177154", "0.51661384", "0.51636344", "0.5161481", "0.5153832", "0.51510376", "0.51510376", "0.5143198", "0.51422095", "0.5141416", "0.51374924", "0.5129986", "0.5123003", "0.5110167", "0.5106249", "0.51024705", "0.50915384", "0.5090842", "0.5089483", "0.50816953", "0.5079727", "0.50681853", "0.5049961" ]
0.566194
17
to verify the functionality of toggle()
function toggleMethod() { $(function() { $("img").toggle(1000); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onToggle() {}", "toggle(){this.off=!this.off}", "action() {\n\t\tthis.toggle();\n\t}", "action() {\n\t\tthis.toggle();\n\t}", "action() {\n\t\tthis.toggle();\n\t}", "onToggle() {\r\n this.toggle = !this.toggle;\r\n }", "toggle4() {\r\n }", "toggle_() {\n if (this.isOpen_()) {\n this.close_();\n } else {\n this.open_();\n }\n }", "function toggle() {\n setIsToggledOn(prev => !prev)\n }", "handleToggle() {\n this.toggle.addEventListener(\"click\", (e) => {\n this.doToggle()\n })\n }", "function toggle(){\r\n\ttoggleResult();\r\n\t// toggleSearch();\r\n}", "function switchToggle() {\n\t\t\t\t\t$scope.isToggleOn = !$scope.isToggleOn;\n\t\t\t\t}", "function toggle() {\n setState(!state);\n }", "toggle () {\n this.opened = !this.opened;\n }", "toggle () {\n this.opened = !this.opened;\n }", "toggleButtonA() {}", "function toggle() {\n setOpened(!opened);\n expandedCallback(!opened);\n }", "toggle() {\n var event = this.fireBeforeEvent_();\n if (!event.defaultPrevented) {\n this.element_.classList.toggle(this.cssClasses_.VISIBLE);\n this.fireAfterEvent_();\n }\n }", "_toggle() {\n if (!this.disabled) {\n this.panel.toggle();\n }\n }", "toggle() {\n return (\n this.modalPanel.isVisible() ?\n this.quit() :\n this.warn()\n );\n }", "toggle() {\n this.checked = !this.checked;\n }", "_toggle() {\n if (this._isVisible) {\n this._hide();\n } else {\n this._show();\n }\n }", "toggle() {\n this.enabled = !this.enabled;\n }", "onUntoggle() {\n const { onChangeToggle } = this.props;\n if (onChangeToggle) {\n onChangeToggle(null);\n }\n }", "toggle()\n {\n if (this.showing)\n {\n this.close();\n }\n else\n {\n this.open();\n }\n }", "toggle() {\n if (this.isOpen()) {\n this.close();\n }\n else {\n this.open();\n }\n }", "toggle() {\n if (this.isOpen()) {\n this.close();\n }\n else {\n this.open();\n }\n }", "toggleHandleClick(e) {\n if (this.opened) {\n this.hide();\n } else {\n this.show();\n }\n }", "_showToggle() {\n return !this.panel.hideToggle && !this.panel.disabled;\n }", "toggle() {\n if (this.isActive) {\n this.close();\n } else {\n this.open();\n }\n }", "toggle(doToggle) {\n // If the menu is horizontal the sub-menus open below and there is no risk of premature\n // closing of any sub-menus therefore we automatically resolve the callback.\n if (this._menu.orientation === 'horizontal') {\n doToggle();\n }\n this._checkConfigured();\n const siblingItemIsWaiting = !!this._timeoutId;\n const hasPoints = this._points.length > 1;\n if (hasPoints && !siblingItemIsWaiting) {\n if (this._isMovingToSubmenu()) {\n this._startTimeout(doToggle);\n }\n else {\n doToggle();\n }\n }\n else if (!siblingItemIsWaiting) {\n doToggle();\n }\n }", "function _toggleState( e ) {\n\t\t\te.stopPropagation();\n\t\t\te.cancelBubble = true;\n\n\t\t\t_setTriggerState( this, !_getTriggerState( this ) );\n\n\t\t\tif ( settings.hasControlLink && (_countTargets( true ) === _countTargets() || _countTargets( false ) === _countTargets()) ) {\n\t\t\t\t_updateControlLinkText();\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "function toggle(o) { o.is(':visible') ? o.hide() : o.show(); }", "function toggle(){\n\tif($(\"[data-toggle-btn]\").length){\n\t\t$(\"[data-toggle-btn]\").click(function(){\n\t\t\tvar btn = $(this).data(\"toggle-btn\");\n\t\t\t$(this).toggleClass(\"act\");\n\t\t\t$(\"[data-toggle-e = \"+btn+\"]\").toggle();\n\t\t\t$(\"[data-toggle-group = \"+btn+\"]\").toggle();\n\n\t\t\tif($(\".uc\").length){\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\tuc(\".uc\");\n\t\t\t\t},130);\n\t\t\t}\n\t\t});\n\n\n\t\t$(document).click(function(event){\n\t\t\tvar clk_obj = $(event.target).closest(\"[data-toggle-area]\");\n\n\t\t\t$(\"[data-toggle-area]\").each(function(){\n\t\t\t\tif(clk_obj.get(0)===$(this).get(0)){\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$(this).removeClass(\"act\");\n\t\t\t\t\t$(this).find(\"[data-toggle-e]\").hide();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\t$(\"[data-show-btn]\").click(function(){\n\t\t\tvar btn = $(this).data(\"show-btn\");\n\t\t\tvar e_group = $(\"[data-toggle-e *= \"+btn+\"]\");\n\t\t\t$(\"[data-toggle-group = \"+btn+\"]\").show();\n\t\t\te_group.show();\n\t\t\treturn false;\n\t\t});\n\n\t\t$(\"[data-hide-btn]\").click(function(){\n\t\t\tvar btn = $(this).data(\"hide-btn\");\n\t\t\tvar group = $(this).data(\"toggle-group\");\n\t\t\tvar e_group = $(\"[data-toggle-group = \"+group+\"][data-toggle-e]\");\n\t\t\t$(\"[data-toggle-e = \"+btn+\"]\").hide();\n\t\t\tif(btn===group){\n\t\t\t\te_group.hide();\n\t\t\t}\n\n\t\t\tvar q = false;\n\t\t\te_group.each(function(){\n\t\t\t\tif($(this).css(\"display\")!==\"none\"){\n\t\t\t\t\treturn q=false;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\treturn q=true;\n\t\t\t\t}\n\t\t\t});\n\t\t\tif(q){\n\t\t\t\t$(\"[data-toggle-k = \"+group+\"]\").hide();\n\t\t\t\t$(\"[data-toggle-mes = \"+group+\"]\").show();\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t\t\n\t\t$(\"[data-toggle-keyup]\").keyup(function(event){\n\t\t\tvar btn_val = $(this).data(\"toggle-keyup\");\n\t\t\tif(event.keyCode==13){\n\t\t\t\t$(\"[data-toggle-btn = \"+btn_val+\"]\").click();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t}\t\n}", "function _toggle() {\n var _editor = EditorManager.getCurrentFullEditor();\n _enabled = !_enabled;\n // Set the new state for the menu item.\n CommandManager.get(AUTOMATCH).setChecked(_enabled);\n \n // Register or remove listener depending on _enabled.\n if (_enabled) {\n _registerHandlers(_editor);\n } else {\n _deregisterHandlers(_editor);\n }\n }", "function toggle() {\n $( \"#target\" ).toggle();}", "toggle() {\n this.checked = !this.checked;\n this._onChange(this.checked);\n }", "function toggle(value){\n return !value;\n }", "toggleVisibility() {\n return this.stateIsOpen ? this.close() : this.open();\n }", "onClick(event) {\n if (event.button !== 0)\n return;\n\n this.dispatchEvent(new CustomEvent('toggle', {\n detail: !this.on,\n }));\n }", "toggle() {\n if (!this.disabled) {\n this.expanded = !this.expanded;\n }\n }", "handleToggleClickA(){\n this.setState({\n toggleStateA: !this.state.toggleStateA\n })\n }", "handleToggleClickA(){\n this.setState({\n toggleStateA: !this.state.toggleStateA\n })\n }", "toggleHelp() {\n this.setState({ showingHelp: !this.state.showingHelp });\n }", "get isToggled() {\n return this.toggled;\n }", "function togglemenu(){\n this.isopen = !this.isopen;\n }", "function simpleSwitcherToggle() {\n \"use strict\";\n $(\"#switcher-head .button\").toggle(function() {\n $(\"#style-switcher\").animate({\n left: 0\n }, 500);\n }, function() {\n $(\"#style-switcher\").animate({\n left: -263\n }, 500);\n });\n }", "toggle() {\n this.expanded = !this.expanded;\n }", "toggle() {\n this.panelOpen ? this.close() : this.open();\n }", "handleChangeToggle(e)\n { \n let togglelocal=\"false\";\n if(e)\n {\n \n togglelocal=\"true\";\n\n }\n this.setState({status: togglelocal});\n }", "if (!this.state.saving) {\n this.handleToggle()\n }", "toggle() {\n if(this.state.active) {\n if(this.state.iAmWinner) {\n this.exit_flag = true;\n this.iWin()\n } else {\n this.deactivate();\n }\n\n } else {\n this.activate();\n }\n\n }", "[toggleChecked](event) {\n\t\tconst self = this;\n\n\t\tif (event && self[IS_CLICKABLE]) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\n\t\tif (!self[IGNORE_EVENTS]) {\n\t\t\tself.isSelected(!self.isSelected());\n\t\t\tif (self.onSelect().length !== 0) {\n\t\t\t\tself.onSelect().trigger();\n\t\t\t}\n\t\t}\n\t}", "function toggle() {\r\n setModal(!modal)\r\n }", "function toggle() {\n if ($scope.menuState === openState) {\n close();\n } else {\n open();\n }\n }", "clickRaceRunnerToggleOFF(){\n this.raceRunnerToggleOFF.waitForExist();\n this.raceRunnerToggleOFF.click();\n }", "function toggleInteractions() {\n scObj.interactions.enable(document.getElementById(\"enableInteractions\").checked);\n}", "toggle() {\n this.selected = !this.selected;\n }", "toggle() {\n this.selected = !this.selected;\n }", "toggleList() {}", "toggle() {\n this.setState({ isOpen: (!this.state.isOpen) });\n }", "handleOnToggle () {\n this.props.onToggle()\n }", "function handleClick() {\n setHam((old) => !old);\n }", "toggle() {\n if(this.$element.hasClass('is-open')){\n if(this.$anchor.data('hover')) return;\n this.close();\n }else{\n this.open();\n }\n }", "handleToggleClick() {\n this.buttonClicked = !this.buttonClicked; //set to true if false, false if true.\n this.cssClass = this.buttonClicked ? 'slds-button slds-button_outline-brand' : 'slds-button slds-button_neutral';\n this.iconName = this.buttonClicked ? 'utility:check' : '';\n }", "clickHandler(event) {\n\t\tconsole.log(event.target);\n\t\tthis.myBool = !this.myBool;\n\t}", "function easyToggleCheck() {\n if (easyToggle === true) {\n easyBTN.classList.toggle(\"currentMode\");\n return easyToggle = false;\n } else {\n return;\n }\n}", "handleToggle() {\n this.setState({open: !this.state.open});\n }", "toggleCheckOutStatus() {\n this._isCheckedOut ? this._isCheckedOut = false : this._isCheckedOut = true;\n }", "confirmToggle() {\n const prevState = this.state.checked;\n const newState = !prevState;\n this.setState({ checked: newState }, () => this.emitCheckedChange(newState));\n // update state of the other buttons in the group\n this.group && this.group.onChecked(this, newState);\n this.aniChecked(newState);\n }", "function toggleFab() {\n\t\t\tshowChatBoolean.set(!$showChatBoolean);\n\t\t}", "function toggle() {\n setChecked((checked)=>!checked)\n }", "toggleState() {\n\n // Update the state to the opposite of what it is currently\n this.state = !this.state;\n }", "function toggle(x){\n switch(x){\n case \"on\":\n $('newBook').style.display = \"none\";\n $('displayData').style.display = \"none\";\n $('clearForm').style.display = \"inline\";\n $('anotherOne').style.display = \"inline\";\n break;\n\n case \"off\":\n $('newBook').style.display = \"block\";\n $('displayData').style.display = \"inline\";\n $('clearForm').style.display = \"inline\";\n $('anotherOne').style.display = \"none\";\n $('books').style.display = \"none\";\n break;\n default:\n return false;\n };\n }", "toggle() {\n this.collapsed = !this.collapsed\n }", "toggle() {\n this.collapsed = !this.collapsed\n }", "setToggled() {\n this.toggled = !!this.getPropValue(\"confirm\");\n }", "enable() {\n\t\tthis.toggle(true);\n\t}", "triggerClick(e) {\n const test = this.state.check_opened_module();\n // if(test){\n\n this.inputElement.click();\n // }\n }", "onToggleClick() {\n if (this.disabled) {\n return;\n }\n const newChecked = this.isSingleSelector ? true : !this._checked;\n if (newChecked !== this._checked) {\n this._checked = newChecked;\n if (this.buttonToggleGroup) {\n this.buttonToggleGroup.syncButtonToggle(this, this._checked, true);\n this.buttonToggleGroup.onTouched();\n }\n }\n // Emit a change event when it's the single selector\n this.change.emit(new McButtonToggleChange(this, this.value));\n }", "toggle(e) {\n\t\tif (this.isShowing) {\n\t\t\tthis.hideContainer(e);\n\t\t} else {\n\t\t\tthis.showContainer(e);\n\t\t}\n\t}", "function toggle(x) {\n\t\tswitch(x) {\n\t\t\tcase \"on\":\n\t\t\t\t$('#workoutForm').css(\"display\", \"none\");\n\t\t\t\t$('#showData').css(\"display\", \"none\");\n\t\t\t\t// $('#clearData').css(\"display\", \"none\");\n\t\t\t\t// $('#startNew').css(\"display\", \"inline\");\n\t\t\t\t// $('#saveData').css(\"display\", \"none\");\n\t\t\t\t// $('#addBack').css(\"display\", \"none\");\n\t\t\t\t// $('#foot').css(\"display\", \"none\");\n\t\t\t\tbreak;\n\t\t\tcase \"off\":\n\t\t\t\t$('#workoutForm').css(\"display\", \"block\");\n\t\t\t\t// $('#showData').css(\"display\", \"inline\");\n\t\t\t\t// $('#clearData').css(\"display\", \"inline\");\n\t\t\t\t// $('#startNew').css(\"display\", \"none\");\n\t\t\t\t$('#saveData').css(\"display\", \"inline\");\n\t\t\t\t// $('#addBack').css(\"display\", \"inline\");\n\t\t\t\t$('#foot').css(\"display\", \"block\");\n\t\t\t\t$('#items').css(\"display\", \"none\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}", "function toggleView(){\n\n }", "function toggleView(){\n\n }", "function toggleFavoriteButton(){\n // if toggle is true set it to false\n if(toggled){\n toggled = false;\n // if toggle is false set it to true\n }else{\n toggled = true;\n }\n}", "clickRaceRunnerToggleON(){\n this.raceRunnerToggleON.waitForExist();\n this.raceRunnerToggleON.click();\n }", "toggleRecommendIt() {\n ProductActions.toggleRecommendIt();\n }", "function toggleButtonClick() {\n toggleButton(event.target);\n}", "toggleOpen(__, evt) {\n // Knockout causes some interesting event handling to happen, so kludge it a bit\n if (evt.target.tagName === 'A') {\n return true;\n }\n\n if (this.isMessageOpen()) {\n return this.isMessageOpen(false);\n }\n return this.updateEvents().then(() => this.isMessageOpen(true));\n }", "function toggle() {\n opened = !opened;\n element.removeClass(opened ? 'closed' : 'opened');\n element.addClass(opened ? 'opened' : 'closed');\n }", "function toggle() {\n opened = !opened;\n element.removeClass(opened ? 'closed' : 'opened');\n element.addClass(opened ? 'opened' : 'closed');\n }", "get isToggled() {\n let command = !!this.range && !!this.command ? document.queryCommandState(this.command) : false,\n\n /* workaround because queryCommandState(\"underline\") returns true on links */\n block = this.command === \"underline\" ? this._getSelectedBlock(\"u\") !== null : command;\n return !!this.range && this.toggles && !!block ? true : false;\n }", "toggle() {\n this.setState({opened: !this.state.opened});\n }", "toggle() {\n this.setState({ collapse: !this.state.collapse });\n }", "toggle() {\n this.setState({\n open: !this.state.open\n });\n }", "toggleRuleSelectBox(){\n if(!this.isRuleBlurEventCalled){\n let temp = !this.state.isToShowRuleSelectBox;\n this.setState({isToShowRuleSelectBox:temp});\n }else{\n this.isRuleBlurEventCalled=false;\n }\n }", "toggleCheckOutStatus() {\n this.isCheckedOut = !this.isCheckedOut;\n }", "function toggleFlipper() {\n\t\t\t\t\tflipperService.toggle(id);\n\t\t\t\t}", "_toggleCollapsedState() {\n const that = this;\n\n if (!that.collapsible) {\n return;\n }\n\n if (!that.collapsed) {\n that.collapse();\n }\n else {\n that.expand();\n }\n }", "toggle(value = !this.onOff) {\r\n return this.operatePlug({ onOff: value });\r\n }", "onClick_() {\n this.fire('toggle-expanded');\n }" ]
[ "0.7454172", "0.7225304", "0.7151616", "0.7151616", "0.7151616", "0.69567966", "0.6868214", "0.67467", "0.67101854", "0.6644265", "0.66378665", "0.6637316", "0.6607134", "0.65587515", "0.65587515", "0.65462184", "0.652574", "0.6515805", "0.6459588", "0.64514756", "0.644936", "0.64427775", "0.6436105", "0.63912606", "0.6374187", "0.6319872", "0.6319872", "0.6306449", "0.6296673", "0.62924576", "0.6258936", "0.6254646", "0.6254188", "0.62432426", "0.6242618", "0.6237209", "0.6229517", "0.62289274", "0.6223109", "0.6215451", "0.6190343", "0.61801004", "0.61801004", "0.6166287", "0.6164654", "0.6163202", "0.6152658", "0.6144714", "0.61440694", "0.613289", "0.61316174", "0.6128594", "0.61171216", "0.6111122", "0.6101322", "0.60988665", "0.6096079", "0.6090091", "0.6090091", "0.6086339", "0.608362", "0.60797614", "0.6073402", "0.60696024", "0.60678524", "0.6063034", "0.606216", "0.60570776", "0.60540086", "0.6049615", "0.60468423", "0.6029673", "0.60259396", "0.60244054", "0.602172", "0.602172", "0.60147524", "0.60144365", "0.6010879", "0.60093176", "0.6008279", "0.6006326", "0.60062814", "0.60062814", "0.5997691", "0.59976107", "0.5993802", "0.599332", "0.5992452", "0.5989417", "0.5989417", "0.59885895", "0.59885466", "0.59824705", "0.5980475", "0.59804565", "0.59803563", "0.5976975", "0.5968728", "0.59646946", "0.59612656" ]
0.0
-1
to verify the slidetoggle() function
function slidetoggleMethod() { $(function() { $("img").slideToggle(2000); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggle_slide(){\n clickSound.play();\n\n if (slide.bodyOffset > 0){ \n slide.close();\n }\n else{\n slide.open();\n }\n\n e.stopPropagation();\n}", "function toggleSlide() {\n var $this = $(this);\n if (!$this.hasClass(\"disabled\")) {\n self.toggle($this, $element, $slideShow, $inViewSlide, $pagerCurrentDot);\n }\n }", "function slideToggle() {\n\tif ( $(this).css(\"display\") == \"none\" ) {\n\t\t$(this).stop(false, false).slideDown();\n\t} else {\n\t\t$(this).stop(false, false).slideUp();\n\t}\n}", "function ptoggles() {\r\n jQuery('.toggles > li').each(function(i){\r\n var photoggles=jQuery(this);\r\n photoggles.find('.toggle-content').slideUp(0);\r\n photoggles.find('.toggle-title').click(function(){\r\n var displ = photoggles.find('.toggle-content').css('display');\r\n if (displ==\"block\") {\r\n photoggles.find('.toggle-content').slideUp(300) \r\n } else {\r\n photoggles.find('.toggle-content').slideDown(300) \r\n }\r\n });\r\n });\r\n}", "onToggle() {}", "function trueSlideFunction(oldSlidePosition, newSlidePosition){\n return true;\n }", "function ks_strategy_toggleSlide(param, elementObject) \n{\n // $(elementObject).children(\".toggle\").css(\"display\", \"none\");\n // $.each(elementObject, function(index, value){\n // console.log(elementObject[index]);\n\n // $(elementObject[index]).on(\"click\", function(e){\n // e.preventDefault();\n // if($(elementObject[index]).children().next().is(\":hidden\")) {\n // $(elementObject[index]).children().next().addClass(\"active\").slideDown();\n // } else {\n // console.log(elementObject[index]);\n // $(elementObject[index]).children().next().removeClass(\"active\").slideUp();\n // }\n // });\n\n // }); //End of each loop\n\n // $(elementObject)\n}", "function showOperations(){\n $(operations).toggle('slide');\n}", "toggle4() {\r\n }", "function Toggle (item) {\n $(item).slideToggle();\n}", "function di_toggle_widget(div_id) \n{\n di_jq('#'+div_id).slideToggle();\t \n}", "function showSlideInfo(slide) {\n if (slide == 1) {\n $('#slideInfo').toggle(\"slide\", { direction: \"right\" }, 400);\n $('.main-header').addClass(\"hideBannerOnMobileSlide\");\n\n\n myPlayer.pause(); //no call to save cc state is needed here since we save it on pause event\n\n\n } else if (slide == 2) {\n //$('#slideInfo2').toggle(\"slide\", { direction: \"right\" }, 400);\n //myPlayer2.pause(); //no call to save cc state is needed here since we save it on pause event\n\n }\n}", "initSlideShare() {\n this.slideTrigger.on( 'click', ( e ) => {\n e.preventDefault()\n\n this.$element\n .toggleClass( 'open' )\n } )\n }", "_showToggle() {\n return !this.panel.hideToggle && !this.panel.disabled;\n }", "on_button(evt)\n\t{\n\t\tlet i = parseInt(evt.currentTarget.getAttribute(\"data-slide-idx\"));\n\t\t(i == this.current) || this.show(i);\n\t}", "function SlidePanels(action){\n var speed=900;\n var easing=\"easeInOutExpo\";\n if(action==\"open\"){\n // $(\"#arrow_indicator\").fadeTo(\"fast\",0);\n $outer_container_right.stop().animate({right: 0}, speed,easing);\n //$bg.stop().animate({right: 585}, speed,easing);\n\n } else {\n $outer_container_right.stop().animate({right: -510}, speed,easing);\n //$bg.stop().animate({right: 0}, speed,easing,function(){$(\"#arrow_indicator\").fadeTo(\"fast\",1);});\n }\n }", "function toggleTimer(){\r\n\t \t$('#PackSuccess').slideToggle(1000,function(){\r\n\t \t\t//??\r\n\t \t});\r\n\t}", "function companyToggle(){\n if($('#company_name_toggle_on').is(\":checked\") || $('#company_name_toggle_off').is(\":checked\")) {\n $('#checkbox2').show(\"slide\", { direction: \"up\" }, 1000);\n $('#step_3').prop('disabled', false);\n $('#step_3').removeClass('bg-disable');\n $('#bg-legend_3').removeClass('bg-legend');\n $('#step_3').css(\"background\",\"rgb(237,203,180)\");\n $(\"#rock\").addClass('clickable');\n }\n}", "function checkActive(){\n return slideDivNbr;\n}", "function slideChanged(evt)\n {\n if ( !printMode ) {\n slideIndices = Reveal.getIndices();\n closeWhiteboard();\n playbackEvents( 0 );\n }\n }", "function dm3_sliding_panel(el) {\r\n\tvar panel_height = el.innerHeight(true);\r\n\tvar panel_switch = el.find('.sp_switch:first');\r\n\t\r\n\tpanel_switch.css({\r\n\t\topacity: 0.6\r\n\t});\r\n\t\r\n\tel.css({\r\n\t\ttop: '-' + panel_height + 'px',\r\n\t\tdisplay: 'block'\r\n\t});\r\n\t\r\n\tfunction hide_el(el) {\r\n\t\tpanel_switch.removeClass('sp_switch_active');\r\n\t\tel.stop().animate({top: '-' + panel_height + 'px'}, {duration: 400});\r\n\t\tel.data('active', false);\r\n\t\tpanel_switch.css({ opacity: 0.6 });\r\n\t}\r\n\t\r\n\tfunction show_el(el) {\r\n\t\tpanel_switch.addClass('sp_switch_active');\r\n\t\tel.stop().animate({top: 0}, {duration: 400});\r\n\t\tel.data('active', true);\r\n\t\tpanel_switch.css({ opacity: 1 });\r\n\t}\r\n\t\r\n\tpanel_switch.click(function(e) {\r\n\t\te.stopPropagation();\r\n\t\t\r\n\t\tif (!el.data('active')) {\r\n\t\t\tshow_el(el);\r\n\t\t\t\r\n\t\t\t$('html').one('click', function() {\r\n\t\t\t\thide_el(el);\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\thide_el(el);\r\n\t\t}\r\n\t});\r\n\t\r\n\tel.click(function(e) {\r\n\t\te.stopPropagation();\r\n\t});\r\n}", "function showAssessmentOne() {\n $(\".assessment-one-container\").slideToggle(500);\n}", "function doIt() {\n $( \".obaut\" ).slideToggle(\"slow\");\n $(\".obaut\").toggleClass('active');\n return false;\n\n \n }", "function blogShareSlide() {\n if ($('.share-box.has-slide').length) {\n $('.share-box.has-slide button').on('click', function() {\n $(this).parent().find('.share-slide').toggleClass('share-hide share-show');\n });\n };\n}", "function toggleLog(btn, box){\n $(\"#\"+btn).click(function(){\n if ($(\"#\"+box).css(\"overflow\") == \"hidden\"){\n event.preventDefault();\n }else{\n $(\"#\"+box).slideToggle();\n } \n });\n}", "function doShowSlide()\n {\n // check status if control bar is shown by key action do nothing\n if(getStatus() == 'shown') {\n return true;\n }\n setStatus('shown');\n var margin;\n \n //check if other slide effect is in action and set margin\n if($('#oc_flash-player').is(':animated')) {\n $('#oc_flash-player').stop();\n margin = '-='+ (_height + parseInt($('#oc_flash-player').css('marginBottom'))).toString() +'px';\n } else {\n margin = '-='+ _height.toString() +'px';\n }\n \n $('#oc_flash-player').animate({\n marginBottom: margin\n }, {\n duration: _time,\n specialEasing: 'swing' \n });\n if(!hideAPLogo)\n {\n doShowAdvLinkSlide();\n }\n }", "function checkSizeTwo(){\n\n if (jQuery(\".menu-toggle\").css(\"display\") == \"block\" ){\n \n jQuery('.site-inner').click(function() {\n jQuery('.genesis-responsive-menu').slideUp('slow');\n jQuery('.menu-toggle').removeClass('activated');\n console.log('two working');\n \n });\n \n } else {\n console.log(\"\");\n // These wouldn't work with just 'if' statements, having to statements both with return caused a fatal conflict that causes the functions to fail\n }\n}", "openSlide() {\n this.reposSlide();\n this.dropAnimation();\n if(!this.transitions) {\n if (this.tansition_timer!=null) clearTimeout(this.tansition_timer);\n this.tansition_timer = setTimeout(this.checkIndex.bind(this), 250);\n }\n }", "function togglePilihPenumpang(){\n\ttoggleByClass(\"slide-div-bottom-penumpang\");\n}", "function toggle_panel(e){\n\t\t\tif($panel.is_popped_in()){\n\t\t\t\theightFix();\n\t\t\t}\n\t\t\t// If the user opens the panel and we didn't get the lyrics yet, pull it.\n\t\t\tif(!cur_song.gotLyrics && cur_song.title !== \"\"){\n\t\t\t\tcur_song.cur_time = $(\".ytp-time-display .ytp-time-current\").text();\n\t\t\t\t$lyrics.get_lyrics(cur_song, true, [$panel.autoscroll, manual_search]);\n\t\t\t\tcur_song.gotLyrics = true;\n\t\t\t}\n\t\t\t$panel.show_hide_panel(e, site);\n\t\t}", "toggleSlideOut() {\n this.setState(() => ({\n slideOutOpen: !this.state.slideOutOpen\n }));\n }", "static slideToggle (element, duration = 500) {\n if (window.getComputedStyle(element).display === 'none') {\n return this.slideDown(element, duration)\n } else {\n return this.slideUp(element, duration)\n }\n }", "function toggleAccommodation(){\n if ($(\"#special_accommodations_toggle_on\").is(\":checked\")) {\n $('#special_accommodations_wrap').show('Slow');\n if ($('#special_accomodations_text').val().trim().length > 0) {\n debugger\n }else{\n $('#checkbox2').hide('Slow');\n $('#step_3').prop('disabled', true);\n $('#step_3').addClass('bg-disable');\n $('#bg-legend_3').addClass('bg-legend');\n $('#step_3').css(\"background\",\"rgb(110,123,127)\");\n }\n }else{\n $('#special_accommodations_wrap').hide(\"slide\", { direction: \"down\" }, 2000);\n companyToggle();\n }\n}", "function switchSlide () {\n grabNextSlide();\n loadSlide();\n }", "function changeSlide(e) {\n // console.log(e);\n\n nextSlide = e.target.dataset.name;\n // if the statement is true\n if ( lastSlide == nextSlide) {\n // return exits (ends) the function\n // the code after (show, hide,..) doesn't get executed\n return;\n }\n\n // SHOW\n document.getElementById(nextSlide).style.display = 'grid';\n document.getElementById('btn-'+nextSlide).style.backgroundColor = \"#2896E0\";\n // HIDE\n document.getElementById(lastSlide).style.display = 'none';\n document.getElementById('btn-'+lastSlide).style.backgroundColor = \"#BEFCFE\";\n //SAVE\n lastSlide = nextSlide;\n \n \n playTimeLine(lastSlide);\n playTimeline(nextSlide);\n}", "function showAndClose() {\n if (slideIndex === 1) {\n prev.style.display = \"none\"\n } else {\n prev.style.display = \"block\"\n }\n\n if (slideIndex === demos.length) {\n next.style.display = \"none\";\n } else {\n next.style.display = \"block\";\n }\n}", "function showSideMenu() {\n if (sideMenuToggle == 0) {\n $(\"#mainpane\").animate({\n left: \"300\"\n }, 500);\n sideMenuToggle = 1;\n }\n else {$(\"#mainpane\").animate({\n left: \"0\"\n }, 500);\n sideMenuToggle = 0;\n }\n}", "function showQuestion1(){\n //show #answer1 if it's hidden\n //hide #answer1 if it's shown\n $('#answer1').slideToggle();\n }", "function showPDFOnClick(toggler, show){ \n $(\"#\"+toggler).slideToggle('200', 'linear');\n if(show){\n setTimeout(function(){\n window.location = \"#\"+toggler; \n }, 350);\n } else {\n setTimeout(function(){\n window.location = \"#section-achievement\"; \n }, 100);\n }\n}", "function toggleaction(ctrl, action) {\n\n $('.action-container').slideToggle(500);\n}", "togglerClick() {\n $('#toggler').click(() => {\n let toggler = parseInt($(this).css('left'))\n if (toggler > 0) {\n this.display.togglerSlideLeft()\n } else {\n this.display.togglerSlideRight()\n }\n })\n }", "function checkVisible()\n{\n\tcheckElementRunThough(\"slide-card\");\n\tcheckElementRunThough(\"cardSec\");\n}", "function toggleInfoPanel() {\n $('#info').slideToggle();\n}", "function show_hide_panel(e){\n\t\t\t\t\tif($mainContainer.length === 0)\n\t\t\t\t\t\t$mainContainer = $(\"#mainContainer\");\n\t\t\t\t\t\n\t\t\t\t\tif($panel.is_visible()){\n\t\t\t\t\t\t$mainContainer.removeClass(\"lyrics_visible\");\n\t\t\t\t\t}else {\n\t\t\t\t\t\tif($panel.is_popped_in()) $mainContainer.addClass(\"lyrics_visible\");\n\t\t\t\t\t\tif(!cur_song.gotLyrics && cur_song.artist !== \"\"){\n\t\t\t\t\t\t\tcur_song.cur_time = $(\"#time_container_current\").text();\n\t\t\t\t\t\t\t$lyrics.get_lyrics(cur_song, true, [$panel.autoscroll, manual_search]);\n\t\t\t\t\t\t\tcur_song.gotLyrics = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$panel.show_hide_panel(e, site);\n\t\t\t\t}", "breakPointMatch() {\n\t\tResponsiveLayoutManager.switchSection(\"left\");\n\t\tResponsiveLayoutManager.toggleToggleButton(true);\n\t}", "function _checkForSlideOut(browserWidth) {\n if (browserWidth >= smallScreenSize) {\n _removeSlideOut();\n } else if (browserWidth < smallScreenSize) {\n _convertToSlideOut();\n }\n }", "function closeSlideOut() {\r\n $('.handleSlideIn').trigger('click');\r\n $('.handle').css('display', 'block');\r\n isSlideOutClosed = 1;\r\n }", "function slideDown() {\n $( \"#target\" ).slideDown();}", "function onSlideChangeEnd()\n {\n isAnimating = false;\n }", "function slideShow() {\n $thumbArray\n .eq(index) // eq selects the element at the given index\n .trigger('click'); // trigger a psuedo click event\n\n // If the last thumbnail is passed, go the beginning\n if (++index >= $thumbArray.length) {\n index = 0;\n }\n }", "function nextSlide() {\n \n}", "function slideUP() {\n $( \"#target\" ).slideUp();}", "function triggerSlideEnd(){\n if(!slided){\n $(element).trigger({\n type: \"afterSliding\",\n prevSlide: prevSlide,\n newSlide: obj.currentSlide,\n totalSlides:obj.totalSlides,\n prevIndex:obj.prevIndex\n });\n slided = true;\n }\n obj.prevIndex = obj.currentSlide;\n }", "function slideDownAndUp() {\n\n // slideToggle Experiment\n $('#headerExperiment').click(function () {\n $('#cardBodyExperiment').slideToggle(\"slow\");\n });\n\n // slideToggle Experiment Text\n $('#headerExperimentText').click(function () {\n $('#cardBodyExperimentText').slideToggle(\"slow\");\n }); \n \n}", "function showslide(s) {\n var slideid = s;\n $('.howtoslide').hide();\n $('#' + displaymode + '_howtoslide' + slideid).fadeIn('slow');\n $('body').scrollTop(0);\n}", "function checkSize(){\n\n if (jQuery(\".menu-toggle\").css(\"display\") == \"block\" ){\n jQuery('.menu li a').click(function() {\n jQuery('.genesis-responsive-menu').slideUp('slow');\n jQuery('.menu-toggle').removeClass('activated');\n });\n \n } else {\n return;\n }\n}", "function _switchSlide(){\r\n\t\tif(slide > 0){\r\n\t\t\tfor(var i = 0; i<slide; i++){\r\n\t\t\t\tTweenMax.set($('#slide_'+i),{css:{top:'-100%'}});\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(slide>3){\r\n\t\t\t$('#fake_slide_1').hide();\r\n\t\t}\r\n\r\n\t\tTweenMax.to($('#slide_'+slide),1.6,{css:{top:'-100%'},ease:Expo.easeOut});\r\n\t\tTweenMax.to($('#slide_'+(slide+1)),1.6,{delay:0.2,css:{top:'0%'},ease:Expo.easeOut, onComplete: function(){\r\n\t\t\tslide +=1;\r\n\t\t\tconsole.log('slide: '+slide);\r\n\t\t}});\r\n\t}", "function sidePanel() {\n var x = document.getElementById(\"panelOpen\");\n if (x.style.display === \"none\") {\n x.style.display = \"block\";\n } else {\n x.style.display = \"none\";\n }\n}", "function show_hide_panel(e){\n\t\t\t\t\tif($panel.is_visible()){\n\t\t\t\t\t\t$mainContainer.removeClass(\"lyrics_visible\");\n\t\t\t\t\t}else {\n\t\t\t\t\t\tif($panel.is_popped_in()) $mainContainer.addClass(\"lyrics_visible\");\n\t\t\t\t\t\tif(!cur_song.gotLyrics && cur_song.artist !== \"\"){\n\t\t\t\t\t\t\tcur_song.cur_time = $(\"#time_container_current\").text();\n\t\t\t\t\t\t\t$lyrics.get_lyrics(cur_song, true, [$panel.autoscroll, manual_search]);\n\t\t\t\t\t\t\tcur_song.gotLyrics = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$panel.show_hide_panel(e, site);\n\t\t\t\t}", "function toplink_toggle() {\n \"use strict\";\n jQuery(\".toplink-toggle\").click(function() {\n jQuery(\".header-menu\").slideToggle();\n });\n}", "function watchSlideButtons() {\n var arrow_left = $('.arrow_left'), arrow_down = $('.arrow_right'),\n full = getUrlParameter('full');\n\n arrow_left.on('click', function scroll_left_init() { scrollLeft(); });\n arrow_down.on('click', function scroll_right_init() { scrollRight(); });\n\n $(window).bind('keydown', function(event) {\n if (event.keyCode == 37) { scrollLeft(); }\n else if (event.keyCode == 39) { scrollRight(); }\n else if ((full != \"true\") && ((event.keyCode == 38) || (event.keyCode == 40))) {toggle_description(); };\n });\n}", "function togglePanel() {\n renewElement($(\".anim-wrap\"));\n var $animated = $(\".anim-wrap\");\n var shown = $animated.hasClass('on');\n $animated.toggleClass('on', !shown).toggleClass('off', shown);\n }", "function SlideInfoRight() {\n if (slidePosition == 1) {\n $('#internment-title').hide();\n $('#tule-title').show();\n $('#lake-title').show();\n } else if (slidePosition == 2) {\n $('#heart-title').show();\n $('#mountain-title').show();\n $('#tule-title').hide();\n $('#lake-title').hide();\n }\n}", "function toggleBlock(toggleClick, toggleElement){\n\t\t\t$(toggleClick).click(function(){\n\t\t\t\t$(toggleElement).slideToggle(\"slow\");\n\t\t\t});\n\t\t}", "function toggleSlideOutNavigation() {\n setSlideOutNavigationVisible(!slideOutNavigationVisible);\n }", "toggle() {\n this.panelOpen ? this.close() : this.open();\n }", "_changeSlide(targetModel) {\n\t\t\t\tthis.getCurrentModel().toggleVisibility();\n\t\t\t\ttargetModel.toggleVisibility();\n\t\t\t}", "function slideButtons() {\n if (current_slide > 1 ){\n activateButton(\"previous\", \"previousSlide\" );\n } else {\n deactivateButton(\"previous\");\n }\n if (current_slide <= slidecount){\n activateButton('next', \"nextSlide\");\n } else {\n deactivateButton('next');\n }\n if (current_slide > slidecount){\n $('#slideshowInfo').html(\"End of \" + slidetitle );\n } else {\n showSlideCount();\n }\n}", "toggleVisible(){\n $(this.content).animate({width: 'toggle'}, 300);\n }", "showDevelopers(){\n $(\"#developerS\").slideToggle(\"fast\")\n }", "function Page_Toggle_State() {\n var currentState = document.getElementsByClassName(\"ww_skin_page_dropdown_arrow_collapsed\").length;\n var dropdownExpandExists = document.getElementsByClassName(\"ww_skin_page_dropdown_arrow_expanded\").length > 0;\n var dropdownCollapseExists = document.getElementsByClassName(\"ww_skin_page_dropdown_arrow_collapsed\").length > 0;\n var dropdownsExist = dropdownExpandExists || dropdownCollapseExists;\n var action = \"\";\n\n if (dropdownsExist) {\n if (currentState >= 1) {\n action = \"open\";\n }\n else if (currentState === 0) {\n action = \"close\";\n }\n }\n else {\n action = \"disabled\";\n }\n\n Set_Toggle_State(action);\n}", "function sidemenuToggle() {\n if(isSideMenuOpen) {\n sidemenuClose();\n } else {\n sidemenuOpen();\n }\n}", "function sidemenuToggle() {\n if(isSideMenuOpen) {\n sidemenuClose();\n } else {\n sidemenuOpen();\n }\n}", "function collapseHide() {\n $( \".slide-collapse\" ).click(function() {\n collapse($(this));\n });\n}", "function decideSlideBead(beadSpot){ \n let x;\n spot = beadChecker(\"left\", \"left\");\n if (beadSpot === spot && canClick){\n moveBead(\"right\"); \n } else {\n spot= beadChecker(\"right\", \"right\"); \n if (beadSpot === spot && canClick){\n moveBead(\"left\"); \n }\n }\n}", "function accordion() {\n\tif ($('.js-accordion').length) {\n\t\t$('.js-accordion').on('click', function () {\n\t\t\t$(this).toggleClass('is-closed');\n\t\t\t$(this).next().slideToggle();\n\t\t})\n\t}\n}", "function toggle() {\n $( \"#target\" ).toggle();}", "function HideThumbnails() { \n if (thumb_flag == 1) {\n $('#thumbnails').slideUp(function () {\n $('#ThumbPanelHideShow').html('<i class=\"fa fa-angle-double-up\"></i> <span>Show Thumbnails</span> <i class=\"fa fa-angle-double-up\"></i>');\n thumb_flag = 0;\n });\n\n }\n}", "_isMobileNavigation() {\n return this.toggleButton.offsetWidth > 0 && this.toggleButton.offsetHeight > 0;\n }", "function slideDropdownBehavior() {\n showSlide(slideDropdown.selectedIndex);\n}", "function _toggleButtons(){\n\n\t\t\t\tif($nav.children('.fn-previous-button').is(':hidden')){\n\t\t\t\t\t$nav.children('.fn-previous-button, .fn-next-button').show();\n\t\t\t\t \t$nav.children('.fn-close-button').hide();\n\t\t\t\t }\n\t\t\t\telse {\n\t\t\t\t\t$nav.children('.fn-previous-button, .fn-next-button').hide();\n\t\t\t\t \t$nav.children('.fn-close-button').show();\n\t\t\t\t}\n\t\t\t}", "function storyAccordion() {\n $(\".storyshow\").unbind().click(function (event) {\n $(this).toggleClass('open');\n\n var storyID = $(this).data('id');\n $(\"#\" + storyID).slideToggle('5000');\n });\n}", "function toggleFlow(elem) {\r\n if (slideshowTimeout != null) {\r\n // Pause slideshow\r\n clearInterval(slideshowTimeout);\r\n slideshowTimeout = null;\r\n\r\n // Set button text to \">\" (play)\r\n elem.innerHTML = \"&#9658;\";\r\n\r\n // Pause audio if it exists\r\n if (slideshowSound != null) {\r\n slideshowSound.pause();\r\n }\r\n } else {\r\n // Play slideshow\r\n slideshow();\r\n\r\n // Set button text to \"||\" (pause)\r\n elem.innerHTML = \"&#10074;&#10074;\";\r\n\r\n // Play audio if it exists\r\n if (slideshowSound != null) {\r\n slideshowSound.play();\r\n }\r\n }\r\n}", "function _manageVisibilityToggle(action) {\n if(action == 'show') {\n $('#container-pihole-toggle').show();\n } else if(action == 'hide') {\n $('#container-pihole-toggle').hide();\n }\n}", "function toggler_cards(btn, card, msg){\n $(btn).click(function(){ \n if ($(this).text() == msg) \n $(this).text(\"Close\"); \n else \n $(this).text(msg); \n $(card).slideToggle();});\n }", "toggle() {\n return (\n this.modalPanel.isVisible() ?\n this.quit() :\n this.warn()\n );\n }", "function toggleFaq(event) {\n\t\t\tif ($(event.currentTarget).parent().find(\".accordion1_body\").first().is(':visible')) {\n $(event.currentTarget).parent().find(\".accordion1_body\").first().slideUp(300);\n $(event.currentTarget).find(\".plusminus1\").text('+');\n }\n else {\n \t$(event.currentTarget).parent().find(\".accordion1_body\").first().slideDown(300);\n $(event.currentTarget).find(\".plusminus1\").text('-');\n }\n\t\t}", "function showInstructions() {\r\n $('#instructions-btn').on('click', () => {\r\n $('.landing-message').slideToggle(250);\r\n })\r\n}", "function checkWinSize() { //also properly redraws the slider.\n\t//for some reason, the slider doesn't retain good form\n\t// (but it does when you refresh, given that this code doesn't exist)\n\t\n\tconsole.log('checkWinSize');\n\tsetTimeout(function() {\n\t\tconsole.clear();\n\t}, 1);\n\t\n\tvar bool = window.innerWidth <= 1100;\n \n\t$('.expand').css('display', bool ? 'inline' : 'none');\n $('#menu-icon').css('display', bool ? 'inline' : 'none');\n $('.collapsible').css('display', bool ? 'none' : 'inline');\n $('.collapsible > *').css('display', bool ? 'none' : 'inline');\n}", "function showSlides() {\n slideIndex++;\n showSlidesByClick(slideIndex);\n}", "function open_NOW () {\n\t\t\tif (!s.isClosed) // skip if no longer closed!\n\t\t\t\tbindStopSlidingEvents(pane, true); // BIND trigger events to close sliding-pane\n\t\t\telse if (!s.isMoving)\n\t\t\t\topen(pane, true); // true = slide - open() will handle binding\n\t\t}", "function checkOffScreen($openedToggle) {\n if($openedToggle.siblings('.disclosure__list-wrap').is(':off-right')) {\n $openedToggle.siblings('.disclosure__list-wrap').addClass('disclosure--left');\n }\n }", "function _togglePosition() {\n\t\t\t// This is a dummy test that just toggles Side Panels positions\n\t\t\tit(\"(dummy) Toggle SidePanel positions\", function() {\n\t\t\t\tvar oPositionButton = element(by.css(\"#PositionButton\"));\n\t\t\t\toPositionButton.click();\n\t\t\t}, iDefaultTimeout);\n\t\t}", "toggle() {\n if(this.$element.hasClass('is-open')){\n if(this.$anchor.data('hover')) return;\n this.close();\n }else{\n this.open();\n }\n }", "function thaw() {\n log(\"clearing stop flag and scheduling a slide change\");\n\n if (stop) {\n jQuery('#panel1').show();\n setTimeout(function () {\n hideTopPanel();\n }, SETTINGS.CHANGETIME);\n }\n stop = false;\n}", "function menuToggle() {\n \"use strict\";\n\n jQuery('#header-service-menu-list a.sub-section').click(function (e) {\n e.preventDefault();\n jQuery(this).next().stop().slideToggle();\n jQuery(this).toggleClass('is-active');\n }).next().stop().hide();\n} //------------------------", "function slides(){\n if( netscape || goodIE || mozilla){\n if(visib==1){\n clearTimeout(tim);\n countdown = longpause;\n moveit();\n tim=setTimeout(\"checktime()\", pausetime);\n }\n }\n}", "function simpleSwitcherToggle() {\n \"use strict\";\n $(\"#switcher-head .button\").toggle(function() {\n $(\"#style-switcher\").animate({\n left: 0\n }, 500);\n }, function() {\n $(\"#style-switcher\").animate({\n left: -263\n }, 500);\n });\n }", "asdftoggle(img){\n this.currimg = img.image;\n this.asdfdialog = !this.asdfdialog;\n }", "function toggleViewCodeClick() \n{\n \n var element = $('#toggleViewCode');\n\n if(element.hasClass('wfHighlighted')) {\n $('.waveCode').slideUp();\n $('#toggleViewCode').removeClass('wfHighlighted');\n } else {\n $('.waveCode').slideDown();\n $('#toggleViewCode').addClass('wfHighlighted');\n }\n\n}" ]
[ "0.6951042", "0.66737735", "0.65691966", "0.64159924", "0.63568324", "0.63109374", "0.6305806", "0.6255506", "0.6211948", "0.6207447", "0.62058276", "0.6203456", "0.6144919", "0.6144548", "0.6133692", "0.6133489", "0.6097422", "0.60935104", "0.60523534", "0.60486597", "0.6047591", "0.6031112", "0.60232586", "0.6017834", "0.601026", "0.60070515", "0.59838796", "0.59813786", "0.59774923", "0.59752697", "0.597318", "0.59635884", "0.5943307", "0.5927926", "0.58967096", "0.5894289", "0.587894", "0.58787346", "0.58618295", "0.5852505", "0.58485436", "0.5837707", "0.58369374", "0.5830952", "0.582757", "0.5822971", "0.58204174", "0.57930183", "0.57807845", "0.5766201", "0.5763277", "0.57624465", "0.5760824", "0.57577753", "0.5745485", "0.5732463", "0.5730934", "0.572732", "0.5725792", "0.57246023", "0.5710708", "0.5697601", "0.5695605", "0.56933784", "0.569265", "0.56786555", "0.5678304", "0.5676272", "0.5675644", "0.5668609", "0.56654096", "0.5663226", "0.5663226", "0.56546503", "0.56514204", "0.5640624", "0.5638433", "0.56362224", "0.5634325", "0.56335396", "0.5625169", "0.562296", "0.56188256", "0.5616754", "0.5616451", "0.56109536", "0.5607454", "0.5603821", "0.56023777", "0.5596274", "0.5595333", "0.55917364", "0.55892926", "0.55883193", "0.55718815", "0.55684614", "0.5563493", "0.55617386", "0.5555625", "0.55551" ]
0.6373
4
to verify the usage of various methods in one line
function manyMethod() { $(function() { $("h2").show(); $("h2").hide(1000).delay(1500).show(1000); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check() {}", "verify() {\n // TODO\n }", "function TestMethods() {}", "function check (args) {\n\tvar actual = args.length;\n\tvar expected = args.callee.length;\n\tif (actual !== expected)\n\t\tthrow Error(\"Expected \" + expected + \" args; got \" + actual);\n}", "function checkFunctions(func1, func2) {\n if (func1.toString() !== func2.toString()) return false;\n return true;\n}", "myBestMethod(){\n\n }", "function callUnoTests() {\n let test1 = callUnoTest1(); //Calling uno with more than 2 cards considered invalid\n let test2 = callUnoTest2(); //Calling uno with only 2 cards considered valid\n console.log(\"\\n$ ~~~~~~ callUno() tests ~~~~~~\");\n console.log(\n \"$ Test 1: Calling uno with more than 2 cards considered invalid\"\n );\n if (test1 == 1) {\n console.log(\"$ **PASSED**\");\n } else {\n console.log(\"$ ~~FAILED~~\");\n }\n\n console.log(\"$ Test 2: Calling uno with only 2 cards considered valid\");\n if (test2 == 1) {\n console.log(\"$ **PASSED**\");\n } else {\n console.log(\"$ ~~FAILED~~\");\n }\n //return sum of tests. 1 = pass, 0 = fail\n return test1 + test2;\n}", "function check_and_report() {\n \n }", "function testAll() {\n testAssert()\n testRemainder()\n testConversions()\n}", "function testBadCall()\n{\n assert( 1 / 0);\n}", "methodIsValid(methodName) {\n return isString(methodName) ? !/^_+|_+$|constructor/g.test(methodName) : false;\n }", "toHaveHadCalls() {\n expect(this.actual.calls.map(call => call.arguments)).toEqual(Array.from(arguments));\n return this;\n }", "function compareMethods(path) {\n var new_data = safeLoadFile(path);\n var old_data = safeRequire(path);\n if (JSON.stringify(new_data) === JSON.stringify(old_data) ) {\n console.log(\"test passed\", new_data, old_data); \n } else {\n console.log(\"test failed\"); \n }\n}", "function test (a,b,c) {return a + b + c;}", "function runner(data, functs) {\n functs.forEach(element => {\n var result = element.funct(data);\n console.log(\"Result: \" + result);\n if (element.hasOwnProperty('exp')) {\n assert(result == element.exp)\n }\n });\n}", "function AssertTests() {\n}", "function checkMainArguments() {\n if (!this.operator) {\n error('\"operator\" parameter is missing');\n }\n\n if (!this.oldApiKey) {\n error('\"oldApiKey\" parameter is missing');\n }\n\n if (!this.newApiKey) {\n error('\"newApiKey\" parameter is missing');\n }\n}", "function\nASSERT_Processor(\n/*a)any*/arg0,\t//)argument to test\n/*a)any*/arg1\t//)second argument to test in compare\n){\n/*m)protected boolean*/this.check=function(\n/*string*/op\n){\nreturn eval(op + this.arg0.getArgument());\n}\t//---check\n\n/*m)protected boolean*/this.compute=function(\n/*string*/op\n){\nreturn eval(op + 'isNaN(' + this.arg0.getArgument() + ')');\n}\t//---compute\n\n/*m)protected boolean*/this.compare=function(\n/*string*/op\n){\nreturn eval(this.arg0.getArgument() + op + this.arg1.getArgument());\n}\t//---compare\n\n/*private ASSERT_Argument*/this.arg0 = new ASSERT_Argument(arg0);\n/*private ASSERT_Argument*/this.arg1 = new ASSERT_Argument(arg1);\n}\t//---ASSERT_Processor", "function __JUAssert(){;}", "function Test(fun, result) {\n console.log(fun === result);\n}", "function Test(fun, result) {\n console.log(fun === result);\n}", "function test(a, b) {\n return a + b;\n}", "function testInternalFunction(f) {\n var exec = f.factory();\n var args = [];\n\n for (var i = 1; i < arguments.length; i++) {\n args.push(new Result(arguments[i]));\n }\n return exec.execute(args);\n}", "async _checkMagik(doc) {\n if (!vscode.workspace.getConfiguration('magik-vscode').enableLinting)\n return;\n\n await this.symbolProvider.loadSymbols();\n\n const isConsole = this.magikVSCode.magikConsole.isConsoleDoc(doc);\n\n const diagnostics = [];\n const methodNames = {};\n const symbols = this.magikVSCode.currentSymbols;\n const symbolsLength = symbols.length;\n\n for (let i = 0; i < symbolsLength; i++) {\n const sym = symbols[i];\n\n if (sym.kind === vscode.SymbolKind.Method) {\n const startLine = sym.location.range.start.line;\n const region = MagikUtils.currentRegion(true, startLine);\n const {lines} = region;\n\n if (lines) {\n const {firstRow} = region;\n const assignedVars = MagikVar.getVariables(\n lines,\n firstRow,\n this.symbolProvider.classNames,\n this.symbolProvider.classData,\n this.symbolProvider.globalNames,\n diagnostics\n );\n this._checkUnusedVariables(assignedVars, diagnostics);\n this._checkClassNameVariables(assignedVars, diagnostics);\n // eslint-disable-next-line\n await this._checkMethodCalls(\n lines,\n firstRow,\n assignedVars,\n methodNames,\n diagnostics\n );\n\n if (!isConsole) {\n this._checkPublicComment(doc, lines, firstRow, diagnostics);\n this._checkMethodComplexity(lines, firstRow, diagnostics);\n this._checkMethodLength(lines, firstRow, diagnostics);\n }\n }\n }\n }\n\n this.diagnosticCollection.set(doc.uri, diagnostics);\n }", "function checkRunMe() {\n if (runMe == 'Lupus') {\n Lupus();\n }\n if (runMe == 'EmbarrassingSymptom')\t{\n\tEmbarrassingSymptom();\n }\n\n if (runMe == 'Respiratory') {\n respiratory();\n }\n\n if (runMe == 'Feet') {\n feet();\n }\n\n if (runMe == 'Rash') {\n rash();\n }\n\n if (runMe == 'Balding') {\n bald();\n\t};\n\n}", "function verifyFakes() {\n var method, isNot;\n\n for (var i = 0, l = arguments.length; i < l; ++i) {\n method = arguments[i];\n isNot = (method || \"fake\") + \" is not \";\n\n if (!method) this.fail(isNot + \"a spy\");\n if (typeof method != \"function\") this.fail(isNot + \"a function\");\n if (typeof method.getCall != \"function\") this.fail(isNot + \"stubbed\");\n }\n\n return true;\n }", "function f024checkFunc(set1, set2) {\n\n\t\treturn function() {\n\n\n\t\t\tif (set1.length === 0 || set2.length === 0) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (!hasSubfield(set1, 'a') || !hasSubfield(set2, 'a')) {\n\t\t\t\treturn null;\n\t\t\t} \n\n\t\t\tif (compareFuncs.isIdentical(set1, set2)) {\n\t\t\t\treturn SURE;\n\t\t\t}\n\n\t\t\tif (compareFuncs.isSubset(set1, set2) || compareFuncs.isSubset(set2, set1)) {\n\t\t\t\treturn SURE;\n\t\t\t}\n\n\t\t\tif (compareFuncs.intersection(set1, set2).length > 0) {\n\t\t\t\treturn ALMOST_SURE;\n\t\t\t}\n\n\t\t\treturn SURELY_NOT;\n\n\t\t};\n\n\t}", "function ok$1() {\n return true\n}", "function some(list, test) {\n throw 'not implemented';\n}", "function runner(data, functs, name = \"Test\") {\n console.log(name);\n functs.forEach(element => {\n var result = element.funct(data);\n console.log(\" - \" + element.funct.name + \" result: \" + result + \", expected: \", element.exp);\n if (element.hasOwnProperty('exp')) {\n assert(result == element.exp)\n }\n });\n}", "function test () {\n return arguments\n}", "function f_ext_2( a, b ) { null.should_not_be_called; return a * 20 + b; }", "function guard(){}", "function example(method, from, to) {\n it(method + 's \"' + from + '\" to \"' + to + '\"', function() {\n expect(_[method](from)).to.equal(to);\n });\n }", "expect(methodName, expectedArgs, returnValue) {\n if (!(typeof methodName === \"string\")) { throw TypeError(\"methodName must be a string.\"); }\n\n // TODO feature: expect a certain number of calls to a method\n if (expectedCalls.includes(methodName)) {\n throw Error(methodName + \" is already expected to be called. You currently cannot expect an method call more than once.\");\n }\n else {\n expectedCalls.push(methodName);\n }\n\n this[methodName] = function (...actualArgs) {\n // TODO feature: How deep should equality be checked?\n if (!arrayEqual(expectedArgs,actualArgs)) {\n errors.push(\"Expected \" + methodName + \" to be called with [\" + expectedArgs + \"]. It was actually called with [\" + actualArgs + \"].\");\n }\n\n if (!actualCalls.includes(methodName)) {\n actualCalls.push(methodName);\n }\n\n return returnValue;\n }\n }", "function calledWithStrict(spy) {\n var calls = spy.getCalls();\n var call;\n var args = Array.prototype.slice.call(arguments, 1);\n SCAN: for (var i = 0, len = calls.length; i < len; i++) {\n call = calls[i];\n if (call.args.length !== args.length) continue SCAN;\n for (var j = 0, lenj = args.length; j < lenj; j++) {\n if (call.args[j] !== args[j]) {\n continue SCAN;\n }\n }\n return true;\n }\n return false;\n}", "function testFunction() {\n\t\t\treturn true;\n\t\t}", "function testFunction() {\n\t\t\treturn true;\n\t\t}", "stop (_next) { methodNotDefined() }", "async _checkMethodCalls(\n lines,\n firstRow,\n assignedVars,\n methodNames,\n diagnostics\n ) {\n if (this.symbolProvider.classNames.length === 0) return;\n\n const names = MagikUtils.getClassAndMethodName(lines[0]);\n const currentClassName = names.className;\n const lineLength = lines.length - 1;\n\n for (let i = 1; i < lineLength; i++) {\n const row = firstRow + i;\n const line = lines[i];\n const text = MagikUtils.stringBeforeComment(line);\n const testString = MagikUtils.removeStrings(text);\n let startIndex = 0;\n let match;\n\n while (match = MagikUtils.VAR_TEST.exec(testString)) { // eslint-disable-line\n const name = match[0];\n let index = match.index;\n\n if (\n Number.isNaN(Number(name)) &&\n testString[index - 1] === '.' &&\n !METHOD_IGNORE_PREV_CHARS.includes(testString[index - 2]) &&\n !METHOD_IGNORE_WORDS.includes(name)\n ) {\n const methodName = MagikUtils.getMethodName(testString, name, index);\n let className;\n let inherit;\n\n index = text.indexOf(name, startIndex);\n\n const prevWord = MagikUtils.previousVarInString(text, index);\n if (prevWord === '_self' || prevWord === '_clone') {\n className = currentClassName;\n } else if (prevWord === '_super') {\n className = currentClassName;\n inherit = true;\n } else if (this.symbolProvider.classData[prevWord]) {\n className = prevWord;\n } else {\n const superMatch = /_super\\s*\\(\\s*([\\w!?]+)\\s*\\)\\s*\\.\\s*[\\w!?]*$/.exec(\n text.substring(0, index)\n );\n if (superMatch) {\n className = superMatch[1];\n } else {\n const prevData = assignedVars[prevWord];\n if (prevData) {\n className = prevData.className;\n }\n }\n }\n\n const key = `${className}.${methodName}`;\n let exists = methodNames[key];\n if (exists === undefined) {\n exists = await this._methodExists(methodName, className, inherit); // eslint-disable-line\n methodNames[key] = exists;\n }\n\n if (!exists) {\n const range = new vscode.Range(\n row,\n index,\n row,\n index + name.length\n );\n const msg = className\n ? `Method '${className}.${methodName}' is not defined.`\n : `Method '${methodName}' is not defined.`;\n const d = new vscode.Diagnostic(\n range,\n msg,\n vscode.DiagnosticSeverity.Error\n );\n diagnostics.push(d);\n } else if (className && methodName.indexOf('(') !== -1) {\n const paramString = await this._getMethodParamString(methodName, className, inherit); // eslint-disable-line\n\n if (paramString && paramString !== '') {\n // console.log(methodName, className, `'${paramString}'`);\n const args = MagikUtils.findArgs(\n lines,\n firstRow,\n i,\n index + name.length + 1\n );\n // console.log(args);\n // console.log(' ');\n\n if (args && !args.some((str) => str.startsWith('_scatter '))) {\n let gatherIndex = paramString.indexOf('_gather');\n let optionalIndex = paramString.indexOf('_optional');\n const exactNumber = gatherIndex === -1 && optionalIndex === -1;\n const optionalNoGather =\n optionalIndex !== -1 && gatherIndex === -1;\n\n if (gatherIndex === -1) {\n gatherIndex = paramString.length;\n }\n if (optionalIndex === -1) {\n optionalIndex = paramString.length;\n }\n\n const totalParams = paramString.split(',').length;\n const params = paramString\n .substring(0, Math.min(gatherIndex, optionalIndex))\n .split(',');\n const minString = params.slice(-1)[0].trim();\n if (minString === '' || minString === ',') {\n params.pop();\n }\n const minParams = params.length;\n const actualParams = args.length;\n\n if (\n actualParams < minParams ||\n (exactNumber && actualParams !== minParams) ||\n (optionalNoGather && actualParams > totalParams)\n ) {\n const range = new vscode.Range(\n row,\n index,\n row,\n index + name.length\n );\n const msg =\n actualParams > minParams\n ? `Too many arguments for method '${className}.${methodName}'.`\n : `Insufficient arguments for method '${className}.${methodName}'.`;\n const d = new vscode.Diagnostic(\n range,\n msg,\n vscode.DiagnosticSeverity.Error\n );\n diagnostics.push(d);\n }\n }\n }\n }\n }\n\n startIndex = index + name.length;\n }\n }\n }", "function error_handlinSuite () {\n return {\n test_add_function__without_name: function() {\n let body = \"{ \\\"code\\\" : \\\"function () { return 1; }\\\" }\";\n let doc = arango.POST_RAW(api, body);\n\n assertEqual(doc.code, internal.errors.ERROR_HTTP_BAD_PARAMETER.code);\n assertEqual(doc.headers['content-type'], contentType);\n assertTrue(doc.parsedBody['error']);\n assertEqual(doc.parsedBody['code'], internal.errors.ERROR_HTTP_BAD_PARAMETER.code);\n assertEqual(doc.parsedBody['errorNum'], internal.errors.ERROR_QUERY_FUNCTION_INVALID_NAME.code);\n },\n\n test_add_function__invalid_name_1: function() {\n let body = \"{ \\\"name\\\" : \\\"\\\", \\\"code\\\" : \\\"function () { return 1; }\\\" }\";\n let doc = arango.POST_RAW(api, body);\n\n assertEqual(doc.code, internal.errors.ERROR_HTTP_BAD_PARAMETER.code);\n assertEqual(doc.headers['content-type'], contentType);\n assertTrue(doc.parsedBody['error']);\n assertEqual(doc.parsedBody['code'], internal.errors.ERROR_HTTP_BAD_PARAMETER.code);\n assertEqual(doc.parsedBody['errorNum'], internal.errors.ERROR_QUERY_FUNCTION_INVALID_NAME.code);\n },\n\n test_add_function__invalid_name_2: function() {\n let body = \"{ \\\"name\\\" : \\\"_aql::foobar\\\", \\\"code\\\" : \\\"function () { return 1; }\\\" }\";\n let doc = arango.POST_RAW(api, body);\n\n assertEqual(doc.code, internal.errors.ERROR_HTTP_BAD_PARAMETER.code);\n assertEqual(doc.headers['content-type'], contentType);\n assertTrue(doc.parsedBody['error']);\n assertEqual(doc.parsedBody['code'], internal.errors.ERROR_HTTP_BAD_PARAMETER.code);\n assertEqual(doc.parsedBody['errorNum'], internal.errors.ERROR_QUERY_FUNCTION_INVALID_NAME.code);\n },\n\n test_add_function__invalid_name_3: function() {\n let body = \"{ \\\"name\\\" : \\\"foobar\\\", \\\"code\\\" : \\\"function () { return 1; }\\\" }\";\n let doc = arango.POST_RAW(api, body);\n\n assertEqual(doc.code, internal.errors.ERROR_HTTP_BAD_PARAMETER.code);\n assertEqual(doc.headers['content-type'], contentType);\n assertTrue(doc.parsedBody['error']);\n assertEqual(doc.parsedBody['code'], internal.errors.ERROR_HTTP_BAD_PARAMETER.code);\n assertEqual(doc.parsedBody['errorNum'], internal.errors.ERROR_QUERY_FUNCTION_INVALID_NAME.code);\n },\n\n test_add_function__no_code: function() {\n let body = \"{ \\\"name\\\" : \\\"myfunc::mytest\\\" }\";\n let doc = arango.POST_RAW(api, body);\n\n assertEqual(doc.code, internal.errors.ERROR_HTTP_BAD_PARAMETER.code);\n assertEqual(doc.headers['content-type'], contentType);\n assertTrue(doc.parsedBody['error']);\n assertEqual(doc.parsedBody['code'], internal.errors.ERROR_HTTP_BAD_PARAMETER.code);\n assertEqual(doc.parsedBody['errorNum'], internal.errors.ERROR_QUERY_FUNCTION_INVALID_CODE.code);\n },\n\n test_add_function__invalid_code: function() {\n let body = \"{ \\\"name\\\" : \\\"myfunc::mytest\\\", \\\"code\\\" : \\\"function ()\\\" }\";\n let doc = arango.POST_RAW(api, body);\n\n assertEqual(doc.code, internal.errors.ERROR_HTTP_BAD_PARAMETER.code);\n assertEqual(doc.headers['content-type'], contentType);\n assertTrue(doc.parsedBody['error']);\n assertEqual(doc.parsedBody['code'], internal.errors.ERROR_HTTP_BAD_PARAMETER.code);\n assertEqual(doc.parsedBody['errorNum'], internal.errors.ERROR_QUERY_FUNCTION_INVALID_CODE.code);\n },\n\n test_deleting_non_existing_function: function() {\n let doc = arango.DELETE_RAW(api + \"/mytest%3A%3Amynonfunc\");\n\n assertEqual(doc.code, internal.errors.ERROR_HTTP_NOT_FOUND.code);\n assertEqual(doc.headers['content-type'], contentType);\n assertTrue(doc.parsedBody['error']);\n assertEqual(doc.parsedBody['code'], internal.errors.ERROR_HTTP_NOT_FOUND.code);\n assertEqual(doc.parsedBody['errorNum'], internal.errors.ERROR_QUERY_FUNCTION_NOT_FOUND.code);\n }\n };\n}", "start (_next) { methodNotDefined() }", "validate() {\n let notCalled = [];\n Object.getOwnPropertyNames(this.mocks).forEach(url => {\n Object.getOwnPropertyNames(this.mocks[url]).forEach(method => {\n if (!(url in this.run) || !(method in this.run[url])) {\n this.mocks[url][method].forEach(payload => notCalled.push({\n url,\n method,\n payload\n }));\n } else if (this.mocks[url][method].length > this.run[url][method]) {\n for (let i = this.run[url][method]; i < this.mocks[url][method].length; i++) {\n notCalled.push({\n url,\n method,\n payload: this.mocks[url][method][i]\n });\n }\n }\n });\n });\n return notCalled;\n }", "function test(a, b, s) {\n var r = extract(a, b)\n assert(r, s);\n }", "function _test(fnName){\n return function(){\n var input = arguments;\n return function(output){\n return function(testText){\n\tvar result = _[fnName].apply(null,input);\n\tif(_.isEqual(result,output)){\n\t console.log(\"Passed: \" + fnName + \": \" + testText);\n\t}\n\telse{\n\t console.log(\"Failed: \" + fnName + \": \" + testText);\n\t console.log(\"input\");\n\t console.log(input);\n\t console.log(\"expected output:\");\n\t console.log(output);\n\t console.log(\"returned:\");\n\t console.log(result);\n\t}\n };\n };\n };\n}", "function verifyPath(func) {\n var real = callpath.shift();\n if (real !== func) {\n var msg = \"Call path verification failure! Expected \" + real + \", found \" + func;\n verificationError(msg);\n }\n }", "expected( _utils ) {\n\t\t\treturn 'nothing';\n\t\t}", "function test(a, b, c) {\n return a + b + c;\n}", "function check1() {\n\n}", "function GranularSanityChecks() {}", "function test() {\n function square(x) {\n return Math.pow(x, 2);\n }\n function cube(x) {\n return Math.pow(x, 3);\n }\n function quad(x) {\n return Math.pow(x, 4);\n }\n if (square(2) !== 4 || cube (3) !== 27 || quad(4) !== 256) {\n console.log(\"check question 1\");\n }\n else {\n console.log(\"You are great at math!\");\n }\n}", "function testAllTests() {\n testExtremal();\n testDifference();\n testSpearman();\n testSerial()\n}", "expected(_utils) {\n return 'nothing';\n }", "function syntaxCheck() {\n let user = {\n name: \"John\",\n go: function () { console.log(\"before\"); alert(this.name); console.log(\"after\"); }\n }\n\n (user.go)()\n // What is the result? A reference error occurs because the parenthesis around user.go act as a \n // function call being invoked at the end of the object defined above it (becuase that object definition \n // doesn't have a terminating semicolon). If you add a semicolon to the end of the user object definition, \n // all behave as expected. Parenthesis directly around object.method do not affect the call of that function.\n // however the strange case of the || operator does affect the passing of the 'this' reference across the \n // dot operator and through to the invoking of a function call.\n}", "function test() { console.log('square test good'); }", "validate() {}", "function testQueryProcessingFunctions() {\n testEvalQueryShow();\n testEvalQueryTopK();\n testEvalQuerySliceCompare();\n\n testGetTable();\n\n testCallGcpToGetQueryResultShow();\n testCallGcpToGetQueryResultTopK(); \n testCallGcpToGetQueryResultSliceCompare();\n\n testCallGcpToGetQueryResultUsingJsonShow();\n testCallGcpToGetQueryResultUsingJsonTopK(); \n testCallGcpToGetQueryResultUsingJsonSliceCompare();\n}", "function fooTest() { }", "function _checkAi(){return true;}", "function another(addFun) {\n assert.deepEqual(addFun(2,4), 6);\n }", "function checkFunction(fn) {\n return typeof fn === 'function';\n }", "function f_ext( a, b ) { null.should_not_be_called; return a * 10 + b; }", "_runTestMethods()\n {\n var methods = Reflect.ownKeys(Reflect.getPrototypeOf(this))\n this.before()\n for (let method of methods) {\n if (this._stopOnError === true && this._errors > 0) {\n break\n }\n if (Tester.is(this[method], 'function') && method.indexOf('test') === 0) {\n this._testsCounter++\n this.beforeEach()\n this[method]()\n this.afterEach()\n }\n }\n this.after()\n }", "isAssistant(obj){\n var returnType = {'getAssistantName':'string', 'getListeningCommands':'object'};\n for (var func in returnType){\n if(typeof obj[func] != 'function' && typeof obj[func]() != returnType[func]) {\n return false;\n }\n }\n // It quacks like an assistant...\n return true;\n }", "function checkArgs(instr: bril.Operation, count: number) {\n if (instr.args.length != count) {\n throw `${instr.op} takes ${count} argument(s); got ${instr.args.length}`;\n }\n}", "function checkArgs(instr: bril.Operation, count: number) {\n if (instr.args.length != count) {\n throw `${instr.op} takes ${count} argument(s); got ${instr.args.length}`;\n }\n}", "function FunctionWithMethodsTest() {\r\n // note that JairuSUnit supports setUp and tearDown methods\r\n this.setUp = function() {\r\n this.addresult = add(1,1);\r\n };\r\n this.testAddSuccess = function() {\r\n assertEquals(2, this.addresult);\r\n };\r\n this.testAddFail = function() {\r\n \tassertTrue(\"3==2\", 3 == add(1,1))\r\n };\r\n this.testAddError = function() {\r\n \tthrow new Error(\"unexpected error\");\r\n };\r\n}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "function verifyInput(){\r\n}", "function test() {}", "function verifyCall(iscall, func, cthis, cargs) {\n var ok = true;\n var callArgs = func.callArgs[func.inst];\n iscall = iscall ? 1 : 0;\n if (cargs.length !== callArgs.length - 1) {\n ok = false;\n } else {\n if (iscall && !verify(cthis, callArgs[0])) ok = false;\n for (var i = 0; i < cargs.length; i++) {\n if (!verify(cargs[i], callArgs[i+1])) ok = false;\n }\n }\n if (!ok) {\n var msg = \"Call verification failure!\";\n verificationError(msg);\n }\n\n return func.returns[func.inst++];\n }", "function ct_test() {\n return ok;\n}", "function checkAnswers() {\n\n}", "exampleMethod() {\n\n }", "method(){}", "function tryThese() {\n for (var i=0; i < arguments.length; i++) {\n try {\n var item = arguments[i]() ;\n return item ;\n } catch (e) {}\n }\n return NO;\n }", "function gSmethodCall(item,methodName,values) {\n\n //console.log('Going!->'+methodName);\n //console.log('Values!->'+values);\n if (gSconsoleInfo && console) {\n console.log('[INFO] gSmethodCall ('+item+').'+methodName+ ' params:'+values);\n }\n\n if (typeof(item)=='string' && methodName=='split') {\n return item.tokenize(values[0]);\n }\n if (typeof(item)=='string' && methodName=='length') {\n return item.length;\n }\n if ((item instanceof Array) && methodName=='join') {\n if (values.size()>0) {\n return item.gSjoin(values[0]);\n } else {\n return item.gSjoin();\n }\n }\n /*if (typeof(item)=='number' && methodName=='times') {\n return (item).times(values[0]);\n }*/\n\n if (!gShasFunc(item,methodName)) {\n\n //console.log('Not Going! '+methodName+ ' - '+item);\n //var nameProperty = methodName.charAt(3).toLowerCase() + methodName.slice(4);\n //var res = function () { return item[nameProperty];}\n //return res;\n\n if (methodName.startsWith('get') || methodName.startsWith('set')) {\n var varName = methodName.charAt(3).toLowerCase() + methodName.slice(4);\n var properties = item.getProperties();\n if (properties.contains(varName)) {\n if (methodName.startsWith('get')) {\n return gSgetProperty(item,varName);\n } else {\n return gSsetProperty(item,varName,values[0]);\n }\n\n }\n }\n\n //Check newInstance\n if (methodName=='newInstance') {\n return item();\n } else {\n\n //Lets check if in any category we have the static method\n if (gScategories.length > 0) {\n var whereExecutes = gScategorySearching(methodName);\n if (whereExecutes!=null) {\n return whereExecutes[methodName].apply(item,gSjoinParameters(item,values));\n }\n }\n //Lets check in mixins classes\n if (gSmixins.length>0) {\n var whereExecutes = gSmixinSearching(item,methodName);\n if (whereExecutes!=null) {\n //console.log('Where!'+whereExecutes[methodName]+' - '+item);\n return whereExecutes[methodName].apply(item,gSjoinParameters(item,values));\n }\n }\n //Lets check in mixins objects\n if (gSmixinsObjects.length>0) {\n var whereExecutes = gSmixinObjectsSearching(item,methodName);\n if (whereExecutes!=null) {\n //console.log('Where!'+whereExecutes[methodName]+' - '+item);\n return whereExecutes[methodName].apply(item,gSjoinParameters(item,values));\n }\n }\n\n //Lets check in delegate\n if (gSactualDelegate!=null && gSactualDelegate[methodName]!=undefined) {\n return gSactualDelegate[methodName].apply(item,values);\n }\n if (gSactualDelegate!=null && item['methodMissing']==undefined\n && gSactualDelegate['methodMissing']!=undefined) {\n return gSmethodCall(gSactualDelegate,methodName,values);\n }\n\n if (item['methodMissing']) {\n\n return item['methodMissing'](methodName,values);\n\n } else {\n\n //Maybe there is a function in the script with the name of the method\n //In Node.js 'this.xxFunction()' in the main context fails\n if (typeof eval(methodName)==='function') {\n return eval(methodName).apply(this,values);\n }\n\n //Not exist the method, throw exception\n throw 'gSmethodCall Method '+ methodName + ' not exist in '+item;\n }\n }\n\n } else {\n var f = item[methodName];\n return f.apply(item,values);\n }\n}", "function check(){\r\n\t// tracking disabilitato\r\n\t//requires(\"/tracking.js\");\r\n\t\r\n\t// funzione legacy\r\n\t_check();\r\n}", "function ExtraMethods() {}", "function ok(test, desc) { expect(test).toBe(true); }", "function doSomething(a, b) {\n return a + b;\n}", "testSimple() {\n this.assertEquals(4, 3 + 1, \"This should never fail!\");\n this.assertFalse(false, \"Can false be true?!\");\n }", "check(options) {\n\t\tthis.constructor.check(this, options);\n\t}", "function main(a, b){\n testTopLevelAccessors()\n\n//FIXME: once worked\n// testNestedAccessors()\n \n// testKeyedVariant2()\n \n testNumberSubScripting()\n \n testNestedAssignment()\n\n testClassPropertyAssignmentSubscripting()\n\n var zero = 0\n return zero.intValue\n}", "function GetTestability(){}", "function Exact() {\r\n}", "test() {\n return true\n }", "emerg(...any){}", "function test(){\n\tassert.ok(ostatus.salmon.verify_signature(me, key));\n}", "static private internal function m121() {}", "function jum_just_test_functions(func_names, re) {\n\n var test_func_names = [];\n var all_names = [];\n for(var i=0;i<func_names.length;++i) {\n var funcname = func_names[i];\n //jum_debug(\"checking symbol '\" + funcname + \"', number \" + i);\n all_count++;\n all_names.push(funcname);\n\n if (jum_is_test_function(funcname, re)) {\n test_func_names.push(funcname);\n }\n }\n var test_count = test_func_names.length;\n var all_count = all_names.length;\n //jum.info(\"(jsunit_wrap.js) found \" + all_count + \" symbols, and \" + test_count + \" tests\");\n // bu_alert(\"(jsunit_wrap.js) all symbols: \" + all_names.join(' '));\n return test_func_names;\n}", "function sharedTests() {\n var result;\n beforeEach(function (done) {\n result = txtToIntObj.getIntObj(this.txtdata);\n done();\n });\n it('check for existence and type', function (done) {\n expect(result).to.exist;\n expect(result).to.be.an('object');\n done();\n });\n\n it('make sure intermediate format has all titles', function (done) {\n var titles = txtToIntObj.getTitles(this.txtdata);\n done();\n });\n\n it('make sure there are no bad keys', function (done) {\n var badKeysResult = checkForBadKeys(result);\n expect(badKeysResult).to.be.true;\n done();\n });\n}", "function oneOf(args) { }", "testAdvanced() {\n var a = 3;\n var b = a;\n this.assertIdentical(a, b, \"A rose by any other name is still a rose\");\n this.assertInRange(\n 3,\n 1,\n 10,\n \"You must be kidding, 3 can never be outside [1,10]!\"\n );\n }", "static test01() {\n let cal = new Calc();\n cal.receiveInput(1);\n cal.receiveInput(1);\n cal.receiveInput(Calc.OP.PLUS);\n cal.receiveInput(5);\n cal.receiveInput(Calc.OP.EQ);\n return cal.getDisplayedNumber() === 11 + 5;\n }", "function TestUtil(cmd)\r\n{\r\n try\r\n {\r\n return (0 == WshShell.Run(cmd + \" /?\", 0, true));\r\n }\r\n catch (e) {}\r\n \r\n return false;\r\n}", "function assertGuestJsCorrect(frame, div, result) {\n // TODO(kpreid): reenable or declare completion value unsupported\n //assertEquals(12, result);\n console.warn('JS completion value not yet supported by ES5 mode; '\n + 'not testing.');\n }", "function test(ops, params) {\n Test.testWithInstructions(SummaryRanges, ops, params);\n}", "function f2(a,b,c){\n\tassert(! sanityjs.arguments_check([\"boolean\",\"number\",\"string\"], options) );\n}" ]
[ "0.6644949", "0.62184924", "0.6199784", "0.5976521", "0.5887775", "0.58133745", "0.5801074", "0.57454747", "0.57334834", "0.5716277", "0.5706827", "0.5696678", "0.5667433", "0.5620291", "0.5594685", "0.559104", "0.5584882", "0.55679977", "0.555837", "0.55321735", "0.55321735", "0.5516321", "0.55139714", "0.5497313", "0.54905987", "0.54863894", "0.54799926", "0.54750746", "0.54651856", "0.5461123", "0.5460094", "0.545358", "0.54488766", "0.5434101", "0.5429459", "0.5428065", "0.54175556", "0.54175556", "0.5411524", "0.540414", "0.5401736", "0.5399403", "0.5385506", "0.53823006", "0.53820956", "0.5381479", "0.53778374", "0.537742", "0.5369387", "0.5358962", "0.53576356", "0.5357032", "0.5343276", "0.53403175", "0.5327446", "0.5321651", "0.5312212", "0.5298159", "0.5292953", "0.528527", "0.52811843", "0.52719766", "0.52711713", "0.5264749", "0.5257844", "0.5257844", "0.52469563", "0.52426565", "0.52426565", "0.52426565", "0.5241874", "0.5240607", "0.5239461", "0.5237283", "0.5236429", "0.5230747", "0.5222776", "0.5202566", "0.5197044", "0.51891804", "0.5189147", "0.51885027", "0.51879317", "0.51848924", "0.5169524", "0.51628435", "0.5161352", "0.515814", "0.515589", "0.515327", "0.5149037", "0.51489013", "0.5143351", "0.51397836", "0.51324284", "0.5127056", "0.5119791", "0.5118749", "0.5117976", "0.51115215", "0.51084095" ]
0.0
-1
To verify the functionality of animate()
function animateMethod() { $(function() { $("img.image1").animate( { left:"+=1000", opacity: 0.40 }, 3000, function() { console.log("Result obtained"); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testAnimation(element) {\n if (!element.hasClass('anim-running') &&\n Utils.isInView(element, {topoffset: offset})) {\n element\n .addClass('anim-running');\n\n setTimeout(function () {\n element\n .addClass('anim-done')\n .animo({animation: animation, duration: 0.7});\n }, delay);\n\n }\n }", "function testAnimation(element) {\n if ( !element.hasClass('anim-running') &&\n Utils.isInView(element, {topoffset: offset})) {\n element\n .addClass('anim-running');\n\n setTimeout(function() {\n element\n .addClass('anim-done')\n .animo( { animation: animation, duration: 0.7} );\n }, delay);\n\n }\n }", "function testAnimation(element) {\n if ( !element.hasClass('anim-running') &&\n Utils.isInView(element, {topoffset: offset})) {\n element\n .addClass('anim-running');\n\n setTimeout(function() {\n element\n .addClass('anim-done')\n .animo( { animation: animation, duration: 0.7} );\n }, delay);\n\n }\n }", "function isAnimate(obj){\r\n\t\treturn obj.is(\":animated\") ? false : true;\r\n\t}", "function testAnim(x) {\r\n $('#animationSandbox').removeClass().addClass(x + ' animated').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){\r\n $(this).removeClass();\r\n });\r\n $('#conceptdiv').removeClass().addClass(x + ' animated').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){\r\n $(this).removeClass();\r\n });\r\n }", "function animcompleted() {\n\t\t\t\t\t\t}", "function modalAnimation() {}", "isAnimating() {\n return animationFrame > 1;\n }", "function initAnimation() {\n}", "animation() {}", "function testAnim(x) {\r\n gfx('#animationSandbox').removeClass().addClass(x + ' animation animation-active').one('webkitAnimationEnd mozAnimationEnd oAnimationEnd animationEnd', function(){\r\n gfx(this).removeClass();\r\n });\r\n }", "animate() {\n switch(this.options.effect) {\n case 'reveal':\n this.__reveal();\n break;\n \n case 'typewriter':\n this.__typewriter();\n break;\n }\n }", "function WaitForAnimation() {\r\n if (animating) {\r\n setTimeout(\"WaitForAnimation()\", 50);\r\n return;\r\n }\r\n ActionAfterAnimation();\r\n}", "function checkAnimation() {\n\t var $elem = $('.slide-intro');\n\n\t // If the animation has already been started\n\n\t if (isElementInViewport($elem)) {\n\t // Start the animation\n\t\t\t$('.easing').css('opacity', '1');\n\t\t\t$('.easing').css('transform', 'none');\n\t }\n\t if(isElementInViewport(slides)) {\n\t \ttop.css('opacity', '0');\n\t } else {\n\t \ttop.css('opacity', '1');\n\t }\n\t}", "notifyAnimationEnd() {}", "updateAnimation() {\n this.animator.animate();\n }", "function doAnimation() {\n\tvar animations = [\"bounce\", \"zoomInDown\", \"zoomIn\",\n\t\t\t\t\t\"zooInLeft\",\"zoomInRight\", \"zoomInUp\"];\n\tvar applyAnimation = animations[Math.floor(Math.random() * animations.length)];\n\t\n\tapplyAnimation = \"animated \" + applyAnimation;\n\t$(\"#container\").addClass(applyAnimation);\n\t$(\"#container\").one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {\n\t\t$(\"#container\").removeClass(applyAnimation);\n\t});\n}", "function checkAnimation(elem) {\n //If the element has already animated, do nothing\n if (elem.hasClass('start')) {\n return;\n }\n //If the element is in the view, begin css animation\n if (isElementInView(elem)) {\n elem.addClass('start');\n }\n}", "animate() {\n clickAnimation(\"#miracle_div\", this.target);\n }", "updateAnimation() {\n return;\n }", "if (m_bInitialAnim) { return; }", "function animacionButton(){\n /* no esta hecha aun */\n}", "animate(animation) {\r\n if (!this.bmp.currentAnimation || this.bmp.currentAnimation.indexOf(animation) === -1) {\r\n this.bmp.gotoAndPlay(animation);\r\n }\r\n }", "function animate() {\n requestAnimationFrame(animate);\n renderer.render(stage);\n //checkHelp();\n}", "animate() {\n if(this.finishedAnimating) {\n return false;\n }\n\n const svg = this.shadowRoot.querySelector(\"svg\");\n\n svg.classList.add(\"animate\");\n\n this.finishedAnimating = true;\n return true;\n }", "function test_animate() {\n //Do the preview (IS THIS NEEDED?)\n if (AUTO_ANIM) {\n for (var i = 0; i < NODES.length; i++) {\n if (NODES[i].parent) {\n var r = Math.min(Math.max(parseFloat(atob(NODES[i].id)), 0.3), 0.7);\n NODES[i].th = NODES[i].th0 + Math.sin((new Date()).getTime() * 0.003 / r + r * Math.PI * 2) * r * 0.5;\n } else {\n NODES[i].th = NODES[i].th0\n }\n }\n }\n doodleMeta.forwardKinematicsNodes(NODES);\n doodleMeta.calculateSkin(SKIN);\n\n //Do the transfered drawings\n if (AUTO_ANIM) {\n for (let i = 0; i < drawings.length; i++) {\n drawings[i].animate();\n }\n }\n //anim_render();\n master_render();\n}", "function anim() {\r\n Loop();\r\n requestAnimFrame(anim);\r\n }", "function animateIt($elements) {\n $elements.each( function( i, el ) {\n\n var $el = $( el ),\n animationClass = $el.data( 'animation' );\n\n $el.addClass( animationClass );\n $el.addClass( 'animated' );\n $el.addClass( 'wait-animation' );\n\n $el.one( 'inview', function() {\n $el.removeClass( 'wait-animation' );\n $el.addClass( 'done-animation' );\n });\n });\n}", "animate(animation) {\n if (!this.bmp.currentAnimation || this.bmp.currentAnimation.indexOf(animation) === -1) {\n this.bmp.gotoAndPlay(animation);\n }\n }", "function checkAnimation(elem) {\n var $elem = $(elem);\n\n // If the animation has already been started\n if ($elem.hasClass('animated')) return;\n\n if (isElementInViewport($elem)) {\n // Start the animation\n $elem.addClass('animated fadeInUp');\n }\n}", "function animate(elm, state) {\n\tvar finished = false;\n\tif (state) {\n\t\tif (state.anim > 0) {\n\t\t\tif (state.start + state.anim >= state.target) {\n\t\t\t\tstate.start = state.target;\n\t\t\t\tfinished = true;\n\t\t\t}\n\t\t} else {\n\t\t\tif (state.start + state.anim <= state.target) {\n\t\t\t\tstate.start = state.target;\n\t\t\t\tfinished = true;\n\t\t\t}\n\t\t}\n\t\t// fail safe\n\t\tif (state.start > 500 || state.start < 0) {\n\t\t\tfinished = true;\n\t\t}\n\n\t\t//console.log(\"start: \" + state.start);\n\t\tif (state.dir == \"height\") {\n\t\t\tstate.elm.style.height = state.start + \"px\";\n\t\t\t//console.log(\"FIN: \", state.elm.style.height);\n\t\t} else if (state.dir == \"width\") {\n\t\t\tstate.elm.style.width = state.start + \"px\";\n\t\t}\n\t\txcon.toggle[xcon.toggle.active] = state;\n\t\tif (!finished) {\n\t\t\tstate.start = state.start + state.anim;\n\t\t\twindow.setTimeout(function() {\n\t\t\t\tanimate(elm, state);\n\t\t\t}, state.speed);\n\t\t}\n\t}\n}", "function checkIfStillAnimating(e){\n if(isAnimating == false){\n e.target.classList.add('animate-border');\n prevWord = e.target.innerHTML;\n eventInfo = e;\n eraseWord(e, e.target.innerHTML, e.target.id);\n }\n }", "function animate() {\n\t\t\t\t\t\trequestAnimationFrame(animate);\n\t\t\t\t\t\tupdate();\n\t\t\t\t\t\trender();\n\t\t\t\t\t}", "function animate() {\n\treqAnimFrame(animate);\n\tcanvasDraw();\n}", "function animate() {\n\n\t\tconst mixer = editor.mixer;\n\t\tconst delta = clock.getDelta();\n\n\t\tlet needsUpdate = false;\n\n\n\t\t//yomotsu camera\n\t\tneedsUpdate = controls.update( delta );\n\n\t\t// Animations\n\n\n\t\tconst actions = mixer.stats.actions;\n\n\t\tif ( actions.inUse > 0 || prevActionsInUse > 0 ) {\n\n\t\t\tprevActionsInUse = actions.inUse;\n\n\t\t\tmixer.update( delta );\n\t\t\tneedsUpdate = true;\n\n\t\t}\n\n\t\t// View Helper\n\n\t\tif ( viewHelper.animating === true ) {\n\n\t\t\tviewHelper.update( delta );\n\t\t\tneedsUpdate = true;\n\n\t\t}\n\n\t\tif ( vr.currentSession !== null ) {\n\n\t\t\tneedsUpdate = true;\n\n\t\t}\n\n\t\tif ( needsUpdate === true ) render();\n\n\t}", "function animate() {\r\n\tif (runAnim) {\r\n\t\trequestAnimationFrame(animate);\r\n\t}\r\n\trender();\r\n}", "function initElementsAnimation() {\n if ($(\".animated\").length > 0) {\n $(\".animated\").each(function() {\n var $this = $(this);\n $this.appear(function() {\n $this.addClass(\"go\");\n }, {\n accX: 0,\n accY: -200\n });\n })\n };\n}", "function checkAnimation() {\r\n \r\n\r\n if (isElementInViewport($('.bars'))) {\r\n var $elem = $('.bar');\r\n // Start the animation\r\n $elem.addClass('animate-bar');\r\n }\r\n }", "function animate() {\r\n if (!doAnim) {\r\n river.context=null; \r\n return;\r\n }\r\n\trequestAnimFrame( animate );\r\n river.background.draw();\r\n}", "function doAnimation() {\n slideContainer.children[0].classList.add('moveSlide')\n slideContainer.children[1].classList.add('moveSlide')\n addAnimationEventToChild()\n}", "function checkAnimation() {\n var $elem = $('.path');\n\n if (isElementInViewport($elem)) {\n // Start the animation\n $elem.addClass('start');\n } else {\n $elem.removeClass('start');\n }\n}", "isAnimating () {\n return this.state.shouldAnimate || this.state.isClosing\n }", "function animate(){\n\n\tanimateCloth();\n\trender();\n\trequestAnimationFrame( animate );\n\n\t\n}", "function animate() {\n if (PLAY_STATUS != PlayStatus.PLAYING) {\n return;\n } else {\n stepAndAnimate()\n }\n}", "function animation() {\n\t\t//This conditional decides what it should do if the i iteration is below set amount \n\t\t//and it's not random type.\n\t\tif (i < iterations && type !== \"random\") {\n\t\t\t//get the current HTML value of the element.\n\t\t\tvar current = el.html();\n\t\t\t//parse that as a float, to avoid concatination over adding\n\t\t\tcurrent = parseFloat(current);\n\t\t\t//add the adder to the current, and set it as it's HTML content\n\t\t\tel.html(Math.floor(current + adder));\n\t\t\t//increase the i so logic will work in next loop through\n\t\t\ti++;\n\t\t//conditional for if iteration passes, and it is random type.\n\t\t} else if (i < iterations && type === \"random\") {\n\t\t\t//Set the element value to a rounded down random number. The random number will be\n\t\t\t//between initial and your target.\n\t\t\tel.html(Math.floor((Math.random()*targetMod)+1));\n\t\t\t//add one to i iteration.\n\t\t\ti++;\n\t\t//If the i is above or equal to iterations then abort the timer\n\t\t} else if (i >= iterations) {\n\t\t\t//abort the timer... clever naming.\n\t\t\tabortTimer();\n\t\t}\n\t}", "function checkAnimated() {\n win.scroll(function () {\n didScroll = true;\n });\n\n var animateInInterval = setInterval(function () {\n if (didScroll) {\n didScroll = false;\n playInView(send, bounceIn);\n }\n if (hits === elementsToAnimate) {\n clearInterval(animateInInterval);\n }\n }, 250);\n }", "function setEndAnimation() {\r\n\t\t\tinAnimation = false;\r\n\t\t}", "function animate() {\n\t\t// check for WOW\n if(window.WOW) {\n var wow = new WOW({\n boxClass: 'wow', // animated element css class (default is wow)\n animateClass: 'animated', // animation css class (default is animated)\n offset: 0, // distance to the element when triggering the animation (default is 0)\n mobile: true, // trigger animations on mobile devices (default is true)\n live: true, // act on asynchronously loaded content (default is true)\n callback: function(box) {\n // the callback is fired every time an animation is started\n // the argument that is passed in is the DOM node being animated\n },\n scrollContainer: null // optional scroll container selector, otherwise use window\n });\n wow.init();\n }\n\t}", "animate(inCollection) {\n\n // Don't animate when not visible.\n if (!this.isVisible) { return; }\n\n // Adjust how often the animation occurs.\n this.frameSkipCount++;\n if (this.frameSkipCount < this.frameSkip) {\n return;\n }\n this.frameSkipCount = 0;\n\n // Hide the img of the current frame.\n this[`frame${this.currentFrame}`].style.display = \"none\";\n // Bump to the next frame, reset when it's time to wrap around.\n this.currentFrame++;\n if (this.currentFrame === this.frameCount) {\n this.currentFrame = 0;\n if (this.animationCallback) {\n this.animationCallback(inCollection);\n }\n }\n // Show the new current frame's img.\n this[`frame${this.currentFrame}`].style.display = \"\";\n\n }", "function clonedAnimationDone(){\n // scroll body\n anime({\n targets: \"html, body\",\n scrollTop: 0,\n easing: easingSwing, // swing\n duration: 150\n });\n\n // fadeOut oldContainer\n anime({\n targets: this.oldContainer,\n opacity : .5,\n easing: easingSwing, // swing\n duration: 300\n })\n\n // show new Container\n anime({\n targets: $newContainer.get(0),\n opacity: 1,\n easing: easingSwing, // swing\n duration: 300,\n complete: function(anim) {\n triggerBody()\n _this.done();\n }\n });\n\n $newContainer.addClass('one-team-anim')\n }", "function onetone_animation(e){\n\t\n\te.css({'visibility':'visible'});\n\t\t\te.find(\"img,i.fa\").css({'visibility':'visible'});\t\n\n\t\t\t// this code is executed for each appeared element\n\t\t\tvar animation_type = e.data('animationtype');\n\t\t\tvar animation_duration = e.data('animationduration');\n\t var image_animation = e.data('imageanimation');\n\t\t\t if(image_animation === \"yes\"){\n\t\t\t\t\t\t \n\t\t\te.find(\"img,i.fa\").addClass(\"animated \"+animation_type);\n\n\t\t\tif(animation_duration) {\n\t\t\t\te.find(\"img,i.fa\").css('-moz-animation-duration', animation_duration+'s');\n\t\t\t\te.find(\"img,i.fa\").css('-webkit-animation-duration', animation_duration+'s');\n\t\t\t\te.find(\"img,i.fa\").css('-ms-animation-duration', animation_duration+'s');\n\t\t\t\te.find(\"img,i.fa\").css('-o-animation-duration', animation_duration+'s');\n\t\t\t\te.find(\"img,i.fa\").css('animation-duration', animation_duration+'s');\n\t\t\t}\n\t\t\t\n\t\t\t }else{\n\t\t\te.addClass(\"animated \"+animation_type);\n\n\t\t\tif(animation_duration) {\n\t\t\t\te.css('-moz-animation-duration', animation_duration+'s');\n\t\t\t\te.css('-webkit-animation-duration', animation_duration+'s');\n\t\t\t\te.css('-ms-animation-duration', animation_duration+'s');\n\t\t\t\te.css('-o-animation-duration', animation_duration+'s');\n\t\t\t\te.css('animation-duration', animation_duration+'s');\n\t\t\t}\n\t\t\t }\n\t}", "isAnimating() {\n return this.state.shouldAnimate || this.state.isClosing;\n }", "function animate() {\n\trequestAnimationFrame(animate);\n\trender();\n}", "get animationPositionError() {}", "onAnimationEnd() {\n\n }", "function animationCompleted()\n{\n // Remove the tick event listener.\n TweenMax.ticker.removeEventListener(\"tick\");\n\n // Reenable the test button.\n animationTest.disabled = false;\n}", "function animate(){\n\t\trequestAnimationFrame( animate );\n\t\trender();\n\t}", "function animate() {\n\tconsole.log(\"Animate blev kaldt\");\n\n\t// Get the #box element\n\tvar $box = $(\"#box\");\n\n\t// Toggle the class\n\t$box.toggleClass(\"animated wobble\");\n}", "function checkAnimation() {\r\n var $elem = $('.bar .level');\r\n\r\n // If the animation has already been started\r\n if ($elem.hasClass('start')) return;\r\n\r\n if (isElementInViewport($elem)) {\r\n // Start the animation\r\n $elem.addClass('start');\r\n }\r\n}", "function projectClickAnimation(proj) {\n $(\".project\").hide();\n $(proj).show();\n $(proj).css(\"left\", \"50%\");\n $(proj).css(\"top\", \"10%\");\n $(proj).css(\"transition-duration\", \".8s\");\n $(\".project\").css(\"animation\", \"none\");\n $(\"#sub-termProject\").css(\"animation\", \"none\");\n $(\"#rotate\").css(\"animation\", \"none\");\n $(\"#sub-rotate\").css(\"animation\", \"none\");\n setTimeout(marioAnimation, 700);\n // $(\"#mario\").css(\"top\",\"90%\");\n // $(\"#mario\").css(\"transition-duration\", \"2s\");\n}", "function animate() {\n // if (stackHelper) {\n // stackHelper.index += 1;\n // if (stackHelper.outOfBounds === true) {\n // stackHelper.orientation = (stackHelper.orientation + 1) % 3;\n // stackHelper.index = 0;\n // }\n // }\n\n controls.update();\n renderer.render(scene, camera);\n stats.update();\n\n // request new frame\n requestAnimationFrame(function() {\n animate();\n });\n }", "function animate() {\r\n\r\n\trequestAnimationFrame( animate );\r\n\trender();\r\n\r\n}", "function animation() {\r\n switchOn();\r\n switchOff();\r\n}", "animate_start(frame) {\r\n this.sprite.animate = true;\r\n }", "animate() {\n\t\tlet self = this,\n\t\t\theight = this.height,\n\t\t\tdotHeight = this.randomNumber;\n\n\t\tif (this.isBonus) {\n\t\t\tthis.move = setTimeout(function moving() {\n\t\t\t\tif (!self.parent.paused) {\n\t\t\t\t\tif (self.pos+dotHeight > height){\n\t\t\t\t\t\tclearInterval(self.move);\n\t\t\t\t\t\tself.remove();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.pos++;\n\t\t\t\t\t\tself.ctx.style.bottom = self.pos + 'px';\n\t\t\t\t\t\tself.move = setTimeout(moving, 1000/250);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tclearInterval(self.move);\n\t\t\t\t} \n\t\t\t}, 1000/250);\n\t\t} else {\n\t\t\tthis.move = setTimeout(function moving() {\n\t\t\t\tif (!self.parent.paused) {\n\t\t\t\t\tif (self.pos+dotHeight > height){\n\t\t\t\t\t\tclearInterval(self.move);\n\t\t\t\t\t\tself.remove();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.pos++;\n\t\t\t\t\t\tself.ctx.style.bottom = self.pos + 'px';\n\t\t\t\t\t\tself.move = setTimeout(moving, 1000/self.parent.fallingSpeed);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tclearInterval(self.move);\n\t\t\t\t} \n\t\t\t}, 1000/self.parent.fallingSpeed);\n\t\t}\n\t}", "function carIsAnimated(){\r\n if ($(\"#car-icon\").is(\":animated\")) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "function animate() {\n // is element in view?\n if (inView()) {\n // element is in view, add class to element\n element.classList.add('animate');\n }\n}", "function animate(elem) {\n var effect = elem.data(\"effect\");\n elem.addClass(\"animated \" + effect).one(animationEnd, function() {\n // !! @animation end is not defined@\n // Its Ok, at the beginning, the object doesnt have an animation attribute, thats why it cant to remove it\n elem.removeClass(\"animated\" + effect);\n });\n}", "function animate() {\n updatePhysics();\n}", "function doAnimation() {\n\n if(dtGlobals.isMobile) {\n $(\".skills\").animateSkills();\n }\n if($(\"html\").hasClass(\"old-ie\")) {\n $(\".skills\").animateSkills();\n };\n }", "function animate() {\n\t\trequestAnimFrame(function(){\n animate();\n });\n\t\t\n\t\tplaceHover();\n\t\titemHover();\n\t\titemDrag();\n\t\t//$('#place').text(getSceneMembers(self.places));\n\t\t//$('#sticky').text(self.items);\n\t\t\n\t\t\n\n self.renderer.render(self.scene, self.camera);\n //self.controls.update(self.clock.getDelta());\n\t\t\n\t}", "function animate() {\n var now = (new Date()).getTime(); // Get current time\n var elapsed = now - start; // How long since we started\n var fraction = elapsed / time; // What fraction of total time?\n\n if (fraction < 1) { // If the animation is not yet complete\n // Compute the x position of e as a function of animation\n // completion fraction. We use a sinusoidal function, and multiply\n // the completion fraction by 4pi, so that it shakes back and\n // forth twice.\n var x = distance * Math.sin(fraction * 4 * Math.PI);\n e.style.left = x + \"px\";\n\n // Try to run again in 25ms or at the end of the total time.\n // We're aiming for a smooth 40 frames/second animation.\n setTimeout(animate, Math.min(25, time - elapsed));\n }\n else { // Otherwise, the animation is complete\n e.style.cssText = originalStyle; // Restore the original style\n if (oncomplete) oncomplete(e); // Invoke completion callback\n }\n }", "function setAnimateFunction(makeAnimator) {\n animate = makeAnimator(visualElement);\n }", "function setAnimateFunction(makeAnimator) {\n animate = makeAnimator(visualElement);\n }", "function setAnimateFunction(makeAnimator) {\n animate = makeAnimator(visualElement);\n }", "function setAnimateFunction(makeAnimator) {\n animate = makeAnimator(visualElement);\n }", "function setAnimateFunction(makeAnimator) {\n animate = makeAnimator(visualElement);\n }", "function initScene() {\n animate();\n}", "function checkAnimationComplete(){\t\n\tvar targetName = '';\n\tfor(n=0;n<animation_arr.length;n++){\n\t\tif($.pukiAnimation[animation_arr[n].name].visible){\n\t\t\ttargetName = animation_arr[n].name;\n\t\t}\n\t}\n\t\n\tvar _currentframe = $.pukiAnimation[targetName].currentFrame;\n\tvar _lastframes = $.pukiData[targetName].getAnimation($.pukiAnimation[targetName].currentAnimation).frames;\n\t_lastframes = _lastframes[_lastframes.length-1];\n\t\n\tif(_currentframe == _lastframes){\n\t\treturn true;\t\n\t}else{\n\t\treturn false;\t\n\t}\n}", "function animationLost() {\n\t\tconsole.log(\"he perdido\");\t\n\tposX2=hasta;\t\nhasta=hasta-60;\nposX=posX-60;\n\t\t// Start the animation.\n\t\trequestID2 = requestAnimationFrame(animate2);\n\t}", "function animate() {\n oneStep();\n if( ! stopRequested ) {\n animationId = requestAnimationFrame(animate);\n }\n}", "function animateHasCorrectForm(theObject)\n {\n hasName = (typeof theObject.name);\n\n if (hasName == 'undefined')\n {\n alert(\"There is an object in the animator that does not have a 'name'.\");\n return false;\n }\n\n hasDraw = (typeof theObject.draw);\n\n if (hasDraw == 'undefined')\n {\n alert(theObject.name+\" does not have a 'draw' function.\");\n return false;\n }\n\n hasMove = (typeof theObject.move);\n\n if (hasMove == 'undefined')\n {\n alert(theObject.name+\" does not have a 'move' function...\");\n return false;\n }\n\n //all checks have been passed\n //so . . .\n return true;\t\n }", "function moverDerecha() {\n\n //con is hago una comprobacion, me devuelve un booleano\n if (!slider.is(':animated')) {\n slider.animate({\n marginLeft : '-105.6%'\n }, 700, function () {\n $('#slider .slide:first').insertAfter('#slider .slide:last');\n slider.css('margin-left', '-43%');\n resetInterval();\n });\n }\n \n\n\n}", "_onAnimationDone(event) {\n this._animationDone.next(event);\n this._isAnimating = false;\n }", "function checkAnimation() {\n var $elem = $('.timer');\n\n // If the animation has already been started\n if ($elem.hasClass('start')) return;\n\n if (isElementInViewport($elem)) {\n // Start the animation\n $elem.addClass('start');\n }\n}", "function animationTrigger() {\n // Slide 1\n if (slide1Flag == false) {\n var currSlideTopPosition = jQuery('.slide-1').offset().top - jQuery(window).scrollTop();\n if (currSlideTopPosition < screenHeightToStartAnimation) {\n slide1Bird();\n };\n };\n // Slide 2\n if (slide2Flag == false) {\n var currSlideTopPosition = jQuery('.slide-2').offset().top - jQuery(window).scrollTop();\n if (currSlideTopPosition < screenHeightToStartAnimation) {\n slide2Bird();\n };\n };\n // Slide 3\n if (slide3Flag == false) {\n var currSlideTopPosition = jQuery('.slide-3').offset().top - jQuery(window).scrollTop();\n if (currSlideTopPosition < screenHeightToStartAnimation) {\n slide3Bird();\n };\n };\n // Slide 4\n if (slide4Flag == false) {\n var currSlideTopPosition = jQuery('.slide-4').offset().top - jQuery(window).scrollTop();\n if (currSlideTopPosition < screenHeightToStartAnimation) {\n slide4Bird();\n };\n };\n // Products Button\n if (productsBtnFlag == false) {\n var currSlideTopPosition = jQuery('#productServicesBar').offset().top - jQuery(window).scrollTop();\n if (currSlideTopPosition < screenHeightToStartAnimationForServicesBar) {\n productsBtnBird();\n };\n };\n }", "function doAnimation() {\n\t\t\n\t\tif(dtGlobals.isMobile){\n\t\t\t$(\".skills\").animateSkills();\n\t\t}\n\t\tif($(\"html\").hasClass(\"old-ie\")){\n\t\t\t$(\".skills\").animateSkills();\n\t\t};\n\t}", "function animate() {\n requestAnimationFrame(animate);\n render();\n update();\n }", "isAnimating () {\n return Boolean(this.state.movingTo)\n }", "function bouger() {\n console.log(\"Animation logo activée\");\n $('.image')\n .transition({\n debug: true,\n animation: 'jiggle',\n duration: 500,\n interval: 200\n })\n ;\n}", "function about_me_animation(){\n\t\tvar $animatedDiv = $('.animated');\n\t\tvar $animatedEl = $('.image-wrapper-animated');\n\t\tvar $window = $(window);\n\n\t\tfunction check_if_in_view(){\n\t\t\tvar window_height= $window.height();\n\t\t\tvar window_top_position= $window.scrollTop();\n\t\t\tvar window_bottom_position=(window_top_position+window_height);\n\t\t\t\t\n\t\t\t$.each($animatedEl, function(){\n\t\t\t\tvar $element = $(this);\n\t\t\t\tvar element_height = $element.outerHeight();\n\t\t\t\tvar element_top_position = $element.offset().top;\n\t\t\t\tvar element_bottom_position = (element_top_position+element_height);\n\n\t\t\t\tif((element_bottom_position>=window_top_position) && (element_top_position<=window_bottom_position)){\n\t\t\t\t\t$element.addClass('inView');\n\t\t\t\t}else{\n\t\t\t\t\t$element.removeClass('inView');\n\t\t\t\t}\t\t\t\t\t\t\t\t\t\n\t\t\t});\t\t\t\t\n\t\t}\t\n\t\t$window.on('scroll resize', function(){ \n\t\t\tcheck_if_in_view()\n\t\t});\n\t\t$window.trigger('scroll');\t\n\t}", "function trigger_animation() {\n\t\t\tvar $this = $('#slide-num' + brick.to + ' a');\n\t\t\t\n\t\t\t$num.removeClass('slide-on');\n\t\t\t$this.addClass('slide-on');\n\t\t\t\n\t\t\tgotohere = -((brick.to - 1) * 1024);\n\t\t\t\n\t\t\t$scrollable.stop().animate({\n\t\t\t\tleft: gotohere},\n\t\t\t\t1000,\n\t\t\t\tfunction(){\n\t\t\t\t\tif (!$('#swf-' + brick.from).hasClass('image-loaded')) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//var image = $('<img>').attr('src', brick.images[function_objs.lang][brick.from]);\n\t\t\t\t\t\tvar useimage = '<img src=\"' + brick.images[function_objs.lang][brick.from] + '\" alt=\"\" />'\n\t\t\t\t\t\t//console.log(useimage);\n\t\t\t\t\t\t$('#swf-' + brick.from)\n\t\t\t\t\t\t\t.parent()\n\t\t\t\t\t\t\t.addClass('image-loaded')\n\t\t\t\t\t\t\t.attr('id','swf-' + brick.from)\n\t\t\t\t\t\t\t.innerHTML = useimage;\n\t\t\t\t\t\t\t//.html(useimage);\n\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (!$('#swf-' + brick.to).hasClass('image-loaded')) {\n\t\t\t\t\t\t//call function to start flash animation\n\t\t\t\t\t\tvar swf = document.getElementById(\"swf-\" + brick.to);\n\t\t\t\t\t\tswf.replay();\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tbrick.from = brick.to;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t);\n\t\t}", "function checkAnimation() {\n chartBarCheckAnimation();\n portfolioCheckAnimation();\n //contactBackgrounCheck();\n }", "function animate() {\n\tmoveShipRight();\n\tmoveShipLeft();\n\tif(GAME_OBJECTS[\"missles\"].length > 0) {\n\t\tstepMissle();\n\t}\n\tif(steps % 60 == 0) {\n\t\tanimateEnemies();\n\t}\n\tsteps++;\n\tif(steps == 600) {\n\t\tsteps = 0;\n\t}\n\t\n\t// check if game has been finished\n\tif(isGameOver() && gamePhase == 1){\n\t\tdisplayEnd();\n\t}\n}", "function animatedChanged() {\n \t\tif (input.animated) {\n \t\t\t$$invalidate(0, input.frameWidth = input.width, input);\n \t\t}\n \t}", "function animateWrong() {\r\n $(\"body\").addClass(\"game-over\");\r\n setTimeout (function() {\r\n $(\"body\").removeClass(\"game-over\");\r\n }, 200);\r\n }", "function contentAnimation() {\n\n var tl = gsap.timeline();\n tl.from('.is-animated', { duration: 1, translateY: 60, opacity: 0, stagger: 0.4 });\n tl.from('.fadein', { duration: 0.5, opacity: 0.9 });\n}", "function animate(oldContent, newContent) {\n function removeOldContent() {\n oldContent.parentNode.removeChild(oldContent);\n newContent.classList.remove('animateOpacity');\n }\n oldContent.style.position = 'absolute';\n newContent.addEventListener('animationend', removeOldContent);\n newContent.classList.add('animateOpacity');\n anchorListeners();\n }", "function animate() {\n\n\trequestAnimationFrame( animate );\n\trender();\n\tinputUpdate();\n}", "function animate() {\n requestAnimFrame( animate );\n game.background.draw();\n game.tardis.move();\n}" ]
[ "0.7113772", "0.70904773", "0.70904773", "0.69137734", "0.6723804", "0.6706252", "0.6679947", "0.6635781", "0.6609295", "0.65995955", "0.6596807", "0.65738153", "0.65525097", "0.65405846", "0.6507279", "0.6495413", "0.6491028", "0.6481762", "0.64644283", "0.6442399", "0.642937", "0.64034814", "0.63828665", "0.63645536", "0.63583964", "0.63457584", "0.63085026", "0.6305483", "0.62962854", "0.6272144", "0.62620807", "0.6244652", "0.6241968", "0.62320405", "0.6209899", "0.61820555", "0.6179994", "0.61628956", "0.61579245", "0.61545324", "0.6148128", "0.6147907", "0.61308813", "0.6128819", "0.6122467", "0.6117706", "0.6115586", "0.611115", "0.61098194", "0.60993874", "0.6095767", "0.60913706", "0.6087318", "0.6081903", "0.6075561", "0.60752726", "0.60749024", "0.60748357", "0.606619", "0.60569584", "0.60359615", "0.6035225", "0.60333484", "0.6023756", "0.60147315", "0.60078734", "0.59957445", "0.5992216", "0.5986889", "0.59785247", "0.597837", "0.5975294", "0.59713453", "0.59713453", "0.59713453", "0.59713453", "0.59713453", "0.59697163", "0.5952913", "0.59452367", "0.5944387", "0.5939597", "0.59392184", "0.59218454", "0.59167063", "0.590445", "0.5904294", "0.58997416", "0.5897111", "0.5894479", "0.5891632", "0.5881838", "0.58814937", "0.588039", "0.5879717", "0.5878825", "0.5877224", "0.58692366", "0.5867728", "0.58569884" ]
0.59660935
78
This gets called only once after login is finished to populate the Messages Log with old messages
addOldMessages(messageList) { for (let i in messageList) { let bIsSelf = false; if (messageList[i].user == this.props.user) bIsSelf=true; this.state.list.push({name: messageList[i].user, msg: messageList[i].message, time: messageList[i].time, self: bIsSelf}); } //Need to save the state to cause the view to refresh this.setState({ list: this.state.list }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _saveMessages()\n\t\t{\n\t\t\tvar messages = _getMessages();\n\t\t\tif (messages.length)\t\t\t//delete messages already displayed\n\t\t\t{\n\t\t\t\twhile (messages.length && EZ.getTime(messages[0].time) < displayTime)\n\t\t\t\t\tmessages.shift();\n\t\t\t}\n\t\t\tif (messages.length)\n\t\t\t{\n\t\t\t\tpage.messageCount = messages.length;\n\t\t\t\tpage.messageTime = formattedDate;\n\t\t\t}\n\t\t\t//=========================================================================\n\t\t\tEZ.store.set('.EZtrace.messages.' + ourPageName + '@', messages);\n\t\t\t//=========================================================================\n\t\t}", "onReceivedMessage(messages) {\n if (this._isMounted) {\n this.setState((previousState) => {\n return {\n messages: GiftedChat.append(previousState.messages, messages),\n };\n });\n this.updateTimeOfLastReadMessage();\n }\n }", "function updateDisplayedMessagesManager() {\n const newMessages = wichMessagesShouldBeAddedInHtml();\n newMessages.map(message => {\n message.type === \"private_message\" &&\n message.from !== GLOBAL.username &&\n message.to !== GLOBAL.username\n ? void(0)\n : displayMessage(generateMessageHTML(message))\n })\n GLOBAL.renderedMessages = Array.from(GLOBAL.messages);\n}", "getMessages() {\n\t\tconst newMessages = this.chat_backlog.getLog();\n\t\tthis.chat_backlog.clearLog();\n\t\treturn newMessages;\n\t}", "function loadPersistedMessages() {\n getPersistedMessages((response) => {\n // console.log(response);\n \n if(response.receivedMessages) {\n receivedMessages = JSON.parse(response.receivedMessages);\n }\n if(response.removedMessages) {\n removedMessages = JSON.parse(response.removedMessages);\n\n }\n // purge receivedMessages if the time conditions are met\n purgeReceivedMessages(response.lastPurgeTime);\n });\n}", "function restorePreviousMessages() {\n var temp = 1701;\n\n while (localStorage.getItem(JSON.stringify(temp)) !== null) {\n if (localStorage.getItem(JSON.stringify(temp)) === 'me') {\n temp += 7;\n displayMessage(localStorage.getItem(JSON.stringify(temp)), 'sent');\n } else {\n temp += 7;\n displayMessage(localStorage.getItem(JSON.stringify(temp)), 'received');\n }\n temp += 7;\n }\n localStorageKey.current = temp;\n }", "function refreshMessages(e) {\n getMessages();\n}", "onReceivedMessage(messages) {\n this._storeMessages(messages);\n }", "function updateMessages(){getCurrentDisplayValue().then(function(msg){ctrl.messages=[getCountMessage(),msg];});}", "function limpaMensagens() {\n $rootScope.messages.length = 0;\n }", "_setupMessages () {\n\t\tvar newMessages = {};\n\t\tconst customMessages = getWithDefault(this, 'customMessages', {});\n\t\tkeys(customMessages).forEach(k => {\n\t\t\tset(newMessages, k, get(customMessages, k));\n\t\t});\n\n\t\tkeys(defaultMessages).forEach(k => {\n\t\t\tif(isNone(get(newMessages, k))) {\n\t\t\t\tset(newMessages, k, get(defaultMessages, k));\n\t\t\t}\n\t\t});\n\t\tset(this, 'messages', O.create(newMessages));\n\t}", "function resetUserMessageCounter() {\n recentUserMessages = 0\n}", "function updateMessages () {\n getCurrentDisplayValue().then(function (msg) {\n ctrl.messages = [ getCountMessage(), msg ];\n });\n }", "function updateMessages () {\n getCurrentDisplayValue().then(function (msg) {\n ctrl.messages = [ getCountMessage(), msg ];\n });\n }", "function updateMessages () {\n getCurrentDisplayValue().then(function (msg) {\n ctrl.messages = [ getCountMessage(), msg ];\n });\n }", "_ackConnectHandler(messages){\n\t // Add stored messages\n\t if ((messages !== \"\") && (this.messages.length === 0)){\n\t\t for (var x in messages){\n\t\t\t var message = messages[x];\n\t\t\t this.push('messages', {\"user\": message.user, \"message\": message.textMessage, \"time\": message.time});\n\t\t }\n\t } \n }", "static messageDataSaved() {\n const lastUpdated = this.getLastUpdated();\n if (lastUpdated) {dataSavedMessage.textContent += ' on ' + lastUpdated;}\n dataSavedMessage.style.display = 'block';\n }", "function loadUnreadMessages() {\n let submitURL = path + \"?\" + $.param({ since: lastMessageTime });\n\n $.get(submitURL, function (messages) {\n if (messages.length > 0) console.log(messages);\n\n messages.forEach(function (message) {\n lastMessageTime = Math.max(lastMessageTime, message.timestamp);\n // console.log(lastMessageTime);\n\n if (message.key === \" \") message.key = \"&nbsp;\";\n\n $('<div class=\"letter\"></div>')\n .css('color', message.color)\n .html(message.key)\n .appendTo('main');\n });\n });\n}", "function loadMessages() {\n\n // Create the query to load the last 12 messages and listen for new ones.\n const recentMessagesQuery = query(collection(db, 'spaces', String(getSpaceId()), 'messages'), orderBy('timestamp', 'desc'), limit(12));\n\n // Start listening to the query.\n onSnapshot(recentMessagesQuery, function (snapshot) {\n snapshot.docChanges().forEach(function (change) {\n if (change.type === 'removed') {\n deleteMessage(change.doc.id);\n } else {\n var message = change.doc.data();\n displayMessage(change.doc.id, message.timestamp, message.name,\n message.text, message.profilePicUrl, message.imageUrl);\n }\n });\n });\n}", "async checkNewMessages() {\n\n try {\n await this.messagesDb.connect();\n let messages = await this.messagesDb.getMessagesSince()\n\n if (!messages.length) return false;\n\n // If we have new messages push them out\n // @TODO will need to abstract this out so we can notify locally, globally, and mesh\n let data = await this.getSupportingMessageData(messages, {alert: true});\n this.dataflow.socket.emit('receivedMessages', data);\n this.dataflow.onReceivedMessages(data);\n } catch (e) {\n console.error(e);\n }\n\n }", "function reloadMessages () { \n console.log(\"Current view called\");\n currentView(true);\n}", "loadMessages() {\n\n // request a range of messages preceeding the current index of the oldest retrieved message\n const promise = App.requests.getMessageRange(App.state.lowIndex, App.constants.LOAD_SIZE);\n promise.done(response => {\n\n // if results were returned add them to the page.\n if (response.data.length > 0) {\n if (App.state.highIndex === 0) {\n\n // if this is the first call, set the initial highest index\n App.state.highIndex = response.data[0].id;\n }\n App.dom.prependMessagesToChat(response.data);\n } else {\n\n // assume there are no older messages and disable the button.\n App.dom.disableLoader();\n }\n });\n }", "function refreshLog() {\n $firebaseArray(teamLogRef.orderByKey()).$loaded(function (data) {\n self.teamLog = data;\n });\n }", "function getNewMessages() {\n var newMessageCount = 0;\n var autoscroll = false;\n if ($('#chatMessages').scrollTop() == document.getElementById('chatMessages').scrollHeight) autoscroll = true;\n if (messageCount > numMessagesToShow) {\n while (messageCount > numMessagesToShow) shiftMessage();\n messages.join('<!-- New Message -->');\n } else {\n for (i = messageCount - newMessageCount; i < messageCount; i++) $('#chatMessages').html($('#chatMessages').html() += messages[i]);\n }\n if (autoscroll) scrollMessageToMostRecent();\n }", "function messagesUpdated() {\n\n updateMessageLayers();\n\n if (scope.detailsMap) {\n updateLabelLayer();\n }\n\n if (scope.fitExtent) {\n var extent = ol.extent.createEmpty();\n ol.extent.extend(extent, nwLayer.getSource().getExtent());\n ol.extent.extend(extent, nmLayer.getSource().getExtent());\n if (!ol.extent.isEmpty(extent)) {\n map.getView().fit(extent, {\n padding: [5, 5, 5, 5],\n size: map.getSize(),\n maxZoom: maxZoom\n });\n } else if (scope.rootArea && scope.rootArea.latitude\n && scope.rootArea.longitude && scope.rootArea.zoomLevel) {\n // Update the map center and zoom\n var center = MapService.fromLonLat([ scope.rootArea.longitude, scope.rootArea.latitude ]);\n map.getView().setCenter(center);\n map.getView().setZoom(scope.rootArea.zoomLevel);\n }\n }\n }", "function clearMessages() {\n chrome.runtime.sendMessage({type: \"clearMessages\"}, function(response) {\n displayResponse(response);\n });\n }", "function setInitialMessages(){\n initialMessagesArr = JSON.parse(event.target.responseText).messages;\n initialMessagesArr.forEach(function(message){Slackish.createMessage(message.text)});\n }", "function onNewMessage(data) {\n //TODO: update dialogs\n\n if ($state.current.name == 'chatRoom' && $state.params.user_id == data.user.id) { //if user in chat\n pushToToday(data.message);\n } else {\n NewMessageService.show(data);\n }\n\n $rootScope.currentUser.new_messages++;\n $rootScope.$apply();\n }", "function loadMessages() {\n // Create the query to load the last 12 messages and listen for new ones.\n var query = firebase.firestore()\n .collection('messages')\n .orderBy('timestamp', 'desc')\n .limit(12);\n \n // Start listening to the query.\n query.onSnapshot(function(snapshot) {\n snapshot.docChanges().forEach(function(change) {\n if (change.type === 'removed') {\n deleteMessage(change.doc.id);\n } else {\n var message = change.doc.data();\n displayMessage(change.doc.id, message.timestamp, message.name,\n message.text, message.profilePicUrl, message.imageUrl);\n }\n });\n });\n}", "function loadMessages() {\n // Create the query to load the last 12 messages and listen for new ones.\n var query = firebase.firestore()\n .collection('messages')\n .orderBy('timestamp', 'desc')\n .limit(12);\n \n // Start listening to the query.\n query.onSnapshot(function(snapshot) {\n snapshot.docChanges().forEach(function(change) {\n if (change.type === 'removed') {\n deleteMessage(change.doc.id);\n } else {\n var message = change.doc.data();\n displayMessage(change.doc.id, message.timestamp, message.name,\n message.text, message.profilePicUrl, message.imageUrl);\n }\n });\n });\n}", "function getMessages() {\n \tvar transaction = db.transaction(['osMsgStore'], 'readonly'),\n \t\tobjectStore = transaction.objectStore('osMsgStore'),\n \t\tcursor = objectStore.openCursor(),\n isAdmin = document.getElementsByTagName('body')[0].className === 'admin' ? true : false;\n\n \tcursor.onsuccess = function(e) {\n var res = e.target.result;\n\n \t if (res) {\n generateMessage(res.key, res.value.created, res.value.message, isAdmin);\n \t res.continue();\n \t }\n \t}\n }", "function onGetMessages(response) {\n\tmessages = response._embedded.status;\n\n\tvar newMessages = '';\n\t$.each(messages, function(index, item) {\n\t\tnewMessages += '<li data-theme=\"\">' + '<a href=\"#page2?msgId=' + index\n\t\t\t\t+ '\" data-transition=\"none\">' + item.message + '</a>' + '</li>';\n\t});\n\t$('#messages li[role!=heading]').remove();\n\t$('#messages').append(newMessages).listview('refresh');\n}", "handleChatMessage() {\n\n $('#chatForm').submit(function(){\n var form = $(this).find(':input[type=submit]');\n form.prop('disabled', true);\n window.setTimeout(function(){\n form.prop('disabled',false);\n },1000);\n });\n\n let messages = get(this, 'messages') || [];\n let chatMsg = get(this, 'chatMessage');\n debug('The chat message is ', chatMsg);\n let chatMessage = Message.create({ originalContent: chatMsg, isFinal: true });\n if (messages.indexOf(chatMessage) === -1) {\n messages.pushObject(chatMessage);\n this.handleMessageTranslation(chatMessage)\n .finally(() => {\n this.setValues({chatMessage: null});\n });\n }\n }", "constructor () {\n this.messages = []\n }", "setLogData() {\n if (this.props.setLogData) this.props.setLogData(this.state.sites,this.state.messages,this.state.sessionStatus,this.state.sessionStatusText,this.state.hotwordListening,this.state.audioListening);\n }", "async function ChatlogProcess() {\r\n //Optimizes send times, removes fast dupes, keeps the order, does not work while restarting\r\n let purged = 0;\r\n if (cursedConfig.chatlog.length != 0 && !cursedConfig.onRestart) {\r\n let actionTxt = cursedConfig.chatlog.shift();\r\n let before = cursedConfig.chatlog.length;\r\n cursedConfig.chatlog = cursedConfig.chatlog.filter(el => el != actionTxt);\r\n purged = before - cursedConfig.chatlog.length;\r\n popChatGlobal(actionTxt);\r\n cursedConfig.chatStreak++;\r\n } else {\r\n cursedConfig.chatStreak = 0;\r\n }\r\n\r\n //Spam block\r\n if (cursedConfig.chatStreak > 5 || purged > 3) {\r\n cursedConfig.isRunning = false;\r\n cursedConfig.chatlog = [];\r\n popChatSilent({ Tag: \"ERROR S011\" }, \"Error\");\r\n }\r\n setTimeout(ChatlogProcess, 500);\r\n}", "function pollMessages() {\n getNewMessages();\n setTimeout(pollMessage, pollInterval);\n }", "function messageSetup(){\n // get all the messages when a user logs in\n var data = {};\n data.action = \"get_all_messages\";\n data.database = \"chattest\";\n data.tz_off = (new Date().getTimezoneOffset());\n \n // Send request\n $.post(\"Control/messages.php\", data, processGetMessages);\n}", "function clearMsgLogs(roomToDelete){\n\t\tmsgDatabase.ref(roomToDelete).remove();\n\t\tmsgDatabase.ref(roomToDelete).push({\n\t message: \"Logs cleared!\",\n\t\t});\n\t\tmsgDatabase.ref(roomToDelete).once(\"value\", function(snapshot, prevChildKey){\n\t\t var newPost = snapshot.val()\n\t \t\tvar n = $(\"<p>\")\n\t\t\tn.text(\"Logs cleared!\")\n\t \t\t$(\"#messagesDiv\").html(n);\n\t\t});\n\t}", "function processReceivedMessages(messages) {\n let message_list = chat_messages.get(initiated_chat_id);\n let message_type = chat_messages_type.get(initiated_chat_id);\n\n if (!is_page_in_view && messages.length > 0) {\n // play message notification sound\n sound.play();\n }\n\n // add messages to list\n for (let i = 0; i < messages.length; i++) {\n message_list.push(messages[i]);\n message_type.push(CLIENT_MSG);\n }\n\n // check to add message to chat window\n if (current_chat_id == initiated_chat_id) {\n let prev_sent_msg_time = 0;\n let curr_sent_msg_time;\n\n for (let i = 0; i < messages.length; i++) {\n curr_sent_msg_time = messages[i].time;\n\n // check to create header or tail message\n if ((curr_sent_msg_time - prev_sent_msg_time) > 60) { // create header message\n chat_window_msg_list_elem.appendChild(createClientHeaderMessageBox(messages[i]));\n\n } else { // create tail message\n chat_window_msg_list_elem.appendChild(createClientTailMessageBox(messages[i]));\n }\n\n prev_sent_msg_time = curr_sent_msg_time;\n }\n }\n }", "async function getMessagesOnOpen(){\n if(messages.length==0){\n return;\n }\n // r for reconnecting\n let rhasMore = true;\n let rnext=null;\n let rmessages = [];\n let lastMessage = messages[messages.length - 1];\n let uri;\n let index = -1;\n\n do{\n uri = rnext?rnext:`/api/branches/${member}/chat_rooms/${data.room.id}/messages/`;\n let response = await axios.get(uri);\n if(!response.data.next){\n rhasMore = false;\n break;\n }\n let newrMessages = response.data.results.reverse();\n rnext = response.data.next;\n rmessages = [...newrMessages,...rmessages];\n\n // try to find last known message before disconnect\n }while(rhasMore && rmessages.length>0 && messages.length>0 && !(index=rmessages.findIndex(m=>m.id==lastMessage.id)));\n\n // if message found slice the new messages\n rmessages = rmessages.slice(index + 1,rmessages.length);\n setMessages([...messages,...rmessages]);\n }", "function main() {\n\n populateUsersOnPageLoad();\n populateMessagesOnPageLoad();\n\n //watch for a removed event, when found, remove message from HTML testing\n messagesService.on('removed', (message)=>{\n var msgId = message._id;\n\n $(`.media[data-id=\"${msgId}\"]`).remove();\n });\n\n $('#chat-area').on('click', '.delete-comment', function(){\n\n var msgId = $(this).closest('.media').attr('data-id');\n messagesService.remove(msgId).catch((e)=>{\n alert('There was an error removing a message!');\n });\n\n });\n\n\n /*\n Logout User if Logout Button is Clicked\n */\n $('#logout-icon').on('click', function(){\n //logout the user on the client/server\n client.logout();\n //redirect to the login form\n window.location.href = `${serverurl}/login.html`\n\n });\n\n /*\n Create new message code\n */\n $('#submit-message-form').submit(function(e){\n e.preventDefault();\n\n var $msgText = $('#msg-text');\n var msgText = $msgText.val();\n\n $msgText.val('');\n\n //if message text contains more than whitespace, save the message to the database\n if(msgText.trim().length) {\n messagesService.create({\n text: msgText\n }).catch((err)=>{\n alert('There was an error!');\n });\n }\n\n });\n\n /*\n Watch for new message events and handle approp.\n */\n messagesService.on('created', (message)=>{\n var newMessage = new Message( message );\n\n $('#chat-area').append( newMessage.getMessageHtmlString() );\n\n //animate the user window down when a new message is added\n $('html, body').animate({ scrollTop: $(document).height() }, \"slow\");\n });\n\n\n /*\n Add/Remove user from DOM\n */\n usersService.on('patched', (user)=>{\n const userId = user._id;\n const userName = user.username;\n\n if(user.isOnline === false) {\n if( userIsInDom(userId) ) {\n removeUserFromDom(userId);\n }\n }\n\n if( user.isOnline === true ) {\n if(!userIsInDom(userId)) {\n addUserToDom(user);\n }\n }\n });\n\n\n }", "function savedata(){\n var message = messageField.value;\n\n messagesRef.push({fieldName:'messageField', text:message});\n messageField.value = '';\n }", "onMessagesRemoved() {}", "clearMessageContents() {\r\n // NOTE: 04/17/2017 - These ui update methods are so short now we can probably recycle them and just pass the\r\n // managers behaviour directly.\r\n this.props.uiManager.clearMessageText();\r\n }", "function logMessage(username, content) {\r\n\tmessagesJSON.messages.push({\r\n\t\tuser: username,\r\n\t\tmessage: content\r\n\t})\r\n}", "function processLastMessagesResponse(data){\n let { pkfp, topic, messages, before } = data;\n let topicUXData = uxTopics[pkfp]\n console.log(\"PROCESSING LAST MESSAGES LOADED RESPONSE\");\n\n let container = getTopicMessagesContainer(pkfp);\n let messagesWindow = domUtil.$(\".messages-window\", container)\n\n if(!messages || messages.length === 0) return;\n\n\n //Here excluding all messages that have been already appended\n messages = messages.filter(message=> !topicUXData.messagesLoadedIds.has(message.header.id))\n\n if(messages.length ===0) {\n //nothing to append.\n return\n }\n\n let willScroll = isScrollingRequired(messagesWindow)\n\n for(let message of messages){\n\n\n let authorAlias = topic.getParticipantAlias(message.header.author)\n appendMessageToChat({\n nickname: message.header.nickname,\n alias: Common.formatParticipantAlias(topic.pkfp, message.header.author, authorAlias),\n body: message.body,\n timestamp: message.header.timestamp,\n pkfp: message.header.author,\n messageID: message.header.id,\n service: message.header.service,\n private: message.header.private,\n recipient: message.header.recipient,\n attachments: message.attachments\n }, pkfp, messagesWindow, true);\n }\n\n uxTopics[pkfp].earliesLoadedMessage = messages[messages.length - 1].header.id;\n\n if(willScroll){\n Scroll.scrollDown(messagesWindow)\n }\n\n}", "function clearMessages() {\n Log.trace( \"Enter - DoubleRecordMailServiceClientCore.clearMessages()\" );\n\n try {\n receivedMails = [];\n }\n finally {\n Log.trace( \"Exit - DoubleRecordMailServiceClientCore.clearMessages()\" );\n }\n }", "function view_messages(msg) {\n jQuery(\"#messages_plugin\").empty();\n jQuery(\"#messages_plugin\").html(msg);\n jQuery(\"#messages_plugin\").fadeIn(200);\n jQuery(\"#messages_plugin\").fadeOut(5000);\n }", "function clearMessages() {\n $('#message-list').empty();\n }", "function updateLogs() {\r\n updatePositionLogs();\r\n updateContactLogs();\r\n}", "resetMessages ({commit}) {\n commit(LOAD_MESSAGES, [])\n }", "function readMessages(){\n\n $.getJSON('/read-messages/' + lastReadMessageTime,function(messages){\n // Update the lastReadMessageTime from the read messages\n if(messages.length){\n lastReadMessageTime = messages[messages.length - 1].time;\n }\n messages.forEach(function(message){\n $('body').append(\n '<div class=\"a-message\">' +\n '<p>' + formatTime(message.time) + '</p>' +\n '<p>' + decodeURIComponent(message.text) + '</p>' +\n '</div>'\n );\n });\n $('body').append($('.spacer'));\n window.scrollTo(0,10000000); // scroll to bottom\n // Read more messages\n readMessages();\n });\n\n }", "componentDidMount() {\n Fire.shared.on(message => {\n this.setState(previousState => ({\n messages: GiftedChat.append(previousState.messages, message),\n isLoading: false\n }))\n });\n }", "function newMessage() {\n\t\t$('.chat-back-arrow').addClass('chat-conversation-new-message');\n\t\t$('#chatID-2 .chat-item-user').addClass('chat-item-new-message');\n\t}", "onMessageCreated (data) {\n\t\t// console.log('CLEARED SENDING');\n\t\tif (data.hasOwnProperty(\"delivered\")) {\n\t\t\tthis.$timeout(() => {\n\t\t\t\tlet lastMsg = null;\n\t\t\t\t_remove(this.messagesList, (item) => {\n\t\t\t\t\tif (item.hasOwnProperty(\"loading\") && item.hasOwnProperty(\"sender\")) {\n\t\t\t\t\t\tif (item.text == data.text && item.chat == data.chat) {\n\t\t\t\t\t\t\tlastMsg = item;\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t\tdata.sender = this.AuthorizationService.user.id;\n\t\t\t});\n\t\t}\n\t\tthis.setScrollbar();\n\t}", "loadMessages (data) {\n\t\tif (this._chatListener != null) this._chatListener();\n\t\t// console.log('DIALOG SELECTED', data);\n\t\tthis.ChatService.setCurrentDialog(data.id);\n\t\tthis.MessageService.fetch(data.id).then((data) => {\n\t\t\tthis.messagesList = data;\n\t\t\t// console.log(\"LOADED MESSAGE\", data);\n\t\t\tthis.setScrollbar();\n\t\t});\n\n\t\tthis._chatListener = this.$scope.$on(\"Message.Created:\" + data.id, (event, data) => this.onMessageCreated(data));\n\t\t// console.log('LISTENER ON CHAT:', data.id);\n\n\t\t// this.$rootScope.$broadcast('Dialog.Selected');\n\t}", "function handleChatMessages(data) {\n // Check whether the message is private.\n if(data.private) {\n $scope.privateChat = {\n state: true,\n contact: data.user\n };\n $scope.privateMessages[data.user.id] = $scope.privateMessages[data.user.id] ? $scope.privateMessages[data.user.id] : [];\n\n // If there is no chat window for private chat with the client, creates a new window.\n if ($scope.privateChats.filter(chat => chat.id === data.user.id).length == 0) {\n $scope.privateChats.push(data.user);\n }\n\n // Update the view with new message.\n $scope.$apply(() => {addPrivateChatMessage({room: data.user.id, username: data.user.username, message: data.message});});\n chatNotify(data.user.username, 'New message received!');\n } else {\n $scope.$apply(() => {addChatMessage(data);});\n chatNotify(data.username, 'New message received!');\n }\n }", "function loadMessages() {\r\n // Create the query to load the last 12 messages and listen for new ones.\r\n var query = firebase.firestore()\r\n .collection('messages')\r\n .orderBy('timestamp','asc')\r\n .limitToLast(200); //last 200 messgae of orderby \r\n \r\n // Start listening to the query.\r\n query.onSnapshot(function(snapshot) {\r\n snapshot.docChanges().forEach(function(change) {\r\n if (change.type === 'removed') {\r\n // deleteMessage(change.doc.id);\r\n } else {\r\n var message = change.doc.data();\r\n // displayMessage(message.text);\r\n render(message);\r\n }\r\n });\r\n });\r\n}", "function addmessages(snap) {\n var message = snap.val();\n var mstamp = message.stamp;\n var now = Date.now();\n if (now > timeout) { // 5 seconds\n uptime();\n timeout = now + 5000;\n if (!work) {\n miserlou.currentTime=0;\n miserlou.play();\n }\n }\n var newdiv = $('<div/>', { id: snap.key, 'class': 'msgdiv' });\n if (message.avatar) {\n $('<img/>', { 'class': 'avatar'+(work ? '' : ' show'), src: message.avatar }).appendTo(newdiv);\n }\n newdiv.append('<strong>'+(message.email ?\n '<a href=\"mailto:'+message.email+'\">'+message.name+'</a>' :\n message.name)+'</strong>').\n append(message.host ? ' ('+message.host+')' : '').\n append($('<div/>', {'class': 'msgtime'}).data('mts', mstamp).\n html('<time>'+deltaTime(now - mstamp)+' ago</time>')).\n append($('<div/>', { 'class': 'msgbody' }).html(message.text));\n newdiv.find('.msgbody iframe').wrap('<div class=\"uservid\" />');\n newdiv.find('div.uservid > div.uservid').unwrap(); // get rid of multiple vid wraps\n // newdiv.find('.msgbody img:not([src^=\"e/\"])').wrap('<div class=\"userimg\" />');\n newdiv.find('.msgbody img').filter(function() {\n var src = this.getAttribute('src');\n return src.match(/^e\\//) === null;\n }).css({\n maxWidth: imgWidth + 'px',\n maxHeight: imgHeight + 'px'\n }).wrap('<div class=\"userimg\" />');\n newdiv.find('div.userimg > div.userimg').unwrap(); // get rid of multiple img wraps\n newdiv.find('div.userimg, div.uservid').toggleClass('worksmall', work).click(imagebig);\n newdiv.find('blink').toggleClass('hideme', work);\n $('#messagesDiv').prepend(newdiv);\n\n if (snap.key <= lastseen) {\n newdiv.addClass('read');\n } else { // unread message, animate\n unseen++; settitle();\n if (lastAnimation !== null) {\n lastAnimation.finish(); // finish animation before starting another one\n }\n newdiv.hide().slideDown(500, function() {\n lastAnimation = null;\n }); // slow reveal\n lastAnimation = newdiv;\n }\n messageBodies[snap.key] = newdiv.html(); // keep track of messages\n } // end add messages", "function requestNewMessages() {\n\t\n\t// saves message and color info\n\tvar currentUser = document.getElementById(\"userName\").value;\n\tvar currentColor = document.getElementById(\"color\").value;\n\t\n\t// only continue if xmlHttpGetMessages isn't void\n\tif (xmlHttpGetMessages) {\n\t\ttry {\n\n\t\t\t// prevents multiple server requests at once\n\t\t\tif (xmlHttpGetMessages.readyState == 0 || xmlHttpGetMessages.readyState == 4) {\n\t\t\t\tvar params = \"\";\n\t\t\t\n\t\t\t\t// loads oldest in cache first or checks for new messages\n\t\t\t\tif (cache.length > 0)\n\t\t\t\t\tparams = cache.shift();\n\t\t\t\telse\n\t\t\t\t\tparams = \"mode=RetrieveNew\" + \"&id=\" + lastMessageID;\n\n\t\t\t\t// sends info to server/database\n\t\t\t\txmlHttpGetMessages.open(\"POST\", chatURL, true);\n\t\t\t\txmlHttpGetMessages.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\t\t\t\txmlHttpGetMessages.onreadystatechange = handleReceivingMessages;\n\t\t\t\txmlHttpGetMessages.send(params);\n\n\t\t\t\t// waits a second then checks if server is ready for an update\n\t\t\t} else {\n\t\t\t\tsetTimeout(\"requestNewMessages();\", updateInterval);\n\t\t\t}\n\t\t} catch(e) {\n\t\t\tdisplayError(e.toString());\n\t\t}\n\t}\n}", "get gettingNewMessages() {\n\t\treturn true;\n\t}", "componentDidUpdate(prevProps) {\n // Have we selected a user different to that which is displayed in the current Conversation component?\n // This runs after our component's state has updated (or when we have picked a new user in our chat list)\n\n if (prevProps.newSelectedUser === null || (this.props.newSelectedUser._id !== prevProps.newSelectedUser._id)) {\n // console.log(\"Selected a new user\");\n \n this.setSelectedUser(this.props.newSelectedUser);\n\n this.getMessages();\n } \n }", "function saveMessagesToCache(message) {\n messages.push(message);\n}", "function loadLog(){\t\t\n\t\tvar oldscrollHeight = jQuery(\"#chatbox\").attr(\"scrollHeight\") - 20;\n\t\tjQuery.ajax({\n\t\t\turl: \"logs/log.html\",\n\t\t\tcache: false,\n\t\t\tsuccess: function(html){\t\t\n\t\t\t\tjQuery(\"#chatbox\").html(html); //Insert chat log into the #chatbox div\t\t\t\t\n\t\t\t\tvar newscrollHeight = jQuery(\"#chatbox\").attr(\"scrollHeight\") - 20;\n\t\t\t\tif(newscrollHeight > oldscrollHeight){\n\t\t\t\t\tjQuery(\"#chatbox\").animate({ scrollTop: newscrollHeight }, 'normal'); //Autoscroll to bottom of div\n\t\t\t\t}\t\t\t\t\n\t\t \t},\n\t\t});\n\t}", "generateMessage (callback) {\n\t\tthis.updatedAt = Date.now();\n\t\tthis.updateStream(error => {\n\t\t\tif (error) { return callback(error); }\n\t\t\tthis.message = {\n\t\t\t\tuser: {\n\t\t\t\t\t_id: this.currentUser.user.id,\t// DEPRECATE ME\n\t\t\t\t\tid: this.currentUser.user.id,\n\t\t\t\t\t$unset: {\n\t\t\t\t\t\t[`lastReads.${this.stream.id}`]: true\n\t\t\t\t\t},\n\t\t\t\t\t$set: {\n\t\t\t\t\t\tversion: 7\n\t\t\t\t\t},\n\t\t\t\t\t$version: {\n\t\t\t\t\t\tbefore: 6,\n\t\t\t\t\t\tafter: 7\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tcallback();\n\t\t});\n\t}", "function AddnewMessages(message)\n{\n\t\t\tconsole.log(message)\n\t\t\t\n\t\t\tif(message.channel.sid == generalChannel.sid)\n\t\t\t{\n\t\t\t\tgeneralChannel.getMessages(1).then(function(messagesPaginator){\n\t\t\t\t\t\t\n\t\t\t\t\tconst ImageURL = messagesPaginator.items[0];\n\t\t\t\t\t\n\t\t\t\t\t\t\tif(message.state.attributes.StaffuserName == \"admin\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (message.type == 'media')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t ImageURL.media.getContentUrl().then(function(url){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"IMAGE url\",url);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(message.state.media.state.contentType == \"image/jpeg\" || message.state.media.state.contentType == \"image/png\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//==============image print \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar temp='<div class=\"m-messenger__wrapper\" id=\"message_'+message.state.index+'\" >'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--out\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"modify-btn\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a id=\"'+message.state.index+'\" onClick=\"MessageDelete(this.id)\" class=\"remove btn m-btn m-btn--icon btn-sm m-btn--icon-only m-btn--pill\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-close\"></i>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\"><img src=\"'+url+'\" height=\"100px\" width=\"100px\"/></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(this).height() }, 10);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//$(\"#chatmessage\").append(\"<li id='message_\"+message.state.index+\"' class='classleft'><img src='\"+url+\"' /> <div id='\"+latestPage.items[msgI].index+\"' onClick='MessageDelete(this.id)'><img src='delete.png'/></div></li>\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//= ==========Any file print hre admin side ======\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t var temp='<div class=\"m-messenger__wrapper\" id=\"message_'+message.state.index+'\" >'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--out\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"modify-btn\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a id=\"'+message.state.index+'\" onClick=\"MessageDelete(this.id)\" class=\"remove btn m-btn m-btn--icon btn-sm m-btn--icon-only m-btn--pill\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-close\"></i>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\"><a src=\"'+url+'\"/></a></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(this).height() }, 10);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//$(\"#chatmessage\").append(\"<li id='message_\"+message.state.index+\"' class='classleft'><a href='\"+url+\"' >file</a><div id='\"+latestPage.items[msgI].index+\"' onClick='MessageDelete(this.id)'><img src='delete.png'/></div> </li>\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t// -------------simple text print ================\n\t\t\t\t\t\t\t\t\t\t\tif(message.state.attributes.note == \"note\")\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tvar temp='<div class=\"m-messenger__wrapper owner_note\" id=\"message_'+message.state.index+'\" >'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--out\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"modify-btn\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a id=\"'+message.state.index+'\" onclick=\"MessageEdit(this.id);\" class=\"edit btn m-btn m-btn--icon btn-sm m-btn--icon-only m-btn--pill\" >'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-pencil\"></i>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a id=\"'+message.state.index+'\" onClick=\"MessageDelete(this.id)\" class=\"remove btn m-btn m-btn--icon btn-sm m-btn--icon-only m-btn--pill\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-close\"></i>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\" id=\"editmessage_'+message.state.index+'\">'+message.state.body+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-pencil\"></i></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(this).height() }, 10);\n\t\t\t\t\t\t\t\t\t\t\t\t//$(\"#chatmessage\").append(\"<li id='message_\"+message.state.index+\"' class='classleft note'>\"+message.state.body+\"<img src='note.png'/><div id='\"+message.state.index+\"' onclick='MessageEdit(this.id);'><img src='edit.png'/></div><div id='\"+message.state.index+\"' onClick='MessageDelete(this.id)'><img src='delete.png'/></div></li>\");\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t var temp='<div class=\"m-messenger__wrapper\" id=\"message_'+message.state.index+'\" >'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--out\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"modify-btn\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a id=\"'+message.state.index+'\" onclick=\"MessageEdit(this.id);\" class=\"edit btn m-btn m-btn--icon btn-sm m-btn--icon-only m-btn--pill\" >'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-pencil\"></i>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a id=\"'+message.state.index+'\" onClick=\"MessageDelete(this.id)\" class=\"remove btn m-btn m-btn--icon btn-sm m-btn--icon-only m-btn--pill\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-close\"></i>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\" id=\"editmessage_'+message.state.index+'\">'+message.state.body+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(this).height() }, 10);\n\t\t\t\t\t\t\t\t\t\t\t\t//$(\"#chatmessage\").append(\"<li id='message_\"+message.state.index+\"' class='classleft'>\"+message.state.body+\"<div id='\"+message.state.index+\"' onclick='MessageEdit(this.id);'><img src='edit.png'/></div><div id='\"+message.state.index+\"' onClick='MessageDelete(this.id)'><img src='delete.png'/></div></li>\");\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (message.type == 'media')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t ImageURL.media.getContentUrl().then(function(url){\n\t\t\t\t\t\t\t\t\t\t\t\t console.log(\"IMAGE url\",url);\n\t\t\t\t\t\t\t\t\t\t\t\tif(message.state.media.state.contentType == \"image/jpeg\" || message.state.media.state.contentType == \"image/png\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar temp='<div class=\"m-messenger__wrapper\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--in\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-pic\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<img src=\"assets/app/media/img/users/user4.jpg\" alt=\"\"/>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-username\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<img src=\"'+url+'\" height=\"100px\" width=\"100px\"/>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(this).height() }, 10);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//$(\"#chatmessage\").append(\"<li class='classright'><img src='\"+url+\"' /> </li>\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t var temp='<div class=\"m-messenger__wrapper\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--in\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-pic\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<img src=\"assets/app/media/img/users/user4.jpg\" alt=\"\"/>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-username\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a href=\"'+url+'\" >file</a>' \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t $(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t $(\"#chatmessage\").animate({ scrollTop: $(this).height() }, 10);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//$(\"#chatmessage\").append(\"<li class='classright'><a href='\"+url+\"' >file</a> </li>\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tvar temp='<div class=\"m-messenger__wrapper\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--in\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-pic\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<img src=\"assets/app/media/img/users/user4.jpg\" alt=\"\"/>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-username\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\">'+message.state.body+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(document).height() }, 10);\n\t\t\t\t\t\t\t\t\t\t//$(\"#chatmessage\").append(\"<li class='classright'>\"+message.state.body+\"</li>\");\n\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(this).height() }, 1000);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t//$(\"#listOfChannel\").html(\"\");\n\t\t\t\t\tfor(var j=0;j<StoreChannel.length;j++)\n\t\t\t\t\t{\n\t\t\t\t\t\t\t//console.log(\"message.channel.sid\",message.channel.sid);\n\t\t\t\t\t\t\t//console.log(\"StoreChannel[i].state.sid\",StoreChannel[j].sid)\n\t\t\t\t\t\t\tif(message.channel.sid == StoreChannel[j].sid)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tconsole.log(\"Messagerboxy\",message.channel.body)\n\t\t\t\t\t\t\t\t\t\tvar countId=$(\"#count_\"+j).val();\n\t\t\t\t\t\t\t\t\t\tcountId=parseInt(countId)+1;\n\t\t\t\t\t\t\t\t\t\tconsole.log(\"countIdcountId\",countId);\n\t\t\t\t\t\t\t\t\t\t$(\".count_\"+j).text(countId);\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t$(\".count_\"+j).addClass(\"m-widget4__number\")\n\t\t\t\t\t\t\t\t\t\t$(\"#onlineStatus_\"+j).removeClass(\"bg-gray\");\n\t\t\t\t\t\t\t\t\t\t$(\"#onlineStatus_\"+j).addClass(\"bg-success\");\n\t\t\t\t\t\t\t\t\t\t$(\"#count_\"+j).val(parseInt(countId));\n\t\t\t\t\t\t\t\t\t\t$(\"#lastMessage_\"+j).text(message.state.body)\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\t\t\t}\n\t\n\t \n\t \n\t\n\t//$(\"#listOfChannel\").prepend(\"<li id='\"+StoreChannel[j].state.uniqueName+\"'onclick='customergetChannel(this.id)' style='color:green;'>\"+StoreChannel[j].state.friendlyName+\"<span class='count_\"+j+\"' style='color:red;'>\"+txtval+\"<span><input type='hidden' id='count_\"+j+\"' value='\"+txtval+\"'/></li>\");\n\t\n\t\n\t\t\t\t\t}\n\n\t\t}\n\t\t\n\n}", "function loadMessages() {\n \n // if the sender of the message is myself attach the message to the right,\n // if not attach to the left and if message is individual add the reciever name to the message\n // if the message from others is individual and if reciever is myself attach the message, if not do nothing\n firestore.collection('messages').doc(`${roomId}`).collection(`${roomId}`).orderBy('timestamp', 'asc').get()\n .then(function(snapshot) {\n snapshot.forEach(function(doc) {\n if(myName === doc.data().name){\n if(doc.data().individualMsg) attachMessage(doc.data().date, doc.data().time, myName, rightChatImg, \"right\", doc.data().msg + \"<br/><hr>to \" + doc.data().toName, doc.data().individualMsg);\n else attachMessage(doc.data().date, doc.data().time, myName, rightChatImg, \"right\", doc.data().msg, doc.data().individualMsg);\n }\n else{\n setPeerChatImgName(\"left\", doc.data().name);\n if(doc.data().individualMsg) {\n if (myName === doc.data().toName) attachMessage(doc.data().date, doc.data().time, doc.data().name, leftChatImg, \"left\", doc.data().msg, doc.data().individualMsg);\n }\n else attachMessage(doc.data().date, doc.data().time, doc.data().name, leftChatImg, \"left\", doc.data().msg, doc.data().individualMsg);\n }\n });\n });\n msgerChat.scrollTop += msgerChat.scrollHeight;\n}", "moveSansCompte() {\n if (GLOBALS.CONNECTED) {\n if (GLOBALS.EMAIL && GLOBALS.PASS)\n GLOBALS.SOCKET.emit('login', { email: GLOBALS.EMAIL, password: GLOBALS.PASS });\n GLOBALS.SOCKET.on('login', data => {\n if (data.status === \"ok\") {\n clearInterval(this.intervalID);\n GLOBALS.USERNAME = data.message.toString();\n this.props.navigation.navigate(\"Contact\");\n // this.props.navigation.navigate(\"Chat\", { room: 'room1' });\n } else\n GLOBALS.CONNECTED = false;\n });\n }\n }", "function loadMessages(done) {\n var url = Application.mainUrl + '?token=' + Application.token;\n\n ajax('GET', url, null, function (responseText) {\n var response = JSON.parse(responseText);\n\n Application.messageList = response.messages;\n Application.token = response.token;\n done();\n });\n}", "applyAudit() {\n super.applyAudit();\n this.log.debug('This is only another custom messagem from your custom server :)');\n }", "function LogEvents(){ \r\n if (GM_getValue('autoLog', '') != \"checked\" || document.body.innerHTML.indexOf('message_body') == -1)\r\n return;\r\n var boxes = document.getElementById(SCRIPT.appID+'_content').getElementsByTagName('span');\r\n if(boxes.length==0)\r\n return;\r\n GM_log('Autoplayer autoLog');\r\n var messagebox = boxes[0];\r\n // skip this messagebox... for now\r\n if(messagebox.innerHTML.indexOf('Someone has invited you to join their Clan') != -1){\r\n if(boxes[1].innerHTML.indexOf('New') != -1)\r\n messagebox = boxes[2];\r\n else\r\n messagebox = boxes[1];\r\n }\r\n if(messagebox.innerHTML.indexOf('You just bought') != -1){\r\n var item = messagebox.innerHTML.split('You just bought')[1].split('for')[0];\r\n addToLog(\"You just bought \" + item);\r\n }\r\n else if(messagebox.innerHTML.indexOf('You successfully dominated') != -1){\r\n var minion = messagebox.innerHTML.split('You successfully dominated ')[1];\r\n minion = minion.split('.')[0];\r\n addToLog(\"You successfully dominated \" + minion);\r\n }\r\n else if(messagebox.innerHTML.indexOf('Rare Ability') != -1){\r\n var ability = boxes[1].innerHTML.split('return true;\">')[1].split('</a>')[0];\r\n addToLog(\"acquired Rare Ability \" + ability);\r\n }\r\n else if(messagebox.innerHTML.indexOf('You withdrew') != -1){\r\n var deposit = messagebox.innerHTML.split('blood.gif\">')[1];\r\n deposit = deposit.replace(\",\",\"\");\r\n deposit = deposit.replace(\",\",\"\");\r\n deposit = parseInt(deposit);\r\n addToLog(\"withrew \" + deposit);\r\n }\r\n else if(messagebox.innerHTML.indexOf('deposited and stored safely') != -1){\r\n var deposit = messagebox.innerHTML.split('blood.gif\">')[1];\r\n deposit = deposit.replace(\",\",\"\");\r\n deposit = deposit.replace(\",\",\"\");\r\n deposit = parseInt(deposit);\r\n addToLog(\"deposit \" + deposit);\r\n }\r\n else if(messagebox.innerHTML.indexOf('more health') != -1){\r\n var addHealth = messagebox.innerHTML.split('You get')[1].split('more health')[0];\r\n var cost = 0;\r\n if(messagebox.innerHTML.indexOf('blood.gif\">') != -1)\r\n cost = messagebox.innerHTML.split('blood.gif\">')[1];\r\n cost = cost.replace(\",\",\"\");\r\n cost = cost.replace(\",\",\"\");\r\n cost = parseInt(cost );\r\n addToLog(\"health +\"+ addHealth + \" for \" + cost );\r\n }\r\n else if(messagebox.innerHTML.indexOf('You fought with') != -1){\r\n if(GM_getValue('freshMeat', '') != \"checked\"){\r\n var user = messagebox.innerHTML.split('href=\"')[1].split('\"')[0];\r\n var username = messagebox.innerHTML.split('true;\">')[1].split('</a>')[0];\r\n user = '<a href=\"'+user+'\">'+username+'</a>';\r\n\r\n var battleResult = document.evaluate(\"//span[@class='good']\",document,null,9,null).singleNodeValue;\r\n if(battleResult!=null && battleResult.innerHTML.indexOf('blood.gif\">') != -1){\r\n var cost = battleResult.innerHTML.split('blood.gif\">')[1]; \r\n cost = cost.replace(\",\",\"\");\r\n cost = cost.replace(\",\",\"\");\r\n addToLog(\"fought \"+ user + \" WON \" +parseInt(cost));\r\n }\r\n battleResult = document.evaluate(\"//span[@class='bad']\",document,null,9,null).singleNodeValue;\r\n if(battleResult!=null && battleResult.innerHTML.indexOf('blood.gif\">') != -1)\r\n {\r\n var cost = battleResult.innerHTML.split('blood.gif\">')[1]; \r\n cost = cost.replace(\",\",\"\");\r\n cost = cost.replace(\",\",\"\");\r\n addToLog(\"fought \"+ user + \" LOST \" +parseInt(cost));\r\n }\r\n for (var i=1;i<boxes.length;i++)\r\n if(boxes[i].innerHTML.indexOf('found')!= -1){\r\n addToLog(\"found \"+ boxes[i].innerHTML.split('found ')[1].split('while fighting ')[0]);\r\n i=boxes.length;\r\n }\r\n if(GM_getValue('rFightList', '') == \"checked\")\r\n CycleFightList(); \r\n }\r\n }\r\n else if(messagebox.innerHTML.indexOf('too weak to fight') != -1){\r\n if(GM_getValue('rFightList', '') == \"checked\")\r\n CycleFightList(); \r\n }\r\n else if(messagebox.innerHTML.indexOf('You cannot fight a member of your Clan') != -1){\r\n if(GM_getValue('rFightList', '') == \"checked\"){\r\n var opponents = GM_getValue('fightList', '').split(\"\\n\");\r\n var opponentList=\"\";\r\n for (var i=1;i<opponents.length;i++)\r\n opponentList = opponentList+ opponents[i]+\"\\n\";\r\n GM_setValue('fightList', opponentList);\r\n }\r\n }\r\n else if(messagebox.innerHTML.indexOf('The Wheel and fate has smiled upon you') != -1){\r\n addToLog(messagebox.innerHTML.split('smiled upon you.<br>')[1].split('Repay the favor')[0]);\r\n }\r\n else if(messagebox.innerHTML.indexOf('The wheel halts suddenly') != -1){\r\n addToLog(messagebox.innerHTML.split('<br>')[1]);\r\n setTimeout(\"document.location ='\" + \"http://apps.facebook.com/\"+SCRIPT.name+\"/buffs.php\", delay);\r\n return; \r\n }\r\n else if(messagebox.innerHTML.indexOf('hours and') != -1){\r\n // index page shows crypt timer\r\n if (location.href.indexOf(SCRIPT.name+'/index') != -1){\r\n // do nothing for now\r\n }\r\n // buffs page shows buff timer\r\n if (location.href.indexOf(SCRIPT.name+'/buffs') != -1){\r\n var now = Math.floor(new Date().getTime() / 1000);\r\n time = 3600 * parseInt(messagebox.innerHTML.split('hours')[0]);\r\n time = time + 60 *(1+ parseInt(messagebox.innerHTML.split('hours and')[1]));\r\n GM_setValue('spin',now + time );\r\n }\r\n }\r\n else if(messagebox.innerHTML.indexOf('Fresh Meat') != -1){\r\n // do nothing\r\n }\r\n else if(messagebox.innerHTML.indexOf('icon-blood.gif') != -1){\r\n // do nothing\r\n }\r\n else if(messagebox.innerHTML.indexOf('You cannot heal so fast') != -1){\r\n document.getElementById(SCRIPT.appID+'_health_refill_popup').style.display = 'block';\r\n setTimeout(function(){document.getElementById(SCRIPT.appID+'_health_refill_popup').getElementsByTagName('form')[0].submit();},delay);\r\n return;\r\n }\r\n else if(messagebox.innerHTML.indexOf('You do not have enough favor points to spin the wheel again') != -1){\r\n window.location = \"http://apps.facebook.com/\"+SCRIPT.name+\"/buffs.php\";\r\n return;\r\n }\r\n //else\r\n //alert(messagebox.innerHTML);\r\n}", "_onMessageSubmitB() {\n const message = this._getInput();\n if (message && message.length) {\n this.messages = [...this.messages, message];\n }\n }", "_fillRoomWithMessages () {\n const { chatGetMessagesRequest, params, data, messagesData, isE2ee } = this.props\n const { messageIds } = messagesData\n if (isE2ee) {\n return // no need to auto fill page if room is in e2ee mode\n }\n if (!messageIds || !messageIds.length) {\n return // wait until initial request is finished\n }\n if (this.state.isScrollable) {\n return // already filled\n }\n if (data.isLoadingMessages) {\n return // already fetching more messages\n }\n if (data.noMoreMessagesAvailable) {\n return // no more messages to fill with\n }\n chatGetMessagesRequest(params.id, true)\n }", "function storeMessages(){\n if (stagedMessages && stagedMessages.length > 0){\n var q1 = 'INSERT INTO messages (date, username, message) VALUES';\n\n //TODO: update this to deal with SQL injection .e.g. setting a username to '; DROP TABLE ...'\n\n var msgCount = stagedMessages.length;\n var i = 0;\n stagedMessages.map(function(msg){\n q1 += \"('\"+stripDate(msg.date)+\"', '\"+msg.author+\"', '\"+msg.message+ \"')\";\n if (i++ != (msgCount-1)){\n q1+=\",\";\n }\n });\n q1 += ';';\n\n db.query(q1, function(done){ if(!done){\n debug.log('serverDB: storeMessages: error');} });\n stagedMessages = [];\n }\n}", "function update() {\n\t\tvar xmlhttp=new XMLHttpRequest();\n\t\tvar username = getcookie(\"messengerUname\");\n\t\tvar output = \"\";\n\t\t\t\t\t\n\t\txmlhttp.onreadystatechange=function() {\n\t\t\t\tif (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n\t\t\t\t\t\tvar response = xmlhttp.responseText.split(\"\\n\")\n\t\t\t\t\t\tvar rl = response.length\n\t\t\t\t\t\tvar item = \"\";\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tfor (var i = 0; i < rl; i++) {\n\t\t\t\t\t\t\t\titem = response[i].split(\"\\\\\")\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (item[1] != undefined) {\n\t\t\t\t\t\t\t\t\tif (item[0] == username) {\n\t\t\t\t\t\t\t\t\t\toutput += \"<div class=\\\"msgc\\\" style=\\\"margin-bottom: 30px;\\\"> <div class=\\\"msg msgfrom\\\">\" + item[2] + \"</div> <div class=\\\"msgarr msgarrfrom\\\"></div> <div class=\\\"msgsentby msgsentbyfrom\\\">Sent by \" + item[0] + \" (\" +item[1]+ \")</div> </div>\";\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\toutput += \"<div class=\\\"msgc\\\"> <div class=\\\"msg\\\">\" + item[2] + \"</div> <div class=\\\"msgarr\\\"></div> <div class=\\\"msgsentby\\\">Sent by \" + item[0] +\" (\" +item[1]+ \")</div> </div>\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tmsgarea.innerHTML = output;\n\t\t\t\t\t\tmsgarea.scrollTop = msgarea.scrollHeight;\n\t\t\t\t}\n\t\t}\n\t\t\n\t\txmlhttp.open(\"GET\",\"get-messages.php?username=\" + username,true);\n\t\txmlhttp.send();\n}", "function clearMessage() {\r\n\t\t// For some reason, unless we call hide(), messages that were faded out\r\n\t\t// on a previous tab will be visible when we switch to that tab.\r\n\t\t$messageArea.fadeOut(\"slow\", function () { \r\n\t\t\t$(this).hide(); \r\n\t\t});\r\n\t}", "function checkNewMessage(){\n if(globalLastId === -1)\n {\n let listItem = document.querySelectorAll(\"li\")\n let lastMess = []\n for (let i = 0; i < listItem.length; i++)\n lastMess.push(listItem[i].textContent.trim())\n\n if(lastMess.length === 0)\n globalLastId = -1\n else\n globalLastId = +lastMess[0].charAt(0)\n }\n\n fetch(\"/checkUpdate\", {method:\"post\"})\n .then(res => res.json())\n .then(response => {updateList(response)})\n .catch((err) => {\n if(err.message === \"Unexpected end of JSON input\") //user disconnected\n stopIntervalAndReturn()\n else\n console.log(err.message)\n })\n }", "function clearMsgs() {\n if(gameInfo.length != 0){\n gameInfo = [];\n }\n}", "async componentDidMount(){\n let user = JSON.parse( await AsyncStorage.getItem('@UserStore:info'));\n let messageList = await RequestHandler.fetchMessages(user.mail,0)//TODO: set timeStamp\n this.setState({messageList: messageList})\n }", "function messageChangeHandler(/*msgs*/) {\n this.views.messages.render(this.model.messages);\n var count = document.querySelector('footer .messages-count');\n //console.log(this.model.messages.length + ' message' + (this.model.messages.length > 1 ? 's' : ''));\n count.textContent = 'Showing ' \n + this.model.messages.length.toLocaleString(this.model.locale)\n + ' message' \n + (this.model.messages.length > 1 ? 's' : '')\n + ' of ' + this.model.total.toLocaleString(this.model.locale);\n }", "async function notifyNewMessages(auth){\n try{\n // Get all the new filtered messages\n const newMessages=await getNewFilteredMessages(auth);\n\n // Notify the user, desktop & console\n notify(newMessages);\n }\n catch(err){\n console.log(\"Error in notifyNewMessages\")\n throw err;\n }\n \n}", "loadSavedMessages(callback){\n AsyncStorage.getItem(this.STORAGE_MESSAGES).then((value) => {\n if(value != null && value != undefined) this.setNewMessage(JSON.parse(value));\n else AsyncStorage.setItem(this.STORAGE_MESSAGES,JSON.stringify([]));\n callback();\n }).done();\n }", "function onMessage(event) {\n var str = event.data.split(\"\\r\");\n var pos\n for (pos = 0; pos < str.length - 1; pos++) {\n if (logMessages.length >= maxLogs) {\n logMessages.shift();\n }\n logMessages.push(str[pos]);\n }\n}", "function Messages()\n\t{\n\t\tthis.msgs = [];\n\t\tif( arguments[0] !== undefined )\n\t\t\tthis.update( arguments[0] );\n\t}", "onSend(messages = []) {\n this.setState(previousState => ({\n messages: GiftedChat.append(previousState.messages, messages),\n }),\n () => {\n this.addMessages();\n this.saveMessages();\n }\n\n );\n }", "function loadMessages() {\n findU().then(reu => {\n console.log(reu.uid);\n findGroup(reu.uid).then(reu => {\n userGroup = reu\n // Create the query to load the last 12 messages and listen for new ones.\n var query = firebase.firestore().collection('group').doc(userGroup).collection(\"messages\").orderBy('timestamp', 'desc').limit(12);\n\n // Start listening to the query.\n query.onSnapshot(function (snapshot) {\n snapshot.docChanges().forEach(function (change) {\n if (change.type === 'removed') {\n deleteMessage(change.doc.id);\n } else {\n var message = change.doc.data();\n displayMessage(change.doc.id, message.timestamp, message.name,\n message.text, message.profilePicUrl, message.imageUrl);\n }\n });\n });\n });\n });\n}", "function _clear() {\n angular.forEach(messages, function(msg, key) {\n delete messages[key];\n });\n }", "async function fetchMessages() {\n const response = await fetch('/api/messages');\n const messages = await response.json();\n\n setMessages(messages);\n }", "function refreshMessages() {\n $.get('/messages', showNewMessages);\n}", "purgeMessages() {\n if (this.messageListPurger) {\n this.messageListPurger.cancel();\n }\n\n this.messageListPurger = Promise.delay(this.options.purgeInterval).then(() => {\n let needsUpdate = false;\n let counter = 0;\n for (let i = 0; i < this.messages.length; i++) {\n let message = this.messages[i];\n\n // only remove infos and warnings\n if (message.severity !== Severity.Error && !message.actions) {\n this.disposeMessages(this.messages.splice(i, 1));\n counter--;\n i--;\n needsUpdate = true;\n }\n }\n\n if (needsUpdate) {\n this.prepareRenderMessages(false);\n }\n });\n }", "onSend(messages = []) {\n this.setState(previousState => ({\n messages: GiftedChat.append(previousState.messages, messages),\n }),\n () => {\n this.addMessage();\n this.saveMessages();\n }\n );\n }", "function updateDisplay() {\n UserService.getUserInfo().then(function(response) {\n displayLogs();\n })\n }", "async loadMessages(loggedUser: string, chatPartner: string, callback) {\n\n // Check if thread exists first\n let threadKey = await this.checkIfThreadExists(loggedUser, chatPartner);\n\n if (threadKey) {\n this.messagesRef = this.firebaseApp.database().ref(`threads/${threadKey}/messages`);\n this.messagesRef.off();\n\n const onReceive = (data) => {\n const message = data.val();\n callback({\n _id: data.key,\n text: message.text,\n createdAt: new Date(message.createdAt),\n user: {\n _id: message.user._id,\n name: message.user.name\n },\n });\n };\n this.messagesRef.limitToLast(20).on('child_added', onReceive);\n }\n }", "_formatMessages(entries) {\n const lastSeenTimestamp = this._storableState.lastSeenTimestamp || 0\n return JSON.parse(JSON.stringify(entries)) // Deep copy\n .map(entry =>\n Object.assign(entry.payload.value, {\n hash: entry.hash,\n userIdentity: entry.identity,\n unread: entry.payload.value.meta.ts > lastSeenTimestamp,\n meta: formatMeta(entry.payload.value.meta)\n })\n )\n }", "handleUserMessage( userMsg ) {\n let {chatMsgs, session_id, inFeedbackSequence} = this.state;\n let that = this;\n let newUserMsg = {\n msgTxt: userMsg,\n msgTimestamp: new Date().toLocaleTimeString(),\n isBot: false,\n msgNum: chatMsgs.length + 1\n }\n chatMsgs.push(newUserMsg);\n this.setState({chatMsgs}, () => {\n this.scrollToMsg(`msgNum-${newUserMsg.msgNum}`);\n this.setState({showLoader: true});\n });\n this.postMsgWrapper(\n userMsg,\n session_id,\n that\n );\n }", "addChat(newMessage) {\n\t\tthis.log.push(newMessage);\n\t}", "getMessages() {\n if(this.loadProcess)\n return true\n\n if(this.room.end)\n return true\n\n this.loadProcess = true\n\n let self = this,\n roomId = this.room.roomId\n\n let dateElements = $('.t_messages-date')\n if(dateElements.length)\n $(dateElements[dateElements.length - 1]).detach()\n\n let postData = {\n paginate: this.paginate,\n last_message: this.room.lastMessage\n }\n\n this.axiosInstance.post(this.links.roomMessages + roomId, postData)\n .then((response) => {\n let tMessages = $('.t_messages'),\n tMessageScrollTop = tMessages[0].scrollHeight\n\n self.loadProcess = false\n\n if(!response.data){\n self.room.end = true\n return true\n }\n\n if(response.data.length < self.paginate)\n self.room.end = true\n\n for (let message in response.data) {\n self.messageHandler(response.data[message])\n }\n\n self.setDate(this.room.lastDate)\n\n if(self.room.toScroll){\n tMessages.scrollTop(tMessages[0].scrollHeight);\n self.room.toScroll = false\n }else{\n $('.t_messages').scrollTop(tMessages[0].scrollHeight - tMessageScrollTop)\n }\n })\n .catch((error) => {\n console.log(error)\n self.loadProcess = false\n })\n }", "function loginCompleted() {\n }", "function flushMessages() {\n\tObject.keys(messages)\n\t\t.forEach(function(type) {\n\t\t\tmessages[type].forEach(function(msg) {\n\t\t\t\twriteLine(msg.type + \" error: [\" + msg.file + \":\" + msg.line + \"] \" + msg.message);\n\t\t\t});\n\t\t});\n}" ]
[ "0.6429734", "0.6294224", "0.6288256", "0.6267448", "0.6138427", "0.613722", "0.6064013", "0.6045805", "0.6029359", "0.602491", "0.5980553", "0.59126776", "0.5908179", "0.5908179", "0.5908179", "0.59018636", "0.5901812", "0.5889961", "0.58642036", "0.58489144", "0.58468455", "0.5843739", "0.58382267", "0.58375674", "0.58321345", "0.58023775", "0.57974136", "0.57908475", "0.5779547", "0.5779547", "0.57675904", "0.5752538", "0.5737863", "0.5736489", "0.57013756", "0.5700293", "0.56916744", "0.5690128", "0.5663393", "0.56610155", "0.5660751", "0.566002", "0.5646032", "0.5639661", "0.5639381", "0.56332564", "0.56330186", "0.5629234", "0.56275505", "0.561914", "0.5602984", "0.5587019", "0.5586499", "0.5581124", "0.55614316", "0.5555402", "0.5552786", "0.55416876", "0.55311805", "0.55167574", "0.551302", "0.5501666", "0.5496198", "0.5490576", "0.5477482", "0.547028", "0.5470083", "0.5468047", "0.5461141", "0.5456364", "0.54547065", "0.5448773", "0.5446228", "0.5445788", "0.5442728", "0.5440654", "0.5437151", "0.54364777", "0.54300195", "0.5429899", "0.542729", "0.5418753", "0.54145133", "0.54115045", "0.5410474", "0.54064834", "0.5388262", "0.538757", "0.53850675", "0.538444", "0.53821576", "0.53773403", "0.537661", "0.5375517", "0.53732646", "0.5373055", "0.53720003", "0.5370812", "0.5369773", "0.5369735" ]
0.5770584
30
function which adds "required" to an input's couple if it is not empty (please note that this validation will run on both forms tab 1 and 3 a "clear fields" procedure, should be add to the tabswitch functionality)
function validateRequired() { fieldCouplesArray.forEach(function (inputCouple) { if (inputCouple[0].value === "" && inputCouple[1].value !== "") { inputCouple[0].required = true; } else if (inputCouple[0].value !== "" && inputCouple[1].value === "") { inputCouple[1].required = true; } else { inputCouple[0].required = false; inputCouple[1].required = false; } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function required(element) {\n if (element.value === \"\") {\n $(element).next().remove();\n var value = $(element).closest('.form__group').find('.form__label').text();\n $(element).after(`<span class=\"form-error-msg\">${value} is required</span>`\n );\n return true;\n } else {\n $(element).next().remove();\n return false;\n }\n}", "function validateRequiredFieldForAdd(){\n\t\tvar factoryCode= $(\"#addFactoryDialog\").find(\"#txtFactoryCode\").val();\n\t\tif(factoryCode.trim() === '' || factoryCode == null)\n\t\t\treturn false;\n\t\t\n\t\tvar shortName= $(\"#addFactoryDialog\").find(\"#txtShortName\").val();\n\t\tif(shortName.trim() === '' || shortName == null)\n\t\t\treturn false;\n\t\t\n\t\treturn true;\n\t}", "function checkRequired(elem) {\n var errorField = $(elem).next('small');\n var hadError = false;\n if ($(elem).val() === '') {\n errorField.text('Det här fältet är obligatoriskt!');\n errorField.addClass('error');\n hadError = true;\n } else {\n errorField.text('');\n errorField.removeClass('error');\n }\n return hadError;\n}", "function validate_required(field,alerttxt)\r\n{\r\n\tif (field.value==null|| field.value==\"\")\r\n\t{\r\n\t\t//var field = field\r\n\t\tshow_it(field,alerttxt)\r\n\t\treturn false;\r\n\t}\r\n\telse \r\n\t{\r\n\t\treturn true;\r\n\t}\r\n}", "checkRequired() {\n if (this.isEmpty() || !this.isValid()) {\n if (this.isEmpty()) {\n this.errorMessage = \"Dit is een required field\";\n this.showError();\n }\n else {\n this.validate();\n }\n }\n else\n this.hideError();\n }", "function reqInputChange() {\n if (this.value === '') {\n window.showError(this.parentNode, 'required');\n } else {\n window.hideError(this.parentNode, 'required');\n }\n}", "function helperFormRequired () {\n if (\n dateNotEmpty() |\n stringNotEmpty('input', 'helper[profile][firstname]') |\n stringNotEmpty('input', 'helper[profile][familyname]') |\n stringNotEmpty('input', 'helper[profile][pob]') |\n stringNotEmpty('select', 'helper[profile][nationality]') |\n stringNotEmpty('input', 'helper[local][contact][countrycode]') |\n stringNotEmpty('input', 'helper[profile][residentialaddress]') |\n stringNotEmpty('select', 'helper[profile][portrepatriated]') |\n stringNotEmpty('select', 'helper[profile][religion]') |\n stringNotEmpty('select', 'helper[profile][dietaryrestriction]') |\n stringNotEmpty('select', 'helper[profile][foodhandlingrestriction]') |\n stringNotEmpty('select', 'helper[profile][maritalstatus]') |\n stringNotEmpty('select', 'helper[profile][phagency]') |\n stringNotEmpty('select', 'helper[education][educationlevel]') |\n stringNotEmpty('input', 'helper[education][fieldofstudy]') |\n numberNotZero('input', 'helper[local][contact][number]') |\n numberNotZero('input', 'helper[profile][heightcm]') |\n numberNotZero('input', 'helper[profile][weightkg]')\n ) {\n return true\n } else {\n return false\n }\n }", "function checkRequired(inputArr) {\n inputArr.forEach((input) => {\n // trim - remove space\n if (input.value.trim() === \"\") {\n showError(input, `${getFieldName(input)} can't be empty`);\n } else {\n showSuccess(input);\n }\n });\n}", "function mandatoryFilled() {\r\n\t\tvar mandatory_filled = true;\r\n\r\n\t\t$(\"input[rel=mandatory]\").each(function() {\r\n\t\t\tif (!$(this).val() && mandatory_filled == true) {\r\n\t\t\t\tmandatory_filled = false;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif (mandatory_filled == false) {\r\n\t\t\t$.ajax({\r\n\t\t\t\ttype : \"POST\",\r\n\t\t\t\turl : \"logic/process_inputcheck.php\",\r\n\t\t\t\tdata : {\r\n\t\t\t\t\taction : \"get_message_mandatory_not_filled\"\r\n\t\t\t\t}\r\n\t\t\t}).done(function(msg) {\r\n\t\t\t\t$('div[id=mandatory_fields]').remove();\r\n\t\t\t\t$('#messagearea').append(msg);\r\n\t\t\t\t$('html, body').animate({\r\n\t\t\t\t\tscrollTop : $('#messagearea').offset().top\r\n\t\t\t\t}, 600);\r\n\t\t\t\treturn false;\r\n\t\t\t});\r\n\r\n\t\t} else {\r\n\t\t\t$('div[id=mandatory_fields]').remove();\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "function required(field, regex, first_error, sec_error, event) {\n if (field.value === \"\") {\n field.nextElementSibling.innerHTML = first_error;\n event.preventDefault();\n return false;\n } else if (!field.value.match(regex)) {\n field.nextElementSibling.innerHTML = sec_error;\n event.preventDefault();\n return false;\n } else {\n field.nextElementSibling.innerHTML = \"\";\n return true;\n }\n}", "function process_required(input) {\n var types = input.getAttribute('form-required').split(',');\n var value;\n if (input.errorNode) {\n input.parentNode.removeChild(input.errorNode);\n input.errorNode = null;\n }\n MochiKit.DOM.removeElementClass(input, 'error');\n for (var i=0; i<types.length; i++) {\n var validator = validators[types[i]];\n if (! validator) {\n throw ('Unknown validation type: ' + types[i]);\n }\n result = validator(get_input_value(input), input, types[i]);\n if (result) {\n var err = MochiKit.DOM.DIV({'class': 'error'}, result);\n input.parentNode.insertBefore(err, input);\n MochiKit.DOM.addElementClass(input, 'error');\n input.errorNode = err;\n return false;\n }\n }\n return true;\n}", "function checkRequired(inputArr) {\n inputArr.forEach(input => {\n if (input.value.trim() === '') {\n showError(input, `${getFieldName(input)} is required`);\n } else {\n showSuccess(input);\n }\n });\n}", "function checkAttrib() {\n var tel = document.getElementById(\"phn\");\n var email = document.getElementById(\"email\");\n // If BOTH fields are empty\n if ((tel.validity.valueMissing && email.validity.valueMissing) || (tel.value === \"\" && email.value === \"\")) {\n // Add the required attributes.\n tel.setAttribute(\"required\", \"\");\n email.setAttribute(\"required\", \"\");\n // If the email field is not missing\n } else if ((tel.validity.valueMissing || tel.value === \"\") && !email.validity.valueMissing) {\n email.setAttribute(\"required\", \"\");\n if (tel.hasAttribute(\"required\")) {\n tel.removeAttribute(\"required\");\n }\n // If the telephone field is not missing.\n } else if (!tel.validity.valueMissing && (email.validity.valueMissing || email.value === \"\")) {\n tel.setAttribute(\"required\", \"\");\n if (email.hasAttribute(\"required\")) {\n email.removeAttribute(\"required\");\n }\n }\n}", "function validateRequired(form) { \n var bValid = true;\n var focusField = null;\n var i = 0; \n var fields = new Array(); \n oRequired = new required(); \n \n for (x in oRequired) { \n if ((form[oRequired[x][0]].type == 'text' || form[oRequired[x][0]].type == 'textarea' || form[oRequired[x][0]].type == 'select-one' || form[oRequired[x][0]].type == 'radio' || form[oRequired[x][0]].type == 'password') && form[oRequired[x][0]].value == '') {\n if (i == 0)\n focusField = form[oRequired[x][0]]; \n \n fields[i++] = oRequired[x][1];\n \n bValid = false; \n } \n } \n \n if (fields.length > 0) {\n focusField.focus();\n // alert(fields.join('\\n')); \n } \n \n return bValid; \n}", "function checkRequired(inputArray) {\n inputArray.forEach(function(input) {\n if (input.value.trim() === '') {\n showError(input, `${getFieldName(input)} is required.`);\n } else {\n showSuccess(input);\n }\n })\n}", "function hasBlankRequiredFields(form) {\n var error = false;\n\n form.find('input, textarea').each(function() {\n var input = $(this);\n\n if (input.data('required') && input.val() === '') {\n\n input.addClass('js-required');\n\n input.on('blur', function() {\n\n if ($(this).val() !== '') {\n $(this).removeClass('js-required');\n }\n\n });\n\n error = true;\n }\n });\n\n if (error) {\n form\n .find('.js-required')\n .first()\n .focus();\n }\n\n return error;\n}", "function validateRequired(form) { \r\n var bValid = true;\r\n var focusField = null;\r\n var i = 0; \r\n var fields = new Array(); \r\n oRequired = new required(); \r\n \r\n for (x in oRequired) { \r\n if ((form[oRequired[x][0]].type == 'text' || form[oRequired[x][0]].type == 'textarea' || form[oRequired[x][0]].type == 'select-one' || form[oRequired[x][0]].type == 'radio' || form[oRequired[x][0]].type == 'password') && form[oRequired[x][0]].value == '') {\r\n if (i == 0)\r\n focusField = form[oRequired[x][0]]; \r\n \r\n fields[i++] = oRequired[x][1];\r\n \r\n bValid = false; \r\n } \r\n } \r\n \r\n if (fields.length > 0) {\r\n focusField.focus();\r\n alert(fields.join('\\n')); \r\n } \r\n \r\n return bValid; \r\n}", "function blankField(ele){\n if (ele.value === \"\"){\n ele.classList.add(\"invalid\");\n ele.insertAdjacentHTML('afterend', \"<p class = 'message'>Field can't be blank</p>\");\n return false;\n }else{\n $(\"p\").remove(\".message\");\n ele.classList.remove(\"invalid\");\n return true;\n }\n }", "function required(event) {\n event.preventDefault();\n\n let firstName = capitalizeFirstLetter(\n document.querySelector(\"#firstName-input\").value\n );\n let jobTitle = document.querySelector(\"#jobTitle-input\").value;\n let emailAddress = document.querySelector(\"#emailAddress-input\").value;\n\n if (firstName === \"\" || jobTitle === \"\" || emailAddress === \"\") {\n alert(\"Please fill in all the required fields ☺🙏🏼\");\n } else {\n handleSubmit(firstName, jobTitle, emailAddress);\n }\n}", "function isRequiredFieldFinished() {\n let isInputFinished = true;\n $(\".combo-content\").each(function () {\n if ($(this).val() === \"\") {\n isInputFinished = false;\n }\n });\n return isInputFinished;\n }", "function validateRequired(form) {\n var bValid = true;\n var focusField = null;\n var i = 0;\n var fields = new Array();\n oRequired = new required();\n\n for (x in oRequired) {\n if ((form[oRequired[x][0]].type == 'text' || form[oRequired[x][0]].type == 'textarea' || form[oRequired[x][0]].type == 'select-one' || form[oRequired[x][0]].type == 'radio' || form[oRequired[x][0]].type == 'password') && form[oRequired[x][0]].value == '') {\n if (i == 0)\n focusField = form[oRequired[x][0]];\n\n fields[i++] = oRequired[x][1];\n\n bValid = false;\n }\n }\n\n if (fields.length > 0) {\n focusField.focus();\n alert(fields.join('\\n'));\n }\n\n return bValid;\n}", "function validateRequiredFieldForEdit(){\n\t\t\n\t\tvar shortName= $(\"#editFactoryDialog\").find(\"#txtShortName\").val();\n\t\tif(shortName.trim() === '' || shortName == null)\n\t\t\treturn false;\n\t\t\n\t\treturn true;\n\t}", "function validateFormNoPref(requiredFields)\n{\n\tvar noBadField = true;\n\tfor(var i = 0; i < requiredFields.length; i++)\n\t{\t\t\n\t\tvar field = requiredFields[i];\n\t\t\n\t\tif(isEmpty(field))\n\t\t{\t\t\t\n\t\t\tmarkBadField(field);\n\t\t\tnoBadField = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmarkGoodField(field);\n\t\t}\t\t\t\t\n\t}\n\t\n\t\n\t\n\tif(isEmailRequired())\n\t{\n\t\tvar field = EMAIL_FIELD_NAME;\n\t\tif(isEmpty(field))\n\t\t{\t\t\t\n\t\t\tmarkBadField(field);\n\t\t\tnoBadField = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmarkGoodField(field);\n\t\t}\t\t\n\t}\n\t\n\tif(!noBadField)\n\t{\n\t\thandleErrorDiv(REQ_STRING);\n\t}\n\treturn noBadField;\n}", "function handleRequired(field) {\n var currentValue = field.val();\n field.val(currentValue);\n if (currentValue != '') {\n AJS.$(\"#macro-browser-dialog button.ok\").prop(\"disabled\", false);\n } else {\n AJS.$(\"#macro-browser-dialog button.ok\").prop(\"disabled\", true);\n }\n }", "function checkRequired(inputArray) {\n // high order array methods\n inputArray.forEach(input => {\n if (input.value.trim() === ''){\n // use ES6 template string instead of concatenating\n showError(input, `${getFieldName(input)} is required`);\n } else {\n showSuccess(input);\n }\n });\n}", "function requiredFavFood() {\n if (favFoodInput.val() === \"\") {\n $(\"#favfood_error_message\").html(\"Field required\");\n favFoodInput.addClass(\"error\");\n $(\"#favfood_error_message\").show();\n }\n else {\n favFoodInput.removeClass(\"error\");\n $(\"#favfood_error_message\").hide();\n }\n }", "function onBlurValidateRequired(event) {\r\n var p \t \t= this.parentNode.parentNode.querySelector(\"p\");\r\n var name \t= this.name;\r\n var valid \t= true;\r\n\r\n if (name == \"company-name\" && this.className == \"required\") {\r\n if (this.value.length == 0) {\r\n p.innerHTML = this.getAttribute(\"title\");\r\n this.style.backgroundColor = \"pink\";\r\n this.focus();\r\n valid = false;\r\n }\r\n }\r\n else if (name == \"first-name\" && this.className == \"required\") {\r\n if (this.value.length == 0) {\r\n p.innerHTML = this.getAttribute(\"title\");\r\n this.style.backgroundColor = \"pink\";\r\n this.focus();\r\n valid = false;\r\n }\r\n }\r\n else if (name == \"last-name\" && this.className == \"required\") {\r\n if (this.value.length == 0) {\r\n p.innerHTML = this.getAttribute(\"title\");\r\n this.style.backgroundColor = \"pink\";\r\n this.focus();\r\n valid = false;\r\n }\r\n }\r\n else if (name == \"dob\") {\r\n if (this.value.length == 0 && this.className == \"required\") {\r\n p.innerHTML = this.getAttribute(\"title\");\r\n this.style.backgroundColor = \"pink\";\r\n this.focus();\r\n valid = false;\r\n }\r\n else if (this.value.length > 0 && !dateValidation(this)) {\r\n p.innerHTML = this.getAttribute(\"title\");\r\n this.style.backgroundColor = \"pink\";\r\n this.focus();\r\n valid = false;\r\n }\r\n }\r\n else if (name == \"street-address\" && this.className == \"required\") {\r\n if (this.value.length == 0) {\r\n p.innerHTML = this.getAttribute(\"title\");\r\n this.style.backgroundColor = \"pink\";\r\n this.focus();\r\n valid = false;\r\n }\r\n }\r\n else if (name == \"city\" && this.className == \"required\") {\r\n if (this.value.length == 0) {\r\n p.innerHTML = this.getAttribute(\"title\");\r\n this.style.backgroundColor = \"pink\";\r\n this.focus();\r\n valid = false;\r\n }\r\n }\r\n else if (name == \"zipcode\" && this.className == \"required\") {\r\n if (this.value.length == 0) {\r\n p.innerHTML = this.getAttribute(\"title\");\r\n this.style.backgroundColor = \"pink\";\r\n this.focus();\r\n valid = false;\r\n }\r\n }\r\n else if (name == \"office-phone\") {\r\n if (this.value.length == 0 && this.className == \"required\") {\r\n p.innerHTML = this.getAttribute(\"title\");\r\n this.style.backgroundColor = \"pink\";\r\n this.focus();\r\n valid = false;\r\n }\r\n else if (this.value.length > 0 && !phoneValidation(this)) {\r\n p.innerHTML = this.getAttribute(\"title\");\r\n this.style.backgroundColor = \"pink\";\r\n this.focus();\r\n valid = false;\r\n }\r\n }\r\n else if (name == \"user-name\") {\r\n if (this.value.length == 0 && this.className == \"required\") {\r\n p.innerHTML = this.getAttribute(\"title\");\r\n this.style.backgroundColor = \"pink\";\r\n this.focus();\r\n valid = false;\r\n }\r\n else if (this.value.length > 0 && !emailValidation(this)) {\r\n p.innerHTML = this.getAttribute(\"title\");\r\n this.style.backgroundColor = \"pink\";\r\n this.focus();\r\n valid = false;\r\n }\r\n }\r\n else if (name == \"password\") {\r\n if (this.value.length == 0 && this.className == \"required\") {\r\n p.innerHTML = this.getAttribute(\"title\");\r\n this.style.backgroundColor = \"pink\";\r\n this.focus();\r\n valid = false;\r\n }\r\n else if (this.value.length > 0 && !passwordValidation(this)) {\r\n p.innerHTML = this.getAttribute(\"title\");\r\n this.style.backgroundColor = \"pink\";\r\n this.focus();\r\n valid = false;\r\n }\r\n }\r\n else if (name == \"card-name\" && this.className == \"required\") {\r\n if (this.value.length == 0) {\r\n p.innerHTML = this.getAttribute(\"title\");\r\n this.style.backgroundColor = \"pink\";\r\n this.focus();\r\n valid = false;\r\n }\r\n }\r\n else if (name == \"card-number\" && this.className == \"required\") {\r\n if (this.value.length == 0) {\r\n p.innerHTML = this.getAttribute(\"title\");\r\n this.style.backgroundColor = \"pink\";\r\n this.focus();\r\n valid = false;\r\n }\r\n }\r\n else if (name == \"expiration-date\" && this.className == \"required\") {\r\n if (this.value.length == 0) {\r\n p.innerHTML = this.getAttribute(\"title\");\r\n this.style.backgroundColor = \"pink\";\r\n this.focus();\r\n valid = false;\r\n }\r\n }\r\n else if (name == \"cid\" && this.className == \"required\") {\r\n if (this.value.length == 0) {\r\n p.innerHTML = this.getAttribute(\"title\");\r\n this.style.backgroundColor = \"pink\";\r\n this.focus();\r\n valid = false;\r\n }\r\n }\r\n\r\n return valid;\r\n}", "function RequiredField() {\n\n }", "function checkRequired(inputArr) {\n\t// Array.forEach(function(items to loop through) {code to run}) input\n\tinputArr.forEach(function (input) {\n\t\t// Check input value and trim the whitespace out\n\t\tif (input.value.trim() === '') {\n\t\t\t// Grabbed inputs by id, so can access id of elements.\n\t\t\tshowError(input, `${getFieldName(input)} is required`);\n\t\t} else {\n\t\t\tshowSuccess(input);\n\t\t}\n\t});\n}", "function validateRequired(el){\n\t\tif(isRequired(el)){\n\t\t\tvar valid = !isEmpty(el);\t\n\t\t\tif(!valid){\t\t\n\t\t\tsetErrorMessage(el, 'Field is required');\n\t\t\t}\n\t\t\treturn valid;\n\t\t}\n\t\treturn true;\n\t}", "function required(inputtx) \n {\n if (inputtx.value.length == 0)\n { \n alert(\"message\"); \t\n return false; \n } \t\n return true; \n }", "validateEmptyFields(firstName,lastName,address,city,state,property,description,pricing){\n if (validator.isEmpty(firstName,lastName,address,city,state,property,description,pricing)){\n return 'This field is required';\n }\n return false;\n }", "handleFieldsCheck(){\n let required = document.querySelectorAll('.required')\n let filled = true\n required.forEach( item => {\n if(!item.value) {\n item.classList.add('required-input')\n filled = false\n }\n })\n return filled\n }", "function required(object){/*///El valor '' es para input que requieran que se ingrese texto, el valor 0 puede ser para selects2 (dropdowns)*/ var valor = object.val(); if (valor=='' || valor==0) {object.addClass('errorform'); return false; /*///Valor vacio (invalido)*/ } else {return true; /*///Valor valido*/ } }", "function empty_field_validation(first_class, second_class) {\n\n var container = document.getElementsByClassName(first_class)[0];\n var input = container.getElementsByClassName(\"required\");\n var url = container.getElementsByClassName(\"url\");\n var tmp = [];\n $(input).each(function (i) {\n if ($(this).val().trim() == \"\") {\n if (this.nextSibling.nodeName == \"SPAN\") {\n this.nextSibling.remove();\n }\n\n $(this).addClass(\"border-danger\");\n $(\"<span class='text-danger required-notice float-left mx-1'><i class='fa fa-warning'></i> This field can`t be empty</span>\").insertAfter(this);\n }\n else {\n tmp[i] = $(this).val().trim();\n if (this.type == \"email\") {\n validate_email(this);\n }\n }\n });\n\n // validate url field\n $(url).each(function () {\n if ($(this).val().trim() != \"\") {\n validate_url(this);\n }\n });\n\n // slide if all required field is not empty\n if (tmp.length == input.length && $(\".required-notice\").length == 0) {\n company_valudition(first_class, second_class);\n }\n\n // remove required message on input\n $(input).each(function () {\n $(this).on(\"input\", function () {\n if (this.nextSibling.nodeName == \"SPAN\") {\n $(this).removeClass(\"border-danger\");\n this.nextSibling.remove();\n }\n });\n });\n\n // remove url message on input\n $(url).each(function () {\n $(this).on(\"input\", function () {\n if (this.nextSibling.nodeName == \"SPAN\") {\n $(this).removeClass(\"border-danger\");\n this.nextSibling.remove();\n }\n });\n });\n\n }", "function checkRequiredFields()\n {\n var fields = $(':input[required]').serializeArray();\n var return_true_false=true;\n\n $.each(fields, function(i, field)\n {\n if (!field.value)\n {\n swal(\"Oops...\", \"Fill all required fields first.\", \"error\");\n return_true_false=false;\n }\n });\n return return_true_false;\n }", "function validateRequired(el) {\r\n\tif(isRequired(el)) {\r\n\t\tvar valid = !isEmpty(el);\r\n\t\tif(!valid) {\r\n\t\t\tsetErrorMessage(el, 'Field is required');\r\n\t\t}\r\n\t\treturn valid;\r\n\t}\r\n\treturn true;\r\n}", "function isAlRequiredFieldEntered(formObj){\n\ttotalReqFields = formObj.find('input,textarea,select').filter('[required]:visible').length;\n\ttotalEntered = formObj.find('input,textarea,select').filter('[required]:visible').filter(function() {return this.value;}).length;\n\tformObj.find('input,textarea,select').filter('[required]:visible').filter(function() {return (!this.value);}).css(\"border\", \"1px solid red\");\n\tconsole.log(\"Total entarable field : \"+totalReqFields);\n\tconsole.log(\"Total entered field : \"+totalEntered);\n\tfrmFieldFillPer();\n\treturn (totalEntered == totalReqFields) ? true : false;\n\t\n}", "function checkFields() {\n\t$('#appointmentInput > input').keyup(function() {\n\n var empty = false;\n $('#appointmentInput > input').each(function() {\n if ($(this).val() == '') {\n empty = true;\n }\n });\n \n if (!empty) {\n \t$('#saveAppointment').removeAttr('disabled'); \n }\n });\n}", "function validateRequired(event)\n{\n\t//save each box as a target\n\tvar target = event.target;\n\t//save the parent of the target\n\t//will be used for an area to display the message\n\tvar parent = target.parentElement;\n\t//save our message html text\n\tvar error = '<label class=\"error\">This field is required!</label>';\n\n\t//check if the target has value\n\tif(!target.value.length)\n\t{\n\t\t//check that the parent doesnt have the error message already\n\t\tif(!parent.querySelector('.error'))\n\t\t{\n\t\t\t//insert the error message if not already there\n\t\t\tparent.insertAdjacentHTML('beforeend', error);\n\t\t}\n\t}\n\telse\n\t{\n\t\t//if there is value\n\t\t//remove the error message\n\t\tparent.removeChild(parent.querySelector('.error'));\n\t}\n}", "function checkRequired(missingVal,skipAlert)\r\n{\r\n var currentObj = null;\r\n var currentObjAtt = null;\r\n var eltName = null;\r\n var eltTag = null;\r\n var eltType = null;\r\n var required = null;\r\n var testValue = null;\r\n var label = null;\r\n var spaceRegExp = new RegExp(\" \",\"g\");\r\n var alerts = \"\";\r\n \r\n var theForm = this.formObj\r\n var formElts = theForm.elements;\r\n// if (missingVal == null || missingVal == '') missingVal = \"Missing : \";\r\n \r\n for(var i = 0 ; i < formElts.length ; i++)\r\n {\r\n\tcurrentObj = formElts[i];\r\n currentObjAtt = currentObj.attributes;\r\n\r\n required = currentObjAtt.getNamedItem(\"required\");\r\n required = (required && required.value == \"true\")?true:false;\r\n if(!required)continue;\r\n\r\n eltName = formElts[i].name;\r\n eltTag = formElts[i].tagName;\r\n eltType = formElts[i].type;\r\n\r\n if (eltTag == \"INPUT\" &&\r\n (eltType == \"text\" || eltType == \"hidden\" || eltType == \"password\"))\r\n {\r\n testValue = formElts[i].value.replace(spaceRegExp, \"\");\r\n if(testValue == \"\")\r\n {\r\n label = currentObjAtt.getNamedItem(\"label\")\r\n if(label)\r\n {\r\n if(this.validationType == \"form\")\r\n {\r\n alerts += missingVal + \" \" + label.value + \"\\n\";\r\n }\r\n else\r\n {\r\n \tif(!currentObj.readOnly && !currentObj.disabled)currentObj.focus();\r\n \tif(!skipAlert) \r\n \t{\r\n \t alert(missingVal + label.value);\r\n \t}\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n else if (eltTag == \"INPUT\" && eltType == \"checkbox\")\r\n {\r\n testValue = currentObj.checked;\r\n if(!testValue)\r\n {\r\n label = currentObjAtt.getNamedItem(\"label\")\r\n if(label)\r\n {\r\n if(this.validationType == \"form\")\r\n {\r\n \talerts += missingVal + \" \" + label.value + \"\\n\";\r\n }\r\n else \r\n {\r\n if(!currentObj.disabled)\r\n {\r\n \tcurrentObj.focus();\r\n }\r\n if(!skipAlert) \r\n {\r\n \talert(missingVal + label.value);\r\n }\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n else if (eltTag == \"INPUT\" && eltType == \"file\")\r\n {\r\n testValue = currentObj.value.replace(spaceRegExp, \"\");\r\n if(testValue == \"\")\r\n {\r\n label = currentObjAtt.getNamedItem(\"label\");\r\n if(label)\r\n {\r\n if(this.validationType == \"form\")\r\n {\r\n \talerts += missingVal + \" \" + label.value + \"\\n\";\r\n }\r\n else\r\n {\r\n if(!currentObj.readOnly && !currentObj.disabled)\r\n {\r\n currentObj.focus();\r\n }\r\n if(!skipAlert) \r\n {\r\n alert(missingVal + label.value);\r\n }\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n else if (eltTag == \"INPUT\" && eltType == \"radio\")\r\n {\r\n testValue = currentObj.checked;\r\n var radio_choice = false;\r\n if(!testValue)\r\n {\r\n label = currentObjAtt.getNamedItem(\"label\")\r\n var radioLst = eval(\"this.formObj.\"+eltName);\r\n if(label)\r\n {\r\n\t if(this.validationType == \"form\")\r\n\t { \t\r\n\t\t\t\tfor (var counter = 0; counter < radioLst.length; counter++)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (radioLst[counter].checked)\r\n\t\t\t\t\t\tradio_choice = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!radio_choice)\r\n\t\t\t{\r\n \t\talerts += missingVal + \" \" + label.value + \"\\n\";\r\n \t\t//return true;\r\n \t\t}\r\n \t\telse \r\n \t\t\tnull;\r\n \t\t\t//return false; \t\r\n }\r\n else \r\n {\r\n if(!currentObj.disabled)\r\n\t\t\t{\r\n\t\t\t\tcurrentObj.focus();\r\n\t\t\t}\r\n\t\t\tif(!skipAlert) \r\n\t\t\t{\r\n\t\t\t\talert(missingVal + label.value);\r\n\t\t\t}\r\n\t\t\treturn true;\r\n }\r\n }\r\n}\r\n else if (eltTag == \"TEXTAREA\")\r\n {\r\n //testValue = (currentObj.innerText)?testValue.replace(spaceRegExp,\"\"):\"\";\r\n testValue = (currentObj.value)?currentObj.value.replace(spaceRegExp,\"\"):\"\";\r\n if(testValue == \"\")\r\n {\r\n label = currentObjAtt.getNamedItem(\"label\");\r\n if(label)\r\n {\r\n if(this.validationType == \"form\")\r\n {\r\n \talerts += missingVal + \" \" + label.value + \"\\n\";\r\n }\r\n else\r\n {\r\n if(!currentObj.readOnly && !currentObj.disabled)\r\n {\r\n currentObj.focus();\r\n }\r\n if(!skipAlert) \r\n {\r\n \talert(missingVal + label.value);\r\n }\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n else if (eltTag == \"SELECT\")\r\n {\r\n if(currentObj.selectedIndex == -1 || currentObj.value == 0) \r\n {\r\n testValue = \"\";\r\n }\r\n else\r\n {\r\n //testValue = currentObj.options[currentObj.selectedIndex].innerText;\r\n\t testValue = currentObj.options[currentObj.selectedIndex].innerHTML;\r\n testValue = (testValue)?testValue.replace(spaceRegExp,\"\"):\"\";\r\n }\r\n if(testValue == \"\")\r\n {\r\n label = currentObjAtt.getNamedItem(\"label\");\r\n if(label)\r\n {\r\n if(this.validationType == \"form\")\r\n \t{\r\n \t\talerts += missingVal + \" \" + label.value + \"\\n\";\r\n \t}\r\n \telse\r\n \t{\r\n if(!currentObj.disabled)\r\n {\r\n currentObj.focus();\r\n }\r\n if(!skipAlert) \r\n {\r\n alert(missingVal + label.value);\r\n }\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if(this.validationType == \"form\" && alerts != \"\")\r\n {\r\n if(!skipAlert) \r\n {\r\n alert(\"Please enter mandatory fields:\\n\" + alerts);\r\n }\r\n return true;\r\n }\r\n return false;\r\n}", "function checkAllRequiredFieldsHaveInput(){\n $('#user-table ._REQUIRED').each(function(index, thisEntry){ \n if($(thisEntry).val() == \"\") { \n $(thisEntry).addClass('MISSING');\n } else {\n $(thisEntry).removeClass('MISSING');\n }\n });\n \n \n \n //We only need to enable the the save button if there are NO missing\n //The bool returns are only for some needs\n console.log($('#user-table .MISSING').length + \" : \" + $('#user-table ._DELUSER').length + \" : \" + $('#user-table ._EDITED').length);\n if ( ($('#user-table ._NEWUSER').length > 0 || $('#user-table ._DELUSER').length > 0 || $('#user-table ._EDITED').length > 0 ) && $('#user-table .MISSING').length == 0 ) {\n $('#submit-user-changes').prop('disabled', false);\n\n } else { \n $('#submit-user-changes').prop('disabled', true);\n\n }\n \n \n \n}", "function checkRequired(inputArr) {\n inputArr.forEach(function(input) {\n if(input.value === \"\") {\n showError(input, `${convertFieldName(input)} is required.`)\n } else {\n showSuccess(input)\n }\n\n });\n\n}", "function check_required_fields(inputObj) {\n \t\n \tvar isValid = true;\n \t$(inputObj).each(function(){\n\n \t\tif (!notempty($(this).attr('id'))) {\n \t\t\tisValid = false;\n \t\t\treturn isValid;\n \t\t}\n \t});\n \treturn isValid;\n }", "function require(field){\n\tif(field.value==\"\" || field.value==null){\n\t\treturn false;\n\t}else{\n\t\treturn true;\n\t};\n}", "function js_validate_fields(text){\n\n\tvar canContinue = true;\n \n\tjQuery('.required-active').each(function(i, obj) {\t\t\n\t\tjQuery(obj).removeClass('required-active');\t\t\t\t\t \n\t});\t\n\t\n \tjQuery('.required-field').each(function(i, obj) {\t\t\n\t\t\t\t\n\t\tif(jQuery(obj).val() == \"\"){\t\t\t\n\t\t\tjQuery(obj).addClass('required-active').focus();\t\t\t\t\n\t\t\tcanContinue = false;\n\t\t}\t\t\n\t});\n\t\n \tjQuery('.val-numeric').each(function(i, obj) {\t\n\t\t \n\t\tif(jQuery(obj).val() === \"\" ){\t\t\t\t\n\t\t\tjQuery(obj).addClass('required-active').focus();\t\t\t\t\n\t\t\tcanContinue = false;\n\t\t}\t\t\n \n\t});\n\t\n\tif(canContinue){\n\t\treturn true;\n\t} else {\n\t\talert(text);\n\t\treturn false;\n\t}\n}", "function checkRequiredFields() {\n\tglobalFilled = true;\n\tfor (pt in attributesHash) {\n\t\tif (!exclusion(pt)) { \n\t\t\ttry {\n\t\t\t\tglobalFilled = checkField(pt, true) && globalFilled;\n\t\t\t} catch (err) { alert(\"error: \" + err.description);}\n\t\t}\n\t}\n\t// should add check for errorMessageLength, because some of the exclusion() fields adds messages, but return true\n\treturn globalFilled && (document.getElementById(\"errorMessage\").innerHTML == '');\n}", "function checkRequired(formInputArr){\n formInputArr.forEach(function(formInput){\n if(formInput.value === \"\"){\n showError(formInput, \"Required\")\n } else {\n showSuccess(formInput);\n }\n });\n}", "function validateEmptyFields(context){\r\n\r\n var errorExists = false,\r\n element = context.previousSibling;\r\n \r\n while(element){\r\n if(element.tagName === 'INPUT'){\r\n if(!element.value){\r\n element.addClass('error');\r\n errorExists = true;\r\n } else {\r\n element.removeClass('error');\r\n }\r\n }\r\n \r\n element = element.previousSibling;\r\n }\r\n \r\n return !errorExists;\r\n}", "function checkEmptyString(fld, feedid){\n\tfld.style.background ='white';//set field to normal style\n\tdocument.getElementById(feedid).innerHTML ='';//set feedback to blank\n\t//if user didnt type character into field\n\tif(fld.value.length == 0){\n\t\t//set the field to a warning\n\t\t//make feedback text appear\n\t\tfld.style.background ='orange';\n\t\tdocument.getElementById(feedid).innerHTML ='Required';//lets user know its required\n\t\tfld.focus();//put focus right back on that field\n\t\treturn false; //this sends 'false; to where function was called and stops code\n\t}//ends if user did something wrong\n\treturn true;\n}", "function require(the_form){\n the_form.find(\".required\").each(function(){\n if($(this).attr(\"type\")!=\"checkbox\"){\n if($(this).val()==\"\" || $(this).val()==$(this).attr(\"default\")){\n $(this).parent().addClass(\"error\");\n }\n else{\n $(this).parent().removeClass(\"error\");\n }\n }\n else{\n if($(this).attr(\"checked\")==\"\"){\n $(this).parent().addClass(\"error\");\n }\n }\n });\n}", "function required(rule,value,source,errors,options,type){if(rule.required&&(!source.hasOwnProperty(rule.field)||util.isEmptyValue(value,type))){errors.push(util.format(options.messages.required,rule.fullField));}}", "function AttendanceRequiredFieldHandler(frm_data, action, required_class) {\n var response = true;\n if (frm_data.timetable.length == 0) {\n toastr.error('Timetable Required!');\n response = false;\n }\n if (frm_data.comment.length == 0) {\n toastr.error('Comment Required!');\n response = false;\n }\n if (action === 1) { //Actions only in Save\n\n }\n $(required_class).each(function () {\n if ($(this).val().length === 0) {\n// $(this).addClass(\"has-error\");\n } else {\n// $(this).removeClass(\"has-error\");\n }\n });\n return response;\n}", "function VKCheckRequireField(object,strMesssage){\n\tif(object.value.length == 0){\n\t\tobject.focus();\n\t\treturn remove_vietnamese_accents(strMesssage);\n\t\t\n\t}\n\telse{\n\t\treturn \"\";\n\t}\n}", "function requiredAction(input,valid,msg){\n \tjQuery(input).closest('fieldset').find('.error').html(msg);\n \tif(!valid){\n \t\tjQuery(input).closest('fieldset').removeClass('success').addClass('error');\n \t\treturn false;\n \t}\n \telse{\n \t\tjQuery(input).closest('fieldset').removeClass('error').addClass('success');\n \t\treturn true;\n \t}\n }", "function employerFormRequired () {\n if (\n stringNotEmpty('input', 'employer[profile][fullname]') |\n stringNotEmpty('select', 'employer[profile][housetype]') |\n stringNotEmpty('input', 'employer[profile][blockhouseno]') |\n stringNotEmpty('input', 'employer[profile][unitno]') |\n stringNotEmpty('input', 'employer[profile][streetname]') |\n stringNotEmpty('select', 'employer[profile][maritalstatus]') |\n numberNotZero('input', 'employer[profile][postalcode]') |\n numberNotZero('input', 'employer[local][contact][number]')\n ) {\n return true\n } else {\n return false\n }\n }", "function checkRequired() {\n const req = Array.from(document.querySelectorAll('.req'));\n let returnValue = 0;\n req.forEach(c => {\n const reqField = Array.from(c.querySelectorAll('.reqfield'));\n let insert = 0;\n reqField.forEach(element => {\n if (element.value == '') {\n element.classList.add(\"errfield\");\n //c.style.background ='rgb(255, 237, 237)';\n \n insert = 1;\n returnValue =1;\n }\n });\n if(insert)\n {\n c.classList.add(\"errForm-section\");\n if(!c.querySelector('.block1')){\n let iDiv = document.createElement('div');\n iDiv.id = 'block';\n iDiv.className = 'block1';\n iDiv.innerHTML = \"! this feild is required\";\n c.appendChild(iDiv); \n }\n }\n });\n if(!checkEmail())\n returnValue = 1; \n \n if(returnValue)\n {\n return false;\n }\n return true;\n }", "setFormRequiredByTab(tab, name, value) {\n this.setOtherTabData(tab, \"formRequired\", name, value)\n }", "function checkRequired() {\r\n\t var checkRequired = true;\r\n\t var inputs = $(\".required\");\r\n\t \r\n\t $.each(inputs, function(i, item) {\r\n\t\t if (item.value.trim() == \"\") {\r\n\t\t item.style.borderColor = \"red\";\r\n\t\t checkRequired = false;\r\n\t\t } else {\r\n\t\t\t item.style.borderColor = \"\";\r\n\t\t }\r\n\t } \r\n\t );\r\n\t return checkRequired;\r\n}", "function isNotEmpty(inputField) {\n\tif(inputField.val() == '') {\t\t \n\t\t inputField.parent().parent().addClass('has-error');\n\t\t var errorMsg = '<small class=\"help-block\">' + inputField.attr('title') + '</small>'; \n\t\t if (inputField.parent().siblings('.help-block').size() == 0) {\n\t\t\tinputField.parent().parent().append(errorMsg);\n\t\t }\n\t} else {\n\t\tinputField.parent().parent().removeClass('has-error');\n\t\tinputField.parent().siblings('.help-block').remove();\n\t\treturn false; \t \t\t\t\n\t}\t\n\treturn true;\n}", "function checkRequired(e,o)\n\t{\n\t\tswitch(e.type)\n\t\t{\n\t\t\tcase 'text':\n\t\t\t\tif(e.value.length<o.minText)\n\t\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\tcase 'password':\n\t\t\t\tif(e.value.length<o.minPassword)\n\t\t\t\t\treturn false\n\t\t\t\tbreak;\n\t\t\tcase 'select-one':\n\t\t\t\tif(e.selectedIndex==o.selectOneIndex)\n\t\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\tcase 'select-multiple':\n\t\t\t\tif(countSelectMultiple(e)<o.minSelectMultiple)\n\t\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\tcase 'textarea':\n\t\t\t\tif(e.value.length<o.minTextarea)\n\t\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function required(rule,value,source,errors,options,type){if(rule.required&&(!source.hasOwnProperty(rule.field)||util.isEmptyValue(value,type||rule.type))){errors.push(util.format(options.messages.required,rule.fullField));}}", "function required(rule,value,source,errors,options,type){if(rule.required&&(!source.hasOwnProperty(rule.field)||util.isEmptyValue(value,type||rule.type))){errors.push(util.format(options.messages.required,rule.fullField));}}", "function validateRequiredField(field) {\n\n // Remove the unnecessary blanks at the front and back\n field.value = field.value.trim();\n\n // check to see if it's valid\n var valid = field.value.length > 0;\n\n // Valid like salad!\n if (valid) {\n field.className = 'form-control';\n } else {\n field.className = 'form-control invalid-field';\n }\n\n return valid;\n}", "function validateFields(field) {\n\tvar reqField = signupForm.find(field);\n\tvar reqValue = reqField.val().trim();\n\tif(0 === reqValue.length) {\n\t\talert(\"You must enter a \" + reqFiled.attr(\"placeholder\") + \".\");\n\t}\n}", "function requiredFields() {\n\tvar application_type = jQuery(\"input[name='application_type']:checked\").val();\n\tvar requiredAll = ['#degree-start', '#title','#surname','#firstname','#contact-number','#preferred-email','#nationality','#college','#degree','#subject','#term','#term-year','#acc-prefer-1','#acc-prefer-2','#tenancy-accept'];\n\tvar requiredJoint = ['#partner-title','#partner-lastname','#partner-firstname','#partner-relationship','#partner-nationality','#partner-preferred-email','#partner-contact-no','#partner-college','#partner-degree','#partner-subject','#partner-degree-start'];\n\tvar requiredFamily = ['#spouse-title','#spouse-firstname','#spouse-lastname','#spouse-relationship','#spouse-nationality'];\n\t\n\tjQuery('div.required').removeClass('required');\n\t\n\tjQuery(requiredAll).each(function(i,v) {\n\t\tjQuery(v).closest('div').addClass('required');\n\t});\n\t\n\tif (typeof application_type !== 'undefined' && application_type === 'Joint') {\n\t\tjQuery(requiredJoint).each(function(i,v){\n\t\t\tjQuery(v).closest('div').addClass('required');\n\t\t});\n\t}\n\telse if (typeof application_type !== 'undefined' && application_type === 'Couple/Family') {\n\t\tjQuery(requiredFamily).each(function(i,v){\n\t\t\tjQuery(v).closest('div').addClass('required');\n\t\t});\n\t}\n\t\n}", "isRequiredProvided(input) {\n if (this.isOptional === true) {\n return true;\n }\n if (input === '') {\n return false;\n }\n return true;\n }", "function required(rule, value, source, errors, options, type) {\n\t\t if (rule.required && (!source.hasOwnProperty(rule.field) || util.isEmptyValue(value, type))) {\n\t\t errors.push(util.format(options.messages.required, rule.fullField));\n\t\t }\n\t\t}", "function setFieldRequired(eltName,state)\r\n{\r\n var formElts = this.formObj.elements;\r\n\r\n for(var i = 0 ; i < formElts.length ; i++)\r\n {\r\n if(formElts[i].id == eltName)\r\n {\r\n \tformElts[i].setAttribute(\"required\", state);\r\n break;\r\n }\r\n }\r\n}", "function validateAddOpForm() {\n // Check inputs\n return pageDialog.amount.value.length > 0 && pageDialog.desc.value.length > 0\n }", "function setRequired() {\n\t\tdocument.getElementById(\"source\").required=true;\n\t\tdocument.getElementById(\"sourceSystem\").required=true;\n\t\tdocument.getElementById(\"token\").required=true;\n\t\tdocument.getElementById(\"user\").required=true;\n\t\tdocument.getElementById(\"password\").required=true;\n\t\tdocument.getElementById(\"url\").required=true;\n\t}", "checkRequired() {\n if(!Validator.required(this.attribute.validation, this.input)) {\n this.progressBar.increment(this.attributeName);\n }\n }", "function checkForm(e) {\n var inputlist = document.getElementsByClassName(\"required\"); // Make an array of required inputs\n var empties = new Array(); // Create a blank list for empty fields\n // Check for empty fields, an add them to the empty list\n for( var i = 0; i < inputlist.length; i++ )\n if(Form.Element.getValue(inputlist[i]) == \"\"){\n empties.push($(inputlist[i]).getAttribute(\"id\"));\n }\n else {\n $(inputlist[i]).style.border=\"1px solid #333\";\n }\n // If there are empty fields, highight them\n if(empties.length > 0) {\n var i = 0;\n while( i < empties.length ) {\n $(empties[i]).style.border=\"2px solid #a00\";\n i++;\n }\n $(\"formerror\").style.display=\"inline\";\n Event.stop(e);\n }\n else {\n // Cosmetic: Reset all of the checked fields to the regular style\n for( var i = 0; i < inputlist.length; i++ )\n $(inputlist[i]).style.border=\"1px solid #333\";\n // If there aren't empty fields, submit the form\n return true;\n }\n}", "function isNotEmpty() {\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tif (arguments[i].value === \"\" || arguments[i].value === null) {\n\t\t\t\t//if empty\n\t\t\t\terrors += 1;\n\t\t\t\targuments[i].placeholder = \"Fill in this feild!\";\n\t\t\t\targuments[i].classList.add(\"error-placeholder\");\n\t\t\t} else if (arguments[i].value.length < 3) {\n\t\t\t\t//if too short\n\t\t\t\terrors += 1;\n\t\t\t\targuments[i].placeholder = \"Enter a valid input!\";\n\t\t\t\targuments[i].value = \"\";\n\t\t\t\targuments[i].classList.add(\"error-placeholder\");\n\t\t\t}\n\t\t}\n\n\t}", "function validateRequiredFieldForAdd(){\n\t\tvar username= $(\"#addUserDialog\").find(\"#txtUserName\").val();\n\t\tif(username.trim() === '' || username == null)\n\t\t\treturn false;\n\t\t\n\t\tvar password= $(\"#addUserDialog\").find(\"#txtPassword\").val();\n\t\tif(password.trim() === '' || password == null)\n\t\t\treturn false;\n\t\t\n\t\treturn true;\n\t}", "function requiredValidator(control) {\n return isEmptyInputValue(control.value) ? { 'required': true } : null;\n}", "function requiredValidator(control) {\n return isEmptyInputValue(control.value) ? { 'required': true } : null;\n}", "function requiredValidator(control) {\n return isEmptyInputValue(control.value) ? { 'required': true } : null;\n}", "function isRequired(data = '') {\n\t\tif (data.length == 0) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function requiredFieldsValid(firstName, lastName, experience, industry) {\n if (firstName === \"\") return false\n if (lastName === \"\") return false\n if (experience === null) return false\n if (industry === null) return false\n return true\n }", "function toggleRequired() {\n if (textInput.hasAttribute('required') !== true) {\n textInput.removeAttribute('disabled');\n textInput.setAttribute('required','required');\n locationIsValid = false;\n activateSearchButton();\n }\n \n else {\n textInput.removeAttribute('required'); \n }\n}", "function checkRequiredFields(){\n\tvar enable = true;\n\tjQuery(':input[required]').each(function(){\n\t\tvar s = jQuery(this).val();\n\t\tif(s == null || s.trim().length == 0){\n\t\t\treturn enable = false;\n\t\t}\n\t});\n\n\tif(typeof sforce != 'undefined'){\n\t\tSfdc.canvas.publisher.publish({name:'publisher.setValidForSubmit', payload: enable});\n\t} else {\n\t\tif(enable){\n\t\t\tjQuery('#submit').removeClass('ui-state-disabled');\n\t\t} else {\n\t\t\tjQuery('#submit').addClass('ui-state-disabled');\n\t\t}\n\t}\n}", "function requiredFieldsValidate(required_fields_selector, display_popup = true) {\n validated = true;\n\n // Looking for empty required fields.\n $(required_fields_selector).each(function() {\n if ($(this).val() === '') {\n // This required field is empty, so let's show up its bullet.\n $('.req-bullet--' + $(this).attr('name')).show();\n validated = false;\n }\n });\n\n if (!validated && display_popup) {\n // We've got empty required fields, let's display popup.\n $('#preemptiveReqPopup').dialog({\n bgiframe: true,\n modal: true,\n width: (isMobileDevice ? $(window).width() : 570),\n open: function() {\n fitDialog(this);\n },\n close: function() {\n $('.req-bullet').hide();\n },\n });\n }\n\n return validated;\n }", "function checkRequired(inputArray)\n{\n inputArray.forEach(function(input) {\n //console.log(input.value);\n if(input.value === '')\n {\n //showError(input,input.id +' is required');\n //showError(input,`${input.id} is required`);\n showError(input,`${getFieldId(input)} is required`);\n }\n // else if(!isValidEmail(email.value)) {\n // showError(email,`${getFieldId(email)} is invalid`);\n // }\n else\n {\n showSuccess(input);\n }\n });\n}", "function validateRequireFields() {\n var page = 0;\n [\n 'proposal.attachments',\n 'proposal.gameDesignDocuments[EN]',\n 'proposal.gameDesignDocuments[JA]'\n ].forEach(angular.bind(this, function(key) {\n var found = pageFieldList[page].indexOf(key);\n if (found > -1) {\n pageFieldList[page].splice(found, 1);\n }\n\n if(conceptCommonServiceField.field(key).required()) {\n pageFieldList[page].push(key);\n }\n }));\n\n }", "function bsMkRelInp(pInp, pIdRelInp) {\n var inpRel = document.getElementById(pIdRelInp);\n if (pInp.value != \"\") {\n inpRel.required = true;\n } else {\n inpRel.required = false;\n inpRel.value = \"\";\n }\n}", "function required(rule,value,source,errors,options,type){if(rule.required&&(!source.hasOwnProperty(rule.field)||__WEBPACK_IMPORTED_MODULE_0__util__[\"e\"/* isEmptyValue */](value,type||rule.type))){errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\"/* format */](options.messages.required,rule.fullField));}}", "function emptyValidation(control, msgBox) {\n\n var control_len = control.value.length;\n if (control_len === 0) {\n document.getElementById(msgBox).innerHTML = '<font style=\"color: red;\">Field should not be empty.</font><br>';\n control.focus();\n return false;\n }\n document.getElementById(msgBox).innerHTML = '';\n return true;\n}", "function set_required(required) {\n for (i=0; i<required.length; i++) {\n $(required[i]).prepend(\"<span class=\\\"required\\\">&#9733;</span>\");\n }\n}", "function fn_CheckRequired ( theElement , theElementName )\n\t{\n\t\t/*\n\t\tif ( theElement == undefined )\n\t\t{\n\t\t\talert ( \"要求检查的项目(\" + theElementName\t+ \")并不是一个有效的JavaScript对象\" ) ;\n\t\t\treturn false;\n\t\t}\n\t\t*/\n\t\ttheElement.value = trimString ( theElement.value ) ;\n\t\tif( theElement.value == \"\" )\n\t\t{\n\t\t\talert( \"\\\"\" + theElementName + \"\\\"\" + \"必须填写!\" ) ;\n\t\t\ttheElement.focus();\n\t\t\treturn false ;\n\t\t}\n\t\treturn true;\n\t}", "function _labelIsRequired(){\n\n\t\tif (this.getRequired && this.getRequired()) {\n\t\t\treturn true;\n\t\t}\n\n\t\tvar oFormElement = this.getParent();\n\t\tvar aFields = oFormElement.getFields();\n\n\t\tfor ( var i = 0; i < aFields.length; i++) {\n\t\t\tvar oField = aFields[i];\n\t\t\tif (oField.getRequired && oField.getRequired() === true &&\n\t\t\t\t\t(!oField.getEditable || oField.getEditable())) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\n\t}", "function validateFields(p1_fname, p1_lname, p2_fname, p2_lname) {\n if (p1_fname == \"\") {\n showError('Please enter a first name for Parent/Guardian 1');\n return false;\n }\n else if (p1_lname == \"\") {\n showError('Please enter a last name for Parent/Guardian 1');\n return false;\n }\n else if ((p2_fname == \"\") && !(p2_lname == \"\")) {\n showError('Please add a first name for Parent/Guardian 2');\n return false;\n }\n else if (!(p2_fname == \"\") && (p2_lname == \"\")) {\n showError('Please add a last name for Parent/Guardian 2');\n return false;\n }\n else {\n return true;\n }\n}", "function VKCheckRequireFieldEx(object,strMesssage){\n\tif((object.value.length == 0) || (object.value == \"0\"))\n\t{\n\t\treturn strMesssage;\n\t\t\n\t}\n\telse{\n\t\treturn \"\";\n\t}\n}", "validateInput(elem){\n\n // checking if the input field is empty and if there are any message not shown\n if (elem.value === '' && elem.nextElementSibling.nextElementSibling.tagName !== 'SPAN'){\n let name;\n if (elem.name === 'name'){\n name = 'Name';\n }else if (elem.name === 'address'){\n name = 'Address';\n }else if (elem.name === 'phone'){\n name = 'Phone';\n }else if (elem.name === 'engineNo'){\n name = 'Engine No';\n }else if (elem.name === 'licenseNo'){\n name = 'License No';\n }\n this.ui.showError(elem, `${name} can not be empty`);\n }else if (elem.value !== '' && elem.nextElementSibling.nextElementSibling.tagName === 'SPAN'){\n this.ui.clearError(elem.nextElementSibling.nextElementSibling);\n }\n }", "function validate_WaitingParts(){\n\tif(document.frmWaitingParts.waiting_parts_comments.value == ''){\n\t\tdocument.getElementById('waiting_parts_commentslabel').innerHTML = 'This field is required';\n\t\tdocument.frmWaitingParts.waiting_parts_comments.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('waiting_parts_commentslabel').innerHTML = '';\n\t\treturn true;\n\t}\n}", "function validateMandatory(control, message, showMessage)\n{\n var result = true;\n \n if (control != null && (control.value == null || jQuery.trim(control.value).length == 0))\n {\n informUser(control, message, showMessage);\n result = false;\n }\n \n return result;\n}", "function RequiredFieldHandler(eventInfo) {\n var app = UiApp.createApplication();\n var par = eventInfo.parameter;\n var submitButton = app.getElementById('Submit');\n \n var ss = SpreadsheetApp.openById(ssKey);\n var sheet = ss.getSheetByName('Fields');\n var range = sheet.getDataRange();\n var values = range.getValues();\n var lastRow = range.getLastRow();\n \n var allOK = true;\n \n for (var i = 1; i < lastRow; i++) {\n if (values[i][8] == \"X\") {\n var test = par[values[i][2]];\n var badInput = app.getElementById(values[i][2]);\n badInput.setStyleAttribute('borderColor', 'LightGray').setStyleAttribute('borderWidth', '1px');\n if (test == \"\" || undefined) { \n allOK = false;\n badInput.setStyleAttribute('borderColor', 'red').setStyleAttribute('borderWidth', '3px');\n \n }\n }\n }\n \n \n if (allOK == true) {submitButton.setEnabled(true);}\n else if (allOK == false) {submitButton.setEnabled(false);}\n \n return app;\n \n}", "function required(rule, value, source, errors, options, type) {\n\t if (rule.required && (!source.hasOwnProperty(rule.field) || util.isEmptyValue(value, type))) {\n\t errors.push(util.format(options.messages.required, rule.fullField));\n\t }\n\t}", "function emptyFields() {\n let docWrap = document.querySelector(\"#docWrap\");\n let inputs = docWrap.querySelectorAll(\"input\");\n let empty = false;\n for (let i = 0; i < inputs.length; i++) {\n const input = inputs[i];\n if (input.value == \"\") {\n empty = true;\n input.classList.add(\"focus\");\n } else {\n input.classList.remove(\"focus\");\n }\n }\n return empty;\n}", "function mandatoryInputCheck(){\n\n\tlet filled = true;\n\tfor (i = 0; i < NECESSARY_VAL.length; i++) {\n\n\t\tlet id = \"#\"+NECESSARY_VAL[i];\n\n\t\t\tif ($(id).val()==\"\" || $(id).hasClass(\"w3-red\")==true) {\n\n\t\t\t\t$(id).addClass(\"w3-red\");\n\t\t\t\tfilled = false;\n\t\t\t} else {\n\n\t\t\t\t$(id).removeClass(\"w3-red\");\n\t\t\t};\n\t};\n\treturn filled\n}" ]
[ "0.7273697", "0.71036416", "0.70281106", "0.6989627", "0.6943709", "0.6905607", "0.6882507", "0.68074524", "0.6796334", "0.6790042", "0.67899114", "0.676405", "0.67570174", "0.67379755", "0.67077714", "0.6704975", "0.66758513", "0.6669831", "0.66407055", "0.66330373", "0.6632097", "0.6622615", "0.66018206", "0.65960115", "0.65874237", "0.6586631", "0.6571545", "0.65678436", "0.6564222", "0.65471417", "0.6531116", "0.6525508", "0.65156627", "0.65122813", "0.6507067", "0.6491307", "0.64669627", "0.64648557", "0.646186", "0.64600796", "0.6453555", "0.6443582", "0.6441044", "0.64383465", "0.64362293", "0.6421703", "0.6420249", "0.64115655", "0.64093655", "0.6406634", "0.6372652", "0.63689005", "0.6356528", "0.6345948", "0.6345684", "0.63419634", "0.63297284", "0.632667", "0.63259476", "0.6314654", "0.62555426", "0.6250012", "0.6250012", "0.62424034", "0.6237002", "0.62344956", "0.6226067", "0.6215822", "0.62128174", "0.620844", "0.62061304", "0.6206083", "0.6200731", "0.61954385", "0.6194688", "0.6184707", "0.6184707", "0.6184707", "0.61765915", "0.6176025", "0.61758286", "0.6173356", "0.6168115", "0.61657155", "0.61546224", "0.61369854", "0.6136309", "0.61322314", "0.6130594", "0.6125049", "0.6124982", "0.6121239", "0.6117371", "0.61140877", "0.611097", "0.61100906", "0.6107318", "0.6105816", "0.610448", "0.6103669" ]
0.7716919
0
declaration de ma function add joueurs
function add_joueurs() { //afficher et stocker les joueurs joueurs.push(prompt("Ecrire un nom de joueur en majuscule.")); // tester varibale joueurs if(joueurs !=null) { alert(joueurs.length) //mettre en majuscule document.getElementById("affiche_joueur").innerHTML=joueurs; } else { alert("Vous n'avez pas indiqué de nom de joueurs"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function User_Insert_Journaux_Liste_des_journaux0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 8\n\nId dans le tab: 52;\nsimple\nNbr Jointure: 1;\n Joint n° 0 = typejournal,tj_numero,tj_numero\n\nId dans le tab: 53;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 54;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 55;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 56;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 57;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 58;\nsimple\nNbr Jointure: 1;\n Joint n° 0 = comptegen,cg_numero,cg_numero\n\nId dans le tab: 59;\ncomplexe\nNbr Jointure: 1;\n Joint n° 0 = piece,jo_numero,jo_numero\n\n******************\n*/\n\n var Table=\"journal\";\n var CleMaitre = TAB_COMPO_PPTES[47].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var tj_numero=GetValAt(52);\n if (tj_numero==\"-1\")\n tj_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"tj_numero\",TAB_GLOBAL_COMPO[52],tj_numero,true))\n \treturn -1;\n var jo_abbrev=GetValAt(53);\n if (!ValiderChampsObligatoire(Table,\"jo_abbrev\",TAB_GLOBAL_COMPO[53],jo_abbrev,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"jo_abbrev\",TAB_GLOBAL_COMPO[53],jo_abbrev))\n \treturn -1;\n var jo_libelle=GetValAt(54);\n if (!ValiderChampsObligatoire(Table,\"jo_libelle\",TAB_GLOBAL_COMPO[54],jo_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"jo_libelle\",TAB_GLOBAL_COMPO[54],jo_libelle))\n \treturn -1;\n var jo_provisoire=GetValAt(55);\n if (!ValiderChampsObligatoire(Table,\"jo_provisoire\",TAB_GLOBAL_COMPO[55],jo_provisoire,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"jo_provisoire\",TAB_GLOBAL_COMPO[55],jo_provisoire))\n \treturn -1;\n var jo_visible=GetValAt(56);\n if (!ValiderChampsObligatoire(Table,\"jo_visible\",TAB_GLOBAL_COMPO[56],jo_visible,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"jo_visible\",TAB_GLOBAL_COMPO[56],jo_visible))\n \treturn -1;\n var jo_contrepartie=GetValAt(57);\n if (!ValiderChampsObligatoire(Table,\"jo_contrepartie\",TAB_GLOBAL_COMPO[57],jo_contrepartie,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"jo_contrepartie\",TAB_GLOBAL_COMPO[57],jo_contrepartie))\n \treturn -1;\n var cg_numero=GetValAt(58);\n if (cg_numero==\"-1\")\n cg_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"cg_numero\",TAB_GLOBAL_COMPO[58],cg_numero,true))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",tj_numero,jo_abbrev,jo_libelle,jo_provisoire,jo_visible,jo_contrepartie,cg_numero\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+tj_numero+\",\"+(jo_abbrev==\"\" ? \"null\" : \"'\"+ValiderChaine(jo_abbrev)+\"'\" )+\",\"+(jo_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(jo_libelle)+\"'\" )+\",\"+(jo_provisoire==\"true\" ? \"true\" : \"false\")+\",\"+(jo_visible==\"true\" ? \"true\" : \"false\")+\",\"+(jo_contrepartie==\"true\" ? \"true\" : \"false\")+\",\"+cg_numero+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "function crearLista(){\n listaJugadores.push({nombre: nombreJugador, puntos: letrasAcertadas});\n }", "function add() {}", "function add_janelas(id, nome){\n \n /*cria uma variavel string com o HTML da jenela*/\n var html_add = \"<div class='janela' id='jan_\"+id+\"'>\"+\n \"<div class='topo' id='\"+id+\"'>\"+\n \"<span>'\"+nome+\"'</span>\"+\n \"<a href='javascript:void(0);' id='fechar'>x</a>\"+\n \"</div>\"+ \n \"<div id='corpo'>\"+\n \"<div class='mensagens'>\"+\n \"<ul class='listar'>\"+\n \"<li><span>Enyo Cavalcante:</span><p>Olá, tudo bem?</p></li>\"+\n \"<li><span>Jamile Solsa:</span><p>Olá, tudo bem?</p></li>\"+ \n \"</ul>\"+\n \"</div>\"+\n \"<input type='text' class='mensagem' id='\"+id+\"' maxlength='255' />\"+\n \"</div>\"+\n \"</div>\";\n $('#janelas').append(html_add);\n }", "function User_Update_Journaux_Liste_des_journaux0(Compo_Maitre)\n{\n var Table=\"journal\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var tj_numero=GetValAt(52);\n if (tj_numero==\"-1\")\n tj_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"tj_numero\",TAB_GLOBAL_COMPO[52],tj_numero,true))\n \treturn -1;\n var jo_abbrev=GetValAt(53);\n if (!ValiderChampsObligatoire(Table,\"jo_abbrev\",TAB_GLOBAL_COMPO[53],jo_abbrev,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"jo_abbrev\",TAB_GLOBAL_COMPO[53],jo_abbrev))\n \treturn -1;\n var jo_libelle=GetValAt(54);\n if (!ValiderChampsObligatoire(Table,\"jo_libelle\",TAB_GLOBAL_COMPO[54],jo_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"jo_libelle\",TAB_GLOBAL_COMPO[54],jo_libelle))\n \treturn -1;\n var jo_provisoire=GetValAt(55);\n if (!ValiderChampsObligatoire(Table,\"jo_provisoire\",TAB_GLOBAL_COMPO[55],jo_provisoire,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"jo_provisoire\",TAB_GLOBAL_COMPO[55],jo_provisoire))\n \treturn -1;\n var jo_visible=GetValAt(56);\n if (!ValiderChampsObligatoire(Table,\"jo_visible\",TAB_GLOBAL_COMPO[56],jo_visible,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"jo_visible\",TAB_GLOBAL_COMPO[56],jo_visible))\n \treturn -1;\n var jo_contrepartie=GetValAt(57);\n if (!ValiderChampsObligatoire(Table,\"jo_contrepartie\",TAB_GLOBAL_COMPO[57],jo_contrepartie,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"jo_contrepartie\",TAB_GLOBAL_COMPO[57],jo_contrepartie))\n \treturn -1;\n var cg_numero=GetValAt(58);\n if (cg_numero==\"-1\")\n cg_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"cg_numero\",TAB_GLOBAL_COMPO[58],cg_numero,true))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"tj_numero=\"+tj_numero+\",jo_abbrev=\"+(jo_abbrev==\"\" ? \"null\" : \"'\"+ValiderChaine(jo_abbrev)+\"'\" )+\",jo_libelle=\"+(jo_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(jo_libelle)+\"'\" )+\",jo_provisoire=\"+(jo_provisoire==\"true\" ? \"true\" : \"false\")+\",jo_visible=\"+(jo_visible==\"true\" ? \"true\" : \"false\")+\",jo_contrepartie=\"+(jo_contrepartie==\"true\" ? \"true\" : \"false\")+\",cg_numero=\"+cg_numero+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "function AddJoueur( yearNum, creneau) {\n $.ajax({\n type: \"GET\",\n url: 'index.php',\n data:{\n \t page:'add_joueur',\n \t iDate: yearNum,\n \t iCreneau: creneau\n },\n \n success : function(msg, statut){ // success est toujours en place, bien sûr !\n\t var msg = $.parseJSON(msg);\n\t if(msg.success=='Oui')\n\t { \t \n\t \t // Rechargement de la page\n\t \t location.reload(true);\n\t return true;\n\t }\n\t else\n\t {\n\t \t $.alert({\n\t\t\t\t\t\tcolumnClass: 'medium',\n\t\t\t\t title : 'Ajouter un joueur',\n\t\t\t\t content : 'Erreur sur le serveur !'\n\t\t\t\t\t});\n\t return false;\n\t }\n },\n\n error : function(resultat, statut, erreur){\n \t $.alert({\n\t\t\t\t\tcolumnClass: 'medium',\n\t\t\t title : 'Ajouter un joueur',\n\t\t\t content : 'Erreur lors de la mise à jour !'\n\t\t\t\t});\n },\n \n complete : function(resultat, statut){\n\n }\n });\n }", "function addAll() {}", "static add(cours) {\r\n // cours.id = nextId++;\r\n // coursExtent.push(cours);\r\n // return cours;\r\n return db.execute('insert into Kurs (Nazwa, Opis, Cena, Wykladowca_Id_wykladowca) values (?, ?, ?, ?)', [cours.name, cours.description, cours.price, cours.id_instructor]);\r\n // return db.execute(\r\n // 'insert into Klient (imie, nazwisko, plec,email, data_urodzenia) values (?, ?, ?, ?, ?)',\r\n // [user.firstName, user.lastName, user.sex, user.email, user.dateOfBirth]\r\n // );\r\n }", "function insertarnombreJugador(){ \n jugador.push(nombre); \n console.log(jugador);\n }", "function User_Insert_Types_de_journaux_Liste_des_types_de_journaux0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 1\n\nId dans le tab: 201;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\n******************\n*/\n\n var Table=\"typejournal\";\n var CleMaitre = TAB_COMPO_PPTES[199].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var tj_libelle=GetValAt(201);\n if (!ValiderChampsObligatoire(Table,\"tj_libelle\",TAB_GLOBAL_COMPO[201],tj_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"tj_libelle\",TAB_GLOBAL_COMPO[201],tj_libelle))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",tj_libelle\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(tj_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(tj_libelle)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "function add(){\n\n\tvar Texto = Valor.value;\n\tvar Texto2 = ed.value;\n\trecep.push(Texto);\n\ttab.push(Texto2);\n\tValor.value='';\n\tde.value='';\n\tMain();\n}", "function ajouter(item) {\n item.push('lait');\n}", "function add_comentarios(){ // funcion de agregar comentarios\n\n var nombre = document.getElementById('nombre').value; //tomo valores que ingresa el usuario en el form\n var coment = document.getElementById('texto_coment').value;\n var puntos = document.getElementById('puntos').value;\n\n comentario.push(nombre);\n comentario.push(coment);\n comentario.push(puntos);\n \n console.log(comentario);\n mostrar(comentario);\n\n}", "constructor() {\n this.joueurs = [];\n this.timer = 0;\n\n }", "function User_Insert_Cantons_Liste_des_cantons0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 2\n\nId dans le tab: 140;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 141;\ncomplexe\nNbr Jointure: 1;\n Joint n° 0 = ville,ct_numero,ct_numero\n\n******************\n*/\n\n var Table=\"canton\";\n var CleMaitre = TAB_COMPO_PPTES[137].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ct_nom=GetValAt(140);\n if (!ValiderChampsObligatoire(Table,\"ct_nom\",TAB_GLOBAL_COMPO[140],ct_nom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ct_nom\",TAB_GLOBAL_COMPO[140],ct_nom))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",ct_nom\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(ct_nom==\"\" ? \"null\" : \"'\"+ValiderChaine(ct_nom)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "function User_Insert_Comptes_auxiliaires_Liste_des_comptes_auxiliaires0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 5\n\nId dans le tab: 128;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 129;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 130;\nsimple\nNbr Jointure: 1;\n Joint n° 0 = acces,ac_numero,ac_numero\n\nId dans le tab: 131;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 132;\ncomplexe\nNbr Jointure: 1;\n Joint n° 0 = ecriture,ca_numero,ca_numero\n\n******************\n*/\n\n var Table=\"compteaux\";\n var CleMaitre = TAB_COMPO_PPTES[123].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ca_numcompte=GetValAt(128);\n if (!ValiderChampsObligatoire(Table,\"ca_numcompte\",TAB_GLOBAL_COMPO[128],ca_numcompte,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ca_numcompte\",TAB_GLOBAL_COMPO[128],ca_numcompte))\n \treturn -1;\n var ca_libelle=GetValAt(129);\n if (!ValiderChampsObligatoire(Table,\"ca_libelle\",TAB_GLOBAL_COMPO[129],ca_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ca_libelle\",TAB_GLOBAL_COMPO[129],ca_libelle))\n \treturn -1;\n var ac_numero=GetValAt(130);\n if (ac_numero==\"-1\")\n ac_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"ac_numero\",TAB_GLOBAL_COMPO[130],ac_numero,true))\n \treturn -1;\n var ca_debit=GetValAt(131);\n if (!ValiderChampsObligatoire(Table,\"ca_debit\",TAB_GLOBAL_COMPO[131],ca_debit,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ca_debit\",TAB_GLOBAL_COMPO[131],ca_debit))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\nvar Asso11=false;\nvar TabAsso11=new Array();\nvar CompoLie = GetSQLCompoAt(113);\nvar CompoLieMaitre = CompoLie.my_Affichable.my_MaitresLiaison.getAttribut().GetComposant();\nvar CleLiasonForte = CompoLieMaitre.getCleVal();\nif (CleLiasonForte!=-1)\n{\n\tAsso11=GenererAssociation11(CompoLie,CleMaitre,CleLiasonForte,TabAsso11);\n}\nelse\n{\n\talert(\"Vous devez d'abord valider \"+CompoLieMaitre.getLabel()+\" puis mettre à jour.\");\n\treturn -1;\n}\n Req+=\"(\"+NomCleMaitre+\",ca_numcompte,ca_libelle,ac_numero,ca_debit\"+(Asso11?\",\"+TabAsso11[0]:\"\")+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(ca_numcompte==\"\" ? \"null\" : \"'\"+ValiderChaine(ca_numcompte)+\"'\" )+\",\"+(ca_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(ca_libelle)+\"'\" )+\",\"+ac_numero+\",\"+(ca_debit==\"true\" ? \"true\" : \"false\")+\"\"+(Asso11?\",\"+TabAsso11[1]:\"\")+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nif (CleLiasonForte!=-1 && !Asso11)\n{\n\tAjouterAssociation(CompoLie,CleMaitre,CleLiasonForte);\n}\nelse\n{\n\tif (CleLiasonForte==-1)\n\t{\n\t\talert(\"Attention votre enregistrement ne peux être relié à \"+CompoLieMaitre.getLabel()+\". Vous devez d'abord ajouter un enregistrement à \"+CompoLieMaitre.getLabel()+\" puis le mettre à jour\");\n\t\treturn -1;\n\t}\n}\nreturn CleMaitre;\n\n}", "function User_Insert_Etats_de_personne_Liste_des_états_de_personne0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 1\n\nId dans le tab: 52;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\n******************\n*/\n\n var Table=\"etatpersonne\";\n var CleMaitre = TAB_COMPO_PPTES[50].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ep_libelle=GetValAt(52);\n if (!ValiderChampsObligatoire(Table,\"ep_libelle\",TAB_GLOBAL_COMPO[52],ep_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ep_libelle\",TAB_GLOBAL_COMPO[52],ep_libelle))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",ep_libelle\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(ep_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(ep_libelle)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "function add() { //funcao ta no html onclick butto\n\n if(!validacao()){\n return;\n }\n\n var descricao = document.getElementById(\"descricao\").value;\n var quantidade = document.getElementById(\"quantidade\").value;\n var valor = document.getElementById(\"valor\").value;\n\n list.unshift({ \"descricao\": descricao, \"quantidade\": quantidade, \"valor\": valor });\n setList(list);//Esse metodo serve para Atualisando a tabela\n}", "function User_Insert_Services_Liste_des_services0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 3\n\nId dans le tab: 71;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 72;\nsimple\nNbr Jointure: 1;\n Joint n° 0 = agent,se_agent,ag_numero\n\nId dans le tab: 73;\ncomplexe\nNbr Jointure: 1;\n Joint n° 0 = employe,se_numero,em_service\n\n******************\n*/\n\n var Table=\"service\";\n var CleMaitre = TAB_COMPO_PPTES[67].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var se_nom=GetValAt(71);\n if (!ValiderChampsObligatoire(Table,\"se_nom\",TAB_GLOBAL_COMPO[71],se_nom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"se_nom\",TAB_GLOBAL_COMPO[71],se_nom))\n \treturn -1;\n var se_agent=GetValAt(72);\n if (se_agent==\"-1\")\n se_agent=\"null\";\n if (!ValiderChampsObligatoire(Table,\"se_agent\",TAB_GLOBAL_COMPO[72],se_agent,true))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\nvar Asso11=false;\nvar TabAsso11=new Array();\nvar CompoLie = GetSQLCompoAt(64);\nvar CompoLieMaitre = CompoLie.my_Affichable.my_MaitresLiaison.getAttribut().GetComposant();\nvar CleLiasonForte = CompoLieMaitre.getCleVal();\nif (CleLiasonForte!=-1)\n{\n\tAsso11=GenererAssociation11(CompoLie,CleMaitre,CleLiasonForte,TabAsso11);\n}\nelse\n{\n\talert(\"Vous devez d'abord valider \"+CompoLieMaitre.getLabel()+\" puis mettre à jour.\");\n\treturn -1;\n}\n Req+=\"(\"+NomCleMaitre+\",se_nom,se_agent\"+(Asso11?\",\"+TabAsso11[0]:\"\")+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(se_nom==\"\" ? \"null\" : \"'\"+ValiderChaine(se_nom)+\"'\" )+\",\"+se_agent+\"\"+(Asso11?\",\"+TabAsso11[1]:\"\")+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nif (CleLiasonForte!=-1 && !Asso11)\n{\n\tAjouterAssociation(CompoLie,CleMaitre,CleLiasonForte);\n}\nelse\n{\n\tif (CleLiasonForte==-1)\n\t{\n\t\talert(\"Attention votre enregistrement ne peux être relié à \"+CompoLieMaitre.getLabel()+\". Vous devez d'abord ajouter un enregistrement à \"+CompoLieMaitre.getLabel()+\" puis le mettre à jour\");\n\t\treturn -1;\n\t}\n}\nreturn CleMaitre;\n\n}", "function ajouter_dans_la_liste(aAjouter){\n $('.jcarousel ul').append(\"<li>\"+aAjouter+\"</li>\");\n}", "function User_Insert_Produits_Liste_des_produits0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 6\n\nId dans le tab: 161;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 162;\nsimple\nNbr Jointure: 1;\n Joint n° 0 = journal,jo_numero,jo_numero\n\nId dans le tab: 163;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 164;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 165;\ncomplexe\nNbr Jointure: 1;\n Joint n° 0 = prix,pd_numero,pd_numero\n\nId dans le tab: 175;\ncomplexe\nNbr Jointure: 1;\n Joint n° 0 = compteproduit,pd_numero,pd_numero\n\n******************\n*/\n\n var Table=\"produit\";\n var CleMaitre = TAB_COMPO_PPTES[158].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var pd_libelle=GetValAt(161);\n if (!ValiderChampsObligatoire(Table,\"pd_libelle\",TAB_GLOBAL_COMPO[161],pd_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"pd_libelle\",TAB_GLOBAL_COMPO[161],pd_libelle))\n \treturn -1;\n var jo_numero=GetValAt(162);\n if (jo_numero==\"-1\")\n jo_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"jo_numero\",TAB_GLOBAL_COMPO[162],jo_numero,true))\n \treturn -1;\n var pd_actif=GetValAt(163);\n if (!ValiderChampsObligatoire(Table,\"pd_actif\",TAB_GLOBAL_COMPO[163],pd_actif,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"pd_actif\",TAB_GLOBAL_COMPO[163],pd_actif))\n \treturn -1;\n var pd_reduction=GetValAt(164);\n if (!ValiderChampsObligatoire(Table,\"pd_reduction\",TAB_GLOBAL_COMPO[164],pd_reduction,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"pd_reduction\",TAB_GLOBAL_COMPO[164],pd_reduction))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",pd_libelle,jo_numero,pd_actif,pd_reduction\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(pd_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(pd_libelle)+\"'\" )+\",\"+jo_numero+\",\"+(pd_actif==\"true\" ? \"true\" : \"false\")+\",\"+(pd_reduction==\"true\" ? \"true\" : \"false\")+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "function User_Insert_Villes_Liste_des_villes0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 2\n\nId dans le tab: 126;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 127;\nsimple\nNbr Jointure: 1;\n Joint n° 0 = canton,ct_numero,ct_numero\n\n******************\n*/\n\n var Table=\"ville\";\n var CleMaitre = TAB_COMPO_PPTES[123].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var vi_nom=GetValAt(126);\n if (!ValiderChampsObligatoire(Table,\"vi_nom\",TAB_GLOBAL_COMPO[126],vi_nom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"vi_nom\",TAB_GLOBAL_COMPO[126],vi_nom))\n \treturn -1;\n var ct_numero=GetValAt(127);\n if (ct_numero==\"-1\")\n ct_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"ct_numero\",TAB_GLOBAL_COMPO[127],ct_numero,true))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",vi_nom,ct_numero\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(vi_nom==\"\" ? \"null\" : \"'\"+ValiderChaine(vi_nom)+\"'\" )+\",\"+ct_numero+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "function User_Insert_Types_de_lien_Liste_des_types_de_lien_entre_personne0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 2\n\nId dans le tab: 45;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 46;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\n******************\n*/\n\n var Table=\"typelien\";\n var CleMaitre = TAB_COMPO_PPTES[43].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var tl_libelle=GetValAt(45);\n if (!ValiderChampsObligatoire(Table,\"tl_libelle\",TAB_GLOBAL_COMPO[45],tl_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"tl_libelle\",TAB_GLOBAL_COMPO[45],tl_libelle))\n \treturn -1;\n var tl_description=GetValAt(46);\n if (!ValiderChampsObligatoire(Table,\"tl_description\",TAB_GLOBAL_COMPO[46],tl_description,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"tl_description\",TAB_GLOBAL_COMPO[46],tl_description))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",tl_libelle,tl_description\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(tl_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(tl_libelle)+\"'\" )+\",\"+(tl_description==\"\" ? \"null\" : \"'\"+ValiderChaine(tl_description)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "function JoueurOrdinateur(numero, nom, color, argent) {\n\tJoueur.call(this, numero, nom, color,argent);\n\tthis.canPlay = false;\n\tthis.initialName = nom;\n\t/* Strategie : definit le comportement pour l'achat des maisons */\n\tthis.strategie = null;\n\t/* Comportement : definit le rapport e l'argent. Inclu la prise de risque */\n\tthis.comportement = null;\n\tthis.nom = nom;\n\tthis.rejectedPropositions = []; // Sotcke les propositions rejetees\n\n\t/* Determine les caracteristiques d'un ordinateur*/\n\tthis.init = function (idStrategie, idComportement) {\n\t\tthis.strategie = (idStrategie == null) ? GestionStrategie.createRandom() : GestionStrategie.create(idStrategie);\n\t\tthis.comportement = (idComportement == null) ? GestionComportement.createRandom() : GestionComportement.create(idComportement);\n\t}\n\n\tthis.saveMore = function (data) {\n\t\tdata.comportement = this.comportement.id;\n\t\tdata.strategie = this.strategie.id;\n\t\t// Charge l'historique des propositions (derniere proposition du terrain)\n\t\tdata.rejectedPropositions = [];\n for (var id in this.rejectedPropositions) {\n\t\t\tvar proposition = this.rejectedPropositions[id][this.rejectedPropositions[id].length -1].proposition;\n\t\t\tvar terrains = [];\t// On ne garde que les ids des fiches pour eviter les cycles a la sauvegarde\n for(var t in proposition.terrains){\n terrains.push(proposition.terrains[t].id);\n }\n data.rejectedPropositions.push({\n\t\t\t\tid: id,\n\t\t\t\tproposition: {\n\t\t\t\t\tcompensation:proposition.compensation,\n\t\t\t\t\tterrains:terrains\n\t\t\t\t}\n\t\t\t});\n\t\t}\t\t\t\n\t}\n\n\tthis.loadMore = function (data) {\t\n\t\tthis.init(data.strategie, data.comportement);\n\t\tthis.rejectedPropositions = [];\n\t\tif (data.rejectedPropositions != null) {\n\t\t\tfor (var id in data.rejectedPropositions) {\n\t\t\t\tvar p = data.rejectedPropositions[id].proposition;\n\t\t\t\tvar terrains = [];\n\t\t\t\tif(p.terrains!=null){\n\t\t\t\t\tfor(var t in p.terrains){\n\t\t\t\t\t\tterrains.push(GestionFiche.getById(p.terrains[t]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// On ajoute la proposition dans le tableau\n\t\t\t\tthis.rejectedPropositions[data.rejectedPropositions[id].id] = [{\n\t\t\t\t\tproposition:{\n compensation:p.compensation,\n\t\t\t\t\t terrains:terrains\n }\n\t\t\t\t}];\n\t\t\t}\n\t\t}\n\t}\n\n\t// Fonction appelee lorsque le joueur a la main\n\tthis.joue = function () {\n\t\t// On reevalue a intervalle regulier la strategie\n\t\tthis.changeStrategie();\n\t\t// On fait des demandes d'echange de proprietes. Asynchrone, le reste du traitement est en callback\n\t\tvar joueur = this;\n\t\tthis.echangeProprietes(function () {\n\t\t\t// Construit des maisons / hotels\n\t\t\tjoueur.buildConstructions();\n\t\t\t// rachete les hypotheques\n\t\t\tjoueur.rebuyHypotheque();\n\t\t\t// on lance les des\n\t\t\t$.trigger('monopoly.debug',{message:'joueur ' + joueur.nom + ' joue'});\n\t\t\tGestionDes.lancer();\n\t\t});\n\t}\n\n\t/* Choisi la case qui l'interesse le plus */\n\t/* 1) Cherche dans les terrains libres celui qu'il prefere */\n\t/* 2) Si pas de terrain libre, choisi la case prison (protege le plus) si besoin */\t\n\tthis.choisiCase = function(callback){\n\t\tvar fiches = GestionFiche.getFreeFiches();\n\t\tvar maxInteret;\n\t\tvar maxFiche;\n\t\tfiches.forEach(function(fiche){\n\t\t\tvar interet = this.strategie.interetGlobal(fiche,this,false).interet;\n\t\t\tif(interet !=0 && (maxInteret == null || interet > maxInteret)){\n\t\t\t\tmaxInteret = interet;\n\t\t\t\tmaxFiche = fiche;\n\t\t\t}\n\t\t},this);\n\t\tif(maxFiche!=null){\n\t\t\tcallback(maxFiche);\n\t\t}else{\n\t\t\t// Interessant de rester en prison\n\t\t\tif(!this.getOutPrison()){\n\t\t\t\tcallback(GestionFiche.getPrison());\n\t\t\t}else{\n\t\t\t\tcallback(GestionFiche.getDepart());\n\t\t\t}\n\t\t}\n\t}\n\t\n\t/* Pour le de rapide, choisi la meilleure configuration */\n\t/* 1) Prefere les terrains libres qui l'interessent */\n\t/* 2) Prefere les terrains libres */\n\t/* 3) Choisi les cases safe (case depart, parking, simple visite) */\n\t/* 4) Choisi le loyer le moins cher a payer */\n\tthis.choisiDes = function(des1,des2,callback){\n\t\tvar f1 = {fiche:this.pion.deplaceValeursDes(des1),total:des1};\n\t\tvar f2 = {fiche:this.pion.deplaceValeursDes(des2),total:des2};\n\t\tvar f3 = {fiche:this.pion.deplaceValeursDes(des1 + des2),total:des1+des2};\n\t\t\n\t\tvar maxInteret = -1000;\n\t\tvar total = 0;\n\t\t[f1,f2,f3].forEach(function(f){\n\t\t\tvar value = this._analyseCase(GestionFiche.get(f.fiche));\n\t\t\tif(value > maxInteret){\n\t\t\t\ttotal = f.total;\n\t\t\t\tmaxInteret = value;\n\t\t\t}\n\t\t},this);\n\t\tcallback(total);\n\t}\n\t\n\t/* Determine l'interet d'une case. Plus il est elevé, plus il est important */\n\t/* Interet pour taxe depend du montant. */\n\t/* Case depart mieux que terrain inutile mais moins que terrain utile */\n\t/* Prison depend de l'interet a y rester. Si non, equivaut a une taxe de 2000 */\n\t/* Interet d'un terrain depend des moyens qu'on a */\n\t/* TODO : dans le cas d'enchere immediate, empecher de tomber sur un terrain qui interesse un autre ? */\n\tthis._analyseCase = function(fiche){\n\t\tvar interet = 0;\n\t\tif(fiche.isPropriete() == true){\n\t\t\tinteret = fiche.statut == ETAT_LIBRE ? \n\t\t\t\tthis.strategie.interetGlobal(fiche,this,false).interet :\n\t\t\t\tfiche.getLoyerFor(this) / -1000;\n\t\t}\n\t\tswitch(fiche.type){\n\t\t\tcase \"prison\" : interet = this.getOutPrison() ? -2 : 1;break;\n\t\t\tcase \"taxe\" : interet = -1 * fiche.montant / 1000;break;\n\t\t\tcase \"depart\": interet = 0.5;break;\n\t\t}\t\t\n\t\treturn interet;\n\t}\n\t\n\t// Fonction appelee lorsque les des sont lances et que le pion est place\n\tthis.actionApresDes = function (buttons, propriete) {\n\t\tif (buttons == null) {\n\t\t\treturn;\n\t\t}\n\t\tvar _self = this;\n\t\tsetTimeout(function () {\n\t\t\tif (buttons.Acheter != null && propriete != null) {\n\t\t\t\tvar interet = _self.strategie.interetGlobal(propriete).interet;\n\t\t\t\tvar comportement = _self.comportement.getRisqueTotal(_self, propriete.achat);\n\t\t\t\t$.trigger(\"monopoly.debug\", {\n\t\t\t\t\tmessage: \"Strategie : \" + interet + \" \" + comportement\n\t\t\t\t});\n\t\t\t\tif (interet > comportement) {\n\t\t\t\t\t$.trigger(\"monopoly.debug\", {\n\t\t\t\t\t\tmessage: \"IA Achete\"\n\t\t\t\t\t});\n\t\t\t\t\tbuttons.Acheter();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var i in buttons) {\n\t\t\t\tif (i != \"Acheter\") {\n\t\t\t\t\tbuttons[i]();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}, IA_TIMEOUT);\n\t}\n\n\tthis.notifyAcceptProposition = function (callback) {\n\t\tif (callback) {\n\t\t\tcallback();\n\t\t}\n\t}\n\n\tthis.notifyRejectProposition = function (callback, terrain, proposition) {\n\t\t// On enregistre le refus du proprietaire : le terrain, la proposition et le numero de tour\n\t\t// utiliser pour plus tard pour ne pas redemander immediatement\n\t\tif (this.rejectedPropositions[terrain.id] == null) {\n\t\t\tthis.rejectedPropositions[terrain.id] = [];\n\t\t}\n\t\tthis.rejectedPropositions[terrain.id].push({\n\t\t\tnbTours: globalStats.nbTours,\n\t\t\tproposition: proposition\n\t\t});\n\t\tif (callback) {\n\t\t\tcallback();\n\t\t}\n\t}\n\n\t/* Cherche a echanger des proprietes. Methode bloquante car negociation avec d'autres joueurs\n\t * Se deroule en plusieurs etapes :\n\t * Calcule les terrains qui l'interessent chez les adversaires\n\t * Penser a prendre les affinites en compte\n\t * @param callback : traitement a lancer a la fin des echanges\n\t * Il faut retenir les demandes rejetees pour proposer plus et ne pas demander a chaque tour\n\t */\n\tthis.echangeProprietes = function (callback) {\n\t\t// Quand echange uniquement apres la vente de tous les terrains\n\t\tif(VARIANTES.echangeApresVente && GestionFiche.isFreeFiches()){\n\t\t\tif(callback){\n\t\t\t\tcallback();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// Proprietes qui interessent le joueur\n\t\tvar proprietes = this.findOthersInterestProprietes();\n\t\tif (proprietes.length == 0) {\n\t\t\tcallback();\t\n\t\t\treturn;\n\t\t}\n\t\tvar nbGroupesPossedes = this.findGroupes().length;\n\t\t/* On calcule l'importance d'echanger (si des groupes sont presents ou non) */\n\t\tvar interetEchange = Math.pow(1 / (1 + nbGroupesPossedes), 2);\n\n\t\t/* On cherche les monnaies d'echanges. */\n\t\tvar proprietesFiltrees = [];\n\t\tfor (var p in proprietes) {\n\t\t\tvar prop = proprietes[p];\n\t\t\tvar maison = prop.maison;\n\t\t\t// On verifie si une demande n'a pas ete faite trop recemment\n\t\t\tif (this._canAskTerrain(maison)) {\n\t\t\t\tvar last = this._getLastProposition(maison);\n\t\t\t\tvar joueur = maison.joueurPossede;\n\t\t\t\tprop.compensation = 0;\n\t\t\t\t// Calcule les monnaies d'echange\n\t\t\t\tprop.deals = maison.joueurPossede.findOthersInterestProprietes(this,maison);\n \tif (prop.deals.length == 0) {\n\t\t\t\t\t// On ajoute les terrains non importants (gare seule, compagnie)\n\t\t\t\t\tvar othersProprietes = this.findUnterestsProprietes();\n \t\tvar montant = 0;\n\t\t\t\t\tif (othersProprietes != null && othersProprietes.proprietes != null && othersProprietes.proprietes.length > 0) {\n\t\t\t\t\t\t// On en ajoute. En fonction de la strategie, on n'ajoute que les terrains seuls dans le groupe (peu important)\n\t\t\t\t\t\tfor (var i = 0; i < othersProprietes.proprietes.length && montant / maison.achat < 0.7; i++) {\n\t\t\t\t\t\t\tvar terrain = othersProprietes.proprietes[i];\n\t\t\t\t\t\t\t// Il ne faut pas proposer un terrain du meme groupe que le terrain demande car pas forcement de la strategie\n\t\t\t\t\t\t\t// Deux terrains qui ne sont pas de la strategie sont potentiellement interessant a garder\n\t\t\t\t\t\t\tif (!this.strategie.interetPropriete(terrain) && (terrain.groupe == null || !terrain.groupe.equals(maison.groupe))) {\n\t\t\t\t\t\t\t\t// On le refourgue\n\t\t\t\t\t\t\t\tprop.deals.push(terrain);\n\t\t\t\t\t\t\t\tmontant += terrain.achat;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Permettre calcul compensation quand traitement fournit des terrains < 80% du montant\n\t\t\t\t\tif (montant / maison.achat < 0.8) {\n\t\t\t\t\t\tprop.compensation = this.evalueCompensation(joueur, maison, interetEchange, last) - montant;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Si trop couteux, on propose autre chose, comme de l'argent. On evalue le risque a echanger contre ce joueur. \n\t\t\t\t\t// On teste toutes les monnaies d'echanges\n\t\t\t\t\tvar monnaies = this.chooseMonnaiesEchange(prop, prop.monnaiesEchange, true, nbGroupesPossedes >= 2, last);\n\t\t\t\t\tif (monnaies == null || monnaies.length == 0) {\n\t\t\t\t\t\tprop.compensation = this.evalueCompensation(joueur, maison, interetEchange, last);\n\t\t\t\t\t\tprop.deals = null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprop.deals = monnaies;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Si aucune proposition, on ajoute les autres terrains dont on se moque (terrains constructibles mais non intéressant)\n // Potentiellement un terrain de la strategie peut tout de meme etre proposee (une gare par exemple)\n\t\t\t\tif ((prop.deals == null || prop.deals.length == 0) && prop.compensation == 0) {\n\t\t\t\t\tvar terrains = this.findOthersProperties(proprietes);\n var montant = 0;\n\t\t\t\t\tfor (var i = 0; i < terrains.length && montant / maison.achat < 0.7; i++) {\n\t\t\t\t\t\tvar terrain = terrains[i];\n\t\t\t\t\t\tif (!this.strategie.interetPropriete(terrain)) {\n\t\t\t\t\t\t\tif (prop.deals == null) {\n\t\t\t\t\t\t\t\tprop.deals = [];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// On le propose\n\t\t\t\t\t\t\tprop.deals.push(terrain);\n\t\t\t\t\t\t\tmontant += terrain.achat;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ((prop.deals != null && prop.deals.length > 0) || (prop.compensation != null && prop.compensation > 0)) {\n\t\t\t\t\tproprietesFiltrees.push(prop);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$.trigger('monopoly.debug', {\n\t\t\t\t\tmessage: 'Le joueur ne demande pas ' + maison.nom\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\t// On choisit la propriete a demander en echange\n\t\tif (proprietesFiltrees.length != 0) {\n\t\t\tfor (var idx in proprietesFiltrees) {\n\t\t\t\tvar p = proprietesFiltrees[idx];\n\t\t\t\tvar proposition = {\n\t\t\t\t\tterrains: (p.deals == null) ? [] : p.deals,\n\t\t\t\t\tcompensation: p.compensation\n\t\t\t\t};\n\t\t\t\ttry {\n\t\t\t\t\t// L'action de fin d'un ordinateur\n\t\t\t\t\tGestionEchange.init(this, p.maison.joueurPossede, p.maison, callback);\n\t\t\t\t\tGestionEchange.propose(proposition);\n\t\t\t\t\treturn;\n\t\t\t\t} catch (e) {\n\t\t\t\t\tconsole.log(e);\n\t\t\t\t\t// Deja en cours quelque part, on continue\n\t\t\t\t\tcallback();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Aucun echange n'est fait, on continue\n\t\tcallback();\n\t}\n\n\t/* Verifie que le terrain peut etre demande a l'echange (si une precedente demande n'a pas été faite trop recemment) */\n\tthis._canAskTerrain = function (terrain) {\n\t\t// On prend le dernier\n\t\tvar last = this._getLastProposition(terrain);\n\t\tif (last != null) {\n\t\t\tvar pas = 3 + (Math.round((Math.random() * 1000) % 3));\n\t\t\treturn last.nbTours + pas < globalStats.nbTours;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/* Renvoie la derniere proposition faite pour un terrain */\n\tthis._getLastProposition = function (terrain) {\n\t\tif (this.rejectedPropositions != null && this.rejectedPropositions[terrain.id] != null) {\n\t\t\treturn this.rejectedPropositions[terrain.id][this.rejectedPropositions[terrain.id].length - 1];\n\t\t}\n\t\treturn null;\n\t}\n\n\t// La gestion des echanges se passe par des mecanismes asynchrones. On utilise un objet contenant une proposition / contre proposition et un statut.\n\t// On bloque le traitement d'un joueur\n\n\t/* Suite a une demande d'echange d'un joueur, analyse la requete. Plusieurs cas : \n\t * Accepte la proposition (ACCEPT, indice > 3)\n\t * Refuse la proposition (BLOCK, indice < 0)\n\t * Fait une contre proposition en demandant plus d'argent et / ou d'autres terrains (UP, 1 < indice > 5)\n\t * Principe de l'algo : evalue les criteres pour obtenir un indicateur qui permet de repondre (bornes)\n\t * Gerer le cas de 2 ou il nous demande le terrain que l'on a (et qui nous interesse)\n\t */\n\tthis.traiteRequeteEchange = function (joueur, maison, proposition) {\n\t\t// Si aucune compensation, on refuse\n\t\tif ((proposition.terrains == null || proposition.terrains.length == 0) && (proposition.compensation == null || proposition.compensation == 0)) {\n\t\t\treturn GestionEchange.reject(this);\n\t\t}\n\t\tvar others = this.findOthersInterestProprietes(joueur);\n\t\tvar infos = this._calculatePropositionValue(maison, joueur, proposition, others);\n\t\tif (infos.critere >= 3) {\n\t\t\treturn GestionEchange.accept(this);\n\t\t}\n\t\tif (infos.critere <= 0) {\n\t\t\treturn GestionEchange.reject(this);\n\t\t}\n\n\t\tvar contreProposition = {\n\t\t\tterrains: [],\n\t\t\tcompensation: 0\n\t\t};\n\t\tvar turn = 0; // Pas plus de 3 tour de calcul\n\t\tdo {\n\t\t\tcontreProposition = this._calculateContreProposition(joueur, proposition, contreProposition, infos.recommandations, maison, others);\n\t\t\tinfos = this._calculatePropositionValue(maison, joueur, contreProposition, others);\n\t\t} while (infos.critere < 3 && turn++ < 3);\n\n\t\tif (infos.critere < 3) { // Impossible a generer\n\t\t\treturn GestionEchange.reject(this);\n\t\t}\n\t\treturn GestionEchange.contrePropose(contreProposition, this);\n\t}\n\n\tthis._calculateContreProposition = function (joueur, proposition, contreProposition, recommandations, terrain, others) {\n\t\tif (recommandations[\"TERRAIN_DISPO\"] == 1 || recommandations[\"TERRAIN_NON_LISTE\"] == 1) {\n\t\t\t// terrain dispo non propose, on ajoute tant que la valeur du terrain n'est pas atteinte\n\t\t\tvar montant = 0;\n\t\t\tfor (var i = 0; i < others.length; i++) {\n\t\t\t\tif (!others[i].maison.groupe.equals(terrain.groupe)) { // si on est interesse par le meme groupe\n\t\t\t\t\tcontreProposition.terrains.push(others[i].maison);\n\t\t\t\t\tmontant += others[i].maison.achat;\n\t\t\t\t\tif (montant > terrain.achat) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t/* Ajout d'un terrain de la propal originale */\n\t\t\tif (montant < terrain.achat && recommandations[\"TERRAIN_NON_LISTE\"] == 1) {\n\t\t\t\t// On ajoute un terrain propose avant\n\t\t\t\tvar done = false;\n\t\t\t\tfor (var i = 0; i < proposition.length && !done; i++) {\n\t\t\t\t\tif (!contreProposition.terrains.contains(proposition.terrains[i])) {\n\t\t\t\t\t\tcontreProposition.terrains.push(proposition.terrains[i]);\n\t\t\t\t\t\tdone = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (!done) {\n\t\t\t\t\t\t// Il faut proposer autre chose, autre terrain\n\t\t\t\t\t\tvar uselessPropritetes = joueur.findUnterestsProprietes();\n\t\t\t\t\t\tif (uselessProprietes.proprietes.length > 0) {\n\t\t\t\t\t\t\tcontreProposition.terrains.push(uselessProprietes.proprietes[0]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (recommandations[\"ARGENT_INSUFFISANT\"] == 1) {\n\t\t\tcontreProposition.compensation += terrain.achat / 2;\n\t\t}\n\t\treturn contreProposition;\n\t}\n\n\t/* Calcule la valeur d'une proposition d'echange */\n\t/* @return : renvoie la valeur de la proposition ainsi que des recommandations (utilise pour les contre propositions) */\n\tthis._calculatePropositionValue = function (maison, joueur, proposition, others) {\n\t\tvar recommandations = []; // Enregistre des parametres pour la contre proposition\n\n\t\tvar interesetMeToo = false; // Indique qu'on est aussi interesse par ce groupe\n\t\tfor (var i = 0; i < others.length; i++) {\n\t\t\tif (maison.groupe.equals(others[i].maison.groupe)) {\n\t\t\t\tinteresetMeToo = true;\n\t\t\t}\n\t\t}\n\t\tvar critereTerrains = 0;\n\t\tvar critereArgent = 0;\n\t\t// Gestion des terrains\n\t\tif ((proposition.terrains != null && proposition.terrains.length > 0)) {\n\t\t\tvar useList = false;\n\t\t\tfor (var t in proposition.terrains) {\n\t\t\t\tvar terrain = proposition.terrains[t];\n\t\t\t\t// On verifie si dans others et on note l'ordre dans la liste, signe de l'interet\n\t\t\t\tvar interetTerrain = null;\n\t\t\t\tfor (var i = 0; i < others.length; i++) {\n\t\t\t\t\tif (others[i].maison.equals(terrain)) {\n\t\t\t\t\t\tinteretTerrain = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Si le terrain est dans la liste, on augmente le critere et prend en compte la position en plus value\n\t\t\t\tif (interetTerrain != null) {\n\t\t\t\t\tcritereTerrains += 1 + (others.length - interetTerrain) / others.length;\n\t\t\t\t\tuseList = true;\n\t\t\t\t}\n\t\t\t\t// On ajoute une info sur le prix du terrain propose, constitue une valeur ajoutee\n\t\t\t\tcritereTerrains += terrain.achat / maison.achat;\n\t\t\t}\n\t\t\tif (!useList) {\n\t\t\t\trecommandations[\"TERRAIN_NON_LISTE\"] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\tif (others != null && others.length > 0) {\n\t\t\t\t// On verifie si le terrain demande n'appartient pas un groupe qui nous interesse\n\t\t\t\tvar length = others.length - ((interesetMeToo) ? 1 : 0);\n\t\t\t\tcritereTerrains -= length;\n\t\t\t\trecommandations[\"TERRAIN_DISPO\"] = 1; // Indique qu'un terrain peut etre choisi en contre proposition\n\t\t\t}\n\t\t}\n\t\t// Gestion de la compensation\n\t\tif (proposition.compensation != null) {\n\t\t\tcritereArgent = proposition.compensation / maison.achat;\n\t\t\t/* On ajoute de l'importance si proposition superieur au fond propre */\n\t\t\tif (this.montant < proposition.compensation) {\n\t\t\t\tcritereArgent += Math.min(1.5, (proposition.compensation / this.montant) - 1);\n\t\t\t} else {\n\t\t\t\trecommandations[\"ARGENT_INSUFFISANT\"] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\trecommandations[\"NO_ARGENT\"] = 1;\n\t\t}\n\n\t\t/* Confirme le traitement ou le durci. Prend le pas sur la decision calculee */\n\t\tvar strategie = this.strategie.acceptSwapTerrain(maison, joueur, others, interesetMeToo);\n\n\t\t// On melange le tout\n\t\tvar critere = (critereTerrains + critereArgent) * strategie;\n\t\t$.trigger('monopoly.debug',{message:\"Criteres : \" + critere + \" \" + critereTerrains + \" \" + critereArgent});\n\t\treturn {\n\t\t\tcritere: critere,\n\t\t\trecommandations: recommandations,\n\t\t\tothers: others\n\t\t};\n\n\t}\n\n\t/* Traite la contre proposition qui peut se composer de terrain et / ou d'argent */\n\t/* A la fin, on a accepte ou pas. Plus d'aller retour. */\n\t/* Prendre en compte qu'on est a l'origine de la demande, un peu plus laxiste, en fonction du comportement */\n\tthis.traiteContreProposition = function (proposition, joueur, maison) {\n\t\tif (proposition.terrains.length == 0 && proposition.compensation == 0) {\n\t\t\treturn GestionEchange.reject(this);\n\t\t}\n\t\t/* On evalue la pertinence */\n\t\tvar others = this.findOthersInterestProprietes(joueur);\n\t\tvar infos = null;\n\t\tif (proposition.terrains.length > 0) {\n\t\t\t// On inverse les parametres\n\t\t\tvar prop = {\n\t\t\t\tterrains: [maison],\n\t\t\t\tcompensation: proposition.compensation * -1\n\t\t\t};\n\t\t\tvar terrain = proposition.terrains[0];\n\t\t\tvar infos = this._calculatePropositionValue(terrain, joueur, prop, others);\n\t\t} else {\n\t\t\t// Uniquement de la tune\n\t\t\t// Il demande de l'argent, on verifie par rapport a nos resources\n\t\t\tinfos = {\n\t\t\t\tcritere: 2\n\t\t\t};\n\t\t}\n\t\t// On peut etre un peu plus laxiste ?\n\t\tif (infos.critere > 3) {\n\t\t\treturn GestionEchange.accept(this);\n\t\t}\n\t\treturn GestionEchange.reject(this);\n\t}\n\n\t/* Si aucune monnaie d'echange ou si la monnaie d'echange est trop dangereuse, on evalue une compensation financiere\n\t * Plusieurs criteres sont pris en compte :\n\t * 1) Prix de base du terrain.\n\t * 2) Economie propre, il faut pouvoir acheter des maisons derriere (2 sur chaque terrain)\n\t * Renvoie des bornes min / max. On propose le min au debut\n\t * @param oldPropal : si non nulle, il existe une precedente proposition et on propose une compensation plus importante\n\t */\n\tthis.evalueCompensation = function (joueur, maison, interetTerrain, oldProposition) {\n\t\t// On calcule les sommes dispos. En fonction de l'interet pour le terrain, on peut potentiellement hypothequer\n\t\tvar budgetMax = this.comportement.getBudget(this, (interetTerrain != null && interetTerrain > 2));\n\t\tvar budget = Math.min(budgetMax, maison.achat);\n\t\tif (oldProposition != null && oldProposition.proposition.compensation >= budget) {\n\t\t\tbudget = Math.min(this.montant, oldProposition.proposition.compensation * this.comportement.getFactorForProposition());\n\t\t\t// On plafonne le budget (fonction logarithmique)\n\t\t\tvar plafondBudget = (14 - Math.log(maison.achat)) * maison.achat;\n\t\t\tbudget = Math.min(budget, plafondBudget);\n\t\t}\n\t\treturn Math.round(Math.max(0, budget));\n\t}\n\n\t/* Evalue la dangerosite d'un joueur s'il recupere une maison supplementaire pour finir un groupe */\n\t/* Plusieurs criteres : \n\t * 1) Capacite a acheter des constructions\n\t * 2) Rentabilite du groupe (hors frais d'achat, uniquement maison + loyer)\n\t * 3) Creation d'une ligne\n\t * Renvoie un nombre. Au dessus de 1, dangereux, en dessous, pas trop.\n\t */\n\tthis.isDangerous = function (groupe) {\n\t\t// Critere 1, nombre de maison par terrain pouvant etre achete\n\t\tvar nbMaison = (this.argent / groupe.maisons[0].prixMaison) / groupe.fiches.length;\n\t\t// compte les autres groupes\n\t\tvar criterePrix = (groupe.maisons[0].loyers[nbMaison]) / (InitMonopoly.plateau.infos.montantDepart*5);\n\t\t// Ligne presente\n\t\tvar groups = this.findGroupes();\n\t\tvar isLigne = false;\n\t\tfor (var g in groups) {\n\t\t\tif (groups[g].isVoisin(groupe)) {\n\t\t\t\tisLigne = true;\n\t\t\t}\n\t\t}\n\t\t// Resultat : nb maison, le fait de faire une ligne et une ponderation par le prix\n\t\tvar moteur = (nbMaison + criterePrix) * (isLigne ? 2 : 1);\n\n\t\treturn moteur >= 5;\n\t}\n\n\t/* Choisis les terrains qu'il est possible de ceder en echange du terrain */\n\t/* Se base sur la dangerosite du terrain (n'est pas pris en compte) et sur la valeur des terrains par rapport a ce qui est demande */\n\t/* @param testDangerous : si le joueur est le seul fournisseur et qu'on a pas le choix, on prend le terrain*/\n\t/* @param strict : si strict est vrai, on ne relance pas l'algo en etant moins dangereux. Le joueur decide de ne pas faire de cadeau */\n\t/* @param oldProposition : derniere proposition refusee qui a ete faite, plus laxiste dans ce cas */\n\tthis.chooseMonnaiesEchange = function (terrainVise, terrains, testDangerous, strict, oldProposition) {\n\t\tif (terrains == null || terrains.length == 0) {\n\t\t\treturn [];\n\t\t}\n\t\tvar proposition = [];\n\t\tvar valeur = 0;\n\t\t// Si seul fournisseur, il faut etre plus laxiste.\n\t\tfor (var t in terrains) {\n\t\t\tif (!terrainVise.joueurPossede.isDangerous(terrains[t].groupe) || !testDangerous) {\n\t\t\t\t// On regarde si c'est necessaire de l'ajouter\n\t\t\t\tif (valeur == 0) {\n\t\t\t\t\tproposition.push(terrains[t]);\n\t\t\t\t\tvaleur += terrains[t].achat;\n\t\t\t\t} else {\n\t\t\t\t\tvar rapport = (Math.abs(1 - terrainVise.achat / valeur)) / (Math.abs(1 - terrainVise.achat(valeur + terrains[t].achat)));\n\t\t\t\t\tif (rapport > 1) {\n\t\t\t\t\t\tproposition.push(terrains[t]);\n\t\t\t\t\t\tvaleur += terrains[t].achat;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (proposition.length == 0 && !strict && (testDangerous || oldProposition != null)) {\n\t\t\t// On relance sans etre strict\n\t\t\treturn this.chooseMonnaiesEchange(terrainVise, terrains, joueur, false, strict);\n\t\t}\n\t\treturn proposition;\n\t}\n\n\tthis.initEnchere = function (transaction, terrain) {\n\t\tif (this.equals(terrain.joueurPossede)) {\n\t\t\treturn;\n\t\t}\n\t\t// On calcule le budget max que le joueur peut depenser pour ce terrain\n\t\tif (this.currentEchange != null) {\n\t\t\tthrow \"Impossible de gerer une nouvelle enchere\";\n\t\t}\n\t\tvar interet = this.strategie.interetGlobal(terrain, this, true);\n\t\tvar budgetMax = this.comportement.getMaxBudgetForStrategie(this, interet.interet);\n\t\tthis.currentEnchere = {\n\t\t\ttransaction: transaction,\n\t\t\tterrain: terrain,\n\t\t\tbudgetMax: budgetMax,\n\t\t\tjoueurInteresse:interet.joueur\n\t\t}\n\t}\n\n\tthis.updateInfoEnchere = function (montant, lastEncherisseur) {}\n\n\tthis.updateEnchere = function (transaction, jeton, montant, lastEncherisseur) {\n\t\tif (transaction != this.currentEnchere.transaction) {\n\t\t\treturn;\n\t\t}\n\t\t// Le joueur a l'enchere courante la plus haute\n\t\tif (this.equals(lastEncherisseur)) {\n\t\t\treturn;\n\t\t}\n\t\t// On temporise la reponse de IA_TIMEOUT + random de ms\n\t\tvar timeout = IA_TIMEOUT * (Math.random() + 1);\n\t\tvar _self = this;\n\t\tsetTimeout(function () {\n\t\t\tif(_self.currentEnchere == null){return;}\n\t\t\tif (montant > _self.currentEnchere.budgetMax || \n\t\t\t(_self.currentEnchere.joueurInteresse!=null && !_self.currentEnchere.joueurInteresse.equals(lastEncherisseur))) {\n\t\t\t\t// Exit enchere\n\t\t\t\tGestionEnchere.exitEnchere(_self);\n\t\t\t} else {\n\t\t\t\t// Fait une enchere. Dans le cas d'un blocage, joueurInteresse est renseigne. Enchere uniquement s'il est le dernier\n\t\t\t\ttry {\n\t\t\t\t\tGestionEnchere.doEnchere(_self, montant, jeton);\n\t\t\t\t} catch (e) {\n\t\t\t\t\t// Si une enchere a deja ete faite et update, on arrete la demande (joueur trop lent)\n\t\t\t\t}\n\t\t\t}\n\t\t},timeout);\n\t}\n\n\tthis.notifyExitEnchere = function (joueurs) {}\n\n\t/* Comportement lorsque l'enchere est terminee */\n\tthis.endEnchere = function () {\n\t\tthis.currentEnchere = null;\n\t\tGestionEnchere.checkEndNotify(this);\n\t}\n\n\t/* Permet de faire du blocage de construction : vente d'un hotel pour limiter l'achat de maison, decision d'acheter un hotel pour bloquer.\n\t * Se base sur les terrains constructibles des adversaires ainsi que de leur tresorie.\n\t * Retourne vrai s'il faut bloquer le jeu de constructions\n\t */\n\tthis.doBlocage = function () {\n\t\t// On compte le nombre joueurs qui peuvent construire\n\t\tGestionJoueur.forEach(function(joueur){\n\t\t\tif (!this.equals(this)) {\n\t\t\t\tvar groups = joueur.findGroupes();\n\t\t\t\tif (groups.size() > 0) {\n\t\t\t\t\t// On verifie si le budget est important ()\n\t\t\t\t\t// On compte le potentiel de maison achetables\n\t\t\t\t\tvar nbMaisons = 0;\n\t\t\t\t\tvar coutMaisons = 0;\n\t\t\t\t\tfor (var color in groups) {\n\t\t\t\t\t\tvar group = groups[color];\n\t\t\t\t\t\tcount += group.proprietes.length;\n\t\t\t\t\t\tfor (var index in group.proprietes) {\n\t\t\t\t\t\t\tvar maison = group.proprietes[index];\n\t\t\t\t\t\t\tnbMaisons += 5 - maison.nbMaison;\n\t\t\t\t\t\t\tcoutMaisons += (5 - maison.nbMaison) * maison.prixMaison;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvar budgetMin = (coutMaisons / nbMaisons) * 3;\n\t\t\t\t\tif (nbMaisons > 3 && budgetMin < joueur.montant) {\n\t\t\t\t\t\t// On doit bloquer la construction\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},this);\n\t\treturn false;\n\t}\n\n\t/* Override de la methode pere */\n\tthis.resolveProblemeArgent = function (montant, callback) {\n\t\t$.trigger('monopoly.debug', {\n\t\t\tmessage: 'Resoud probleme argent'\n\t\t});\n\t\tvar joueur = this;\n\n\t\t/* Ordre de liquidations :\n\t\t * 1) Terrains non constructibles, terrains non groupes, terrains groupes non construits\n\t\t * 2) Vente des maisons les maisons / hotels les mains rentables prochainement (base sur les stats des prochains passages)\n\t\t * 3) Hypotheque des terrains precedemment construits\n\t\t **/\n\n\t\t/* CAS 1 */\n\t\tvar maisons = [];\n\t\tfor (var index in this.maisons) {\n\t\t\tvar maison = this.maisons[index];\n\t\t\t// On prend les terrains non hypotheques et non construits\n\t\t\tif (maison.statutHypotheque == false && !maison.isGroupeeAndBuild()) {\n\t\t\t\tmaisons.push(maison);\n\t\t\t}\n\t\t}\n\n\t\tvar findInfo = function (maison) {\n\t\t\tswitch (maison.type) {\n\t\t\tcase \"gare\":\n\t\t\t\treturn -1;\n\t\t\t\tbreak;\n\t\t\tcase \"compagnie\":\n\t\t\t\treturn -2;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn (maison.isTerrain()) ? maison.groupe.getInfos(joueur) : 0;\n\t\t\t}\n\t\t}\n\t\tmaisons.sort(function (a, b) {\n\t\t\tvar infosA = findInfo(a);\n\t\t\tvar infosB = findInfo(b);\n\n\t\t\treturn infosA - infosB;\n\t\t});\n\n\t\t$.trigger(\"monopoly.debug\", {\n\t\t\tmessage: \"PHASE 1\"\n\t\t});\n\t\tfor (var index = 0; index < maisons.length && this.montant < montant; index++) {\n\t\t\tvar maison = maisons[index];\n\t\t\tmaison.hypotheque();\n\t\t}\n\n\t\t/* CAS 2 */\n\t\tif (this.montant < montant) {\n\t\t\t$.trigger(\"monopoly.debug\", {\n\t\t\t\tmessage: \"PHASE 2\"\n\t\t\t});\n\t\t\t// 3 Terrains construits, on vend les maisons dessus\n\t\t\t// On recupere les groupes construits classes par ordre inverse d'importance. On applique la meme regle que la construction tant que les sommes ne sont pas recupereres\n\t\t\tvar sortedGroups = [];\n\t\t\ttry {\n\t\t\t\tsortedGroups = this.getGroupsToConstruct(\"ASC\", 0.1);\n\t\t\t} catch (e) {}\n\t\t\t// On boucle (tant que les sommes ne sont pas recouvres) sur le groupe pour reduire le nombre de maison, on tourne sur les maisons\n\t\t\tvar run = true;\n\t\t\tfor (var idGroup in sortedGroups) {\n\t\t\t\tvar group = sortedGroups[idGroup];\n\t\t\t\t// On boucle pour reduire les maisons au fur et a mesure\n\t\t\t\tvar proprietes = group.proprietes;\n\t\t\t\t// On trie par nombre de maison\n\t\t\t\tproprietes.sort(function (a, b) {\n\t\t\t\t\tif (a.nbMaison == b.nbMaison) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t\treturn a.nbMaison < b.nbMaison ? 1 : -1;\n\t\t\t\t});\n\t\t\t\tvar currentId = 0;\n\t\t\t\tvar nbNoHouse = 0;\n\t\t\t\tvar boucle = 0; // Securite pour eviter boucle infinie\n\t\t\t\tvar maisonVendues = 0;\n\t\t\t\twhile (this.montant < montant && nbNoHouse < proprietes.length && boucle++ < 100) {\n\t\t\t\t\tvar p = proprietes[currentId];\n\t\t\t\t\tif (p.nbMaison == 0) {\n\t\t\t\t\t\tnbNoHouse++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (p.sellMaison(this)) {\n\t\t\t\t\t\t\tmaisonVendues++;\n\t\t\t\t\t\t\tthis.gagner(p.prixMaison / 2, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcurrentId = (currentId + 1) % proprietes.length;\n\t\t\t\t}\n\t\t\t\tif (this.montant > montant) {\n\t\t\t\t\tif (maisonVendues > 0) {\n\t\t\t\t\t\t$.trigger('monopoly.vendMaison', {\n\t\t\t\t\t\t\tjoueur: this,\n\t\t\t\t\t\t\tnbMaison: maisonVendues\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\t$.trigger('refreshPlateau');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/* CAS 3, il reste les maisons groupees desormais non construites */\n\t\tif (this.montant < montant) {\n\t\t\tvar maisons = [];\n\t\t\tfor (var index in this.maisons) {\n\t\t\t\tvar maison = this.maisons[index];\n\t\t\t\t// On prend les terrains non hypotheques\n\t\t\t\tif (maison.statutHypotheque == false) {\n\t\t\t\t\tmaisons.push(maison);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// On trie par montant (moins cher en premier). A deporter dans la strategie\n\t\t\tmaisons.sort(function (a, b) {\n\t\t\t\treturn a.achat - b.achat;\n\t\t\t});\n\t\t\tfor (var index = 0; index < maisons.length && this.montant < montant; index++) {\n\t\t\t\tvar maison = maisons[index];\n\t\t\t\tmaison.hypotheque();\n\t\t\t}\n\t\t\tif (this.montant < montant) {\n\t\t\t\t// Cas impossible car verification des fonds fait avant\n\t\t\t\tthis.doDefaite();\n\t\t\t\tif (callback) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Somme recouvree\n\t\tthis.setArgent(this.montant - montant); // Paiement de la dette\n\t\tthis.bloque = false;\n\t\tif (callback) {\n\t\t\tcallback();\n\t\t}\n\t\treturn true;\n\t}\n\n\tthis.getNbGroupConstructibles = function () {\n\t\tvar nb = 0;\n\t\tvar tempGroup = [];\n\t\tfor (var idx in this.maisons) {\n\t\t\tvar maison = this.maisons[idx];\n\t\t\tif (maison.isGroupee() && tempGroup[maison.groupe.nom] == null) {\n\t\t\t\tnb++;\n\t\t\t\ttempGroup[maison.groupe.nom] = 1;\n\t\t\t}\n\n\t\t}\n\t\treturn nb;\n\t}\n\n\t/* Renvoie la liste des groupes a construire trie. \n\t * @param sortType : Tri des groupes en fonction de l'importance. ASC ou DESC\n\t */\n\tthis.getGroupsToConstruct = function (sortType, level) {\n\t\tvar groups = this.findGroupes(); // structure : [color:{color,proprietes:[]}]\n\t\t// Pas de terrains constructibles\n\t\tif (groups.size() == 0) {\n\t\t\tthrow \"Impossible\";\n\t\t}\n\t\t// On determine les terrains les plus rentables a court terme (selon la position des joueurs)\n\t\tvar maisons = this.comportement.getNextProprietesVisitees(this, level);\n\t\t// On Calcule pour chaque maison des groupes (meme ceux sans interet) plusieurs indicateurs : proba (pondere a 3), la rentabilite (pondere a 1)\n\t\tvar totalMaisons = 0; // Nombre total de proprietes constructibles\n\t\tfor (var color in groups) {\n\t\t\tvar group = groups[color];\n\t\t\tgroup.proba = 0;\n\t\t\tgroup.rentabilite = 0;\n\t\t\tgroup.lessThree = 0;\n\t\t\tgroup.interetGlobal = 0;\n\t\t\tfor (var index in group.proprietes) {\n\t\t\t\tvar propriete = group.proprietes[index];\n\t\t\t\ttotalMaisons++;\n\t\t\t\t// On cherche si proba\n\t\t\t\tif (maisons[propriete.id] != null) {\n\t\t\t\t\tgroup.proba += maisons[propriete.id].proba * 3;\n\t\t\t\t}\n\t\t\t\tgroup.rentabilite += propriete.getRentabilite();\n\t\t\t\tgroup.lessThree += (propriete.nbMaison <= 3) ? 0.5 : 0;\n\t\t\t}\n\t\t}\n\t\t// On trie les groupes\n\t\tvar sortedGroups = [];\n\t\tfor (var color in groups) {\n\t\t\tvar group = groups[color];\n\t\t\tgroup.interetGlobal = group.proba + group.rentabilite + ((group.lessThree > 0) ? 0.5 : 0);\n\t\t\tsortedGroups.push(group);\n\t\t}\n\t\tvar GREATER_VALUE = (sortType == \"ASC\") ? 1 : -1;\n\t\tvar LESSER_VALUE = (sortType == \"ASC\") ? -1 : 1;\n\n\t\tsortedGroups.sort(function (a, b) {\n\t\t\tif (a.interetGlobal == b.interetGlobal) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tif (a.interetGlobal > b.interetGlobal) {\n\t\t\t\treturn GREATER_VALUE;\n\t\t\t}\n\t\t\treturn LESSER_VALUE;\n\t\t});\n\t\treturn sortedGroups;\n\t}\n\n\t/* Renvoie les groupes construits */\n\t/* @param nbMaison : nombre de maison moyen qui servent de palier */\n\tthis.hasConstructedGroups = function (nbMaison) {\n\t\tvar nb = nbMaison || 0;\n\t\tvar groups = this.findGroupes();\n\t\tfor (var idGroup in groups) {\n\t\t\tif (groups[idGroup].group.getAverageConstructions() > nb) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/* Rachete les hypotheques */\n\t/* Cas : groupes presents (1) et construits (nb>3). Liquidite > 7 fois prix hypotheque */\n\tthis.rebuyHypotheque = function () {\n\t\t// Hypotheque presentes\n\t\tvar terrains = this.findMaisonsHypothequees();\n\t\tif (terrains == null || terrains.length == 0 && (this.getNbGroupConstructibles() > 0 && !this.hasConstructedGroups(3))) {\n\t\t\treturn;\n\t\t}\n\t\tvar pos = 0;\n\t\twhile (pos < terrains.length && this.montant > 7 * terrains[pos].achatHypotheque) {\n\t\t\tterrains[pos++].leveHypotheque();\n\t\t}\n\t}\n\n\t/* Construit des maisons / hotels \n\t * Calcul les groupes constructibles, verifie l'argent disponible. Construit sur les proprietes ou peuvent tomber les adversaires (base sur leur position et les stats au des)\n\t * Possibilite d'enregistrer tous les deplacements des joueurs pour affiner les cases les plus visitees\n\t */\n\tthis.buildConstructions = function () {\n\t\tvar budget = this.comportement.getBudget(this);\n\t\t// Pas d'argent\n\t\tif (budget < InitMonopoly.plateau.infos.montantDepart / 4) {\n\t\t\treturn;\n\t\t}\n\t\tvar sortedGroups = [];\n\t\ttry {\n\t\t\tsortedGroups = this.getGroupsToConstruct(\"DESC\", 0.1);\n\t\t\t// On tri les maisons de chaque groupe en fonction du prix et du nombre (le moins de maison en premier puis l'achat le plus eleve\n\t\t\tfor (var idGroup in sortedGroups) {\n\t\t\t\tsortedGroups[idGroup].proprietes.sort(function (a, b) {\n\t\t\t\t\tif (a.nbMaison == b.nbMaison) {\n\t\t\t\t\t\tif (a.achat == b.achat) {\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn a.achat < b.achat ? 1 : -1\n\t\t\t\t\t}\n\t\t\t\t\treturn a.nbMaison > b.nbMaison ? 1 : -1;\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t// Pas de terrains constructibles\n\t\t\treturn;\n\t\t}\n\n\t\t/* Plusieurs regles pour gerer les constructions : \n\t\t * Si un seul groupe, on construit notre budget dessus\n\t\t * Si plusieurs groupes avec des taux equivalent, on construit sur le groupe le plus rentable (basé sur stats et sur cout)\n\t\t * On construit jusqu'a obtenir 3 maisons partout (seuil de rentabilité). On construit ensuite sur l'autre groupe\n\t\t * On construit toujours plus sur la maison la plus chere\n\t\t * S'il reste du budget, on recupere les terrains sans interet et on construit dessus\n\t\t * On calcule la somme des taux par groupe\n\t\t */\n\n\n\t\t// On construit des maisons. On s'arrete quand plus de budget ou qu'on ne peut plus construire (hotel partout ou 4 maisons (blocage de constructions))\n\t\tvar stopConstruct = false;\n\t\tvar currentMaison = 0;\n\t\tvar currentGroup = 0;\n\t\tvar seuil = 3; // Premier passage, ensuite passe a 4 ou 5\n\t\tvar achats = {\n\t\t\tmaison: 0,\n\t\t\thotel: 0,\n\t\t\tterrains:[]\n\t\t};\n\t\twhile (budget >= 5000 && !stopConstruct) {\n\t\t\t// On choisit une maison\n\t\t\tvar group = sortedGroups[currentGroup];\n\t\t\t// Changement de group\n\t\t\tvar maison = group.proprietes[currentMaison];\n\t\t\t// Si le seuil est atteint, on construit sur une autre maison ou sur un autre group\n\t\t\tif (maison.nbMaison >= seuil) {\n\t\t\t\tif (group.treat == null) {\n\t\t\t\t\tgroup.treat = 1;\n\t\t\t\t} else {\n\t\t\t\t\tgroup.treat++;\n\t\t\t\t}\n\t\t\t\t// Le goupe est traite, on passe au suivant\n\t\t\t\tif (group.treat == group.proprietes.length) {\n\t\t\t\t\tcurrentGroup++;\n\t\t\t\t\tcurrentMaison = 0;\n\t\t\t\t\t// Soit on a fait le tour, on recommence en changeant le seuil\n\t\t\t\t\tif (currentGroup >= sortedGroups.length) {\n\t\t\t\t\t\tif (seuil == 3) {\n\t\t\t\t\t\t\tseuil = 5;\n\t\t\t\t\t\t\tfor (var color in sortedGroups) {\n\t\t\t\t\t\t\t\tsortedGroups[color].treat = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcurrentGroup = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Fin du traitement\n\t\t\t\t\t\t\tstopConstruct = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Maison suivante dans le groupe\n\t\t\t\t\tcurrentMaison = (currentMaison + 1) % group.proprietes.length;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// On construit\n\t\t\t\ttry {\n\t\t\t\t\tmaison.buyMaison(this, true);\n\t\t\t\t\tbudget -= maison.prixMaison;\n\t\t\t\t\tthis.payer(maison.prixMaison);\n\t\t\t\t\tif (maison.nbMaison == 4) { //hotel\n\t\t\t\t\t\tachats.hotel++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tachats.maison++;\n\t\t\t\t\t}\n\t\t\t\t\tachats.terrains[group.proprietes[currentMaison].id] = group.proprietes[currentMaison]; \n\t\t\t\t\tcurrentMaison = (currentMaison + 1) % group.proprietes.length;\n\t\t\t\t} catch (e) {\n\t\t\t\t\t// Plus de maison ou d'hotel (on peut potentiellement continuer en achetant des maisons ?) \n\t\t\t\t\tstopConstruct = true;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\t$.trigger('monopoly.acheteConstructions', {\n\t\t\tjoueur: this,\n\t\t\tachats: achats\n\t\t});\n\t\t$('body').trigger('refreshPlateau');\n\t}\n\n\n\t/* Reevalue la strategie. Se base sur plusieurs parametres :\n\t * Si peu de propriete ont ete achetees (<3)\n\t * Si 60% des terrains qui l'interessent ont ete vendu\n\t * Si aucune famille n'est completable (dans la strategie choisie)\n\t * Si on possede deux terrains d'une strategie qui n'est pas la notre, on choisi cette strategie\n\t * TODO : Si on a des groupes, que la strategie est bloquee et qu'on a de l'argent pour changer\n\t */\n\tthis.changeStrategie = function () {\n\t\tvar localStats = this.strategie.getStatsProprietes();\n\t\tif (localStats.color.pourcent < 40 && this.countInterestProperties() <= 2 && !this.isFamilyFree()) {\n\t\t\t$.trigger(\"monopoly.debug\", {\n\t\t\t\tmessage: this.nom + \" cherche une nouvelle strategie\"\n\t\t\t});\n\t\t\t// On change de strategie. Une nouvelle strategie doit posseder au moins 60% de ses terrains de libre\n\t\t\tfor (var i in GestionStrategie.getAll()) {\n\t\t\t\tvar s = GestionStrategie.create(i);\n\t\t\t\tif (s.name != this.strategie.name) {\n\t\t\t\t\tvar strategieStats = s.getStatsProprietes();\n\t\t\t\t\tif (strategieStats.color.pourcent > 50) {\n\t\t\t\t\t\t// Nouvelle strategie\n\t\t\t\t\t\t$.trigger(\"monopoly.debug\", {\n\t\t\t\t\t\t\tmessage: this.nom + \" change de stratégie : \" + this.strategie.name + \" => \" + s.name\n\t\t\t\t\t\t});\n\t\t\t\t\t\tthis.strategie = s;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// On garde la meme si aucune n'est interessante\n\t\t}\n\t}\n \n\t/* Compte le nombre de maison possedee correspondant a la strategie */\n\tthis.countInterestProperties = function () {\n\t\tvar count = 0;\n\t\tfor (var i = 0; i < this.maisons.length; i++) {\n\t\t\tif (this.strategie.groups.contains(this.maisons[i].color)) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}\n\n\t/* Indique s'il existe des familles que je peux encore posseder sans echange\n\t * Se base sur les maisons possedees et non celle de la strategie =>TODO\n\t */\n\tthis.isFamilyFree = function () {\n\t\t// On parcourt les terrains et on verifie la dispo des terrains\n\t\tvar family = new Array();\n\t\tfor (var m in this.maisons) {\n\t\t\tvar maison = this.maisons[m];\n\t\t\tif (!family[maison.groupe.nom]) {\n\t\t\t\tfamily[maison.groupe.nom] = true;\n\t\t\t\tvar free = true;\n\t\t\t\tfor (var idf in maison.groupe.fiches) {\n\t\t\t\t\tvar fiche = maison.groupe.fiches[idf];\n\t\t\t\t\tif (fiche.statut != ETAT_LIBRE && !this.equals(fiche.joueurPossede)) {\n\t\t\t\t\t\tfree = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (free) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\n\t/* Fonction appelee avant que les des ne soit lances, lorsqu'il est en prison */\n\t/* Regle : si on est au debut du jeu, on sort de prison pour acheter des terrains. \n\t * Si on est en cours de jeu et que le terrain commence a etre miné, on reste en prison */\n\tthis.actionAvantDesPrison = function (buttons) {\n\t\tvar _self = this;\n\t\tsetTimeout(function () {\n\t\t\t// Cas 1 : on prend la carte de sortie\n\t\t\tvar getOut = _self.getOutPrison();\n\t\t\tif (getOut) {\n\t\t\t\tif (buttons[\"Utiliser carte\"] != null) {\n\t\t\t\t\tbuttons[\"Utiliser carte\"]();\n\t\t\t\t} else {\n\t\t\t\t\tbuttons[\"Payer\"]();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbuttons[\"Attendre\"]();\n\t\t\t}\n\t\t}, IA_TIMEOUT);\n\t}\n\n\t/* On sort de prison prison dans les cas suivants \n\t * 1) Le joueur a moins de deux groupes et le terrain n'est pas mine (moyenne des loyers < 20% de ses moyens) avec au moins 3 terrains de vendu\n\t * 2) Si le terrain est miné (moyenne < 30% des moyens) mais que le joueur a absolument besoin d'un terrain encore libre pour termine son groupe (pas de groupe)\n\t * 3) On sort de prison pour acheter en debut de jeu\n\t * Corolaire, on reste en prison\n\t * 1) Si le joueur a au moins deux groupes\n\t * 2) Si le terrain est miné > 15% et qu'il n'a pas un terrain a recuperer absoluement\n\t * 3) Si le terrain est très miné > 30%, quelque soit sa recherche de terrain\n\t */\n\tthis.getOutPrison = function () {\n\t\tvar loyerStat = this.comportement.getLoyerMoyen(this);\n\t\tvar groupesPossibles = this.getGroupesPossibles();\n\t\t// On peut augmenter le risque si les terrains rouges et oranges sont blindes (sortie de prison)\n\t\t// depend de l'argent dispo et du besoin d'acheter un terrain (libre et indispensable pour finir le groupe)\n\t\t// Cas pour rester en prison \n\t\tif (this.findGroupes().size() >= 2) {\n\t\t\treturn false;\n\t\t}\n\t\tif (groupesPossibles.length > 0 && loyerStat.montant < (this.montant * 0.3)) {\n\t\t\treturn true;\n\t\t}\n\t\tif (loyerStat.nb >= 4 && loyerStat.montant > (this.montant * 0.15)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t// decide si achete ou non la maison\n\t// On se base sur la politique, les fiches obtenues par les autres\n\tthis.gererAchat = function (boutonAchat) {\n\t\tboutonAchat.click();\n\t}\n\n\tthis.init();\n}", "addNuevos(auditorias){\n // al agregar un elemento unico, se debe ubicar: DESPUES de los auditorias sin fecha, y ANTES que los auditorias con fecha\n // buscar el indice del primer inventario con fecha\n let indexConFecha = this.lista.findIndex(aud=>{\n let dia = aud.aud_fechaProgramada.split('-')[2]\n return dia!=='00'\n })\n if(indexConFecha>=0){\n // se encontro el indice\n this.lista.splice(indexConFecha, 0, ...auditorias)\n }else{\n // no hay ninguno con fecha, agregar al final\n this.lista = this.lista.concat(auditorias)\n }\n }", "function add() {\n // TODO: your code here\n}", "function ajouter(Anew,Atype,Atexte,Aimage,Alien) {\r\n if (Anew<0) {\r\n \tnumpere+=Anew;\r\n \tif (numpere!=0) {\r\n \t Apere=oldpere[numpere];\r\n \t Alevel=level[Apere]+1;\r\n \t}\r\n \telse {\r\n \t Apere=0;numpere=0;Alevel=1;\r\n \t}\r\n }\r\n if (Anew==1) {\r\n\t Apere=0;numpere=0;Alevel=1;\r\n }\r\n type[nb]=Atype;\r\n level[nb]=Alevel;\r\n pere[nb]=Apere;\r\n status[nb]=0;\r\n texte[nb]=Atexte;\r\n image[nb]=Aimage;\r\n lien[nb]=Alien; \r\n if (Atype==1) {oldpere[numpere]=Apere;Apere=nb;numpere+=1;Alevel+=1;}\t\r\n nb+=1;\r\n}", "function lisaaJoukkueTilasto(tilasto, joukkue, tulos, pvm){\n\n\t// Jos joukkuella ei ole aikaisempia merkintöjä, alustetaan merkinnät\n\tif( !(joukkue in tilasto) ){\n\t\ttilasto[joukkue] = [0,0,0];\t// Nolla voittoa, tasapeliä, tappiota\n\t}\n\n\t// Lisätään: voitto\n\tif(tulos === \"voitto\"){\n\t\ttilasto[joukkue][0] = tilasto[joukkue][0] + 1;\n\n\t} else if(tulos === \"tasapeli\"){\t// Lisätään: tasapeli\n\t\ttilasto[joukkue][1] = tilasto[joukkue][1] + 1;\n\n\t} else if(tulos === \"tappio\"){ // Lisätään: tappio\n\t\ttilasto[joukkue][2] = tilasto[joukkue][2] + 1;\n\n\t} else{\n\t\talert(\"Virhe! Päiväyksellä \" + pvm + \" oli peli, jolla ei ollut voittajaa, häviäjää eikä tasapelin pelannutta.\")\n\t}\n\n\treturn tilasto;\n}", "function addTodo(todo) {\n todos.push(todo);\n}", "add_s( _simbolo){\n this.listado_Simbolos.push(_simbolo);\n }", "function ajoutMateriau($conteneur) {\r\n\r\n\t\t// on remplace le __name__ avec l'index en cours\r\n\t\tvar $prototype = $($ligne.attr('data-prototype').replace(/__name__/g, index));\r\n\t\t//tableau json des produits passé par symfony (variable )\r\n\t\tvar matieres = $.parseJSON(listematiere);\r\n\t\t//index du tableau json\r\n\t\tvar idproduit = -1;\r\n\r\n\t\t// On ajoute au prototype un lien pour pouvoir supprimer la matière première\r\n\t\tajoutSuppressionLien($prototype);\r\n\r\n\t\t// On ajoute le prototype modifié à la fin du tableau\r\n\t\t$conteneur.append($prototype);\r\n\r\n\t\t//On recupère la valeur de l'option sélectionné et on recherche l'index du produit dans le json\r\n\t\tjQuery.each(matieres, function(index, value){\r\n\t\t\tif (value.idtProduit == $('#selectmateriau option:selected')[0].value) {\r\n\t\t\t\tidproduit = index;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//On rempli les champs\r\n\t\tif( idproduit >= 0 ){\r\n\t\t\t$('#nomenclature_' + index + '_pcode').val(matieres[idproduit].codeProduit);\r\n\t\t\t$('#nomenclature_' + index + '_pnom').val(matieres[idproduit].nomProduit);\r\n\t\t\t$('#nomenclature_' + index + '_quantite').val(1);\r\n\t\t\t$('#nomenclature_' + index + '_pid').val(matieres[idproduit].idtProduit);\r\n\t\t}\r\n\r\n\t\t// Enfin, on incrémente le compteur pour que le prochain ajout se fasse avec un autre numéro\r\n\t\tindex++;\r\n\r\n\t\treturn false;\r\n\t}", "agregarPersonajes(personaje) {\n this.personajes.push(personaje);\n }", "function User_Insert_Types_d_attribut_Liste_des_types_d_attribut_de_personne0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 2\n\nId dans le tab: 30;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 31;\ncomplexe\nNbr Jointure: 1;\n Joint n° 0 = categorie,ta_numero,ta_numero\n\n******************\n*/\n\n var Table=\"typeattribut\";\n var CleMaitre = TAB_COMPO_PPTES[28].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ta_nom=GetValAt(30);\n if (!ValiderChampsObligatoire(Table,\"ta_nom\",TAB_GLOBAL_COMPO[30],ta_nom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ta_nom\",TAB_GLOBAL_COMPO[30],ta_nom))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",ta_nom\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(ta_nom==\"\" ? \"null\" : \"'\"+ValiderChaine(ta_nom)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "function getJoueurListe() {\r\n\trequest(\"GET\", \"admin.php?methode=JOUEUR_liste\" , true, setData);\r\n}", "function User_Insert_Ecritures_Liste_des_écritures_comptables0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 6\n\nId dans le tab: 93;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 94;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 95;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 96;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 97;\nsimple\nNbr Jointure: 1;\n Joint n° 0 = pointage,pt_numero,pt_numero\n\nId dans le tab: 98;\nsimple\nNbr Jointure: 1;\n Joint n° 0 = lettrage,lt_numero,lt_numero\n\n******************\n*/\n\n var Table=\"ecriture\";\n var CleMaitre = TAB_COMPO_PPTES[88].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ec_libelle=GetValAt(93);\n if (!ValiderChampsObligatoire(Table,\"ec_libelle\",TAB_GLOBAL_COMPO[93],ec_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ec_libelle\",TAB_GLOBAL_COMPO[93],ec_libelle))\n \treturn -1;\n var ec_compte=GetValAt(94);\n if (!ValiderChampsObligatoire(Table,\"ec_compte\",TAB_GLOBAL_COMPO[94],ec_compte,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ec_compte\",TAB_GLOBAL_COMPO[94],ec_compte))\n \treturn -1;\n var ec_debit=GetValAt(95);\n if (!ValiderChampsObligatoire(Table,\"ec_debit\",TAB_GLOBAL_COMPO[95],ec_debit,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ec_debit\",TAB_GLOBAL_COMPO[95],ec_debit))\n \treturn -1;\n var ec_credit=GetValAt(96);\n if (!ValiderChampsObligatoire(Table,\"ec_credit\",TAB_GLOBAL_COMPO[96],ec_credit,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ec_credit\",TAB_GLOBAL_COMPO[96],ec_credit))\n \treturn -1;\n var pt_numero=GetValAt(97);\n if (pt_numero==\"-1\")\n pt_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"pt_numero\",TAB_GLOBAL_COMPO[97],pt_numero,true))\n \treturn -1;\n var lt_numero=GetValAt(98);\n if (lt_numero==\"-1\")\n lt_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"lt_numero\",TAB_GLOBAL_COMPO[98],lt_numero,true))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\nvar Asso11=false;\nvar TabAsso11=new Array();\nvar CompoLie = GetSQLCompoAt(132);\nvar CompoLieMaitre = CompoLie.my_Affichable.my_MaitresLiaison.getAttribut().GetComposant();\nvar CleLiasonForte = CompoLieMaitre.getCleVal();\nif (CleLiasonForte!=-1)\n{\n\tAsso11=GenererAssociation11(CompoLie,CleMaitre,CleLiasonForte,TabAsso11);\n}\nelse\n{\n\talert(\"Vous devez d'abord valider \"+CompoLieMaitre.getLabel()+\" puis mettre à jour.\");\n\treturn -1;\n}\n Req+=\"(\"+NomCleMaitre+\",ec_libelle,ec_compte,ec_debit,ec_credit,pt_numero,lt_numero\"+(Asso11?\",\"+TabAsso11[0]:\"\")+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(ec_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(ec_libelle)+\"'\" )+\",\"+(ec_compte==\"\" ? \"null\" : \"'\"+ValiderChaine(ec_compte)+\"'\" )+\",\"+(ec_debit==\"\" ? \"null\" : \"'\"+ValiderChaine(ec_debit)+\"'\" )+\",\"+(ec_credit==\"\" ? \"null\" : \"'\"+ValiderChaine(ec_credit)+\"'\" )+\",\"+pt_numero+\",\"+lt_numero+\"\"+(Asso11?\",\"+TabAsso11[1]:\"\")+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nif (CleLiasonForte!=-1 && !Asso11)\n{\n\tAjouterAssociation(CompoLie,CleMaitre,CleLiasonForte);\n}\nelse\n{\n\tif (CleLiasonForte==-1)\n\t{\n\t\talert(\"Attention votre enregistrement ne peux être relié à \"+CompoLieMaitre.getLabel()+\". Vous devez d'abord ajouter un enregistrement à \"+CompoLieMaitre.getLabel()+\" puis le mettre à jour\");\n\t\treturn -1;\n\t}\n}\nreturn CleMaitre;\n\n}", "add(t){\n this.t.push(t);\n this.r.push(0);\n }", "function User_Insert_Types_de_personne_Liste_des_types_de_personne0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 1\n\nId dans le tab: 49;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\n******************\n*/\n\n var Table=\"typepersonne\";\n var CleMaitre = TAB_COMPO_PPTES[47].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var tp_type=GetValAt(49);\n if (!ValiderChampsObligatoire(Table,\"tp_type\",TAB_GLOBAL_COMPO[49],tp_type,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"tp_type\",TAB_GLOBAL_COMPO[49],tp_type))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",tp_type\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(tp_type==\"\" ? \"null\" : \"'\"+ValiderChaine(tp_type)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "function User_Insert_Agents_Liste_des_agents0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 10\n\nId dans le tab: 110;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 111;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 112;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 113;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 114;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 115;\nsimple\nNbr Jointure: 1;\n Joint n° 0 = equipe,eq_numero,eq_numero\n\nId dans le tab: 116;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 117;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 118;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 119;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\n******************\n*/\n\n var Table=\"agent\";\n var CleMaitre = TAB_COMPO_PPTES[104].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ag_nom=GetValAt(110);\n if (!ValiderChampsObligatoire(Table,\"ag_nom\",TAB_GLOBAL_COMPO[110],ag_nom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_nom\",TAB_GLOBAL_COMPO[110],ag_nom))\n \treturn -1;\n var ag_prenom=GetValAt(111);\n if (!ValiderChampsObligatoire(Table,\"ag_prenom\",TAB_GLOBAL_COMPO[111],ag_prenom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_prenom\",TAB_GLOBAL_COMPO[111],ag_prenom))\n \treturn -1;\n var ag_initiales=GetValAt(112);\n if (!ValiderChampsObligatoire(Table,\"ag_initiales\",TAB_GLOBAL_COMPO[112],ag_initiales,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_initiales\",TAB_GLOBAL_COMPO[112],ag_initiales))\n \treturn -1;\n var ag_actif=GetValAt(113);\n if (!ValiderChampsObligatoire(Table,\"ag_actif\",TAB_GLOBAL_COMPO[113],ag_actif,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_actif\",TAB_GLOBAL_COMPO[113],ag_actif))\n \treturn -1;\n var ag_role=GetValAt(114);\n if (!ValiderChampsObligatoire(Table,\"ag_role\",TAB_GLOBAL_COMPO[114],ag_role,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_role\",TAB_GLOBAL_COMPO[114],ag_role))\n \treturn -1;\n var eq_numero=GetValAt(115);\n if (eq_numero==\"-1\")\n eq_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"eq_numero\",TAB_GLOBAL_COMPO[115],eq_numero,true))\n \treturn -1;\n var ag_telephone=GetValAt(116);\n if (!ValiderChampsObligatoire(Table,\"ag_telephone\",TAB_GLOBAL_COMPO[116],ag_telephone,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_telephone\",TAB_GLOBAL_COMPO[116],ag_telephone))\n \treturn -1;\n var ag_mobile=GetValAt(117);\n if (!ValiderChampsObligatoire(Table,\"ag_mobile\",TAB_GLOBAL_COMPO[117],ag_mobile,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_mobile\",TAB_GLOBAL_COMPO[117],ag_mobile))\n \treturn -1;\n var ag_email=GetValAt(118);\n if (!ValiderChampsObligatoire(Table,\"ag_email\",TAB_GLOBAL_COMPO[118],ag_email,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_email\",TAB_GLOBAL_COMPO[118],ag_email))\n \treturn -1;\n var ag_commentaire=GetValAt(119);\n if (!ValiderChampsObligatoire(Table,\"ag_commentaire\",TAB_GLOBAL_COMPO[119],ag_commentaire,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_commentaire\",TAB_GLOBAL_COMPO[119],ag_commentaire))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",ag_nom,ag_prenom,ag_initiales,ag_actif,ag_role,eq_numero,ag_telephone,ag_mobile,ag_email,ag_commentaire\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(ag_nom==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_nom)+\"'\" )+\",\"+(ag_prenom==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_prenom)+\"'\" )+\",\"+(ag_initiales==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_initiales)+\"'\" )+\",\"+(ag_actif==\"true\" ? \"true\" : \"false\")+\",\"+(ag_role==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_role)+\"'\" )+\",\"+eq_numero+\",\"+(ag_telephone==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_telephone)+\"'\" )+\",\"+(ag_mobile==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_mobile)+\"'\" )+\",\"+(ag_email==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_email)+\"'\" )+\",\"+(ag_commentaire==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_commentaire)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "function User_Insert_Groupes_de_cantons_Liste_des_groupes_de_cantons0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 2\n\nId dans le tab: 37;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 41;\ncomplexe\nNbr Jointure: 2;\n Joint n° 0 = appartienta,gc_numero,gc_numero\n Joint n° 1 = canton,ct_numero,ct_numero\n\n******************\n*/\n\n var Table=\"groupecanton\";\n var CleMaitre = TAB_COMPO_PPTES[35].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var gc_nom=GetValAt(37);\n if (!ValiderChampsObligatoire(Table,\"gc_nom\",TAB_GLOBAL_COMPO[37],gc_nom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"gc_nom\",TAB_GLOBAL_COMPO[37],gc_nom))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",gc_nom\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(gc_nom==\"\" ? \"null\" : \"'\"+ValiderChaine(gc_nom)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\n\n/* table canton*/\nLstDouble_Exec_Req(GetSQLCompoAt(41),CleMaitre);\nreturn CleMaitre;\n\n}", "function addTodo() {\n\ttodos.push('new todos');\n}", "function addUfoRechts() {\r\n let neu = new abschlussaufgabe.UfosRechts(x, y, color, colorbody, colorAlien, status);\r\n abschlussaufgabe.ufos.push(neu);\r\n n++;\r\n }", "add () {\n }", "function carte_ajout_layer_marqueurs(map,titre) {\n\tvar markers = new OpenLayers.Layer.Markers(titre);\n\tmap.addLayer(markers);\n\treturn markers;\n}", "addNuevo(auditoria){\n // al agregar un elemento unico, se debe ubicar: DESPUES de los inventarios sin fecha, y ANTES que los inventarios con fecha\n // buscar el indice del primer inventario con fecha\n let indexConFecha = this.lista.findIndex(auditoria=>{\n let dia = auditoria.aud_fechaProgramada.split('-')[2]\n return dia!=='00'\n })\n if(indexConFecha>=0){\n // se encontro el indice\n this.lista.splice(indexConFecha, 0, auditoria)\n }else{\n // no hay ninguno con fecha, agregar al final\n this.lista.push(auditoria)\n }\n }", "function addTarefa() {\n event.preventDefault();\n if (document.getElementById(\"todoInput\").value == undefined ||\n document.getElementById(\"todoInput\").value.trim() == \"\") {\n alert('Por favor, preencha o campo');\n //reseta o formulario\n todoForm.reset();\n return false;\n };\n //cria li \n const tarefa = document.createElement('li');\n //atribui a caracteristica draggable para todo li criado, para que possa ser arrastado\n tarefa.setAttribute('draggable', true);\n\n\n //evento adicionado ao ul (todoLista). dragstart é o começo, o que vamos agarrar (drag)\n todoLista.addEventListener('dragstart', function(e) {\n dragging = e.target.closest('li')\n })\n //closest pega o elemento mais proximo da caixa principal onde rola o evento\n\n //dragover é pra arrastar o elemento. funciona como uma sobra que segura o elemento que estava no start, pra poder deslocar\n todoLista.addEventListener('dragover', function(e) {\n //prevent default pra permitir arrastar. o padrao de drag é agarrar e soltar\n e.preventDefault()\n //closest pega o elemento mais proximo da caixa principal\n const node = e.target.closest('li')\n this.insertBefore(dragging, node)\n })\n\n //dragend é o lugar onde vamos soltar, ou seja, fazer o drop\n todoLista.addEventListener('dragend', function(e) {\n dragging = null //valor null pra conseguirmos pegar outros elementos pra arrastar\n })\n\n //cria checkbox\n let checkbox = document.createElement(\"input\");\n checkbox.setAttribute(\"type\", \"checkbox\");\n checkbox.setAttribute(\"id\", inputText.value);\n checkbox.setAttribute(\"name\", inputText.value); \n checkbox.addEventListener(\"input\", checarTodosMarcados) // Chama checar todos marcados porque o valor da variavel todosFeitos pode precisar ser atualizado\n tarefa.appendChild(checkbox);\n\n //mudar linha\n function sublinhado(){\n document.getElementById(\"todoInput\").style.fontStyle = \"italic\";\n }\n\n //cria label\n let label = document.createElement('label');\n label.innerHTML = inputText.value;\n label.setAttribute(\"for\", inputText.value);\n tarefa.appendChild(label);\n\n \n //botão de fechamento\n let button = document.createElement('button');\n button.innerText = \"x\";\n tarefa.appendChild(button);\n button.addEventListener('click', () => {\n todoLista.removeChild(tarefa);\n })\n\n // function feita() {\n // if (checkbox.checked == true) {\n // document.getElementById('label').style.color = \"grey\";\n // }\n // }\n // checkbox.addEventListener('click', feita)\n\n //adiciona tarefa na lista\n todoLista.appendChild(tarefa);\n //reseta o formulario\n todoForm.reset();\n }", "function addElement(){\n\tlet todoText = todoInput.value\n\tif(todoText!=\"\"){\n\t\ttodoListeView.innerHTML+=todo(todoText)\n\t\tlet checkboxes = document.querySelectorAll(\"input[type='checkbox']\")\n\t\tcheckboxes.forEach((checkbox)=>{\n\t\t\tcheckbox.onclick = ()=>{\n\t\t\t\tconsole.log(checkbox.checked)\n\t\t\t\tif(checkbox.checked)\n\t\t\t\t\tchecked+=1\n\n\t\t\t\telse \n\t\t\t\t\tchecked-=1\n\t\t\t\tratioView.innerText = `Ratio des tache : ${checked} / ${counter}`\n\t\t\t}\n\t\t})\n\t\t//vider l'input\n\t\ttodoInput.value=\"\"\n\t\tcounter++\n\t\tcounterView.innerText = `Nombre de tache : ${counter}`\n\t\tratioView.innerText = `Ratio des tache : ${checked} / ${counter}`\n\n\t}else{\n\t\t// matnajamch tzid element\n\t\talert(\"matnjamch tzid ekteb 7aja\")\n\t}\n\t\n}", "function boucleJeu() {\n\n var nouvelInterval = Date.now();\n\n\n\n //SI au premier instant du jeu on initialise le debut de l'interval a quelque chose\n if (!debutInterval) {\n debutInterval = Date.now();\n }\n\n gestionnaireObjets.repositionnerObjets(Bouteille, nouvelInterval);\n gestionnaireObjets.repositionnerObjets(Obstacle, nouvelInterval);\n gestionnaireObjets.repositionnerObjets(Voiture, nouvelInterval);\n\n\n //Si le nouveau temps est plus grand que l'accelaration souhaiter par rapport au début de l'interval\n if (nouvelInterval - debutInterval >= 20) {\n vitesseRoute += 0.005;\n\n debutInterval = nouvelInterval;\n }\n\n //Appliquer les déplacements\n gestionnaireObjets.deplacerLesObjets(vitesseRoute);\n }", "agregar(usuario) {\n this.lista.push(usuario);\n }", "function formulaire(){\n $(\"main\").text(\"\");\n let recup = JSON.parse(httprequest.responseText);\n $(\"main\").append(recup[0]);\n $(\"#enregistrement\").click(function(){\n $(\"main\").text(\"\");\n $(\"main\").append(recup[1]);\n creation();\n });\n $(\"#connexion\").click(function(){\n connexion();\n });\n}", "function addTodo(todo) {\r\n todo.push(todo);\r\n displayTodos();\r\n}", "quickAdd() {\n }", "function User_Insert_TVA_Liste_des_T_V_A_0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 4\n\nId dans le tab: 154;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 155;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 156;\nsimple\nNbr Jointure: 1;\n Joint n° 0 = comptegen,cg_numero,cg_numero\n\nId dans le tab: 157;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\n******************\n*/\n\n var Table=\"tva\";\n var CleMaitre = TAB_COMPO_PPTES[150].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var tv_taux=GetValAt(154);\n if (!ValiderChampsObligatoire(Table,\"tv_taux\",TAB_GLOBAL_COMPO[154],tv_taux,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"tv_taux\",TAB_GLOBAL_COMPO[154],tv_taux))\n \treturn -1;\n var tv_code=GetValAt(155);\n if (!ValiderChampsObligatoire(Table,\"tv_code\",TAB_GLOBAL_COMPO[155],tv_code,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"tv_code\",TAB_GLOBAL_COMPO[155],tv_code))\n \treturn -1;\n var cg_numero=GetValAt(156);\n if (cg_numero==\"-1\")\n cg_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"cg_numero\",TAB_GLOBAL_COMPO[156],cg_numero,true))\n \treturn -1;\n var tv_actif=GetValAt(157);\n if (!ValiderChampsObligatoire(Table,\"tv_actif\",TAB_GLOBAL_COMPO[157],tv_actif,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"tv_actif\",TAB_GLOBAL_COMPO[157],tv_actif))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",tv_taux,tv_code,cg_numero,tv_actif\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(tv_taux==\"\" ? \"null\" : \"'\"+ValiderChaine(tv_taux)+\"'\" )+\",\"+(tv_code==\"\" ? \"null\" : \"'\"+ValiderChaine(tv_code)+\"'\" )+\",\"+cg_numero+\",\"+(tv_actif==\"true\" ? \"true\" : \"false\")+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "async addNewOcjenaAktivnost(){\n await dbAddNewOcjenaAktivnost(this);\n }", "function User_Insert_Groupe_de_tables_Liste_des_groupes_de_tables0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 2\n\nId dans le tab: 102;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 103;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\n******************\n*/\n\n var Table=\"groupetable\";\n var CleMaitre = TAB_COMPO_PPTES[99].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var gt_libelle=GetValAt(102);\n if (!ValiderChampsObligatoire(Table,\"gt_libelle\",TAB_GLOBAL_COMPO[102],gt_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"gt_libelle\",TAB_GLOBAL_COMPO[102],gt_libelle))\n \treturn -1;\n var gt_tables=GetValAt(103);\n if (!ValiderChampsObligatoire(Table,\"gt_tables\",TAB_GLOBAL_COMPO[103],gt_tables,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"gt_tables\",TAB_GLOBAL_COMPO[103],gt_tables))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",gt_libelle,gt_tables\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(gt_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(gt_libelle)+\"'\" )+\",\"+(gt_tables==\"\" ? \"null\" : \"'\"+ValiderChaine(gt_tables)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "function submitAddTarefa() {\r\n\r\n /* Definicao das variaveis a serem usadas */\r\n let jsPref_1 = document.getElementById('pref_1').value;\r\n let jsPref_2 = document.getElementById('pref_2').value;\r\n let jsPref_3 = document.getElementById('pref_3').value;\r\n let peso1 = document.getElementById('pesoPref_1').value;\r\n let peso2 = document.getElementById('pesoPref_2').value;\r\n let peso3 = document.getElementById('pesoPref_3').value;\r\n let tManha = document.getElementById('turnoManha').checked;\r\n let tTarde = document.getElementById('turnoTarde').checked;\r\n let tNoite = document.getElementById('turnoNoite').checked;\r\n\r\n let turno;\r\n let cor1 = selecionadorCor(jsPref_1);\r\n let cor2 = selecionadorCor(jsPref_2);\r\n let cor3 = selecionadorCor(jsPref_3);\r\n\r\n //actionAddTarefa(\"hist\", \"#caeaf5\", \"mat\", \"#0e91bd \", \"port\", \"#f5deb3\", 1);\r\n\r\n\r\n if (validarInput() == false) {\r\n console.log('ERROR: Missing Field')\r\n }\r\n else {\r\n console.log('Todos campos preenchidos')\r\n btnCloseAdd()\r\n\r\n // Verificacao do turno\r\n if (tManha)\r\n turno = 1\r\n else if (tTarde)\r\n turno = 2\r\n else if (tNoite)\r\n turno = 3\r\n\r\n // Verificacao do peso \r\n if (peso1 > peso2 && peso2 > peso3)\r\n actionAddTarefa(jsPref_1, cor1, jsPref_2, cor2, jsPref_3, cor3, turno)\r\n\r\n else if (peso2 > peso1 && peso1 > peso3)\r\n actionAddTarefa(jsPref_2, cor2, jsPref_1, cor1, jsPref_3, cor3, turno)\r\n\r\n else if (peso3 > peso1 && peso1 > peso2)\r\n actionAddTarefa(jsPref_3, cor3, jsPref_1, cor1, jsPref_2, cor2, turno)\r\n\r\n else if (peso1 > peso3 && peso3 > peso2)\r\n actionAddTarefa(jsPref_1, cor1, jsPref_3, cor3, jsPref_2, cor2, turno)\r\n\r\n else if (peso2 > peso3 && peso3 > peso1)\r\n actionAddTarefa(jsPref_2, cor2, jsPref_3, cor3, jsPref_1, cor1, turno)\r\n\r\n else if (peso3 > peso2 && peso2 > peso1)\r\n actionAddTarefa(jsPref_3, cor3, jsPref_2, cor2, jsPref_1, cor1, turno)\r\n }\r\n\r\n console.log(`================================`);\r\n console.log(`cor1 = ${cor1}`);\r\n console.log(`cor2 = ${cor2}`);\r\n console.log(`cor3 = ${cor3}`);\r\n console.log(`================================`);\r\n}", "function addStudentToList(id,name) {\n students2.push({\n id: id,\n name: name,\n isLoggeIn: false,\n requestConection() {\n console.log('deseo ingresar a clases');\n }\n });\n}", "function add() {\r\n DlgHelper.AjaxAction(\"/schedule/add/\", \"POST\", function (data) {\r\n\r\n if (data != null && data != \"\") {\r\n refresh().done(function () { DlgHelper.ShowDialogSuccess(\"Добавлено: \" + data, 1000); });\r\n } else {\r\n DlgHelper.ShowDialogError(\"Неверный ввод...\", 2000);\r\n }\r\n\r\n });\r\n }", "Add() {\n\n }", "Add() {\n\n }", "function User_Insert_Impressions_Liste_des_modèles_d_impressions0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 8\n\nId dans le tab: 229;\nsimple\nNbr Jointure: 1;\n Joint n° 0 = societe,im_societe,so_numero\n\nId dans le tab: 230;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 231;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 232;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 233;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 234;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 235;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 236;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\n******************\n*/\n\n var Table=\"table_impression\";\n var CleMaitre = TAB_COMPO_PPTES[226].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var im_societe=GetValAt(229);\n if (im_societe==\"-1\")\n im_societe=\"null\";\n if (!ValiderChampsObligatoire(Table,\"im_societe\",TAB_GLOBAL_COMPO[229],im_societe,true))\n \treturn -1;\n var im_libelle=GetValAt(230);\n if (!ValiderChampsObligatoire(Table,\"im_libelle\",TAB_GLOBAL_COMPO[230],im_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"im_libelle\",TAB_GLOBAL_COMPO[230],im_libelle))\n \treturn -1;\n var im_nom=GetValAt(231);\n if (!ValiderChampsObligatoire(Table,\"im_nom\",TAB_GLOBAL_COMPO[231],im_nom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"im_nom\",TAB_GLOBAL_COMPO[231],im_nom))\n \treturn -1;\n var im_modele=GetValAt(232);\n if (!ValiderChampsObligatoire(Table,\"im_modele\",TAB_GLOBAL_COMPO[232],im_modele,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"im_modele\",TAB_GLOBAL_COMPO[232],im_modele))\n \treturn -1;\n var im_defaut=GetValAt(233);\n if (!ValiderChampsObligatoire(Table,\"im_defaut\",TAB_GLOBAL_COMPO[233],im_defaut,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"im_defaut\",TAB_GLOBAL_COMPO[233],im_defaut))\n \treturn -1;\n var im_keytable=GetValAt(234);\n if (!ValiderChampsObligatoire(Table,\"im_keytable\",TAB_GLOBAL_COMPO[234],im_keytable,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"im_keytable\",TAB_GLOBAL_COMPO[234],im_keytable))\n \treturn -1;\n var im_keycle=GetValAt(235);\n if (!ValiderChampsObligatoire(Table,\"im_keycle\",TAB_GLOBAL_COMPO[235],im_keycle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"im_keycle\",TAB_GLOBAL_COMPO[235],im_keycle))\n \treturn -1;\n var im_keydate=GetValAt(236);\n if (!ValiderChampsObligatoire(Table,\"im_keydate\",TAB_GLOBAL_COMPO[236],im_keydate,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"im_keydate\",TAB_GLOBAL_COMPO[236],im_keydate))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",im_societe,im_libelle,im_nom,im_modele,im_defaut,im_keytable,im_keycle,im_keydate\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+im_societe+\",\"+(im_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(im_libelle)+\"'\" )+\",\"+(im_nom==\"\" ? \"null\" : \"'\"+ValiderChaine(im_nom)+\"'\" )+\",\"+(im_modele==\"\" ? \"null\" : \"'\"+ValiderChaine(im_modele)+\"'\" )+\",\"+(im_defaut==\"true\" ? \"true\" : \"false\")+\",\"+(im_keytable==\"\" ? \"null\" : \"'\"+ValiderChaine(im_keytable)+\"'\" )+\",\"+(im_keycle==\"\" ? \"null\" : \"'\"+ValiderChaine(im_keycle)+\"'\" )+\",\"+(im_keydate==\"\" ? \"null\" : \"'\"+ValiderChaine(im_keydate)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "function CrearJugador() {\n if (validarFormCrear() == true) {\n var existe = false;\n for (var vc = 0; vc < Jugadores.length; vc = vc + 1) {\n var jug = Jugadores[vc].Alias;\n if (jug.localeCompare($(\"#Nick\").val()) == 0) {\n $(\"#Nick\").css(\"border\", \"1px solid red\");\n errorMsg(\"Nick Name ya existente, intenta con uno nuevo\");\n existe = true;\n }\n }\n if (existe == false) {\n newPlayer($(\"#Nombjug\").val(), $(\"#DocID\").val(), $(\"#Direcc\").val(), $(\"#EM\").val(), $(\"#Nick\").val(), $(\"#Pass\").val());\n }\n }\n }", "function addBtnFunctionality(){\r\n let btns = document.getElementsByClassName('btnTarjeta');\r\n for (let index = 0; index < btns.length; index++) {\r\n btns[index].addEventListener('click', agregarCarrito);\r\n }\r\n }", "add(clave, valor) {\n if (typeof clave == \"string\") {\n var indx = this.findIndex(this.#elementos, clave);\n if (indx != -1)\n this.#elementos[indx].valor = valor;\n else\n this.#elementos.push({ clave, valor });\n }\n }", "function add() {\n\n //faz as verificações acima antes de adicionar o elemento a lista\n if (verNum(number.value) && !verList(number.value, numeros)) {\n numeros.push(Number(number.value))\n\n //adiciona o elemento a lista\n let item = document.createElement('option')\n item.text = `Valor ${num.value} adicionado`\n list.appendChild(item)\n\n } else {\n window.alert('Número inválido ou já adicionado na lista')\n }\n\n //limpa o campo #num ao adicionar o valor a lista\n num.value = ''\n num.focus()\n}", "function agregarAlCarrito() {\n /* Función que agrega un producto al carrito. utiliza el atributo \"alt\" del botón clickeado para obtener el código del producto a agregar. Cada vez que se agrega un producto se vuelve a generar la tabla que se muestra en pantalla.*/\n var elCodigo = $(this).attr(\"alt\");\n var laPosicion = buscarCodigoProducto(elCodigo);\n var productoAgregar = listadoProductos[laPosicion];\n carrito[carrito.length] = productoAgregar;\n armarTablaCarrito();\n }", "function addTodos(todo) {\n todos.push(todo);\n displayTodos();\n}", "function addJerk(jerk) {\n //gotta make sure he's not already on here\n let jerkStatus = false;\n for(let i = 0; i < jerkList.length; i++) {\n if (jerk === jerkList[i]) {\n jerkStatus = true;\n break;\n }\n }\n if(jerkStatus === true) {\n return\n } else {\n jerkList.push(jerk);\n return\n }\n }", "add(element) {}", "function addEntries() {\n\n}", "function addComment(autor, descricao) {\n if (autor != undefined && descricao != undefined) {\n arrayComments.push(new Comment(\n autor,\n descricao\n ));\n } else {\n arrayComments.push(new Comment(\n activeUser.nome,\n $(\"#txtComment\").val()\n ));\n }\n console.log(\"Adicionado novo comentário: \" + JSON.stringify(arrayComments[arrayComments.length - 1]));\n //console.log(arrayComments);\n}", "function genereTournoi(){\n\n selecteurMatch = -1;\n bd.tournoi.tours = [];\n joueurAttente = [];\n\n //init\n for (var i = 0; i < bd.joueurs.length; i++){\n bd.joueurs[i].adversaires = [];\n bd.joueurs[i].coequipiers = [];\n bd.joueurs[i].points = 0;\n }\n\n var nbMatch;\n for (var i = 0; i < bd.tournoi.nbTour; i++){\n mettreJoueursDansSac(); //on met tous les joueurs selectionné dans un sac et on mélange\n populateAllMatchs(); //on générre tous les matchs possibles à partir des joueurs dans sac\n\n //nombre de mathc par tour\n nbMatch = Math.min(\n Math.floor(sac.length / (typeTournoiListe.SIMPLE ? 2 : 4)), \n allMatchs.length,\n bd.tournoi.nbTerrain\n );\n\n //on teste tous les matchs en les priorisant\n for (var j = 0; j < allMatchs.length; j++){\n testContraintes(allMatchs[j]);\n }\n //on tri la liste\n allMatchs.sort((m1, m2) => m1.pointContrainte - m2.pointContrainte);\n var matchs = [];\n var currentMatch;\n for (var j = 0; j < nbMatch; j++){\n if (allMatchs.length == 0) break; //s'il n'y a plus de match dispo on sort\n currentMatch = allMatchs[0];\n matchs.push(currentMatch);\n //attribution adversaires\n for (var k = 0; k < currentMatch[\"equipeA\"].length; k++){\n j1 = currentMatch[\"equipeA\"][k];\n for (var m = 0; m < currentMatch[\"equipeB\"].length; m++){\n j2 = currentMatch[\"equipeB\"][m];\n if (!j1.adversaires.includes(j2)) j1.adversaires.push(j2); \n if (!j2.adversaires.includes(j1)) j2.adversaires.push(j1); \n }\n }\n //et coequipiers equipe A\n var j1, j2;\n for (var k = 0; k < currentMatch[\"equipeA\"].length; k++){\n j1 = currentMatch[\"equipeA\"][k];\n for (var m = 0; m < currentMatch[\"equipeA\"].length; m++){\n j2 = currentMatch[\"equipeA\"][m];\n if (j1 != j2){\n if (!j1.coequipiers.includes(j2)) j1.coequipiers.push(j2);\n if (!j2.coequipiers.includes(j1)) j2.coequipiers.push(j1);\n }\n }\n }\n //et coequipiers equipe B\n var j1, j2;\n for (var k = 0; k < currentMatch[\"equipeB\"].length; k++){\n j1 = currentMatch[\"equipeB\"][k];\n for (var m = 0; m < currentMatch[\"equipeB\"].length; m++){\n j2 = currentMatch[\"equipeB\"][m];\n if (j1 != j2){\n if (!j1.coequipiers.includes(j2)) j1.coequipiers.push(j2);\n if (!j2.coequipiers.includes(j1)) j2.coequipiers.push(j1);\n }\n }\n }\n //on supprime tous les match ayant des joueurs déjà affecté sur ce tour\n allMatchs = allMatchs.filter(match => \n match.equipeA.filter(joueur => currentMatch.equipeA.includes(joueur)).length == 0 && \n match.equipeB.filter(joueur => currentMatch.equipeB.includes(joueur)).length == 0 &&\n match.equipeA.filter(joueur => currentMatch.equipeB.includes(joueur)).length == 0 &&\n match.equipeB.filter(joueur => currentMatch.equipeA.includes(joueur)).length == 0\n );\n\n //on supprime du sac les joueurs affectés a currentMatch\n var currentIndexOf;\n for (var k = 0; k < currentMatch.equipeA.length; k++){\n currentIndexOf = sac.indexOf(currentMatch.equipeA[k]);\n if (currentIndexOf != -1) sac.splice(currentIndexOf, 1);\n }\n for (var k = 0; k < currentMatch.equipeB.length; k++){\n currentIndexOf = sac.indexOf(currentMatch.equipeB[k]);\n if (currentIndexOf != -1) sac.splice(currentIndexOf, 1);\n }\n\n }\n\n //on ajoute dans joueur attente les joueurs restant dans le sac\n var flag;\n for (var k = 0; k < sac.length; k++){\n flag = false;\n for (var m = 0; m < joueurAttente.length; m++) {\n if (joueurAttente[m].name == sac[k].name){\n joueurAttente[m][\"nb\"]++;\n flag = true;\n }\n }\n if (!flag) joueurAttente.push({\"name\": sac[k].name, \"nb\": 1});\n }\n\n bd.tournoi.tours.push({\"matchs\": matchs, \"joueurAttente\": sac});\n }\n\n}", "function AddOuvreur( yearNum, creneau) {\n $.ajax({\n type: \"GET\",\n url: 'index.php',\n data:{\n \t page:'add_ouvreur',\n \t iDate: yearNum,\n \t iCreneau: creneau\n },\n \n success : function(msg, statut){ // success est toujours en place, bien sûr !\n\t var msg = $.parseJSON(msg);\n\t if(msg.success=='Oui')\n\t {\n\t \t $.alert({\n\t\t\t\t\t\tcolumnClass: 'medium',\n\t\t\t\t title : 'Ajouter un ouvreur',\n\t\t\t\t content : msg.data\n\t\t\t\t\t});\n\t \t \n\t \t // Rechargement de la page\n\t \t location.reload(true);\n\t return true;\n\t }\n\t else\n\t {\n\t \t $.alert({\n\t\t\t\t\t\tcolumnClass: 'medium',\n\t\t\t\t title : 'Ajouter un ouvreur',\n\t\t\t\t content : 'Erreur sur le serveur !'\n\t\t\t\t\t});\n\t return false;\n\t }\n },\n\n error : function(resultat, statut, erreur){\n \t $.alert({\n\t\t\t\t\tcolumnClass: 'medium',\n\t\t\t title : 'Ajouter un ouvreur',\n\t\t\t content : 'Erreur lors de la mise à jour !'\n\t\t\t\t});\n },\n \n complete : function(resultat, statut){\n\n }\n });\n }", "function addOne(tweeps, theOne)// tweeps here only belongs to this function it doesnt mean the global tweeps. any name would do\n{\n tweeps.push(theOne)\n return tweeps;\n}", "function addOne(tweeps, theOne)// tweeps here only belongs to this function it doesnt mean the global tweeps. any name would do\n{\n tweeps.push(theOne)\n return tweeps;\n}", "function addTodos(todo) {\n todos.push(todo)\n displayTodos()\n}", "function addTodos(todos) {\n todos.forEach(function(todo){\n addTodo(todo);\n })\n}", "function addTodo() {\n\ttodos.push('new todos');\n\tdisplayTodos(); // We can use function inside a other function\n}", "function addNewJoke() {\n let jokeToBeAdded = document.getElementById(IDaddJokeEx1Field).value;\n jokeFacade.addJoke(jokeToBeAdded);\n makeListItems();\n document.getElementById(IDprintJokeEx1P).innerHTML = jokeToBeAdded;\n\n // Clear text field\n document.getElementById(IDaddJokeEx1Field).value = \"\";\n}", "add(element){\n this.addLast(element);\n }", "add(data){\n // se crea el elemento desde la clase node\n const newNode = new node(data,null);\n // si la cabeza tiene un valor de nulo esta toma el valor del nuevo nodo\n if(!this.head){\n this.head = newNode;\n // si ya tiene datos comenzamos a recorrer la lista desde head\n }else{\n // guardamos el valor actual de head en current\n let current = this.head;\n // mientras exista un valor dentro del nuevo nodo.next este ciclo se repetira\n while(current.next){\n current = current.next;\n };\n // al salir del ciclo le asignamos el valor del nuevo nodo al ultimo nodo.next\n current.next = newNode;\n }\n // incrementamos el tamaño de la lista\n this.size++;\n }", "function addPays(name, alpha, capital, region, subregion, population, area, flag, currencies, languages, demonym, top, native, borders){\r\n \r\n /* Une valeur unique pour ces éléments*/\r\n tp.textContent = cutName(name);\r\n title.textContent = cutName(name); \r\n stitle.textContent = alpha;\r\n capi.textContent = capital; \r\n reg.textContent = region; \r\n scont.textContent = subregion; \r\n popu.textContent = cutNumber(population) + ' M';\r\n sup.textContent = cutNumber(area) + ' Km²'; \r\n hab.textContent = demonym;\r\n tld.textContent = top;\r\n natname.textContent = native;\r\n drap.src = flag;\r\n // console.log(reg.textContent);\r\n\r\n /*Plusieurs valeurs possible dans ces éléments*/\r\n let money_name = currencies.map(i => i.name);\r\n for(let i=0; i < currencies.length; i++){\r\n const money = document.createElement('li');\r\n money.textContent = money_name[i];\r\n monaie.appendChild(money)\r\n }\r\n \r\n let langage_name = languages.map(i => i.name);\r\n for(let i=0; i < languages.length; i++){\r\n const langue = document.createElement('li');\r\n langue.textContent = langage_name[i];\r\n lang.appendChild(langue)\r\n }\r\n\r\n /*Partie pays frontalier avec conditions et possibilité de lien*/\r\n if(borders.length === 0){\r\n pf.textContent = \"NO BORDER COUNTRIES\"\r\n }else{\r\n pf.textContent = \"BORDER COUNTRIES\"\r\n for(let i=0; i<borders.length; i++){\r\n //construction des éléments via boucle\r\n const voisin = document.createElement('li');\r\n const aref = document.createElement('a');\r\n voisin.className = \"btnbord\"\r\n cutName(borders[i]);\r\n aref.dataset.land = borders[i]\r\n // console.log(aref.dataset.land)\r\n aref.addEventListener('click', (ev)=> {\r\n choixPays = borders[i];\r\n select(URL, choixPays)\r\n backToTop()\r\n })\r\n //construction requete AJAX pour les pays frontaliers en affichant leurs nom sans parenthèses ou autres compléments\r\n let requestIso = new XMLHttpRequest();\r\n requestIso.open(\"GET\", URL + borders[i], true);\r\n requestIso.addEventListener(\"readystatechange\", () => {\r\n if (requestIso.readyState === XMLHttpRequest.DONE && requestIso.status === 200) {\r\n aref.textContent = cutName(JSON.parse(requestIso.responseText).name);\r\n vois.appendChild(voisin);\r\n voisin.appendChild(aref);\r\n } \r\n });\r\n requestIso.send();\r\n }\r\n }\r\n }", "constructor(){\n this.ju1 = new Jugador(1, 'X');\n this.ju2 = new Jugador(2, 'O');\n this.actual = this.ju1;\n this.tab = new Juego();\n this.ganador = 0;\n this.liGanad = [[0,1,2],\n [3,4,5],\n [6,7,8],\n [0,3,6],\n [1,4,7],\n [2,5,8],\n [0,4,8],\n [2,4,6]];\n }", "function addBuchungen(kalender, buchungen){\r\r\n//\tconsole.debug(buchungen);\r\r\n\tfor(var i=0;i<buchungen.length; i++){\r\r\n\t\tvar erstesFeld = true;\r\r\n\t\tvar editable = (buchungen[i].username == kalender_user);\r\r\n//\t\tconsole.debug(buchungen[i].username, kalender_user, editable);\r\r\n\t\t\r\r\n\t\t// zeitfenster der buchung\r\r\n\t\tvar datum = new Date(buchungen[i].datum);\r\r\n\t\tvar tag = datum.getDay()==0?6:datum.getDay()-1; // sonntag ist 6 statt 0, die anderen werden verschoben\r\r\n\t\tvar begin = new Uhrzeit(buchungen[i].t_begin);\r\r\n\t\tvar end = new Uhrzeit(buchungen[i].t_end);\r\r\n//\t\tconsole.debug(tag, begin, ende);\r\r\n\t\t\r\r\n\t\tfor(jetzt = begin;jetzt.compareTo(end) < 0;jetzt.addMin(30)){\r\r\n//\t\t\tconsole.debug(jetzt, end, jetzt.compareTo(end));\r\r\n\t\t\t\r\r\n\t\t\tvar selector = '#timeSlot_' + tag + '_' + jetzt.stunde + '_' + jetzt.minute;\r\r\n\t\t\tif(!(timeSlot = kalender_html.querySelector(selector))) break;\r\r\n//\t\t\tconsole.debug(selector, timeSlot);\r\r\n\t\t\t\r\r\n\t\t\ttimeSlot.classList.add('active');\r\r\n\t\t\ttimeSlot.classList.toggle('editable', editable);\r\r\n\t\t\ttimeSlot.buchung = buchungen[i];\r\r\n\t\t\t\r\r\n\t\t\tif(erstesFeld){ // wird nur einmal ausgefuehrt\r\r\n\t\t\t\terstesFeld = false;\r\r\n\t\t\t\ttimeSlot.innerHTML = buchungen[i].username;\r\r\n\t\t\t\ttimeSlot.classList.add('erstesFeld');\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t}\r\r\n}", "function ajouterArticle(){\n if(panier[props.id]) {\n panier[props.id].qte++;\n }\n else{\n panier[props.id] = {prix: props.prix, qte: 1}\n }\n // mntnt il faut changer letat du panuer avec setPanier\n // il faut passer a setPanier un NOUVEL objet (obtenu par clonage)\n setPanier(JSON.parse(JSON.stringify(panier))); \n // setPanier({...panier})\n // console.log(panier);\n }", "function enviarComentario(){\r\n let comentarioAEnviar = {\r\n user:document.getElementById(\"comentarioUsuario\").value,\r\n description:document.getElementById(\"comentario\").value,\r\n score:parseInt(document.getElementById(\"comentarioPuntuacion\").value),\r\n dateTime:Fecha()\r\n };\r\n comentarios.push(comentarioAEnviar);\r\n showProductComments();\r\n}", "function criarLembrete(){\n\tvar conteudoTextArea = document.getElementById(\"texto\").value;\n\tif(!textoValido(conteudoTextArea)){\n\t\tmostrarError();\n\n\t}\n\n\tlimparError();\n\n\t// criar as variaveis para tempo\n\tvar referencia = new Date();\n\tvar id = referencia.getTime();\n\tvar data = referencia.toLocaleDateString();\n\tvar texto = conteudoTextArea;\n\n\t//JSON\n\tvar recordatorio = {\"id\": id, \"data\": data,\"texto\": texto};\n\n\t//função para comprovar se existe lembrete\n\tcomprovarRecordatorio(recordatorio);\n}", "function womAdd(func)\r\n{\r\n woms[woms.length] = func;\r\n}", "function addToGui( \n guiElemenent , // gui element to add options into\n obj, // object that holds parameters\n paramList, // array of strings that contains list \n // of parmeters to be added\n solverList // array of solvers that need to be update upon \n // change of a parameter through gui interactions\n ){\n let elements = {} ;\n for(let param of paramList){\n elements[param] = \n guiElemenent.add(obj, param ).onChange( ()=> {\n Abubu.setUniformInSolvers( \n param, obj[param], solverList ) ;\n } ) ;\n }\n return elements ;\n}", "function activiteAjout(id){\t\t\n\t//si utilisateur present dans l'activite, on incremente de 1 son nombre de requete.\n\tif(activiteBoolId(id)){\t\t\t\t\n\t\t//on parcourt notre array d'activite\n\t\tfor (let i = 0; i < clesActivite.length; i++) {\t\t\t\n\t\t\t// on incremente de 1 le nombre de requete de l'utlisateur(Id)\n\t\t\tif(clesActivite[i][0] == id){\t\n\t\t\t\tclesActivite[i][1] += 1\t\t\t\t\n\t\t\t}\n\t\t}\t\t\t\t\n\t}else{\n\t\t//si array d'activite vide, on ajoute l'utisateur et son nombre d'activite à 1.\n\t\tclesActivite.push([id,1]);\t\n\t}\t\n}", "function addProduit (id, nom, prix) {\n\tlet detailProduit = [id, nom, prix];\n\tcontenuPanier.push(detailProduit);\n\tlocalStorage.panier = JSON.stringify(contenuPanier);\n\tcountProduits();\n}", "function ajoutArticlePanier(){\n\n for(let i = 0; i < elAccueil.length; i++){\n boutonPanierAcceuil[i] = document.querySelector(\"#bouton-panier-\"+i);\n }\n \n boutonPanierAcceuil[0].addEventListener(\"click\", () =>{\n articlePanier[0].classList.remove(\"none\");\n iArticle0++;\n });\n boutonPanierAcceuil[1].addEventListener(\"click\", () =>{\n iArticle1++;\n articlePanier[1].classList.remove(\"none\");\n });\n boutonPanierAcceuil[2].addEventListener(\"click\", () =>{\n iArticle2++;\n articlePanier[2].classList.remove(\"none\");\n });\n boutonPanierAcceuil[3].addEventListener(\"click\", () =>{\n iArticle3++;\n articlePanier[3].classList.remove(\"none\");\n });\n boutonPanierAcceuil[4].addEventListener(\"click\", () =>{\n iArticle4++;\n articlePanier[4].classList.remove(\"none\");\n });\n}", "function addEventsTablaEj(){\r\n let filasDeTabla = document.querySelectorAll(\".filaEjercicioAlumno\"); //Sumo funcionalidad para mostrar ejercicio al alumno\r\n for(let i=0; i<filasDeTabla.length; i++){\r\n const element = filasDeTabla[i];\r\n element.addEventListener(\"click\", mostrarEjElegido);\r\n }\r\n}", "function User_Insert_Types_d_attribut_Catégories_2(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 2\n\nId dans le tab: 33;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 34;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\n******************\n*/\n\n var Table=\"categorie\";\n var CleMaitre = TAB_COMPO_PPTES[31].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n /* COMPOSANT LISTE AVEC JOINTURE SIMPLE */\n var cr_libelle=GetValAt(33);\n if (!ValiderChampsObligatoire(Table,\"cr_libelle\",TAB_GLOBAL_COMPO[33],cr_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"cr_libelle\",TAB_GLOBAL_COMPO[33],cr_libelle))\n \treturn -1;\n var cr_description=GetValAt(34);\n if (!ValiderChampsObligatoire(Table,\"cr_description\",TAB_GLOBAL_COMPO[34],cr_description,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"cr_description\",TAB_GLOBAL_COMPO[34],cr_description))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",ta_numero,cr_libelle,cr_description\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+TAB_COMPO_PPTES[28].NewCle+\",\"+(cr_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(cr_libelle)+\"'\" )+\",\"+(cr_description==\"\" ? \"null\" : \"'\"+ValiderChaine(cr_description)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "function agregarCurso(indice) {\r\n cursosElegidos.push(cursos[indice])\r\n // console.log(cursoElegido) \r\n\r\n diagramarCursos()\r\n sumadordePrecios();\r\n\r\n\r\n}", "addJetons(y ,x){\n\t\t\n\t\tthis.grid[y][x] = this.turn;\n\t\tthis.count_turn++;\n\t\t// console.log(\"count-turn :\",this.count_turn);\n\t\tif (this.turn === this.player_one) {\n\t\t\t$(`tr:nth-child(${y+1}) td:nth-child(${x+1})`).addClass(\"player1\");\n\t\t}\n\t\telse {\n\t\t\t$(`tr:nth-child(${y+1}) td:nth-child(${x+1})`).addClass(\"player2\");\n\t\t}\n\n\t\t// switch de joueurs\n\t\tthis.turn = (this.player_one === this.turn) ? this.player_two : this.player_one;\n\t\t\n\t\t// checkwin appliquer sur nos col, lgn et this.turn\n\t\tif (this.checkWin(y, x, this.grid[y][x])) {\n\t\t\t\n\t\t\talert(\"le joueur :\"+ this.grid[y][x]+\"a gagner\");\n\n\t\t\tif (confirm(\"voulez vous recommencer la partie ??\")) {\n\t\t\t\t// $(\"td\").addClass(\"restartGame\").attr(\"data-col\");\n\t\t\t\tthis.endGame(y,x);\n\t\t\t}\n\t\t}\n\n\t\t// match null si 42 count atteind\n\t\tif(this.count_turn === this.max_turn) {\n\t\t\talert(\"Match null\");\n\t\t\tthis.endGame(y,x);\n\t\t}\n\t}", "initAdd() {\n const button = this.jq.wrapper.find(this.jq.add)\n const _this = this\n button.on('click', function (e) {\n e.preventDefault()\n _this.addOne()\n })\n }", "function User_Update_Types_de_journaux_Liste_des_types_de_journaux0(Compo_Maitre)\n{\n var Table=\"typejournal\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var tj_libelle=GetValAt(201);\n if (!ValiderChampsObligatoire(Table,\"tj_libelle\",TAB_GLOBAL_COMPO[201],tj_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"tj_libelle\",TAB_GLOBAL_COMPO[201],tj_libelle))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"tj_libelle=\"+(tj_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(tj_libelle)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "function addTodo(event) {\r\n //anuleaza refreshul provenit din submit\r\n event.preventDefault();\r\n\r\n\r\n let ok = 0;\r\n for (let i=1; i<=todoList.childElementCount; i++){\r\n if(todoList.childNodes[i].innerText === todoInput.value){\r\n ok = 1;\r\n }\r\n }\r\n if(ok){\r\n alert(\"This already exists! Add something else!\");\r\n } else{\r\n \r\n //creez todo div ce contine element si buton de stergere\r\n const todoDiv = document.createElement(\"div\");\r\n todoDiv.classList.add(\"todo-div\");\r\n\r\n //creez element pt div\r\n const todoNew = document.createElement(\"li\");\r\n todoNew.innerText = todoInput.value;\r\n todoNew.classList.add(\"todo-item\");\r\n todoDiv.appendChild(todoNew);\r\n\r\n //adaugare in local storage\r\n saveLocalTodos(todoInput.value);\r\n\r\n\r\n //creez buton de completed\r\n const completBtn = document.createElement(\"button\");\r\n completBtn.innerHTML = `<i class=\"fas fa-check\"></i>`;\r\n completBtn.classList.add(\"complete-btn\");\r\n todoDiv.appendChild(completBtn);\r\n\r\n //creez buton de delete\r\n const deleteBtn = document.createElement(\"button\");\r\n deleteBtn.innerHTML = `<i class=\"fas fa-trash\"></i>`;\r\n deleteBtn.classList.add(\"delete-btn\");\r\n todoDiv.appendChild(deleteBtn);\r\n\r\n //atasare la lista principlata\r\n todoList.appendChild(todoDiv);\r\n\r\n //sterg textul din input\r\n todoInput.value = \"\";\r\n }\r\n}", "function addElementAtStartArray(tableau, nouvelElement){\n tableau.push(nouvelElement)\n}", "function User_Insert_Profils_de_droits_Liste_des_profils_de_droits0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 2\n\nId dans le tab: 90;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 91;\ncomplexe\nNbr Jointure: 1;\n Joint n° 0 = droit,dp_numero,dp_numero\n\n******************\n*/\n\n var Table=\"droitprofil\";\n var CleMaitre = TAB_COMPO_PPTES[88].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var dp_libelle=GetValAt(90);\n if (!ValiderChampsObligatoire(Table,\"dp_libelle\",TAB_GLOBAL_COMPO[90],dp_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"dp_libelle\",TAB_GLOBAL_COMPO[90],dp_libelle))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",dp_libelle\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(dp_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(dp_libelle)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}" ]
[ "0.6989579", "0.6597122", "0.63563573", "0.62625104", "0.6201763", "0.61757743", "0.59878564", "0.5944662", "0.5917507", "0.59056556", "0.58264595", "0.581973", "0.5817277", "0.5803665", "0.5797754", "0.5756482", "0.5730177", "0.57014817", "0.570115", "0.56993467", "0.5693006", "0.5667497", "0.56633914", "0.56257963", "0.56250644", "0.5583135", "0.55735075", "0.5557005", "0.5555798", "0.55538374", "0.5550401", "0.5548385", "0.5540651", "0.5517267", "0.5508715", "0.55027944", "0.54988235", "0.54985577", "0.5487264", "0.5459338", "0.54528075", "0.5449971", "0.54450375", "0.54444367", "0.5443662", "0.5434356", "0.5433483", "0.54180145", "0.5417098", "0.54099375", "0.5405563", "0.5405279", "0.53946453", "0.5385772", "0.5384656", "0.5379062", "0.53767306", "0.5375361", "0.5375361", "0.5370536", "0.5368268", "0.5359903", "0.5359162", "0.5351829", "0.53410095", "0.5340613", "0.53392464", "0.5336385", "0.53323525", "0.5325792", "0.5320544", "0.53183746", "0.5317421", "0.5317421", "0.53157794", "0.53121465", "0.530282", "0.5299219", "0.5298819", "0.5298509", "0.52974135", "0.52953494", "0.5291971", "0.528916", "0.527813", "0.52738404", "0.5268972", "0.526691", "0.5264739", "0.5261853", "0.5260352", "0.52572286", "0.52543956", "0.52541685", "0.52478063", "0.52474445", "0.5246244", "0.52457494", "0.5235485", "0.5230778" ]
0.5742897
16
declaration de ma function tirage_au_sort
function tirage_au_sort () { //tester la longueur de la chaine if (joueurs.length >0) { /* - déclaration d'une variable - methode mathematique pour melanger des donnees - tirage au sort d'une donnee - indication de la longueur de mon tableau joueurs */ var rand = Math.floor(Math.random()*joueurs.length); // afficher le nom du gagnant// document.getElementById("affiche_gagnant").innerHTML="Le gagnant est : <strong> "+joueurs[rand]+"</strong>"; } else { alert("Vous n'avez pas inscrit de joueurs !!!") } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Sort() {}", "sort() {\n\t}", "sort() {\n\t}", "sort(){\n\n }", "Sort() {\n\n }", "function sortData (data) {\n ...\n}", "function funzioneSort(type) {\n\tvar freturn;\n\n\ttype= Number(type)\n\n\tswitch (type) {\n\t\tcase 0:\n\t\t\t\t\t\tfreturn=function(a,b) {\n\t\t\t\t\t\t\tvar tita = $(a).find(\"h3\").text();\n\t\t\t\t\t\t\tvar titb = $(b).find(\"h3\").text();\n\n\t\t\t\t\t\t\tif (tita >= titb) {\n\t\t\t\t\t\t\t\treturn 1\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn -1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\tbreak;\n\t\tcase 1:\n\t\t\t\t\t\tfreturn=function(a,b) {\n\t\t\t\t\t\t\tvar tita = $(a).find(\"h3\").text();\n\t\t\t\t\t\t\tvar titb = $(b).find(\"h3\").text();\n\n\t\t\t\t\t\t\tif (tita <= titb) {\n\t\t\t\t\t\t\t\treturn 1\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn -1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\tbreak;\n\t\tcase 2:\n\t\t\t\t\tfreturn=function(a,b) {\n\n\t\t\t\t\t\tvar datia = $(a).find(\"section strong\");\n\t\t\t\t\t\tvar datib = $(b).find(\"section strong\");\n\n\t\t\t\t\t\tvar lungha = parseFloat($(datia[0]).text())\n\t\t\t\t\t\tvar lunghb = parseFloat($(datib[0]).text())\n\n\t\t\t\t\t\tif (lungha >= lunghb) {\n\t\t\t\t\t\t\treturn 1\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn -1\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t\t\tfreturn=function(a,b) {\n\t\t\t\t\t\t\tvar datia = $(a).find(\"section strong\");\n\t\t\t\t\t\t\tvar datib = $(b).find(\"section strong\");\n\n\t\t\t\t\t\t\tvar lungha = parseFloat($(datia[0]).text())\n\t\t\t\t\t\t\tvar lunghb = parseFloat($(datib[0]).text())\n\n\t\t\t\t\t\t\tif (lungha >= lunghb) {\n\t\t\t\t\t\t\t\treturn -1\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn 1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t\t\tfreturn=function(a,b) {\n\t\t\t\t\t\t\tvar datia = $(a).find(\"span.full\");\n\t\t\t\t\t\t\tvar datib = $(b).find(\"span.full\");\n\n\t\t\t\t\t\t\tif (datia.length >= datib.length) {\n\t\t\t\t\t\t\t\treturn 1\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn -1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\t\t\tfreturn=function(a,b) {\n\t\t\t\t\t\t\t\tvar datia = $(a).find(\"span.full\");\n\t\t\t\t\t\t\t\tvar datib = $(b).find(\"span.full\");\n\n\t\t\t\t\t\t\t\tif (datia.length < datib.length) {\n\t\t\t\t\t\t\t\t\treturn 1\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\treturn -1\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\t\tfreturn=function(a,b) {\n\t\t\t\t\t\t\t\t\tvar datia = $(a).find(\"section div.row div.col-md-9 span.gps-txt\");\n\t\t\t\t\t\t\t\t\tvar datib = $(b).find(\"section div.row div.col-md-9 span.gps-txt\");\n\n\t\t\t\t\t\t\t\t\tvar distA = parseFloat($(datia).text())\n\t\t\t\t\t\t\t\t\tvar distB = parseFloat($(datib).text())\n\n\t\t\t\t\t\t\t\t\tif (distA < distB) {\n\t\t\t\t\t\t\t\t\t\treturn -1\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\treturn 1\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 7:\n\t\t\t\t\t\t\t\t\tfreturn=function(a,b) {\n\t\t\t\t\t\t\t\t\t\tvar datia = $(a).find(\"section div.row div.col-md-9 span.gps-txt\");\n\t\t\t\t\t\t\t\t\t\tvar datib = $(b).find(\"section div.row div.col-md-9 span.gps-txt\");\n\n\t\t\t\t\t\t\t\t\t\tvar distA = parseFloat($(datia).text())\n\t\t\t\t\t\t\t\t\t\tvar distB = parseFloat($(datib).text())\n\n\t\t\t\t\t\t\t\t\t\tif (distA < distB) {\n\t\t\t\t\t\t\t\t\t\t\treturn 1\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\treturn -1\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t}\n\n\treturn freturn\n}", "function kartenSortieren() {\n hand.sort(sortByvalue);\n hand.sort(sortBybild);\n handkarten();\n}", "function sortFunction ( a, b ) { \n\t\t if (a[0] - b[0] != 0) {\n\t\t return (a[0] - b[0]);\n\t\t } else if (a[1] - b[1] != 0) { \n\t\t return (a[1] - b[1]);\n\t\t } else { \n\t\t return (a[2] - b[2]);\n\t\t }\n\t\t }", "function sorter(a,b) {\n return a - b;\n}", "function sort(theArray){\n\n}", "async function TopologicalSort(){}", "function sortArray() {\n\n //PRZYPISANIE WARTOSCI DO TABLICY\n var points = [41, 3, 6, 1, 114, 54, 64];\n\n //SORTOWANIE OD NAJMNIEJSZEJ DO NAJWIEKSZEJ\n points.sort(function (a, b) {\n //POROWNANIE DWOCH ELEM. TABLICY - MNIEJSZY STAWIA PO LEWEJ, WIEKSZY PO PRAWEJ\n return a - b;\n });\n\n //ZWROCENIE POSORTOWANEJ TABLICY\n return points;\n}", "function Sort(arr)\n{\n\n}", "function quickSort() {}", "function sortab(a,b){\n return a - b;\n }", "sort () {\n\n\t\tthis.Dudes.sort((a, b) => {\n\t\t\treturn b.amIToughEnough(this.fitnessFunction) - a.amIToughEnough(this.fitnessFunction);\n\t\t});\n\n\t}", "function ComparisonSort(e,t,n){this.init(e,t,n)}", "function sortArray() {\n //Twoj komentarz ...\n //deklaracje tablicy z elemtami\n var points = [41, 3, 6, 1, 114, 54, 64];\n\n //Twoj komentarz ...\n points.sort(function(a, b) {\n //Twoj komentarz ...\n\n return a - b;\n });\n\n //Twoj komentarz ...\n //zwrócenie tablicy points\n return points;\n}", "function sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}", "function sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}", "function sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}", "function sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}", "function sort(unsortedArray) {\n // Your code here\n}", "function alphabetique(){\n entrepreneurs.sort.year\n }", "function sortFunction(val){\n return val.sort();\n}", "function sortirajSveRastuce() {\r\n console.log(\"SORTIRANJE\");\r\n console.log(nizPrikazanihProizvoda);\r\n let tempNiz = nizPrikazanihProizvoda;\r\n tempNiz.sort((a,b) => {\r\n if(a.cena == b.cena)\r\n return 0;\r\n return a.cena < b.cena ? -1 : 1;\r\n });\r\n prikaziProizvode(tempNiz);\r\n}", "function sortirajSveOpadajuce() {\r\n console.log(\"SORTIRANJE\");\r\n console.log(nizPrikazanihProizvoda);\r\n let tempNiz = nizPrikazanihProizvoda;\r\n tempNiz.sort((a,b) => {\r\n if(a.cena == b.cena)\r\n return 0;\r\n return a.cena > b.cena ? -1 : 1;\r\n });\r\n prikaziProizvode(tempNiz);\r\n}", "function sortFunction(arrTemp,orderAsc,sortElementType){\r\n var temp ;\r\n var value1;\r\n var value2;\r\n \r\n // alert(\"in sortFunction\");\r\n \r\n for(i=0;i<arrTemp.length;i++){\r\n\t\t for(j=0;j<arrTemp.length-1;j++){\r\n\t\t\t \r\n\t\t\t //extract value depedning on data type\r\n\t\t\t if(sortElementType=='N'){\r\n\r\n\t\t\t\t \tif(arrTemp[j][0] == \"\"){\r\n\t\t\t\t\t\tvalue1 = -1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t {\r\n\t\t\t\t\t\tvalue1 = eval(arrTemp[j][0]);\r\n\t\t\t\t }\r\n\t\t\t\t\tif(arrTemp[j+1][0] == \"\"){\r\n\t\t\t\t\t\tvalue2 = -1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t {\r\n\t\t\t\t\t\tvalue2 = eval(arrTemp[j+1][0]);\r\n\t\t\t\t }\r\n\r\n\t\t\t\t \r\n\r\n\t\t\t }\r\n\t\t\t else if (sortElementType == 'D'){\r\n\t\t\t\t\tdataVal1 = convertDateFormat(arrTemp[j][0])\r\n\t\t\t\t\tdataVal2 = convertDateFormat(arrTemp[j+1][0])\r\n\t\t\t\t\tif(dataVal1 == \"\"){\r\n\t\t\t\t\t\tdataVal1 = \"01/01/1900\"\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(dataVal2 == \"\"){\r\n\t\t\t\t\t\tdataVal2 = \"01/01/1900\"\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvalue1 = new Date(dataVal1);\r\n\t\t\t\t\tvalue2 = new Date(dataVal2);\r\n\t\t\t }\r\n\t\t\t else if (sortElementType == 'A'){\r\n\t\t\t\t // alert('proper call to sort A Function');\r\n\t\t\t\t value1 = arrTemp[j][0];\r\n\t\t\t\t // alert(value1);\r\n\t\t\t\t value2 = arrTemp[j+1][0];\r\n\t\t\t\t value1 = value1.toUpperCase();\r\n\t\t\t\t value2 = value2.toUpperCase();\r\n\t\t\t\t if(value1 == \"\"){\r\n\t\t\t\t\t value1 = \"zzzzzzzzzzzzzzzzzzzz\";\r\n\t\t\t\t }\r\n\t\t\t\t if(value2 == \"\"){\r\n\t\t\t\t\t value2 = \"zzzzzzzzzzzzzzzzzzzz\";\r\n\t\t\t\t }\r\n\t\t\t\t // alert(value2);\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t//\t alert('Improper call to sort Function');\r\n\t\t\t\t return false;\r\n\t\t\t }\r\n\r\n\t\t\tif(sortElementType=='N'){\r\n\t\t\t\tif(value1!=value2){\r\n\t\t\t\t\tif(orderAsc && (value1 < value2)){\r\n\t\t\t\t\t\ttemp = arrTemp[j];\r\n\t\t\t\t\t\tarrTemp[j] = arrTemp[j+1];\r\n\t\t\t\t\t\tarrTemp[j+1] = temp;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(!orderAsc && (value1 > value2)){\r\n\t\t\t\t\t\ttemp = arrTemp[j];\r\n\t\t\t\t\t\tarrTemp[j] = arrTemp[j+1];\r\n\t\t\t\t\t\tarrTemp[j+1] = temp;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//return;\r\n\t\t\t}\r\n\r\n\t\t\t //apply interchange of data elements to sort in order\r\n\t\t\t if(value1!=value2 && sortElementType!='N')\r\n\t\t\t\t {\r\n\t\t\t\t\t\t//alert(value1 + ':::' + value2);\r\n\t\t\t\t\t if(orderAsc && ((value1 < value2)||((value1=='')&&(value2!=''))))\r\n\t\t\t\t\t{\r\n\t\t\t//\t\t\t alert('interchanging');\r\n\r\n\t\t\t///\t\t\t alert('j b4 changing' + arrTemp[j]);\r\n\t\t\t//\t\t\t alert('j + 1 b4 changing' + arrTemp[j + 1]);\r\n\t\t\t\t\t\ttemp = arrTemp[j];\r\n\t\t\t\t\t\tarrTemp[j] = arrTemp[j+1];\r\n\t\t\t\t\t\tarrTemp[j+1] = temp;\r\n\t\t\t\t//\t\talert('j after changing' + arrTemp[j]);\r\n\t\t\t\t//\t\talert('j + 1 after changing' +arrTemp[j + 1]);\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t if(!orderAsc && ((value1 > value2)||(value1=='')&&(value2!='')))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttemp = arrTemp[j];\r\n\t\t\t\t\t\tarrTemp[j] = arrTemp[j+1]\r\n\t\t\t\t\t\tarrTemp[j+1] = temp;\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t }\r\n\t}\r\n\r\n//\talert('Leaving sort Function');\r\n\r\n}", "sort() {\n const a = this.dict;\n const n = a.length;\n\n if( n < 2 ) { // eslint-disable-line \n } else if( n < 100 ) {\n // insertion sort\n for( let i = 1; i < n; i += 1 ) {\n const item = a[ i ];\n let j = i - 1;\n while( j >= 0 && item[ 0 ] < a[ j ][ 0 ] ) {\n a[ j + 1 ] = a[ j ];\n j -= 1;\n }\n a[ j + 1 ] = item;\n }\n } else {\n /**\n * Bottom-up iterative merge sort\n */\n for( let c = 1; c <= n - 1; c = 2 * c ) {\n for( let l = 0; l < n - 1; l += 2 * c ) {\n const m = l + c - 1;\n const r = Math.min( l + 2 * c - 1, n - 1 );\n if( m > r ) continue;\n merge( a, l, m, r );\n }\n }\n }\n }", "function ordena(v){\n //algoritmo do buble sort\n for(let i=0; i<v.length; i++){\n for(let j=0;j<v.length-1; j++){\n if(v[j]> v[j+1]){\n //troca\n let aux = v[j]\n v[j] = v[j+1]\n v[j+1] = aux\n }\n }\n }\n //return v\n}", "function twpro_sortJobs(){\r\n\t\tif (TWPro.twpro_failure) return;\r\n\t\tvar sortby = TWPro.twpro_jobsort, twpro_jobValues = TWPro.twpro_jobValues;\r\n\t\tvar sortfunc = function(twpro_a, twpro_b){\r\n\t\t\tvar twpro_a_str = twpro_a.name,\r\n\t\t\t\ttwpro_b_str = twpro_b.name;\r\n\t\t\tif(sortby == 'name'){\r\n\t\t\t\treturn twpro_a_str.localeCompare(twpro_b_str);\r\n\t\t\t}\r\n\t\t\tif(sortby == 'comb'){\r\n\t\t\t\treturn (twpro_jobValues[twpro_a.shortName].jobrank == twpro_jobValues[twpro_b.shortName].jobrank) ? twpro_a_str.localeCompare(twpro_b_str) : (twpro_jobValues[twpro_b.shortName].jobrank - twpro_jobValues[twpro_a.shortName].jobrank);\r\n\t\t\t}\r\n\t\t\tif(sortby == 'erfahrung'){\r\n\t\t\t\treturn (twpro_jobValues[twpro_a.shortName].experience == twpro_jobValues[twpro_b.shortName].experience) ? twpro_a_str.localeCompare(twpro_b_str) : (twpro_jobValues[twpro_b.shortName].experience - twpro_jobValues[twpro_a.shortName].experience);\r\n\t\t\t} if(sortby == 'lohn'){\r\n\t\t\t\treturn (twpro_jobValues[twpro_a.shortName].wages == twpro_jobValues[twpro_b.shortName].wages) ? twpro_a_str.localeCompare(twpro_b_str) : (twpro_jobValues[twpro_b.shortName].wages - twpro_jobValues[twpro_a.shortName].wages);\r\n\t\t\t} if(sortby == 'glueck'){\r\n\t\t\t\treturn (twpro_jobValues[twpro_a.shortName].luckvaluemax == twpro_jobValues[twpro_b.shortName].luckvaluemax) ? twpro_a_str.localeCompare(twpro_b_str) : (twpro_jobValues[twpro_b.shortName].luckvaluemax - twpro_jobValues[twpro_a.shortName].luckvaluemax);\r\n\t\t\t} if(sortby == 'gefahr'){\r\n\t\t\t\treturn (twpro_jobValues[twpro_a.shortName].danger == twpro_jobValues[twpro_b.shortName].danger) ? twpro_a_str.localeCompare(twpro_b_str) : (twpro_jobValues[twpro_a.shortName].danger - twpro_jobValues[twpro_b.shortName].danger);\r\n\t\t\t} else {\r\n\t\t\t\treturn (twpro_jobValues[twpro_a.shortName][sortby] == twpro_jobValues[twpro_b.shortName][sortby]) ? twpro_a_str.localeCompare(twpro_b_str) : (twpro_jobValues[twpro_b.shortName][sortby] - twpro_jobValues[twpro_a.shortName][sortby]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tTWPro.twpro_jobs.sort(sortfunc);\r\n\t\t//if(sortby == 'danger') TWPro.twpro_jobs.reverse();\r\n\t}", "sort() {\n let a = this.array;\n const step = 1;\n let compares = 0;\n for (let i = 0; i < a.length; i++) {\n let tmp = a[i];\n for (var j = i; j >= step; j -= step) {\n this.store(step, i, j, tmp, compares);\n compares++;\n if (a[j - step] > tmp) {\n a[j] = a[j - step];\n this.store(step, i, j, tmp, compares);\n } else {\n break;\n }\n }\n a[j] = tmp;\n this.store(step, i, j, tmp, compares);\n }\n this.array = a;\n }", "function sortFunction(){\r\n // parse arguments into an array\r\n var args = [].slice.call(arguments);\r\n return args.sort();\r\n}", "sort(){\n\t\tvar sortable = [];\n\t\tfor (var vehicle in this.primes) {\n\t\t sortable.push([vehicle, this.primes[vehicle]]);\n\t\t}\n\t\treturn sortable.sort(function(a, b) {\n\t\t return a[1] - b[1];\n\t\t});\n\t}", "sortData() {\n this.data.sort(($val1, $val2 ) => {\n const a = JSON.stringify($val1[this.sortBy]);\n const b = JSON.stringify($val2[this.sortBy]);\n if ( a < b ){\n return -this.sortDir;\n }\n if ( a > b ){\n return this.sortDir;\n }\n return 0;\n });\n }", "function sortRows(){\n sortRowsAlphabeticallyUpwards();\n}", "function toogleSort(){\r\n\t\tif(settings.sort_type=='desc'){\r\n\t\t\tsettings.sort_type='asc';\r\n\t\t }else{\r\n\t\t\t settings.sort_type='desc';\r\n\t\t }\r\n\t}", "function sortirajSveRastuce() {\r\n let tempNiz = nizPrikazanihProizvoda;\r\n tempNiz.sort((a,b) => {\r\n if(a.cena == b.cena)\r\n return 0;\r\n return a.cena < b.cena ? -1 : 1;\r\n });\r\n prikaziProizvode(tempNiz);\r\n}", "sort () {\r\n this._data.sort((a, b) => a.sortOrder !== b.sortOrder ? b.sortOrder - a.sortOrder : a.value.localeCompare(b.value))\r\n }", "function sortujPoTytule() {\n \n // resetujemy monit o dodaniu filmu (aby caly czas sie nie wyswietlal)\n // paragraf ten bedzie istnial juz w dokumencie HTML\n // przy pierwszym wywolaniu tej funkcji\n parWalidacjaDodanegoFilmu.innerHTML = \"\";\n\n if (tytulRosnaco) {\n\t// mozliwosc przeslania wlasnej funkcji sortujacej daje duza plastycznosc\n\tlistOfMovies.sort((a, b) => getTitle(a).localeCompare(getTitle(b)));\n\ttytulRosnaco = !tytulRosnaco;\n\t\n\t// update-owanie napisu w przycisku\n\t// przy kazdym sortowaniu zmieni sie wartosc przecisku aby\n\t// uzytkownik wiedzial co i jak\n\t// przy pierwszym wywolaniu tej funkcji zmienna przyciskSortujPoTytule\n\t// (patrz nizej bedzie juz istniala)\n\tprzyciskSortujPoTytule.value = \"Sortuj po tytule (malejąco)\";\n\t\n\tusunListeKafelkow(); \t// usuwa liste kafelkow\n\t// a teraz ja odtwarza\n\toutput.appendChild(utworzListeKafelkow(listOfMovies));\n\t\n\t// updateujemy i wyswietlamy liczbe filmow i liczbe filmow widocznych\n\tupdateFilmyWszystkieIwidoczne();\n\twyswietlFilmyWszystkieIwidoczne();\n\n } else {\n\t// mozliwosc przeslania wlasnej funkcji sortujacej daje duza plastycznosc\n\tlistOfMovies.sort((a, b) => getTitle(b).localeCompare(getTitle(a)));\n\ttytulRosnaco = !tytulRosnaco;\n\n\t// update-owanie napisu w przycisku\n\t// przy kazdym sortowaniu zmieni sie wartosc przecisku\n\t// aby uzytkownik wiedzial co i jak\n\t// przy pierwszym wywolaniu tej funkcji zmienna przyciskSortujPoTytule\n\t// (patrz nizej) bedzie juz istniala\n\tprzyciskSortujPoTytule.value = \"Sortuj po tytule (rosnąco)\";\n\n\tusunListeKafelkow(); \t// usuwa liste kafelkow\n\t// a teraz ja odtwarza\n\toutput.appendChild(utworzListeKafelkow(listOfMovies));\n\t\n\t// updateujemy i wyswietlamy liczbe filmow i liczbe filmow widocznych\n\tupdateFilmyWszystkieIwidoczne();\n\twyswietlFilmyWszystkieIwidoczne();\n }\n\n // aby przy dodaniu filmu do listy posortowac je odpowiednio przy wyswietleniu\n // przy pierwszym wywolaniu tej funkcji zmienna ostatnoSortowanePo\n // bedzie juz istniala\n // (patrz nizej) bedzie juz istniala\n ostatnioSortowanePo = \"tytul\";\n}", "function sort_li(a, b) {\n console.log('in');\n an = Date.parse($(a).find('.col1').text());\n bn = Date.parse($(b).find('.col1').text());\n\n return bn < an ? 1 : -1;\n }", "tareasPorAntiguedad(){\n return this.tareas.sort((a,b) => b.antiguedad < a.antiguedad)\n }", "function smartSort(a, b) {\n switch (typeof(a)) {\n case \"string\": return d3.ascending(a, b);\n case \"number\": return a - b; //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort\n default: return d3.ascending(a, b);\n }\n }", "function sort() {\n // // parse arguments into an array\n var args = [].slice.call(arguments);\n\n // // .. do something with each element of args\n // // YOUR CODE HERE\n var sortedargs = args.sort(function(a, b) {\n return a > b ? 1 : -1\n })\n return sortedargs\n}", "function sortFunction(a, b) {\n $('#deus_loader span').text('Tri par mots clés');\n if (a.deus_keywords_similarities === b.deus_keywords_similarities) {\n if (a.note_deussearch === b.note_deussearch) {\n return 0;\n }\n if(a.note_deussearch < b.note_deussearch) {\n return 1;\n }\n if(a.note_deussearch > b.note_deussearch) {\n return -1;\n }\n }\n if(a.deus_keywords_similarities < b.deus_keywords_similarities) {\n return 1;\n }\n if(a.deus_keywords_similarities > b.deus_keywords_similarities) {\n return -1;\n }\n }", "function sortirajSveOpadajuce() {\r\n let tempNiz = nizPrikazanihProizvoda;\r\n tempNiz.sort((a,b) => {\r\n if(a.cena == b.cena)\r\n return 0;\r\n return a.cena > b.cena ? -1 : 1;\r\n });\r\n prikaziProizvode(tempNiz);\r\n}", "function VardenSorter2018(){\n var list, i, sortera, b, borSortera;\n list = document.getElementById(\"varden\");\n sortera = true;\n while (sortera) {\n sortera = false;\n b = list.getElementsByTagName(\"LI\");\n for (i = 0; i < (b.length - 1); i++) {\n borSortera = false; \n if (Number(b[i].innerHTML) < Number(b[i + 1].innerHTML)) {\n borSortera = true;\n break;\n }\n }\n if (borSortera) {\n b[i].parentNode.insertBefore(b[i + 1], b[i]);\n sortera = true;\n }\n }\n}", "sortBy() {\n // YOUR CODE HERE\n }", "function sortJson() {\r\n\t \r\n}", "function ageSort(){\n return function(people){\n people.sort(function(a,b){\n return a.age - b.age;\n });\n console.log(people);\n };\n }", "get overrideSorting() {}", "function sort(argument) {\r\n return argument.sort();\r\n}", "static finalSort(a, b){ return 0 }", "function ordenPorTitulos(misPeliculas){\n var titulos=misPeliculas.slice(0);\n titulos.sort(function(a,b){\n var x=a.titulo.toLowerCase();\n var y=b.titulo.toLowerCase();\n return x < y?-1:x>y?1:0;\n });\n console.log(titulos);\n}", "repeaterOnSort() {\n }", "function sortAssets2() {\r\n\t//}\r\n\tchangeList();\r\n\t}", "function sortfunction( p, q ) {\n\treturn p.x - q.x;\n}", "static sort(a)\n{//return a if array lenth is less then 2.\n if(a.length<2)\n return a;\n else{\n for(var i=0;i<a.length;i++){\n for(var j=0;j<a.length-i-1;j++)\n {//checks first value with next value\n if(a[j]>a[j+1]){\n //swap the values\n var temp=a[j];\n a[j]=a[j+1];\n a[j+1]=temp;\n }//end if\n }//end for j\n }//end for i\n }//end else\n//making the sorted array global\n module.exports.a=a;\n //returns a\n return a;\n}", "function numSort(a,b) { \n\t\t\t\treturn a - b; \n\t\t\t}", "function ascendente(col){ // uso de slice() para que no cambie el array original\n Equipos_sort= CpyEquipos_array.slice().sort(function(a,b){\n if (a.puntos[col] > b.puntos[col]) { // > ordena de mayor a menor\n return 1;\n }\n if (a.puntos[col] < b.puntos[col]) {\n return -1;\n }\n // a must be equal to b\n return 0;\n });\n}", "sorted(x) {\n super.sorted(0, x);\n }", "function ascSort(a,b){\n return a - b;\n }", "function updateSortFunction() {\n switch(sortBy.value) {\n case '0': // receiverId increasing\n sortFunction = function(tr1, tr2) {\n if(tr1.getElementsByTagName('td')[0].textContent <\n tr2.getElementsByTagName('td')[0].textContent) {\n return -1;\n };\n return 1;\n }\n break;\n case '1': // receiverId decreasing\n sortFunction = function(tr1, tr2) {\n if(tr1.getElementsByTagName('td')[0].textContent >\n tr2.getElementsByTagName('td')[0].textContent) {\n return -1;\n };\n return 1;\n }\n break;\n }\n sortReceiversAndHighlight();\n}", "function sort(a, b) {\n return a - b;\n}", "function sort_li(a, b) {\n an = Date.parse($(a).find('.col2').text());\n bn = Date.parse($(b).find('.col2').text());\n\n return bn < an ? 1 : -1;\n }", "function sortFunction(a, b) {\n if (a[1] === b[1]) {\n return 0;\n } else {\n return (a[1] > b[1]) ? -1 : 1;\n }\n }", "function sortArr(a, b){\n return a - b ;\n }", "function sortFunction(a, b) {\n if (a.EDT_for_sort === b.EDT_for_sort) {\n return 0;\n }\n else {\n return (a.EDT_for_sort < b.EDT_for_sort ? -1 : 1);\n }\n}", "function sortit(e)\n{\n var exp;\n if (typeof e == \"string\") {\n exp = e.split(\",\");\n last_sort = e;\n } else {\n exp = e.sortedlist.split(\",\");\n last_sort = e.sortedlist;\n }\n\n var sorter = [];\n var order=[];\n for(var i=0;i<exp.length;i++) {\n if (exp[i] === \"0\") continue;\n if (exp[i] === \"1\") {\n sorter.push(i);\n order.push(1);\n }\n else if (exp[i] == \"2\") {\n sorter.push(i);\n order.push(-1);\n }\n }\n\n var data;\n if (filtered_data == null) {\n data = raw_data.slice();\n } else {\n data = filtered_data.slice();\n }\n\n if (sorter.length == 0) {\n var dta = new async_emulator(data);\n views.view('table').data(dta);\n return;\n }\n\n // Do the Sort\n data.sort(function(a,b) {\n for(var i=0;i<sorter.length;i++) {\n var s = sorter[i];\n if ((a[s] == null && b[s] != null) || a[s] < b[s]) {\n if (order[i] > 0) return (-1)\n else return (1);\n } else if ((b[s] == null && a[s] != null) || a[s] > b[s]) {\n if (order[i] > 0) return (1);\n else return (-1);\n }\n }\n return (0);\n });\n\n var dta = new async_emulator(data);\n views.view('table').data(dta);\n}", "function mergeSort(array) {\n\n}", "function sorterTabell(tabellen) {\n var table = 0;\n var rader =0;\n var bytte= 0;\n var i= 0;\n var x= 0;\n var y= 0;\n var shouldSwitch= 0;\n var vei= 0;\n var switchcount = 0;\n table = document.getElementById(\"rapportTable\");\n vei = \"asc\";\n bytte = true;\n\n while (bytte) {\n bytte = false;\n rader = table.rows;\n for (i = 1; i < (rader.length - 1); i++) {\n shouldSwitch = false;\n y = rader[i + 1].getElementsByTagName(\"td\")[tabellen];\n x = rader[i].getElementsByTagName(\"td\")[tabellen];\n if (vei == \"asc\") {\n if (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase()) {\n shouldSwitch = true;\n break;\n }\n\n } else if (vei == \"desc\") {\n if (x.innerHTML.toLowerCase() < y.innerHTML.toLowerCase()) {\n shouldSwitch = true;\n break;\n }\n }\n }\n if (shouldSwitch) {\n rader[i].parentNode.insertBefore(rader[i + 1], rader[i]);\n bytte = true;\n switchcount ++;\n } else {\n if (switchcount == 0 && vei == \"asc\") {\n vei = \"desc\";\n bytte = true;\n }\n\n }\n\n\n }\n }", "function sortAction(array) {\n var arr = array \n arr.sort(function (a, b) {\n if(a.py + a.sy > b.py + b.sy) {\n return 1;\n }\n if(a.py + a.sy < b.py + b.sy) {\n return -1;\n }\n return 0;\n })\n return arr\n }", "function mergesort2(){\n console.log(\"mergesort - implement me !\");\n let a = new Array({dist:59},{dist:57},{dist:52},{dist:50},{dist:58},{dist:55},{dist:1},{dist:25},{dist:18},{dist:20})\n let profondeur = 1;\n ms2(csvData,profondeur,false); \n console.log(csvData);\n setupDisplay();\n //console.log(a);\n}", "function alfa (arr){\n\tfor (var i = 0; i< arr.length;i++){\n\t\tarr[i].sort();\n\t}\n\treturn arr;\n}", "function musasSortFunction(array){\n const sortedArray =[];\n//take all array \n array.forEach(element => {\n// for every element check new array\n for (let i = 0; i < array.length; i++) {\n// if array empty, push your element and stop loop\n if(sortedArray.length === 0){ \n sortedArray.push(element);\n break;\n }\n//if element smaller or equal than sortedArray element, put before than it and stop loop\n if(element <=sortedArray[i]){\n// console.log(`${element} smaller than ${sortedArray[i]} ----pushed array`);\n sortedArray.splice(i,0,element);\n break;\n// if you can not find until end of the array, its biggest element. push end of the sortedArray\n }else if(i === sortedArray.length-1){//arayin sonuna gelindi sona ekle\n sortedArray.push(element);\n break;\n }\n }\n });\n // console.log(`SORTED SOLUTION: ${sortedArray} k<<<<<<<<<<<<<`);\n return sortedArray;\n}", "function sort(d) {\r\n\t\t\t\tif (d.children) {\r\n\t\t\t\t d.children = senseD3.sortByLEROI(d.children, 'le_roi');\r\n\t\t\t\t d.children.forEach(function(child){\r\n\t\t\t\t \t\t\t\t\t\tsort(child);\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\treturn d;\r\n\t\t\t}", "function sortByMe(e) {\n // (1) This function is a click handler which coordinates sorting a column\n\n var arrow = e.toElement; // Which element received this event?\n var heading = arrow.id.split('-')[1]; // Find out which heading is ours\n\n var ascending = null;\n if (arrow.classList.contains('up')) {\n ascending = 'ascending';\n } else {\n ascending = 'descending';\n }\n\n sortTableBy(tracklist, sortBy(heading, ascending));\n}", "function subSort(arr) {\n // didnt get this one. try again\n}", "function sortAlpha(a, b){\r\n\t if(a < b) return -1;\r\n\t if(a > b) return 1;\r\n\t return 0;\r\n}//sortAlpha", "function sortFunction(a, b) {\n if (a[0] - b[0] != 0) {\n return a[0] - b[0];\n } else if (a[1] - b[1] != 0) {\n return a[1] - b[1];\n } else {\n return a[2] - b[2];\n }\n }", "function sort(){\n var toSort = S('#sched-list').children;\n toSort = Array.prototype.slice.call(toSort, 0);\n\n toSort.sort(function(a, b) {\n var a_ord = +a.id.split('e')[1]; //id tags of the schedule items are timeINT the INT = the numeric time\n var b_ord = +b.id.split('e')[1]; //splitting at 'e' and getting the element at index 1 gives use the numeric time\n\n return (a_ord > b_ord) ? 1 : -1;\n });\n\n var parent = S('#sched-list');\n parent.innerHTML = \"\";\n\n for(var i = 0, l = toSort.length; i < l; i++) {\n parent.appendChild(toSort[i]);\n }\n }", "function sortTable(column){\n\n}", "function rankitup(array) {\narray.sort(function(a, b){return a-b});\n}", "function sort(){\n myArray.sort(compareNumbers);\n\n showAray();\n}", "function numberSortFunction(a, b) {\n return a - b;\n}", "function resort(){\n if(scope.sorting && scope.sorting.obj){\n var sortKey = scope.sorting.obj.field;\n sorter(sortKey,scope.sorting.direction);\n }\n }", "function resort(){\n if(scope.sorting && scope.sorting.obj){\n var sortKey = scope.sorting.obj.field;\n sorter(sortKey,scope.sorting.direction);\n }\n }", "sort() {\n for (let i = 0; i < this.values.length - 1; i++) {\n let min = i;\n for (let j = i + 1; j < this.values.length; j++) {\n if (this.values[j] < this.values[min]) min = j;\n }\n\n this.swap(i, min);\n }\n }", "sort() {\r\n\t\treturn this.data.sort((a,b) => {\r\n\t\t\tfor(var i=0; i < this.definition.length; i++) {\r\n\t\t\t\tconst [code, key] = this.definition[i];\r\n\t\t\t\tswitch(code) {\r\n\t\t\t\t\tcase 'asc':\r\n\t\t\t\t\tcase 'desc':\r\n\t\t\t\t\t\tif (a[key] > b[key])\r\n\t\t\t\t\t\t\treturn code == 'asc' ? 1 : -1;\r\n\t\t\t\t\t\tif (a[key] < b[key])\r\n\t\t\t\t\t\t\treturn code == 'asc' ? -1 : 1;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'fn':\r\n\t\t\t\t\t\tlet result = key(a, b);\r\n\t\t\t\t\t\tif (result != 0) // If it's zero the sort wasn't decided.\r\n\t\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn 0;\r\n\t\t});\r\n\t}", "function askaron_sort(){\n\t$(\".sort__abc, sort__cba\").click(function(){\n\t\tvar ths = $(this);\n\t\tvar c = ths.closest(\".sort\");\n\t\tvar inx_col = ths.index();\n\t\tvar list = c.find(\".sort__list > td:nth-child(\"+(inx_col+1)+\")\").get();\n\t\t\n\t\t// Arrows\n\t\tths.toggleClass(\"sort__abc\").toggleClass(\"sort__cba\");\n\t\t\n\t\t// Sort\n\t\tlist.sort(function(a, b) {\n\t\t var compA = $(a).text().toUpperCase();\n\t\t var compB = $(b).text().toUpperCase();\n\t\t \n\t\t if(ths.hasClass(\"sort__abc\")){\n\t\t\t\treturn (compA < compB) ? -1 : (compA > compB) ? 1 : 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn (compA > compB) ? -1 : (compA < compB) ? 1 : 0;\n\t\t\t}\n\t\t \n\t\t});\n\t\t\n\t\t// Output\n\t\tvar prev_tr = false;\n\t\t$.each(list, function(idx, itm){\n\t\t\tvar tr_n = c.find(\".sort__list\").length;\n\t\t\tvar q = 0;\n\t\t\twhile(tr_n >= q){\n\t\t\t\tvar tr_c = c.find(\".sort__list:nth-child(\"+(q+2)+\")\");\n\t\t\t\tif(itm == tr_c.find(\"td\").get(inx_col)){\n\t\t\t\t\tif (prev_tr.length>0) {\n\t\t\t\t\t\tprev_tr.after(tr_c); \n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tc.find(\"th:last\").closest(\"tr\").after(tr_c); \n\t\t\t\t\t}\n\t\t\t\t\tprev_tr = tr_c;\n\t\t\t\t}\n\t\t\t\tq++;\n\t\t\t}\n\t\t});\n\t});\n}", "function sorte ( i ){\n return function(){\n if(scope.sorting.obj){\n //var index = _.findIndex(scope.viewer, scope.sorting.obj);\n }\n var key = scope.headers[i].field;\n if(scope.sorting.field === key){\n scope.sorting.direction = scope.sorting.direction * -1;\n }else{\n scope.sorting.field = key;\n scope.sorting.direction = 1;\n }\n sorter(key,scope.sorting.direction);\n scope.sorting.obj = scope.headers[i];\n scope.buildTable();\n\n };\n }", "function sorte ( i ){\n return function(){\n if(scope.sorting.obj){\n //var index = _.findIndex(scope.viewer, scope.sorting.obj);\n }\n var key = scope.headers[i].field;\n if(scope.sorting.field === key){\n scope.sorting.direction = scope.sorting.direction * -1;\n }else{\n scope.sorting.field = key;\n scope.sorting.direction = 1;\n }\n sorter(key,scope.sorting.direction);\n scope.sorting.obj = scope.headers[i];\n scope.buildTable();\n\n };\n }", "sortTwitsByDate( ) {\n this.twits.sort( (a, b) => {\n \n if (this.switchPosition == \"normal\");\n if (this.dateCompare(a,b)) {\n return 1;\n }\n if (!this.dateCompare(a,b)) {\n return -1;\n }\n if (this.switchPosition == \"reversed\"){\n if (!this.dateCompare(a,b)) {\n return 1;\n }\n if (this.dateCompare(a,b)) {\n return -1;\n }\n }\n return 0;\n });\n }", "function properSort(a, b) {\n if (a.times > b.times) {\n return -1;\n }\n if (b.times > a.times) {\n return 1;\n }\n return 0;\n }", "function invalidSortFunction(a, b) {\n return 'bad'\n}", "function mergeSort(arr) {\n\n}", "function sortujPoRoku() {\n \n // resetujemy monit o dodaniu filmu (aby caly czas sie nie wyswietlal)\n // paragraf ten bedzie istnial juz w dokumencie HTML\n // przy pierwszym wywolaniu tej funkcji\n parWalidacjaDodanegoFilmu.innerHTML = \"\";\n \n if (rokRosnaco) {\n\t// mozliwosc przeslania wlasnej funkcji sortujacej daje duza plastycznosc\n\t// getYear() zwraca rok jako string (np. \"1998\")\n\tlistOfMovies.sort((a, b) => parseInt(getYear(a)) - parseInt(getYear(b)));\n\trokRosnaco = !rokRosnaco;\n\t\n\t// update-owanie napisu w przycisku\n\t// przy kazdym sortowaniu zmieni sie wartosc przecisku \n\t// aby uzytkownik wiedzial co i jak\n\t// przy pierwszym wywolaniu tej funkcji zmienna przyciskSortujPoRoku\n\t// (patrz nizej bedzie juz istniala)\n\tprzyciskSortujPoRoku.value = \"Sortuj po roku (malejąco)\";\n\t\n\tusunListeKafelkow(); \t// usuwa liste kafelkow\n\t// a teraz ja odtwarza\n\toutput.appendChild(utworzListeKafelkow(listOfMovies));\n\t\n\t// updateujemy i wyswietlamy liczbe filmow i liczbe filmow widocznych\n\tupdateFilmyWszystkieIwidoczne();\n\twyswietlFilmyWszystkieIwidoczne();\n\t\n\n } else {\n\t// mozliwosc przeslania wlasnej funkcji sortujacej daje duza plastycznosc\n\t// getYear() zwraca rok jako string (np. \"1998\")\n\tlistOfMovies.sort((a, b) => parseInt(getYear(b)) - parseInt(getYear(a)));\n\trokRosnaco = !rokRosnaco;\n\n\t// update-owanie napisu w przycisku\n\t// przy kazdym sortowaniu zmieni sie wartosc przecisku\n\t// aby uzytkownik wiedzial co i jak\n\t// przy pierwszym wywolaniu tej funkcji zmienna przyciskSortujPoRoku\n\t// (patrz nizej bedzie juz istniala)\n\tprzyciskSortujPoRoku.value = \"Sortuj po roku (rosnąco)\";\n\t\n\tusunListeKafelkow(); \t// usuwa liste kafelkow\n\t// a teraz ja odtwarza\n\toutput.appendChild(utworzListeKafelkow(listOfMovies));\n\t\n\t// updateujemy i wyswietlamy liczbe filmow i liczbe filmow widocznych\n\tupdateFilmyWszystkieIwidoczne();\n\twyswietlFilmyWszystkieIwidoczne();\n\n }\n // aby przy dodaniu filmu do listy posortowac je odpowiednio przy wyswietleniu\n // przy pierwszym wywolaniu tej funkcji zmienna ostatnoSortowanePo\n // bedzie juz istniala\n ostatnioSortowanePo = \"rok\";\n}", "function sortFunc(a, b) {\n var aDate = new Date(a.time);\n var bDate = new Date(b.time);\n\n if (aDate > bDate) {\n return -1;\n } else if (aDate < bDate) {\n return 1;\n } else {\n return 0;\n }\n }", "function sortTableAlphabeticallyAscending(){\n sortAlphabeticallyAscending();\n}" ]
[ "0.77340084", "0.75063723", "0.75063723", "0.74498975", "0.72386485", "0.70577157", "0.70062983", "0.6817365", "0.6765226", "0.67633146", "0.6738104", "0.669977", "0.66935825", "0.6646647", "0.6622803", "0.66184086", "0.6615645", "0.66143537", "0.66125965", "0.66082346", "0.66082346", "0.66082346", "0.66082346", "0.66081315", "0.66052353", "0.66006434", "0.6583791", "0.65412104", "0.6528523", "0.65109926", "0.6507254", "0.6506474", "0.65019345", "0.64995605", "0.64958656", "0.64404935", "0.64374757", "0.6434587", "0.6428476", "0.6418275", "0.6418241", "0.6406727", "0.6390682", "0.63759923", "0.6369565", "0.6345158", "0.63276607", "0.6325991", "0.63254637", "0.63108283", "0.63091505", "0.62982", "0.6295325", "0.6280735", "0.62799597", "0.62798536", "0.6271007", "0.6265027", "0.6258908", "0.62585986", "0.6248083", "0.62456405", "0.62424237", "0.6237884", "0.6237588", "0.6223427", "0.6220189", "0.6215596", "0.6205818", "0.6201879", "0.6195905", "0.6194199", "0.61889106", "0.61878794", "0.6183895", "0.61781245", "0.61697435", "0.6166257", "0.61643255", "0.61566347", "0.6155793", "0.6144469", "0.6133805", "0.6131399", "0.61300725", "0.6128328", "0.61261994", "0.61261994", "0.61251646", "0.6123557", "0.6122715", "0.6119548", "0.6119548", "0.61092937", "0.6102585", "0.6098993", "0.60904884", "0.60884154", "0.6086721", "0.6081845" ]
0.6094798
96
create a function around the fs.readFile to call
function readJSON ( filename, callback ) { fs.readFile ( filename , function ( err , filedata ) { if (err) { console.log( "We have a problem broski :" + err ) } console.log(countryname) var jsondata = JSON.parse( filedata ) jsondata.forEach( function ( country ) { if ( country.name == countryname ) { // possibly client wants to output all the info from a country? console.log( "Country: " + country.name ) console.log( "Top Level Domain: " + country.topLevelDomain ) // tld field is an array and may contain more tld's } }) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "readFile (filepath, callback) {\n let option = {encoding: this.encoding, flag: 'r'}\n fs.readFile(filepath, option, (err, data) => {\n callback(err, data)\n })\n }", "static readFile(filepath, callback) {\n fs.readFile(filepath, function (err, data) {\n if (err)\n logger.warn(\"Error in reading file \", filepath, \" , error code: \", err.code, \", error message: \", err.message);\n callback(!err, data);\n }.bind(this));\n }", "function readFileFunction() {\n fs.readFile(name, 'utf8', (err, data) => {\n if (err) {\n // try to reading file up to maxTryCount\n tryCount++;\n if (tryCount >= attr.maxTryCount) {\n // error callback\n callback(true, null);\n clearInterval(tmrId);\n isReceiving = false;\n }\n return;\n }\n \n // Exception handling when json parsing\n var cbErr = false;\n try {\n var jsonData = JSON.parse(data); \n }\n catch (e) { \n cbErr = true; \n }\n\n // data callback\n callback(cbErr, jsonData);\n clearInterval(tmrId);\n\n // delete file\n /*\n fs.unlink(name, err => {\n if (err) throw err;\n });\n */\n\n isReceiving = false;\n }); \n }", "readFile(filePath) {\n return fs.readFileSync(path.resolve(filePath));\n }", "function readFile() {\n return fs.readFileSync(fileName);\n}", "function readFile(file_path) {\n return fs.readFileSync(file_path, 'utf8', function(err, data) { \n if (err) throw err;\n console.log(data);\n });\n}", "read() {\n return fs.readFileSync(this.filepath).toString();\n }", "function read(f)\n\t{\n\t\tt = fs.readFileSync(f, 'utf8', (err,txt) => {\n\t\t\tif (err) throw err;\n\t\t});\n\t\treturn t;\n\t}", "function read(f)\n{\n t = fs.readFileSync(f, 'utf8', (err,txt) => {\n if (err) throw err;\n });\n return t;\n}", "constructor (inFile, outFile) {\n this.inFile = inFile\n this.outFile = outFile\n this.readFile = function readFile (inFile) {\n return new Promise((resolve, reject) => {\n fs.readFile(inFile, 'utf8', (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n }", "fileCall(path) {\n var fileStream = require('fs');\n var f = fileStream.readFileSync(path, 'utf8');\n return f;\n // var arr= f.split('');\n // return arr;\n }", "_read () {\n let { filename } = this\n return new Promise((resolve, reject) =>\n fs.readFile((filename), (err, content) => err ? reject(err) : resolve(content))\n ).then(JSON.parse)\n }", "function FSReadFile(filePath, encoding, callback) {\n if(FileSystem.verbose) console.log(\"FileSystem.readFile(\" + filePath + \", \" + encoding + \")\");\n\n encoding = encoding || 'utf8';\n\n fs.readFile(filePath, encoding, function(err, data) {\n if (callback != null) {\n if (err) {\n console.log(err);\n }\n callback(err, data);\n }\n });\n}", "readFile(mfs, file) {\n try {\n return mfs.readFileSync(path.join(this.confClient.output.path, file), \"utf-8\")\n } catch (error) {}\n }", "static readFiles(){\n\t\treturn (context, arr) => {\n\t\t\tvar fs = context.createProvider(\"default:fs\");\n\t\t\tvar res = arr.map((file) => {\n\t\t\t\treturn Lib.readFile(fs, file);\n\t\t\t});\n\t\t\treturn res;\n\t\t}\n\t}", "function readFile(filename){\n return task(resolver => {\n console.log('duwenjian')\n fs.readFile(filename,'utf-8',(err,data) => {\n console.log('chufa')\n if(err) resolver.reject(err)\n resolver.resolve(data)\n })\n })\n}", "function FileReader () {}", "function whateverYouSay() {\n fs.readFile('random.txt', 'utf8', function(error, data) {\n \n if (error) {\n return console.log(error)\n }\n\n});\n}", "static readFile(callback) {\n DBHelper.fetchFile((error, data) => {\n if(error) {\n callback(error, null);\n }\n else {\n let reader = new FileReader();\n reader.readAsText(data);\n reader.onload = (event) => {\n let csv = event.target.result;\n let results = DBHelper.convertToJson(csv);\n callback(null, results);\n }\n reader.onerror = (event) => {\n if(event.target.error.name == \"NotReadableError\") {\n callback(`File cannot be read`, null);\n }\n }\n }\n });\n }", "function readFile(filename,callback, params){\n\tfs.readFile(filename, function(err, data){\n\t\tif (err){\n\t\t\tlogger.info(\"error reading file\", err);\n\t\t}\n\t\telse {\n\t\t\t//logger.info(\"Here are the params\", params);\n\t\t\tcallback(JSON.parse(data), params);\n\t\t}\n\t});\n\n\n}", "function readFile(onReceive,onError = function(e){console.error(e);}){\r\n\t//onRecieve is a function which handles your data in the file\r\n\tfs.readFile(phonebook, 'utf8' , (err, data) => {\r\n\t\tif (err) {\r\n\t\t\tonError(err);\r\n\t\t\treturn\r\n\t\t}\r\n\t\tonReceive(data);\r\n\t})\r\n}", "function readFile(fileName, cb){\n fs.readFile(fileName,'utf-8', function(err, data){\n cb(data);\n });\n}", "function readFileText(name,callback){\n process.nextTick(function () {\n var content=fs.readFileSync(name)\n callback(content.toString())\n })\n}", "static readFile(path) {\n path = pathHelper.resolve(path);\n logger.debug('Checking data file: ' + path);\n\n return fs.readFileSync(path, 'utf8');\n }", "function FileReader() {}", "readin () {\n this.content = readFile(this.path);\n }", "static readFile(evt, {path=null}){\n // must have file name\n if(!path){\n let err = \"No file name provided (path is null).\";\n IpcResponder.respond(evt, \"file-read\", {err});\n return;\n }\n\n // read file promise \n FileUtils.readFile(path)\n .then(str => {\n // got file contents \n // file name with forward slashes always\n let pathClean = path.replace(/\\\\/g, \"/\"); \n IpcResponder.respond(evt, \"file-read\", {path, pathClean, str});\n\n // update folder data\n FolderData.update({recentFilePaths: [path], lastFilePath: path});\n })\n .catch(err => {\n // error\n IpcResponder.respond(evt, \"file-read\", {err: err.message});\n });\n }", "function readFile(filename, callback) {\n fs.readFile(filename, function (err, data) {\n if(err) {\n callback(err);\n return;\n }\n try {\n callback(null, data);\n } catch(exception) {\n callback(exception);\n }\n });\n }", "function myfucntion(filePath){\n return new Promise(function fn(resolve , reject) {\n console.log(\"Hello\");\n // call back\n fs.readFile(filePath , function(err , data) {\n\n if(err){\n reject(err);\n\n } \n else {\n resolve(data);\n }\n });\n\n }) ;\n}", "function _openInputFile() {\r\n fs.open(src, 'r', function(err, infd) {\r\n\r\n if (err) {\r\n callback('Error opening source file for read: ' + err);\r\n return;\r\n }\r\n\r\n _openOutputFile(infd);\r\n });\r\n }", "function readFile() {\n fs.readFile(\"random.txt\", \"utf8\", function (error, data) {\n\n if (error) {\n return console.log(error);\n }\n\n var data = data.split(\",\");\n argument = data[0];\n search = data[1];\n console.log(argument, search);\n\n runSearch(argument, search);\n\n });\n}", "function readEntireTextFile(filepath, func) {\n var called = false;\n try {\n obj.fs.open(filepath, 'r', function (err, fd) {\n obj.fs.fstat(fd, function (err, stats) {\n var bufferSize = stats.size, chunkSize = 512, buffer = new Buffer(bufferSize), bytesRead = 0;\n while (bytesRead < bufferSize) {\n if ((bytesRead + chunkSize) > bufferSize) { chunkSize = (bufferSize - bytesRead); }\n obj.fs.readSync(fd, buffer, bytesRead, chunkSize, bytesRead);\n bytesRead += chunkSize;\n }\n obj.fs.close(fd);\n called = true;\n func(buffer.toString('utf8', 0, bufferSize));\n });\n });\n } catch (e) { if (called == false) { func(null); } }\n }", "function naive() {\n readFile('/sample.csv');\n}", "function readFile(file) {\n return fs.readFileSync(file, \"utf8\");\n}", "function getRead() {\n fs.readFile(\"random.txt\", \"utf8\", function(error, data) {\n\n // If the code experiences any errors it will log the error to the console.\n if (error) {\n return console.log(error);\n }else {\n console.log(data);\n var dataArr = data.split(\",\");\n runLiri(dataArr[0],dataArr[1]);\n } \n \n });\n }", "function readFileHandler( fileName, cb ) {\n fs.readFile(fileName, { encoding: 'utf-8' }, function ( err, data ) {\n if ( err ) throw err;\n\n cb(fileName, data);\n\n });\n}", "static readFileToBuffer(filePath) {\n return FileSystem._wrapException(() => {\n return fsx.readFileSync(filePath);\n });\n }", "function readFile(fileEntry) {\n\n // Get the file from the file entry\n fileEntry.file(function (file) {\n \n // Create the reader\n var reader = new FileReader();\n reader.readAsText(file);\n\n reader.onloadend = function() {\n\n console.log(\"Successful file read: \" + this.result);\n console.log(\"file path: \" + fileEntry.fullPath);\n\n };\n\n }, onError);\n}", "function readfile(){\n\tvar fileinput =\"\"\n\tvar fileswitch=\"\"\n\tfs.readFile(randfile, \"utf8\", function(error, data){\n\t\tif (error){\n\t\t\treturn console.log(\"error in the file reader\");\n\t\t}\n\t\tconsole.log(\"you are reading file\");\n\t\tdataArr = data.split(\",\");\n\t\tconsole.log(dataArr);\n\t\tfileswitch = dataArr[0];\n\t\tconsole.log(\"holder is \" + fileswitch);\n\t\tfileinput= dataArr[1];\n\t\tconsole.log(\"raw output is \"+fileinput);\n\t\tuserinput=fileinput.replace(/ /g, \"+\").replace(/\"/g, \"\");\n\t\tconsole.log(userinput);\n\t\tconsole.log(\"switcher is \" + switcher + \"and you are in the first if fileswitch is \" + fileswitch);\n\t\tswitcher = fileswitch;\n\t\tconsole.log(\"post replacement switcher \"+switcher);\n\t\tapiCalls();\n\t});\n}", "function readFile(fileName, fs) {\n\t\n\tfs.root.getFile(fileName, { create: false, exclusive: false }, function (fileEntry) {\n\n\t\tconsole.log(\"readFile() does file exist? \" + fileEntry.isFile.toString());\n\t\tfileEntry.file(function (file) {\n\t\t\tvar reader = new FileReader();\n\t\t\treader.onloadend = function() {\n\t\t\t\tconsole.log(\"readFile() Successful file read: \" + this.result);\n\t\t\t\talert(\"readFile() Successful file read: \" + this.result);\n\t\t\t\treturn this.result;\n\t\t\t};\n\t\t\treader.readAsText(file);\n\t\t},\n\t\tfunction(e) {\n\t\t\tconsole.log(e);\n\t\t\talert(e);\n\t\t});\n\n\t},\n\tfunction(e) {\n\t\talert(\"File system error: \"+e);\n\t});\n}", "function ler(){\n fs.readFile(\"./input/test.txt\",{encoding: 'utf-8'},(error, dados) => {\n if(error){\n console.log('Ocorreu um erro durante a leitura do arquivo!')\n }else{\n console.log(dados)\n }\n })\n}", "readFile(filename, settings) {\r\n const str = fs.readFileSync(filename, \"utf8\");\r\n return this.readXmlString(str, filename, settings)\r\n }", "readFromFile(fileName) {\n const fs = require(\"fs\");\n try {\n const data = fs.readFileSync(\"uploads/\" + fileName, \"utf8\");\n console.log(data);\n return data;\n } catch (err) {\n console.error(err);\n }\n }", "readFile() {\n const fileContents = fs.readFileSync(this.fileName, { encoding: \"utf8\" })\n return fileContents.split(\"\\n\")\n }", "readFile(filePath) {\n return RNFetchBlob.fs.readFile(filePath, 'utf8');\n }", "function readFile() {\n\n var fileName = \"\";\n\n //if a file name is given then store it in the fileName variable.\n if(nodeArgs[3]) {\n fileName = nodeArgs[3];\n }\n //if no file name is given then default the file name to 'random.txt'.\n else {\n fileName = \"random.txt\";\n }\n\n fs.readFile(fileName, \"utf8\", function(err, data) {\n //if the code experiences any errors it will lof the error and return it to terminate the program. \n if(err){\n console.log(err);\n console.log(\"\\n************ Enter an existing text file name in the folder **************\\n\");\n return;\n }\n //let user know that file name can be inserted.\n if(fileName != \"log.txt\") {\n console.log(\"\\nInsert log.txt as the file name after 'do-what-it-says' to have the program run your latest commands out of that file.\");\n }\n\n if(data.length < 1) {\n console.log(\"\\n******** This file is empty, add to the file before trying to read from it *******\\n\")\n }\n else {\n //stores each piece of data between commas in a different index of the array.\n var dataArr = data.split(\",\");\n //this sets the parameter to the last argument in the file...\n //note: if format is not sustained within the text files (i.e. \"COMMAND\",\"PARAMETER\",\"COMMAND\",\"PARAMETER\")then this function will break.\n nodeArgs[3] = dataArr[(dataArr.length - 1)];\n //this sets the command to the last used command in the file...\n //again..this will break if format is not sustained.\n liri(dataArr[(dataArr.length - 2)]);\n }\n });\n \n}", "async read(filepath) {\n try {\n return await this.reader(filepath, 'utf-8');\n } catch (error) {\n return undefined;\n }\n }", "function readFile(filePath, fmt) {\n return new Promise((resolve, reject) =>\n fs.readFile(filePath, fmt || 'utf8', (err, results) =>\n err ? reject(err) : resolve(results))\n );\n}", "function readFile(filename, defaultData, callbackFn) {\n fs.readFile(filename, function(err, data) {\n if (err) {\n console.log(\"Error reading file: \", filename);\n data = defaultData;\n } else {\n console.log(\"Success reading file: \", filename);\n }\n if (callbackFn) callbackFn(err, data);\n });\n}", "function readFile(filename, defaultData, callbackFn) {\n fs.readFile(filename, function(err, data) {\n if (err) {\n console.log(\"Error reading file: \", filename);\n data = defaultData;\n } else {\n console.log(\"Success reading file: \", filename);\n }\n if (callbackFn) callbackFn(err, data);\n });\n}", "function readfile(path)\r\n{\r\n return fs.readFileSync(path,'UTF8',function(data,err)\r\n {\r\n if(err) throw err;\r\n return data\r\n });\r\n}", "function doWhatItSays() {\n fs.readFile('random.txt', 'utf8', function (err, data) {\n if (err) throw err;\n console.log(data);\n });\n}", "function doSomething(){\n fs.readFile('random.txt', \"utf8\", function(error, data){\n var readText = data.split(',');\n\n spotifySong(readText[1]);\n });\n}", "static pFileRead(fileprops){\n\t\tvar file = fileprops.file,\n\t\t\ttask = fileprops.task,\n\t\t\ttype = fileprops.type,\n\t\t\tfed_data = fileprops.fed_data || false;\n\n\t\treturn new Promise((resolve, reject) => {\n\n\t\t\tif (fed_data){\n\t\t\t\t//console.log(\"\")\n\t\t\t\ttry {\n\t\t\t\t\ttask(fed_data)\n\t\t\t\t\tresolve();\n\t\t\t\t} catch (e) {\n\t\t\t\t\tconsole.log(\"error\", e);\n\t\t\t\t\treject(\"Generated data failed to process\")\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tvar fr = new FileReader();\n\n\t\t\t\tfr.onload = function(e){\n\t\t\t\t\ttry {\n\t\t\t \t\ttask(e.target.result);\n\t\t \t\t\tresolve();\n\n\t\t \t\t} catch(e){\n\t\t \t\t\treject(file.name + \" is not a \" + type + \", and \" + e);\n\t\t \t\t}\n\t\t \t}\n\t\t\t\tfr.readAsText(file);\n\t\t\t}\n\t\t});\n\t}", "function readFile(fileName) {\n let path = `./input/${fileName}.in`;\n log(`Reading From ${path}`);\n return fs.readFileSync(path, {\n encoding: \"UTF8\",\n flag: \"r\"\n });\n}", "function doThis(){\n \n const fs = require('fs');\n fs.readFile('random.txt', 'utf8', function(error, data) {\n \n if (error) \n {\n return console.log(error);\n }\n\n //getSongInfo(data);\n getMovieInfo(data);\n\n});\n}", "function readFile (file) {\n var str = fs.readFileSync(file, 'utf-8');\n console.log(str);\n}", "_read() {}", "_read() {}", "function read_file(dname, fname, cback) {\n\tfs.readFile(dname + '/' + fname, function (err, data) {\t// read in the file contents\n\t\tif (err) {\n\t\t\tconsole.log(err);\t// debug\n\t\t\tconsole.log(dname + '/' + fname);\t// debug\n\t\t} else cback(fname, String(data));\n\t});\n}", "function read(file) {\n var complete = fs.readFileSync(file, 'utf8')\n return complete\n}", "static async readFile(path) {\n return (await Util.promisify(Fs.readFile)(path)).toString('utf-8');\n }", "function file_read(file, callback=null) {\n $.ajax({\n url: file,\n success: callback\n });\n}", "function readFile(filename, flag) {\n return new Promise(function (complete, reject) {\n fsx.readFile(filename, function (error, data) {\n if (error) {\n reject(error);\n return;\n }\n complete(data);\n });\n });\n}", "function read_file(filepath, cb) {\n var param = { fsid: fsid, path: filepath };\n ajax(service_url.read, param, function(err, filecontent, textStatus, jqXHR) {\n if (err) return cb(err);\n if (jqXHR.status != 200) {\n var msg;\n switch (jqXHR.status) {\n case 404:\n msg = lang('s0035'); break;\n case 406:\n msg = lang('s0036'); break;\n case 400:\n msg = lang('s0037'); break;\n default:\n msg = 'Code ' + jqXHR.status +' -- '+ textStatus;\n }\n return cb(new Error(lang('s0038')+ ': '+ filepath+ ', '+ msg));\n }\n var mimetype = jqXHR.getResponseHeader('Content-Type');\n var uptime = jqXHR.getResponseHeader('uptime');\n cb(null, filecontent, uptime, mimetype);\n });\n }", "_read() {\n\n }", "function readFile() {\n return new Promise((resolve, reject) => {\n fs.readFile(SOURCE, {\n encoding: 'utf-8'\n }, (err, data) => {\n if (err) {\n reject(err);\n // puts the callback given to the .catch in the Promise pending callbacks queue\n } else {\n resolve(data);\n // puts the callback given to the first .then, in the Promise pending callbacks queue\n }\n });\n });\n}", "function handleReadFile(file, callback) {\n\t// open and read the file\n\tfs.readFile(file, 'utf8', function (err, data) {\n\t\t// log error and stop if error\n\t\tif (err) return console.error(err);\n\t\tconsole.log('read', file);\n\t\tcallback(err, data);\n\t\tconsole.log('sent the response');\n\t}); // fs.readFile(file, ...\n} // function handleReadFile(file, callback)", "static read_file(filename, encoding='utf8')\r\n {\r\n let data;\r\n try\r\n {\r\n data = fs.readFileSync(filename, encoding);\r\n }\r\n catch (err)\r\n {\r\n throw new Error(err);\r\n }\r\n return data;\r\n }", "function readFS(){\n\tfs.readFile(\"random.txt\", \"utf8\", function(error, data){\n\t\tif (error){\n\t\t\tconsole.log(error);\n\t\t} else {\n\t\t\tvar randomArr = data.split(\",\");\n\t\t\tvar command = randomArr[0].trim();\n\t\t\tvar title = randomArr[1].trim();\n\t\t\t\n\t\t\tdoIt(command, title);\n\t\t};\n\t});\n}", "function doThis(){ \n fs.readFile(\"random.txt\", \"utf8\", function(err, data) {\n if (err) {\n console.log(\"Error\" + err);\n return;\n }else {\n console.log(data);\n\n var whatever = data.split(\",\");\n commands(whatever[0], whatever[1]);\n }\n });\n}", "function readFile (file){ \n let data = (fs.readFileSync(file)\n .toString())\n .replace('\\r', '')\n .split('\\n');\n return data;\n}", "function openFile(filename)\n{\n return new LineReaderSync(filename);\n}", "function readFile(fileEntry) {\n // Get the file from the file entry\n fileEntry.file(function (file) { \n // Create the reader\n var reader = new FileReader();\n reader.readAsText(file);\n reader.onloadend = function() {\n console.log(\"Successful file read: \" + reader.result);\n document.getElementById('dataObj').innerHTML = reader.result;\n console.log(\"file path: \" + fileEntry.fullPath);\n };\n });\n }", "function read$2(context, file, fileSet, next) {\n var filePath = file.path;\n\n if (file.contents || file.data.unifiedEngineStreamIn) {\n debug$a('Not reading file `%s` with contents', filePath);\n next();\n } else if (stats$7(file).fatal) {\n debug$a('Not reading failed file `%s`', filePath);\n next();\n } else {\n filePath = path$6.resolve(context.cwd, filePath);\n\n debug$a('Reading `%s` in `%s`', filePath, 'utf8');\n fs$6.readFile(filePath, 'utf8', onread);\n }\n\n function onread(error, contents) {\n debug$a('Read `%s` (error: %s)', filePath, error);\n\n file.contents = contents || '';\n\n next(error);\n }\n}", "getFileContent(path: string) {\n fs.readFile(path, 'utf8', (err, data) => {\n this.editorContentCallback(data, path);\n });\n }", "function getFileContents(filename){\r\n\t\r\n\tvar contents;\r\n\tcontents = fs.readFileSync(filename);\r\n\treturn contents;\r\n}", "getContents() {\n return _fs.default.readFileSync(this.filePath, \"utf8\");\n }", "function doTheThing() {\n fs.readFile(\"random.txt\", \"utf8\", function (error, data) {\n\n // If the code experiences any errors it will log the error to the console.\n if (error) {\n return console.log(error);\n }\n\n // Then split it by commas (to make it more readable)\n var dataArr = data.split(\",\");\n\n spotifyThis(dataArr[1])\n\n\n\n });\n}", "function InFile() {\r\n}", "function readText() {\n\n fs.readFile(\"random.txt\", \"utf8\", function (error, data) {\n var dataArr = data.split(\",\");\n\n // Calls switch case \n switcher(dataArr[0], dataArr[1]);\n });\n}", "handleTheFile(event) {\n event.preventDefault();\n if (this.inputFile.current.files[0] === undefined) { return; }\n\n // Confirm file extension and read the data as text\n console.log('Reading the file...');\n let fileName = this.inputFile.current.files[0].name;\n if (!fileName.endsWith('.asc')) {\n console.error('Error opening the file: Invalid file extension, .asc expected.');\n return;\n }\n let file = this.inputFile.current.files[0];\n let reader = new FileReader();\n reader.onload = (event) => {\n console.log('Done.');\n this.ParseTheData(event.target.result);\n }\n reader.onerror = () => {\n console.error('Error opening the file: Cannot read file.');\n return;\n }\n reader.readAsText(file);\n }", "function readFile(fileName, cb) {\n var filePath = path.join(__dirname, fileName);\n fs.readFile(filePath, {encoding: 'utf-8'}, function (error, data) {\n if (error) {\n console.log(error);\n process.exit();\n }\n\n cb(data);\n });\n}", "function doWhat (){\n var fs = require(\"fs\");\n\n// Running the readFile module that's inside of fs.\n// Stores the read information into the variable \"data\"\nfs.readFile(\"random.txt\", \"utf8\", function(err, data) {\n if (err) {\n return console.log(err);\n }\n\n // We will then print the contents of data\n console.log(data);\n\n// // Then split it by commas (to make it more readable)\n// var dataArr = data.split(\",\");\n\n// // We will then re-display the content as an array for later use.\n// console.log(dataArr);\n});\n\n}", "readFile(path_to_file) {\n return new Promise((resolve, reject) => {\n let result = [],\n line_reader = readline.createInterface({\n input : fs.createReadStream(__dirname + path_to_file)\n })\n line_reader.on('line', (line) => {\n result.push(line)\n })\n line_reader.on('close', () => {\n resolve(result)\n })\n })\n }", "function readFileContent(fileName) {\n console.log(\"Reading \" + fileName + \" file started\");\n fs.readFile(fileName, 'utf8', function (err, data) {\n if (err) {\n console.log(err);\n }\n else {\n eventsEmitter.emit('write', data);\n }\n });\n}", "read() {}", "function getSampleFileContent(){\n var output = ''\n\n fs.readFile('Sample.txt', 'utf8', function(err, data){\n if(err){ //if there are any error\n \n output = err;\n //console.log('error block');\n console.log(err);\n }\n else{\n \n output = data;\n console.log('data block');\n console.log(data)\n }\n console.log('File read completed...')\n return output;\n })\n }", "static process_file(filename)\r\n {\r\n if (fs === null)\r\n {\r\n throw new Error(\"Not in node.js : module fs not defined. Aborting.\");\r\n }\r\n if (DEBUG)\r\n {\r\n console.log('Processing file:', filename);\r\n console.log('--------------------------------------------------------------------------');\r\n }\r\n let data = Hamill.read_file(filename);\r\n let doc = this.process_string(data);\r\n doc.set_name(filename);\r\n return doc;\r\n }", "function loadFile(fn) {\n return new Promise ( (res, rej) => {\n fs.readFile(fn, (err, data) => {\n if (err) {\n rej(err);\n };\n res(data);\n })\n\n })\n}", "function processFile(callback) {\n fs.readFile('numbers.txt', 'utf-8', callback);\n}", "function doWhatItSays() {\r\n fs.readFile(\"./random.txt\", \"utf8\", function (error, data) {\r\n if (error) {\r\n return console.log(error);\r\n }\r\n var dataArr = data.split(\",\");\r\n var songFromTxtFile = dataArr[1];\r\n // console.log(songFromTxtFile);\r\n getSong(songFromTxtFile);\r\n });\r\n}", "function readFile(filename){\n return new Promise(function(resolve,reject){\n fs.readFile(filename,'utf8',function(err,data){\n err?reject(err):resolve(data);\n });\n })\n}", "function readFile(fileName, callback) {\n\n\tfs.readFile(repoPath + '/' + fileName, 'utf8', function(err, content) {\n\t\tif (err) {\n\t\t\tif (err.errno === -2)\n\t\t\t\tcallback(err)\n\t\t\telse\n\t\t\t\tthrow err\n\t\t}\n\t\telse {\n\t\t\tcallback(null, content)\n\t\t}\n\t})\n}", "_read() {\n }", "async function readFile(...args) {\n const p = new Promise((resolve, reject) => {\n fs.readFile(...args, (err, data) => {\n if (err) {\n return reject(err);\n }\n resolve(data);\n });\n });\n return p;\n}", "function doIt() {\n\n fs.readFile(\"random.txt\", \"utf8\", function (error, data) {\n\n if (error) {\n return console.log(error);\n }\n\n var dataArr = data.split(\",\");\n console.log(dataArr);\n doSomething(dataArr[0], dataArr[1]);\n });\n}", "function readFile(fileIn, callback) {\n var codeList = [];\n var ns = path.basename(fileIn,\".coffee\");\n var fileOut = ns + \"-doc.json\";\n var filePathIn = path.join(sourceDir, fileIn);\n console.log(filePathIn);\n var rd = readline.createInterface({\n input: fs.createReadStream(filePathIn),\n output: process.stdout,\n terminal: false\n });\n\n rd.on('close', function () {\n var mapfile = path.join(outDir, ns + '-map.txt');\n\n try {\n fs.unlinkSync(mapfile);\n }\n catch(err){}\n\n for (var i = 0; i < codeList.length; i++) {\n fs.appendFileSync(mapfile, codeList[i].join(\"|\") + \"\\r\\n\");\n }\n builder.generate(codeList, fileOut, callback, String.fromCharCode(chrcode));\n chrcode++;\n });\n\n var parseLine = parser.parseLine;\n rd.on('line', function (line) {\n var parsed = parseLine(line);\n codeList.push(parsed);\n });\n\n}", "function getAsText1(fileToRead) {\n var reader = new FileReader();\n\n reader.readAsText(fileToRead);\n\n reader.onload = loadHandler1;\n reader.onerror = errorHandler;\n}", "function doWhatItSays() {\n fs.readFile(\"random.txt\", \"utf8\", function (err, data) {\n if (err) {\n return console.log(err);\n }\n\n data = data.split(\",\");\n // console.log(data[1]);\n masterFunction(data[0], data[1] || null);\n\n });\n}", "function callTxt() {\n fs.readFile(\"random.txt\", \"utf8\", function(error, data) {\n\n // If the code experiences any errors it will log the error to the console.\n if (error) {\n return console.log(error);\n }\n // Then split it by commas (to make it more readable)\n var dataArr = data.split(\",\");\n \n //assign command and search based on contents of random.txt\n liriCommand = dataArr[0];\n searchParams = dataArr[1];\n return checkCommand(liriCommand);\n });\n}" ]
[ "0.7206378", "0.70569354", "0.69823897", "0.6981759", "0.69233257", "0.6809702", "0.67769957", "0.6772387", "0.67619365", "0.6711953", "0.667342", "0.6637057", "0.6600005", "0.65548325", "0.65400314", "0.65141046", "0.6513383", "0.65132767", "0.65095633", "0.65021443", "0.6492621", "0.6459899", "0.64570206", "0.643898", "0.6426665", "0.6399233", "0.63090634", "0.63084817", "0.63055044", "0.63027674", "0.630114", "0.6300325", "0.62946", "0.62820643", "0.6272852", "0.6262481", "0.6261174", "0.62570786", "0.62351024", "0.62324244", "0.621232", "0.6202801", "0.61876917", "0.6144194", "0.6135349", "0.613388", "0.6128486", "0.6100758", "0.6098296", "0.6098296", "0.6095275", "0.6093383", "0.6093319", "0.60844696", "0.6083155", "0.6082877", "0.60747623", "0.60641944", "0.60641944", "0.6036676", "0.6029955", "0.60268927", "0.6024587", "0.6020878", "0.6012937", "0.6002031", "0.60010844", "0.5999248", "0.5990441", "0.5989971", "0.5975224", "0.5965766", "0.5957017", "0.59556746", "0.59553957", "0.59544426", "0.5945142", "0.59440976", "0.59363765", "0.5935577", "0.59343743", "0.59301627", "0.5915464", "0.59061223", "0.5905804", "0.59041715", "0.5902387", "0.59004027", "0.5899145", "0.58942646", "0.5882359", "0.58766925", "0.58742875", "0.5872574", "0.5867183", "0.5860621", "0.5860494", "0.58597386", "0.5859114", "0.5854672", "0.58542144" ]
0.0
-1
Get next level entities
function createGoingUpObj( startingPgm, entrels, DiagramChild, entityId, ChildId, InitialObj ) { let StartingPgmParentRels = entrels.filter(rel => { return rel.CHLD.trim() === startingPgm; }); let DiagramParents = StartingPgmParentRels.map(rel => { return rel.PAR; }); // if (!InitialObj && DiagramParents.length > 20 ){ // DiagramParents = [] // } entityId++; return [ { ParentIds: [], EntityId: entityId, ChildId: ChildId, DiagramParents: DiagramParents, DiagramEntity: startingPgm, DiagramChild: DiagramChild }, entityId ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fetchNext() {\n if (!this.busy && !this.complete && this.models.length) {\n let nextStart = this.models[this.models.length - 1].get('parent');\n\n if (nextStart === '') {\n this.complete = true;\n } else {\n this.options.start = nextStart;\n\n this.fetch({\n remove: false,\n success: () => this.busy = false\n });\n }\n }\n }", "function _findNextVisibleObjectRecursively(object){\n\t\t\t\t\t\t\t\t\t\t\t// get parent\n\t\t\t\t\t\t\t\t\t\t\tvar parentId = object.getParentId();\n\t\t\t\t\t\t\t\t\t\t\tif(parentId == null)\n\t\t\t\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tvar parent = _getObject(parentId);\n\t\t\t\t\t\t\t\t\t\t\tif(parent == undefined || parent == null)\n\t\t\t\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tvar indexOfChild = parent.getChildren().indexOf(object);\n\t\t\t\t\t\t\t\t\t\t\tif(indexOfChild == parent.getChildren().length - 1){\n\t\t\t\t\t\t\t\t\t\t\t\treturn _findNextVisibleObjectRecursively(parent);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\t\treturn parent.getChildren()[indexOfChild + 1];\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}", "*descendantsUntil(end) {\r\n let state = this.next;\r\n while (state != null && state.stateId !== end && state !== end) {\r\n yield state;\r\n state = state.next;\r\n }\r\n }", "function setEntities() {\n var entitiesArr = new Array();\n var entitiesCurrent = new Array();\n for (var i = 0; i < mRoot.objEntities.count; i++) {\n var entity = mRoot.objEntities.collection[i];\n if (!checkIn(entity.info.id, entitiesCurrent)) {\n if (entity.info.type === typeEntity.t_start) {\n entitiesCurrent.push(entity.info.id);\n var item = {\n x: entity.entity.attr(\"x\"),\n y: entity.entity.attr(\"y\"),\n width: entity.entity.attr(\"width\"),\n height: entity.entity.attr(\"height\"),\n id: entity.info.id,\n annotation: entity.info.annotation,\n label: entity.info.label,\n type: entity.info.type,\n sizeW: $(\"#viewport\").width(),\n sizeH: $(\"#viewport\").height()\n }\n entitiesArr.push(item);\n } else {\n var parent = checkParent(entity);\n if (parent != entity) {\n entitiesArr.push(checkChildren(parent));\n } else {\n entitiesArr.push(checkChildren(entity));\n }\n }\n }\n }\n return entitiesArr;\n\n function checkChildren(entity) {\n // check connection\n if (entity.info._case !== undefined) {\n entity.info._case = undefined;\n }\n if (entity.info._true !== undefined) {\n entity.info[\"_true\"] = undefined;\n }\n if (entity.info._false !== undefined) {\n entity.info[\"_false\"] = undefined;\n }\n if (entity.info._next !== undefined) {\n entity.info[\"_next\"] = undefined;\n }\n var item = entity.info;\n item.x = entity.entity.attr(\"x\"),\n item.y = entity.entity.attr(\"y\"),\n item.width = entity.entity.attr(\"width\"),\n item.height = entity.entity.attr(\"height\"),\n\n item.child = new Array();\n if (entity.info.type === typeEntity.t_decision) {\n item.condition = entity.info.condition;\n }\n if (entity.info.type === typeEntity.t_switch) {\n item.expression = entity.info.expression;\n }\n entitiesCurrent.push(entity.info.id);\n for (var i = 0; i < mRoot.objConnections.count; i++) {\n var conn = mRoot.objConnections.collection[i];\n if (conn.info.from === entity.info.id) {\n for (var j = 0; j < mRoot.objEntities.count; j++) {\n var entityTo = mRoot.objEntities.collection[j];\n if (!checkIn(entityTo.info.id, entitiesCurrent)) {\n if (conn.info.to === entityTo.info.id) {\n var obj = checkChildren(entityTo);\n item.child.push(obj);\n }\n }\n }\n }\n }\n return item;\n }\n\n function checkParent(entity, parent) {\n for (var i = 0; i < mRoot.objConnections.count; i++) {\n var conn = mRoot.objConnections.collection[i];\n if (conn.info.to == entity.info.id) {\n for (var j = 0; j < mRoot.objEntities.count; j++) {\n var entityFrom = mRoot.objEntities.collection[j];\n if (parent !== undefined && parent === entityFrom) {\n return entity;\n }\n if (conn.info.from == entityFrom.info.id) {\n if (entityFrom.info.type === typeEntity.t_start) {\n return entity;\n }\n if (entity === entityFrom) {\n return entity;\n }\n return checkParent(entityFrom, entity);\n }\n }\n }\n }\n return entity;\n }\n}", "*descendants() {\r\n let state = this.next;\r\n while (state != null) {\r\n yield state;\r\n state = state.next;\r\n }\r\n }", "function _step() {\n for (var uid in entities) {\n var entity = entities[uid];\n entity.step();\n }\n }", "function findNext(el) {\n var branch = $$mdTree.getBranch(el[0].parentNode);\n if (!branch) { return null; }\n var next = angular.element(branch).next();\n if (next && next.length) { return next; }\n return findNext(angular.element(branch));\n }", "function show_next_level(){\n\t $(this).parent( '.pl-tree' ).addClass( 'pl-tree-det' );\n\n\t $(this).siblings( '.pl-tree-node-info' )\n\t .find( '.pl-tree-node-des' )\n\t .css({ display: \"none\" });\n\n\t $(this).siblings( '.pl-tree-end-det' )\n\t .css({ display: \"block\" });\n\n\t $(this).siblings( '.pl-tree-pointer' )\n\t .css({ display: \"inline-block\" });\n\n\t $(this).siblings( '.pl-tree-list' )\n\t .children( 'li' )\n\t .children( 'section.pl-tree' )\n\t .children( 'img.pl-tree-pointer' )\n\t .css({ display: \"inline-block\" });\n\n\t $(this)\n\t .unbind( 'click' )\n\t .click( hide_level );\n }", "get next() {\n if (!this.mParent)\n return null;\n return this.mParent.nextChild(this);\n }", "loadNextArtistsOrAlbums() {\n this.page++;\n this.loadArtistsOrAlbums(this.page * 6);\n }", "function traverseNext (here, rel, arrayItem) {\n return here.then(function (response) {\n // if the entity has this relation, go there next\n if (hasEmbeddedRel(response.entity, rel)) {\n return response.entity._embedded[rel];\n }\n\n // if the entity does not have a _links key, there is nowhere else\n // to go\n if(!response.entity._links) {\n return [];\n }\n\n // if none of the above cases are true, then either the relation\n // is a string or a dictionary with a relation and params. If it is\n // just a string, go there. If it is a dictionary, go to the relation\n // location using the specified params\n if (typeof arrayItem === 'string') {\n return api({\n method: 'GET',\n path: response.entity._links[rel].href\n });\n } else {\n return api({\n method: 'GET',\n path: response.entity._links[rel].href,\n params: arrayItem.params\n });\n }\n });\n }", "get next () {\n let n = this.right\n while (n !== null && n.deleted) {\n n = n.right\n }\n return n\n }", "next() {\n this._followRelService(\"next\", \"List\");\n }", "async getOrgChildren(id) {\n const d2 = this.props.d2;\n let nodes = [id];\n let m = await d2.models.organisationUnits.get(id);\n if (m.id===id){\n if (m.hasOwnProperty('children') && m.children !== undefined){\n if (m.children.size===0){\n return nodes;\n }\n for (let child of m.children){\n let c = await this.getOrgChildren(child[0]);\n nodes = nodes.concat(c);\n }\n return nodes;\n }\n else{ //other way to get no children\n return nodes;\n }\n }\n return nodes;\n }", "function familyTreeGetDown({\n // public parameters\n // @param callback: function({depth, from, infolocal, fullinfo})\n // @param from: family search identifier XXXX-YYY\n // @param depthmax: maximal depth\n // @param callbackEnd: called at the end\n callback=function(){{depth=0, from='UNKNOWN', infolocal={}, fullinfo={}, chain=[]}},\n from=getCurrentId(),\n depthmax=10,\n callbackBeforePerson=function(identifier) {return true;},\n callbackEnd=function({visited=0, errors=0}){console.log(\"Default ended method\");},\n // private parameters\n // @param depth: the current depth\n // @param currentChain: the current chain to the current 'from' (not included) [{id, name, nextisfather}]\n // @param currentalgo: shared parameters for the current process\n depth=0, currentChain=[],\n shareddata={},\n currentalgo={totaldone:0, currentmax:0, errors:0}}={}) {\n if (!callbackBeforePerson(from)) {\n return;\n }\n currentalgo.currentmax++;\n //console.log(\"After call:\" + from + \" \" + objectId(currentalgo));\n fetch(familyTreeRecursive_urlSimple(from)\n )\n .then(response => {\n return response.json();\n })\n .then(function (infolocal) {\n fetch(familyTreeRecursive_urlComplete(from)).then(response => {\n return response.json();\n }).then(function (fullinfo) {\n var command = callback({depth:depth, from:from, infolocal:infolocal, fullinfo:fullinfo, chain:currentChain,shareddata:shareddata});\n if (command == \"stop\") {\n // do not go deeper\n return;\n }\n if (depth < depthmax && fullinfo.data.spouses) {\n var childCounter = 0;\n for (var i=0; i < fullinfo.data.spouses.length; i++) {\n if (!fullinfo.data.spouses[i].children) continue;\n for (var j=0; j < fullinfo.data.spouses[i].children.length; j++) {\n var child = fullinfo.data.spouses[i].children[j];\n childCounter++;\n //console.log(\"In \"+from+\", child \" + i + \"-\"+j)\n // new chain in order to tell we are in a father\n var newChain = currentChain.slice(0);\n newChain.push({id:from, name:infolocal.name, child:childCounter});\n var arguments = {callback:callback, depthmax:depthmax, callbackEnd:callbackEnd, currentChain:newChain, depth:depth+1, currentalgo:currentalgo, shareddata:shareddata,\n from:child.id};\n familyTreeGetDown(arguments);\n }\n }\n }\n }).catch(function(e) {\n console.log(e);\n currentalgo.errors++;\n }).finally(function() {\n currentalgo.totaldone++;\n if (currentalgo.totaldone == currentalgo.currentmax) {\n console.log(\"Ended, \" + currentalgo.totaldone + \" visited, \"+currentalgo.errors+\" errors.\");\n callbackEnd({visited:currentalgo.totaldone, errors:currentalgo.errors, shareddata:shareddata})\n }\n });\n }\n ).catch(function(err) {\n console.log(err);\n currentalgo.currentmax--;\n currentalgo.errors++;\n if (currentalgo.totaldone == currentalgo.currentmax) {\n console.log(\"Ended, \" + currentalgo.totaldone + \" visited, \"+currentalgo.errors+\" errors.\");\n callbackEnd({visited:currentalgo.totaldone, errors:currentalgo.errors, shareddata:shareddata})\n }\n });\n}", "getNext() {\r\n if (this.hasNext) {\r\n const items = new Items(this.nextUrl, null).configureFrom(this.parent);\r\n return items.getPaged(this.innerParser);\r\n }\r\n return new Promise(r => r(null));\r\n }", "get next () {\n let n = this.right;\n while (n !== null && n.deleted) {\n n = n.right;\n }\n return n\n }", "get next () {\n let n = this.right;\n while (n !== null && n.deleted) {\n n = n.right;\n }\n return n\n }", "function step2(map) {\n\tconst root = { name: '/', nodes: [] };\n\treturn (function next(map, parent, level) {\n\t\tObject.keys(map).forEach(key => {\n\t\t\tlet val = map[key];\n\t\t\tlet node = { name: key };\n\t\t\tif (typeof val === 'object') {\n\t\t\t\tnode.nodes = [];\n\t\t\t\tnode.open = level < 1;\n\t\t\t\tnext(val, node, level + 1);\n\t\t\t} else {\n\t\t\t\tnode.src = val;\n\t\t\t}\n\t\t\tparent.nodes.push(node);\n\t\t});\n\t\treturn parent;\n\t})(map, root, 0);\n}", "function findChildren(/* jQuery object tr */ tr){\n var depth = tr.data('depth');\n return tr.nextUntil($('tr').filter(function () {\n return $(this).data('depth') <= depth;\n }));\n }", "print_level_order() {\n console.log(\"Level order traversal using 'next' pointer: \");\n let nextLevelRoot = this;\n while (nextLevelRoot !== null) {\n let current = nextLevelRoot;\n nextLevelRoot = null;\n while (current != null) {\n console.log(`${current.val} `);\n if(current.next) {\n console.log(`next ${current.next.val}`)\n }\n if (nextLevelRoot === null) {\n if (current.left !== null) {\n nextLevelRoot = current.left;\n } else if (current.right !== null) {\n nextLevelRoot = current.right;\n }\n }\n current = current.next;\n }\n console.log();\n }\n }", "traverse() {\n let current = this.head;\n\n while (current) {\n console.log(current.val)\n current = current.next\n }\n }", "next(){\n let next = this.currentId + 1;\n if(next >= this.list.length){\n next = this.list.length;\n }\n this.goto(next);\n }", "function next() {\n\t\t\treturn go(current+1);\n\t\t}", "getRelated() {}", "next(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var {\n mode = 'lowest',\n voids = false\n } = options;\n var {\n match,\n at = editor.selection\n } = options;\n\n if (!at) {\n return;\n }\n\n var [, from] = Editor.last(editor, at);\n var [, to] = Editor.last(editor, []);\n var span = [from, to];\n\n if (Path.isPath(at) && at.length === 0) {\n throw new Error(\"Cannot get the next node from the root node!\");\n }\n\n if (match == null) {\n if (Path.isPath(at)) {\n var [parent] = Editor.parent(editor, at);\n\n match = n => parent.children.includes(n);\n } else {\n match = () => true;\n }\n }\n\n var [, next] = Editor.nodes(editor, {\n at: span,\n match,\n mode,\n voids\n });\n return next;\n }", "next(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var {\n mode = 'lowest',\n voids = false\n } = options;\n var {\n match,\n at = editor.selection\n } = options;\n\n if (!at) {\n return;\n }\n\n var pointAfterLocation = Editor.after(editor, at, {\n voids\n });\n if (!pointAfterLocation) return;\n var [, to] = Editor.last(editor, []);\n var span = [pointAfterLocation.path, to];\n\n if (Path.isPath(at) && at.length === 0) {\n throw new Error(\"Cannot get the next node from the root node!\");\n }\n\n if (match == null) {\n if (Path.isPath(at)) {\n var [parent] = Editor.parent(editor, at);\n\n match = n => parent.children.includes(n);\n } else {\n match = () => true;\n }\n }\n\n var [next] = Editor.nodes(editor, {\n at: span,\n match,\n mode,\n voids\n });\n return next;\n }", "function getNextEmployee () {\n clearInfo();\n nextEmployee = thisEmployee.parent().next();\n getCurrentEmployee(nextEmployee);\n }", "levelTraversal () {\n let elements = [];\n let agenda = [this];\n while(agenda.length > 0) {\n let curElem = agenda.shift();\n if(curElem.height == 0) continue;\n elements.push(curElem);\n agenda.push(curElem.left);\n agenda.push(curElem.right);\n }\n return elements;\n }", "function nextLeft(v) {\n var children = v.children;\n return children ? children[0] : v.t;\n} // This function works analogously to nextLeft.", "function nextLeft(v) {\n var children = v.children;\n return children ? children[0] : v.t;\n} // This function works analogously to nextLeft.", "function nextLeft(v) {\n var children = v.children;\n return children ? children[0] : v.t;\n} // This function works analogously to nextLeft.", "function nextLeft(v) {\n var children = v.children;\n return children ? children[0] : v.t;\n} // This function works analogously to nextLeft.", "function nextLeft(v) {\n var children = v.children;\n return children ? children[0] : v.t;\n} // This function works analogously to nextLeft.", "function nextLeft(v) {\n var children = v.children;\n return children ? children[0] : v.t;\n} // This function works analogously to nextLeft.", "traverse(){\n let current = this.head;\n while(current){\n console.log(current.val);\n current = current.next;\n }\n }", "function getNext ( pages, id, parent ) {\n for ( var i in pages ) if ( pages[ i ].previd == id && pages[ i ].parentid == parent ) return [ pages[ i ], i ];\n return [];\n }", "get entities() {\n return this[\"entityManager\"]._entities;\n }", "function inOrderTraversal(node) {}", "get entities() {\n return this.__entities;\n }", "nextSibling() {\n var siblings = this._containers.top(); // If we're at the root of the tree or if the parent is an\n // object instead of an array, then there are no siblings.\n\n\n if (!siblings || !Array.isArray(siblings)) {\n return null;\n } // The top index is a number because the top container is an array\n\n\n var index = this._indexes.top();\n\n if (siblings.length > index + 1) {\n return siblings[index + 1];\n } else {\n return null; // There is no next sibling\n }\n }", "*nodesDescending(){\n let node = this.root && this.root.getRightmostChild();\n while(node){\n yield node;\n node = node.getPredecessor();\n }\n }", "next(e) { return this._edges.next(e); }", "*ancestors() {\r\n let state = this.prev;\r\n while (state != null) {\r\n yield state;\r\n state = state.prev;\r\n }\r\n }", "nextLevel() {\n if(player.x > 4200) {\n return 3;\n }\n return null;\n }", "function getEntities(obj, parent) {\n // decision\n if (obj[\"p:FlowDecision\"] !== undefined) {\n var root_decisions = obj[\"p:FlowDecision\"];\n if (typeof root_decisions === \"object\" && root_decisions.length !== undefined) { // is array objects\n for (var i = 0; i < root_decisions.length; i++) {\n var root_decision = root_decisions[i];\n var isAlias = root_decision[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_decision[\"@sap2010:WorkflowViewState.IdRef\"] : root_decision[\"sap2010:WorkflowViewState.IdRef\"];\n if (root_decision[\"p:FlowDecision.True\"] !== undefined) { // have obj in true connection\n getEntities(root_decision[\"p:FlowDecision.True\"], isAlias);\n }\n if (root_decision[\"p:FlowDecision.False\"] !== undefined) { // have obj in false connection\n getEntities(root_decision[\"p:FlowDecision.False\"], isAlias);\n }\n // get info\n var _decision = new Entity();\n _decision.label = root_decision[\"@DisplayName\"] !== undefined ? root_decision[\"@DisplayName\"].replaceAll(\"\\\"\", \"&quot;\") : \"Decision\";\n _decision.condition = root_decision[\"@Condition\"] !== undefined ? root_decision[\"@Condition\"].replaceAll(\"\\\"\", \"&quot;\").substr(1, root_decision[\"@Condition\"].length - 2) : (root_decision[\"p:FlowDecision.Condition\"] !== undefined ? root_decision[\"p:FlowDecision.Condition\"][\"mca:CSharpValue\"][\"#text\"].replaceAll(\"\\\"\", \"&quot;\") : \"\");\n _decision.annotation = root_decision[\"@sap2010:Annotation.AnnotationText\"] !== undefined ? root_decision[\"@sap2010:Annotation.AnnotationText\"].replaceAll(\"\\\"\", \"&quot;\") : \"\";\n _decision.type = typeEntity.t_decision;\n _decision.alias = isAlias;\n _decision.parent = parent !== undefined ? parent : '';\n\n mRoot.infoEntities.add(_decision);\n }\n } else { // is object\n var isAlias = root_decisions[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_decisions[\"@sap2010:WorkflowViewState.IdRef\"] : root_decisions[\"sap2010:WorkflowViewState.IdRef\"];\n if (root_decisions[\"p:FlowDecision.True\"] !== undefined) { // have obj in true connection\n getEntities(root_decisions[\"p:FlowDecision.True\"], isAlias);\n }\n if (root_decisions[\"p:FlowDecision.False\"] !== undefined) { // have obj in false connection\n getEntities(root_decisions[\"p:FlowDecision.False\"], isAlias);\n }\n // get info\n var _decision = new Entity();\n _decision.label = root_decisions[\"@DisplayName\"] !== undefined ? root_decisions[\"@DisplayName\"].replaceAll(\"\\\"\", \"&quot;\") : \"Decision\";\n _decision.condition = root_decisions[\"@Condition\"] !== undefined ? root_decisions[\"@Condition\"].replaceAll(\"\\\"\", \"&quot;\").substr(1, root_decisions[\"@Condition\"].length - 2) : (root_decisions[\"p:FlowDecision.Condition\"] !== undefined ? root_decisions[\"p:FlowDecision.Condition\"][\"mca:CSharpValue\"][\"#text\"].replaceAll(\"\\\"\", \"&quot;\") : \"\");\n _decision.annotation = root_decisions[\"@sap2010:Annotation.AnnotationText\"] !== undefined ? root_decisions[\"@sap2010:Annotation.AnnotationText\"].replaceAll(\"\\\"\", \"&quot;\") : \"\";\n _decision.type = typeEntity.t_decision;\n _decision.alias = isAlias;\n _decision.parent = parent !== undefined ? parent : '';\n mRoot.infoEntities.add(_decision);\n }\n }\n\n // switch\n if (obj[\"p:FlowSwitch\"] !== undefined) {\n var root_switchs = obj[\"p:FlowSwitch\"];\n // have \n if (typeof (root_switchs) === \"object\" && root_switchs.length !== undefined) { // is array object\n for (var i = 0; i < root_switchs.length; i++) {\n var root_switch = root_switchs[i];\n var isAlias = root_switch[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_switch[\"@sap2010:WorkflowViewState.IdRef\"] : root_switch[\"sap2010:WorkflowViewState.IdRef\"];\n // switch connection multi other decision/switch/step\n if (root_switch[\"p:FlowDecision\"] !== undefined || root_switch[\"p:FlowSwitch\"] !== undefined || root_switch[\"p:FlowStep\"]) {\n getEntities(root_switch, isAlias);\n }\n // only exitings a connect default by switch\n if (root_switch[\"p:FlowSwitch.Default\"] !== undefined) { // connect default\n getEntities(root_switch[\"p:FlowSwitch.Default\"], isAlias);\n }\n // get info\n var _switch = new Entity();\n _switch.label = root_switch[\"@DisplayName\"] !== undefined ? root_switch[\"@DisplayName\"].replaceAll(\"\\\"\", \"&quot;\") : \"Switch\"; // label if existing different default\n _switch.expression = root_switch[\"@Expression\"] !== undefined ? root_switch[\"@Expression\"].replaceAll(\"\\\"\", \"&quot;\").substr(1, root_switch[\"@Expressionf\"].length - 2) : (root_switch[\"p:FlowSwitch.Expression\"] !== undefined ? root_switch[\"p:FlowSwitch.Expression\"][\"mca:CSharpValue\"][\"#text\"] : \"\");\n _switch.annotation = root_switch[\"@sap2010:Annotation.AnnotationText\"] !== undefined ? root_switch[\"@sap2010:Annotation.AnnotationText\"].replaceAll(\"\\\"\", \"&quot;\") : \"\";\n _switch.typeSwitch = root_switch[\"@x:TypeArguments\"].split(\"x:\")[1];\n _switch.type = typeEntity.t_switch;\n _switch.alias = isAlias;\n _switch.parent = parent !== undefined ? parent : \"\";\n mRoot.infoEntities.add(_switch);\n }\n } else { // if object\n var isAlias = root_switchs[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_switchs[\"@sap2010:WorkflowViewState.IdRef\"] : root_switchs[\"sap2010:WorkflowViewState.IdRef\"];\n // only exitings a connect default by switch\n if (root_switchs[\"p:FlowSwitch.Default\"] !== undefined) { // connect default\n getEntities(root_switchs[\"p:FlowSwitch.Default\"], isAlias);\n }\n // switch connection multi other decision/switch/step\n if (root_switchs[\"p:FlowDecision\"] !== undefined || root_switchs[\"p:FlowSwitch\"] !== undefined || root_switchs[\"p:FlowStep\"] !== undefined) {\n getEntities(root_switchs, isAlias);\n }\n\n // get info\n var _switch = new Entity();\n _switch.label = root_switchs[\"@DisplayName\"] !== undefined ? root_switchs[\"@DisplayName\"].replaceAll(\"\\\"\", \"&quot;\") : \"Switch\"; // label if existing different default\n _switch.expression = root_switchs[\"@Expression\"] !== undefined ? root_switchs[\"@Expression\"].replaceAll(\"\\\"\", \"&quot;\").substr(1, root_switchs[\"@Expression\"].length - 2) : (root_switchs[\"p:FlowSwitch.Expression\"] !== undefined ? root_switchs[\"p:FlowSwitch.Expression\"][\"mca:CSharpValue\"][\"#text\"] : \"\");\n _switch.annotation = root_switchs[\"@sap2010:Annotation.AnnotationText\"] !== undefined ? root_switchs[\"@sap2010:Annotation.AnnotationText\"].replaceAll(\"\\\"\", \"&quot;\") : \"\";\n _switch.typeSwitch = root_switchs[\"@x:TypeArguments\"].split(\"x:\")[1];\n _switch.type = typeEntity.t_switch;\n _switch.alias = isAlias;\n _switch.parent = parent !== undefined ? parent : \"\";\n mRoot.infoEntities.add(_switch);\n }\n }\n\n // step - unknown\n if (obj[\"p:FlowStep\"] !== undefined) {\n var root_steps = obj[\"p:FlowStep\"];\n if (typeof (root_steps) === \"object\" && root_steps.length !== undefined) {\n for (var i = 0; i < root_steps.length; i++) {\n var root_step = root_steps[i];\n // approve\n if (root_step[\"ftwa:ApproveTask\"] !== undefined) {\n var root_approve = root_step[\"ftwa:ApproveTask\"];\n // alias is step's name\n var isAlias = root_step[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_step[\"@sap2010:WorkflowViewState.IdRef\"] : root_step[\"sap2010:WorkflowViewState.IdRef\"];\n if (root_step[\"p:FlowStep.Next\"] !== undefined) {\n getEntities(root_step[\"p:FlowStep.Next\"], isAlias);\n }\n var _approve = new Entity();\n _approve.label = root_approve[\"@DisplayName\"] != undefined ? root_approve[\"@DisplayName\"].replaceAll(\"\\\"\", \"&quot;\") : \"ApproveTask\";\n _approve.annotation = root_approve[\"@sap2010:Annotation.AnnotationText\"] != undefined ? (root_approve[\"@sap2010:Annotation.AnnotationText\"] !== \"{x:Null}\" ? root_approve[\"@sap2010:Annotation.AnnotationText\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n // assign result to\n if (root_approve[\"@AssignResultTo\"] != undefined && root_approve[\"@AssignResultTo\"] === \"{x:Null}\") {\n _approve.AssignResultTo = \"\";\n } else {\n if (root_approve[\"ftwa:ApproveTask.AssignResultTo\"][\"p:OutArgument\"][\"mca:CSharpReference\"][\"#text\"] !== undefined) {\n _approve.AssignResultTo = root_approve[\"ftwa:ApproveTask.AssignResultTo\"][\"p:OutArgument\"][\"mca:CSharpReference\"][\"#text\"].replaceAll(\"\\\"\", \"&quot;\");\n } else {\n _approve.AssignResultTo = \"\";\n }\n }\n _approve.AssignedToUsers = root_approve[\"@AssignedToUsers\"] != undefined ? (root_approve[\"@AssignedToUsers\"] !== \"{x:Null}\" ? root_approve[\"@AssignedToUsers\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.CorrelationId = root_approve[\"@CorrelationId\"] != undefined ? (root_approve[\"@CorrelationId\"] !== \"{x:Null}\" ? root_approve[\"@CorrelationId\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.DefaultResult = root_approve[\"@DefaultResult\"] != undefined ? (root_approve[\"@DefaultResult\"] !== \"{x:Null}\" ? root_approve[\"@DefaultResult\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.Description = root_approve[\"@Description\"] != undefined ? (root_approve[\"@Description\"] !== \"{x:Null}\" ? root_approve[\"@Description\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.ExpiresIn = root_approve[\"@ExpiresIn\"] != undefined ? (root_approve[\"@ExpiresIn\"] !== \"{x:Null}\" ? root_approve[\"@ExpiresIn\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.ExpiresWhen = root_approve[\"@ExpiresWhen\"] != undefined ? (root_approve[\"@ExpiresWhen\"] !== \"{x:Null}\" ? root_approve[\"@ExpiresWhen\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.HandOverUsers = root_approve[\"@HandOverUsers\"] != undefined ? (root_approve[\"@HandOverUsers\"] !== \"{x:Null}\" ? root_approve[\"@HandOverUsers\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.OnComplete = root_approve[\"@OnComplete\"] != undefined ? (root_approve[\"@OnComplete\"] !== \"{x:Null}\" ? root_approve[\"@OnComplete\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.OnInit = root_approve[\"@OnInit\"] != undefined ? (root_approve[\"@OnInit\"] !== \"{x:Null}\" ? root_approve[\"@OnInit\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.TaskCode = root_approve[\"@TaskCode\"] != undefined ? (root_approve[\"@TaskCode\"] !== \"{x:Null}\" ? root_approve[\"@TaskCode\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.Title = root_approve[\"@Title\"] != undefined ? (root_approve[\"@Title\"] !== \"{x:Null}\" ? root_approve[\"@Title\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.UiCode = root_approve[\"@UiCode\"] != undefined ? (root_approve[\"@UiCode\"] !== \"{x:Null}\" ? root_approve[\"@UiCode\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.type = typeEntity.t_approve;\n _approve.alias = isAlias;\n _approve.parent = parent !== undefined ? parent : \"\";\n mRoot.infoEntities.add(_approve);\n }\n // generic\n if (root_step[\"ftwa:GenericTask\"] !== undefined) {\n // alias is step's name\n var root_generic = root_step[\"ftwa:GenericTask\"];\n var isAlias = root_step[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_step[\"@sap2010:WorkflowViewState.IdRef\"] : root_step[\"sap2010:WorkflowViewState.IdRef\"];\n if (root_step[\"p:FlowStep.Next\"] !== undefined) {\n getEntities(root_step[\"p:FlowStep.Next\"], isAlias);\n }\n var _generic = new Entity();\n _generic.label = root_generic[\"@DisplayName\"] != undefined ? root_generic[\"@DisplayName\"] : \"GenericTask\";\n _generic.annotation = root_generic[\"@sap2010:Annotation.AnnotationText\"] != undefined ? (root_generic[\"@sap2010:Annotation.AnnotationText\"] !== \"{x:Null}\" ? root_generic[\"@sap2010:Annotation.AnnotationText\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _generic.OnRun = root_generic[\"@OnRun\"] != undefined ? (root_generic[\"@OnRun\"] !== \"{x:Null}\" ? root_generic[\"@OnRun\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n // assign result to\n if (root_generic[\"@TaskCode\"] !== undefined && root_generic[\"@TaskCode\"] === \"{x:Null}\") {\n _generic.TaskCode = \"\";\n } else {\n if (root_generic[\"ftwa:GenericTask.TaskCode\"][\"p:InArgument\"][\"mca:CSharpValue\"][\"#text\"] !== undefined) {\n _generic.TaskCode = root_generic[\"ftwa:GenericTask.TaskCode\"][\"p:InArgument\"][\"mca:CSharpValue\"][\"#text\"].replaceAll(\"\\\"\", \"&quot;\");\n } else {\n _generic.TaskCode = \"\";\n }\n }\n _generic.type = typeEntity.t_generic;\n _generic.alias = isAlias;\n _generic.parent = parent !== undefined ? parent : \"\";\n mRoot.infoEntities.add(_generic);\n }\n }\n } else {\n // approve\n if (root_steps[\"ftwa:ApproveTask\"] !== undefined) {\n var root_approve = root_steps[\"ftwa:ApproveTask\"];\n // alias is step's name\n var isAlias = root_steps[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_steps[\"@sap2010:WorkflowViewState.IdRef\"] : root_steps[\"sap2010:WorkflowViewState.IdRef\"];\n if (root_steps[\"p:FlowStep.Next\"] !== undefined) {\n getEntities(root_steps[\"p:FlowStep.Next\"], isAlias);\n }\n var _approve = new Entity();\n _approve.label = root_approve[\"@DisplayName\"] != undefined ? root_approve[\"@DisplayName\"].replaceAll(\"\\\"\", \"&quot;\") : \"ApproveTask\";\n _approve.annotation = root_approve[\"@sap2010:Annotation.AnnotationText\"] != undefined ? (root_approve[\"@sap2010:Annotation.AnnotationText\"] !== \"{x:Null}\" ? root_approve[\"@sap2010:Annotation.AnnotationText\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n // assign result to\n if (root_approve[\"@AssignResultTo\"] !== undefined && root_approve[\"@AssignResultTo\"] === \"{x:Null}\") {\n _approve.AssignResultTo = \"\";\n } else {\n if (root_approve[\"ftwa:ApproveTask.AssignResultTo\"][\"p:OutArgument\"][\"mca:CSharpReference\"][\"#text\"] !== undefined) {\n _approve.AssignResultTo = root_approve[\"ftwa:ApproveTask.AssignResultTo\"][\"p:OutArgument\"][\"mca:CSharpReference\"][\"#text\"].replaceAll(\"\\\"\", \"&quot;\");\n } else {\n _approve.AssignResultTo = \"\";\n }\n }\n _approve.AssignedToUsers = root_approve[\"@AssignedToUsers\"] != undefined ? (root_approve[\"@AssignedToUsers\"] !== \"{x:Null}\" ? root_approve[\"@AssignedToUsers\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.CorrelationId = root_approve[\"@CorrelationId\"] != undefined ? (root_approve[\"@CorrelationId\"] !== \"{x:Null}\" ? root_approve[\"@CorrelationId\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.DefaultResult = root_approve[\"@DefaultResult\"] != undefined ? (root_approve[\"@DefaultResult\"] !== \"{x:Null}\" ? root_approve[\"@DefaultResult\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.Description = root_approve[\"@Description\"] != undefined ? (root_approve[\"@Description\"] !== \"{x:Null}\" ? root_approve[\"@Description\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.ExpiresIn = root_approve[\"@ExpiresIn\"] != undefined ? (root_approve[\"@ExpiresIn\"] !== \"{x:Null}\" ? root_approve[\"@ExpiresIn\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.ExpiresWhen = root_approve[\"@ExpiresWhen\"] != undefined ? (root_approve[\"@ExpiresWhen\"] !== \"{x:Null}\" ? root_approve[\"@ExpiresWhen\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.HandOverUsers = root_approve[\"@HandOverUsers\"] != undefined ? (root_approve[\"@HandOverUsers\"] !== \"{x:Null}\" ? root_approve[\"@HandOverUsers\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.OnComplete = root_approve[\"@OnComplete\"] != undefined ? (root_approve[\"@OnComplete\"] !== \"{x:Null}\" ? root_approve[\"@OnComplete\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.OnInit = root_approve[\"@OnInit\"] != undefined ? (root_approve[\"@OnInit\"] !== \"{x:Null}\" ? root_approve[\"@OnInit\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.TaskCode = root_approve[\"@TaskCode\"] != undefined ? (root_approve[\"@TaskCode\"] !== \"{x:Null}\" ? root_approve[\"@TaskCode\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.Title = root_approve[\"@Title\"] != undefined ? (root_approve[\"@Title\"] !== \"{x:Null}\" ? root_approve[\"@Title\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.UiCode = root_approve[\"@UiCode\"] != undefined ? (root_approve[\"@UiCode\"] !== \"{x:Null}\" ? root_approve[\"@UiCode\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.type = typeEntity.t_approve;\n _approve.alias = isAlias;\n _approve.parent = parent !== undefined ? parent : \"\";\n mRoot.infoEntities.add(_approve);\n }\n // generic\n if (root_steps[\"ftwa:GenericTask\"] !== undefined) {\n var root_generic = root_steps[\"ftwa:GenericTask\"];\n // alias is step's name\n var isAlias = root_steps[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_steps[\"@sap2010:WorkflowViewState.IdRef\"] : root_steps[\"sap2010:WorkflowViewState.IdRef\"];\n if (root_steps[\"p:FlowStep.Next\"] !== undefined) {\n getEntities(root_steps[\"p:FlowStep.Next\"], isAlias);\n }\n var _generic = new Entity();\n _generic.label = root_generic[\"@DisplayName\"] != undefined ? root_generic[\"@DisplayName\"].replaceAll(\"\\\"\", \"&quot;\") : \"GenericTask\";\n _generic.annotation = root_generic[\"@sap2010:Annotation.AnnotationText\"] != undefined ? (root_generic[\"@sap2010:Annotation.AnnotationText\"] !== \"{x:Null}\" ? root_generic[\"@sap2010:Annotation.AnnotationText\"] : \"\") : \"\";\n _generic.OnRun = root_generic[\"@OnRun\"] != undefined ? (root_generic[\"@OnRun\"] !== \"{x:Null}\" ? root_generic[\"@OnRun\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n // assign result to\n if (root_generic[\"@TaskCode\"] !== undefined && root_generic[\"@TaskCode\"] === \"{x:Null}\") {\n _generic.TaskCode = \"\";\n } else {\n if (root_generic[\"ftwa:GenericTask.TaskCode\"][\"p:InArgument\"][\"mca:CSharpValue\"][\"#text\"] !== undefined) {\n _generic.TaskCode = root_generic[\"ftwa:GenericTask.TaskCode\"][\"p:InArgument\"][\"mca:CSharpValue\"][\"#text\"].replaceAll(\"\\\"\", \"&quot;\");\n } else {\n _generic.TaskCode = \"\";\n }\n }\n _generic.type = typeEntity.t_generic;\n _generic.alias = isAlias;\n _generic.parent = parent !== undefined ? parent : \"\";\n mRoot.infoEntities.add(_generic);\n }\n }\n }\n}", "inOrderNext() {\n if (this.rightChild !== null)\n return this.rightChild.getSmallestInSubstree()\n var node = this\n while (node.parent.rightChild === node) {\n node = node.parent\n if (node.parent === null)\n return null\n }\n return node.parent\n }", "function cautiousNext() {\n depth++;\n if (depth > 100) {\n depth = 0;\n setImmediate(next);\n } else {\n next();\n }\n }", "function nextLeft(node) {\n\t var children = node.children;\n\t return children.length && node.isExpand ? children[0] : node.hierNode.thread;\n\t }", "getObjectInChildren(type)\n {\n let next = this.getObjectsInChildren(type).next();\n return next.done ? undefined : next.value;\n }", "function getNextItems(){\n getItems(model.itemOffset + model.items.length);\n }", "entityClick(params) {\r\n console.log(\"entityClick: \");\r\n console.log(params);\r\n const { traversalAction } = this.props;\r\n var menuData = this.props;\r\n for (let irow = 0; irow < params.value.items.length; irow++) {\r\n let row = params.value.items[irow];\r\n entityType = params.value.name;\r\n //creating a payload for traversal\r\n var payload = {\r\n \"request\": {\r\n \"level\": 1\r\n }\r\n , \"response\": {\r\n \"responseType\": \"List\"\r\n , \"entity\": [entityType]\r\n , \"selfJoin\": \"true\"\r\n , \"responseFilter\": [{\r\n \"for\": row.data.PrimaryLabel\r\n , \"filter\": [\"UUID;NOT EQUAL;\" + row.data.UUID]\r\n }\r\n ]\r\n }\r\n , \"expand\": [\"Capacity\", \"State\"]\r\n , \"searchFilter\": [{\r\n \"for\": row.data.PrimaryLabel\r\n , \"filter\": [\"UUID;EQUALS;\" + row.data.UUID]\r\n }\r\n ]\r\n };\r\n\r\n //for traversal from one entity to similar subentity\r\n if (row.data.PrimaryLabel == entityType && entityType != undefined) {\r\n if (payload && payload.request) {\r\n (payload.request.gDirection = entityType == \"Path\" || entityType == \"Service\" || entityType == \"Policy\" ? \"OUTGOING\" : \"INCOMING\");\r\n }\r\n //columnSelectedArray = this.state.columnAdd;\r\n var colPreferenceSelected = [];\r\n var displayedColumns = this.gridApi.gridCore.columnApi.getAllDisplayedColumns()\r\n if (displayedColumns == displayedColumnsOnApply) {\r\n colPreferenceSelected = columnSelected;\r\n }\r\n }\r\n //for traversal from Location to Equipment\r\n if (row.data.PrimaryLabel == \"Location\" && entityType != undefined && entityType == \"Equipment\") {\r\n if (payload && payload.response) {\r\n payload.response.levelData = {\r\n level: [\"0\"]\r\n };\r\n }\r\n }\r\n //\r\n //for traversal from Service to Customer\r\n if ((row.data.PrimaryLabel == \"Service\" || row.data.PrimaryLabel == \"Policy\") && entityType != undefined && entityType == \"Customer\") {\r\n if (payload && payload.request) {\r\n payload.request.level = '1';\r\n payload.request.gDirection='INCOMING';\r\n \r\n }\r\n }\r\n // if (row.data.PrimaryLabel != entityType) {\r\n // delete payload.request.level;\r\n // }\r\n var traversalMenuData = [entityType, row.data.PrimaryLabel, payload, row.data];\r\n this.traversalEntityFn(traversalMenuData);\r\n traversalData = [entityType, row.data.PrimaryLabel, payload];\r\n //ajax call for traversal\r\n traversalAction({\r\n url: menuData.gridData.domain + \"graphSearch?limit=100&page=1\",\r\n imageIconurl: menuData.gridData.imageIconurl,\r\n requestHeaders: menuData.gridData.requestHeaders ? menuData.gridData.requestHeaders : {},\r\n payload: payload,\r\n externalIconURL: menuData.gridData.externalIconURL,\r\n stateConfig: menuData.gridData.stateConfig,\r\n method: menuData.gridData.method,\r\n columnUrl: menuData.gridData.metadataUrl + menuData.gridData.columnurl,\r\n selectedEntity: entityType,\r\n columnResponse: menuData.gridData.columnResponse ? menuData.gridData.columnResponse : colPreferenceSelected\r\n });\r\n }\r\n }", "entity() {\n return internal(this).entity;\n }", "get root () {\r\n return this.levels[this.levels.length - 1][0];\r\n }", "getLast () {\n if (!this.head) {\n return null \n }\n\n let current = this.head; \n\n // if a current node doesn't have a next property it means its the last node in the list \n while (current.next) {\n current = current.next\n }\n\n return current \n }", "*[Symbol.iterator]() {\n\t\tlet node = this.head;\n\t\twhile(node.next !== null){\n\t\t\tyield node;\n\t\t\tnode = node.next;\n\t\t}\n\t}", "getNext(data) {\n return __awaiter(this, void 0, void 0, function* () {\n const { children } = this;\n for (let i = 0; i < children.length; ++i) {\n const child = children[i];\n if (!child.condition || (yield child.condition(data))) {\n return child;\n }\n }\n return null;\n });\n }", "getNext() {\n return this.next || null;\n }", "get end() {\n return this.$to.after(this.depth + 1);\n }", "function advance(n, item) {\n var currNode = this.find(item);\n for (var i = 1; i <= n; i++) {\n if (currNode.next.element !== \"head\") {\n currNode = currNode.next;\n }\n else {\n currNode = currNode.next.next;\n }\n }\n console.log(currNode.element);\n return currNode;\n }", "nestCurrBullet() {\n const prevBullet = this.previousElementSibling;\n if (prevBullet == null) return;\n if (this.getNestDepthRem() <= 0) return;\n prevBullet.nestBulletInside(this);\n this.updateCallbacks.nestCurrBullet(this.uniqueID, prevBullet.uniqueID, true);\n this.transferFocusTo(this); // Reset focus\n }", "function nextLeft(node) {\n var children = node.children;\n return children.length && node.isExpand ? children[0] : node.hierNode.thread;\n}", "read() {\n var current = this.head; // set curret as the head, if it exists or not\n\n while (current) { // if current, log and move to current.next\n console.log(current.data);\n current = current.next;\n }\n }", "nextImage() {\n this.postFeatures();\n //get the scenes for the next lat/lng\n const collectionid = 'GOOGLE/GEO/ALL/SATELLITE/WORLDVIEW3/ORTHO/RGB';\n // const collectionid = 'LANDSAT/LC8_L1T_TOA';\n this._get(GEE_IMAGE_SERVER_ENDPOINT + \"getIdsForPoint?lng=\" + this.state.lng + \"&lat=\" + this.state.lat + \"&collectionid=\" + collectionid).then(json => {\n //the geeImageServer returns quasi-json data\n const sceneIds = eval(json.records.substring(json.records.indexOf(\"[\"), json.records.length - 1));\n //if there are scenes then get the first\n const sceneId = (sceneIds.length) ? sceneIds[0] : undefined;\n //load that scene\n if (sceneId) this.addGEEImage(sceneId);\n });\n }", "function getNext() {\n\n }", "get _first () {\n let n = this._start;\n while (n !== null && n.deleted) {\n n = n.right;\n }\n return n\n }", "get _first () {\n let n = this._start;\n while (n !== null && n.deleted) {\n n = n.right;\n }\n return n\n }", "get next() {\n for (let i = 0; i < this.chapters.length; i++)\n if(this.isSelected(this.chapters[i]))\n return this.chapters[i + 1] ? this.chapters[i + 1] : null;\n }", "nextLevel() {\n this.subLevel = 0;\n this.changeTagLevel(this.level);\n this.illuminateSequence();\n this.addButtonListener();\n }", "function traverseNextElement(tNode) {\n if (tNode.child) {\n return tNode.child;\n } else if (tNode.next) {\n return tNode.next;\n } else {\n // Let's take the following template: <div><span>text</span></div><component/>\n // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n // in this case the parent `div`, so that we can find the component.\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n\n return tNode.parent && tNode.parent.next;\n }\n }", "function traverseNextElement(tNode){if(tNode.child){return tNode.child;}else if(tNode.next){return tNode.next;}else{// Let's take the following template: <div><span>text</span></div><component/>\n// After checking the text node, we need to find the next parent that has a \"next\" TNode,\n// in this case the parent `div`, so that we can find the component.\nwhile(tNode.parent&&!tNode.parent.next){tNode=tNode.parent;}return tNode.parent&&tNode.parent.next;}}", "function nextRight(v){var children=v.children;return children?children[children.length-1]:v.t}", "function get_level_from_db_and_start_level(next_level_hash) {\n\t// Provides server with level_id, will return json\n\tdebug(\"Get the next level\")\n\t$.ajax( {\n url: '/_get_level_blob',\n data: JSON.stringify ({\n 'next_level_hash':next_level_hash\n }, null, '\\t'),\n contentType: 'application/json;charset=UTF-8',\n type: \"POST\",\n success: function(response) {\n // Returns status=1 and userID\n var response = JSON.parse(response);\n var status = response['status']\n var level_blob = response['data']\n if (status=='1') {\n\n // Saved successfully and got next level\n //level_number += 1 // Done elsewhere\n level = level_blob\n\n // Once the level is loaded, start the level sequence\n begin_level_sequence() \n\n }\n else {\n console.log(\"Could not load level.\")\n }\n },\n fail: function() {\n alert(\"Server error\")\n } // end success callback\n }); // end ajax\n}", "getNext() {\n return this.next;\n }", "async function getRestOfPages(nodes, currPage) {\n let next = currPage.paging.next;\n if (!next) {\n return nodes;\n }\n /* TODO: Eliminate dependency on request-promise-native by using fb.api()\n * instead.\n */\n let nextPage = await request.get(next, {json: true});\n nodes.push(...nextPage.data);\n return getRestOfPages(nodes, nextPage);\n}", "traverse() {\n let result = [];\n let curr = this.first;\n while (curr) {\n result.push(curr.val);\n curr = curr.next;\n }\n return result;\n }", "getNextNavigable(event) {\n // subclasses should override\n this.MarkAsLastVisitedChild();\n return this;\n }", "*forwards() {\r\n yield this;\r\n yield* this.descendants();\r\n }", "function _contextNext() {\n\n\t // Get the next node from the sequence\n\t if (!this._contextState.nextSequence) {\n\t return undefined;\n\t }\n\t if (this._context.reverse) {\n\t this._contextState.nextSequence = this._contextState.nextSequence.getNext();\n\t if (!this._contextState.nextSequence) {\n\t return undefined;\n\t }\n\t }\n\t var renderNode = this._contextState.nextSequence.get();\n\t if (!renderNode) {\n\t this._contextState.nextSequence = undefined;\n\t return undefined;\n\t }\n\t var nextSequence = this._contextState.nextSequence;\n\t if (!this._context.reverse) {\n\t this._contextState.nextSequence = this._contextState.nextSequence.getNext();\n\t }\n\t return {\n\t renderNode: renderNode,\n\t viewSequence: nextSequence,\n\t next: true,\n\t index: ++this._contextState.nextGetIndex\n\t };\n\t }", "levelOrderSearch(node) {\n if (node === null) {\n return;\n }\n\n let discoveredNodes = [];\n discoveredNodes.push(node);\n\n while(discoveredNodes.length > 0) {\n let currentNode = discoveredNodes[0];\n console.log(currentNode.data);\n\n if (currentNode.leftChild !== null) {\n discoveredNodes.push(currentNode.leftChild);\n }\n if (currentNode.rightChild !== null) {\n discoveredNodes.push(currentNode.rightChild);\n }\n\n discoveredNodes.shift();\n }\n }", "function handleObjects(root, entities) {\n for (var i = 0; i < entities.length; i++) {\n var entity = entities[i];\n if (entity.child !== undefined && entity.child.length != 0) {\n for (var j = 0; j < entity.child.length; j++) {\n var child = entity.child[j];\n check(child, entity);\n }\n }\n if (entity.type === typeEntity.t_start) {\n root.start = entity;\n } else if (entity.type === typeEntity.t_decision) {\n if (root.decision === undefined) {\n root.decision = new Array();\n }\n root.decision.push(entity);\n } else if (entity.type === typeEntity.t_switch) {\n if (root.switch === undefined) {\n root.switch = new Array();\n }\n root.switch.push(entity);\n } else {\n if (root.step === undefined) {\n root.step = new Array();\n }\n root.step.push(entity);\n }\n }\n\n function check(entity, parent) {\n if (entity.child.length !== 0) {\n for (var i = 0; i < entity.child.length; i++) {\n var child = entity.child[i];\n check(child, entity);\n }\n }\n if (parent.type === typeEntity.t_decision) {\n if (checkconnection(parent.id, entity.id, groupConnectionsIDFroms).toLowerCase() === \"false\") {\n parent._false = entity;\n }\n if (checkconnection(parent.id, entity.id, groupConnectionsIDFroms).toLowerCase() === \"true\") {\n parent._true = entity;\n }\n }\n\n if (parent.type === typeEntity.t_switch) {\n if (parent._case === undefined) {\n parent._case = new Array();\n }\n if (checkconnection(parent.id, entity.id, groupConnectionsIDFroms).toLowerCase() !== \"true\"\n || checkconnection(parent.id, entity.id, groupConnectionsIDFroms).toLowerCase() !== \"false\"\n || checkconnection(parent.id, entity.id, groupConnectionsIDFroms).toLowerCase() !== \"\") {\n parent._case.push(entity);\n }\n }\n if (parent.type === typeEntity.t_approve || parent.type === typeEntity.t_generic) {\n if (checkconnection(parent.id, entity.id, groupConnectionsIDFroms).toLowerCase() === \"default\"\n || checkconnection(parent.id, entity.id, groupConnectionsIDFroms).toLowerCase() === \"\") {\n parent._next = entity;\n }\n }\n }\n\n function checkconnection(from, to, connections) {\n for (var i = 0; i < connections.length; i++) {\n var conn = connections[i];\n if (conn.idfrom == from) {\n for (var j = 0; j < conn.connections.length; j++) {\n var entityTo = conn.connections[j];\n if (entityTo.to == to) {\n return entityTo.label;\n }\n }\n }\n }\n return \"\";\n }\n}", "print_level_order() {\n console.log(\"Level order traversal using 'next' pointer: \");\n let nextLevelRoot = this;\n while (nextLevelRoot !== null) {\n let current = nextLevelRoot;\n nextLevelRoot = null;\n while (current != null) {\n process.stdout.write(`${current.val} `);\n if (nextLevelRoot === null) {\n if (current.left !== null) {\n nextLevelRoot = current.left;\n } else if (current.right !== null) {\n nextLevelRoot = current.right;\n }\n }\n current = current.next;\n }\n console.log();\n }\n }", "static get nextId() {\n return TreeChart._nextId++;\n }", "traversal(position) {\n let node = this.head\n let counter = 1\n while (counter < position && node !== null) {\n node = node.next\n counter++\n }\n return node\n }", "function nextContext(level) {\n if (level === void 0) {\n level = 1;\n }\n contextViewData = walkUpViews(level, contextViewData);\n return contextViewData[CONTEXT];\n}", "function getContextualPath() {\n var currentObj = $scope.domainObject,\n currentParent,\n parents = [];\n\n currentParent = currentObj &&\n currentObj.hasCapability('context') &&\n currentObj.getCapability('context').getParent();\n\n while (currentParent && currentParent.getModel().type !== 'root' &&\n currentParent.hasCapability('context')) {\n // Record this object\n parents.unshift(currentParent);\n\n // Get the next one up the tree\n currentObj = currentParent;\n currentParent = currentObj.getCapability('context').getParent();\n }\n\n $scope.contextutalParents = parents;\n }", "async fetchChildren(block) {\n const height = block.header.height;\n const maxHeight = this.chainCache.length - 1;\n if (height >= maxHeight) return null;\n let nextGen = null;\n // walk up the chain until we find the next gen or we run out of chain\n for (\n let nextHeight = height + 1;\n !nextGen && nextHeight <= maxHeight;\n nextHeight++\n ) {\n nextGen = await this.chainCache[nextHeight];\n }\n if (!nextGen) return null;\n // only return blocks that point the requested parent\n return nextGen.filter(b => {\n const cids = Chain.getParentCids(b);\n return cids.some(cid => cid === block.cid);\n });\n }", "printForward() {\n let current = this.head;\n while(current != null) {\n console.log(current.object);\n current = current.next;\n }\n }", "nextOrder() {\r\n return this.length ? this.last().get('order') + 1 : 1;\r\n }", "expandEntities(name, entities, instances, rootInstance, op, property, operations, properties, turn, text, entityToInfo) {\n if (!name.startsWith('$')) {\n // Entities representing schema properties end in \"Property\" to prevent name collisions with the property itself.\n const propName = this.stripProperty(name);\n let entityName;\n let isOp = false;\n let isProperty = false;\n if (operations.includes(name)) {\n op = name;\n isOp = true;\n }\n else if (properties.includes(propName)) {\n property = propName;\n isProperty = true;\n }\n else {\n entityName = name;\n }\n entities.forEach((entity, index) => {\n const instance = instances[index];\n let root = rootInstance;\n if (!root) {\n // Keep the root entity name and position to help with overlap.\n root = cloneDeep_1.default(instance);\n root.type = `${name}${index}`;\n }\n if (entityName) {\n this.expandEntity(entityName, entity, instance, root, op, property, turn, text, entityToInfo);\n }\n else if (typeof entity === 'object' && entity !== null) {\n if (isEmpty_1.default(entity)) {\n if (isOp) {\n // Handle operator with no children.\n this.expandEntity(op, null, instance, root, op, property, turn, text, entityToInfo);\n }\n else if (isProperty) {\n // Handle property with no children.\n this.expandEntity(property, null, instance, root, op, property, turn, text, entityToInfo);\n }\n }\n else {\n this.expandEntityObject(entity, op, property, root, operations, properties, turn, text, entityToInfo);\n }\n }\n else if (isOp) {\n // Handle global operator with no children in model.\n this.expandEntity(op, null, instance, root, op, property, turn, text, entityToInfo);\n }\n });\n }\n }", "function traverse(_itemData,_start,_stop,_list){\n\tif (_itemData.children){\n\t\t_start++;\n\t\tfor (var i in _itemData.children){\n\t\t\tif (_itemData.children[i].children && _stop >_start){\n\t\t\t\ttraverse(_itemData.children[i],_start,_stop,_list);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// do whtever needs to be don on the stop-level\n\t\t\t\t// as an example just return the elements\n\t\t\t\t_list.push(_itemData.children[i]);\n\t\t\t}\n\t\t}\n\t}\n\telse{\n\t\tconsole.log(\"....no more children found..\");\n\t}\n}", "get leaves () {\r\n return this.levels[0];\r\n }", "function getFreeId() {\n while(entities[nextId] !== undefined) {\n nextId++;\n }\n return nextId++;\n}", "recursiveDisplay(current = this.head){\n if(current === null) return;\n console.log(current.data);\n this.recursiveDisplay(current.next);\n }", "function nextRight(node) {\n\t var children = node.children;\n\t return children.length && node.isExpand ? children[children.length - 1] : node.hierNode.thread;\n\t }", "nextLevel() { \n \n    level++;\n    progress = 0;\n \n    //  We change the image to name\n    this.currentObject.loadLevel();\n \n    //  Update the current level\n  }", "fetchMore(options) {\n var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (options.amount <= 0 || startIndex >= this.children.length) {\n return _Promise2.default.resolve([]);\n }\n if (!options.skipReplies) {\n return this.fetchTree(options, startIndex);\n }\n var ids = getNextIdSlice(this.children, startIndex, options.amount, _constants.MAX_API_INFO_AMOUNT).map(function (id) {\n return 't1_' + id;\n });\n // Requests are capped at 100 comments. Send lots of requests recursively to get the comments, then concatenate them.\n // (This speed-requesting is only possible with comment Listings since the entire list of ids is present initially.)\n var promiseForThisBatch = this._r._getListing({ uri: 'api/info', qs: { id: ids.join(',') } });\n var nextRequestOptions = _extends({}, options, { amount: options.amount - ids.length });\n var promiseForRemainingItems = this.fetchMore(nextRequestOptions, startIndex + ids.length);\n return _Promise2.default.all([promiseForThisBatch, promiseForRemainingItems]).then(_flatten3.default);\n }", "get entities() {\n return this.system.entities;\n }", "function orgNodeTrail(node) {\n\tvar na = new Array();\n\twhile( node ) {\n\t\tna.push(node);\n\t\tnode = findOrgUnit(node.parent_ou());\n\t}\n\treturn na.reverse();\n}", "lazyLoad() {\n if(!this.state.loading && this.state.next) {\n const offset = this.state.offset + this.state.limit;\n this.getAlbums(offset);\n }\n }", "nextLevel(){\n this.levelSpawner.level++;\n\n // if we get to the end set player to the first level and bring up the main menu\n if(this.levelSpawner.level >= this.levelSpawner.levels.length)\n {\n this.scene.switch(\"menuscene\");\n this.scene.stop(\"levelcompletescene\");\n this.scene.stop(\"maingame\");\n\n } else{\n this.levelSpawner.setCurrentLevel();\n this.triggerLevelLoad();\n this.activateControllerInput();\n }\n\n }" ]
[ "0.57785875", "0.56962353", "0.5526726", "0.5470669", "0.54487985", "0.5401424", "0.5371717", "0.53493565", "0.53141624", "0.52868146", "0.5265171", "0.5262571", "0.52598953", "0.5193684", "0.5184942", "0.5181525", "0.51799035", "0.51799035", "0.51523674", "0.5148079", "0.51362556", "0.51349187", "0.50778294", "0.5076287", "0.5072711", "0.5064208", "0.50583017", "0.50515586", "0.50347114", "0.5015612", "0.5015612", "0.5015612", "0.5015612", "0.5015612", "0.5015612", "0.5003821", "0.49901295", "0.49735245", "0.4972711", "0.49509946", "0.4940401", "0.49335226", "0.49277532", "0.4914638", "0.48989105", "0.48979428", "0.48974186", "0.48884127", "0.48788944", "0.48766765", "0.48761782", "0.4868141", "0.48643368", "0.4863362", "0.4855717", "0.48523355", "0.48515278", "0.48228407", "0.4811638", "0.48107678", "0.4810168", "0.47986346", "0.47983536", "0.47949475", "0.4781545", "0.47812432", "0.47812432", "0.4773372", "0.47689864", "0.47631177", "0.4762243", "0.475941", "0.475604", "0.47557008", "0.4750757", "0.47504622", "0.4744015", "0.4738973", "0.47376657", "0.47323096", "0.47221482", "0.4721586", "0.47129342", "0.47129327", "0.47095308", "0.47061542", "0.47030458", "0.47019178", "0.46989062", "0.4698853", "0.46952426", "0.4690883", "0.46872967", "0.46845928", "0.4681382", "0.4668134", "0.46635514", "0.4662196", "0.4646462", "0.46348467", "0.4634016" ]
0.0
-1
generates random number inclusive, taking min & max as arguments
function getRandom(min, max) { return Math.floor((Math.random() * (max-min+1))+min); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomNumberGenerator(min, max) {return Math.floor(Math.random() * (max - min + 1) ) + min;}", "function numberGenerator(min, max) {\n return min + Math.floor(Math.random() * max)\n}", "function generateNumber(min, max) {\r\n return Math.floor(Math.random()* (max - min) + min);\r\n}", "function randomNumberGenerator(min, max){\n return Math.floor(Math.random()*(max-min+1))+min;\n}", "function generateNumber(min, max){\n return Math.floor(Math.random() * (max - min) + min)\n}", "function randomNumberGenerator(max, min){\n\n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "function randomNumberGenerator(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function generateNumberBetween(min, max) {\n return min + Math.floor(Math.random() * (max - min));\n}", "function randomIntGen(min, max){\n return Math.floor(Math.random() * (max - min +1)) + min;\n }", "function randomNumGenerator(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "function randomNumberGen(min,max) {\n\n return Math.floor(Math.random()*(max-min+1)+min)\n\n}", "function generateRandomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "function generateRandomNumber(min, max){\n return Math.floor(Math.random() * (max - min) + min);\n}", "function randomNumberGenerate(min, max) {\n return Math.floor(Math.random() * max - min + 1) + 1;\n}", "function generateRandomNumber(min, max){\n return Math.floor(Math.random() * (1 + max - min) + min);\n\n}", "function getNumberGenerator(min, max) {\n return Math.floor(Math.random() * (max - min) + 1) + min;\n}", "function randomGen(min, max){\r\n return Math.floor(Math.random() * max - min) + min;\r\n}", "range(min, max) {\n\t\tlet r = Math.floor(Math.random() * max);\n\t\twhile(r < min)\n\t\t\tr = Math.floor(Math.random() * max);\n\t\treturn r;\n\t}", "function genRanNum(min,max){\r\n return Math.floor(Math.random() * (max - min)) + min;\r\n}", "range(max, min){\n let num = Math.round(Math.random()*(min-max)+max);\n return num;\n}", "function randomNumberGenerator(min, max) {\n function randomNum() {\n return Math.floor(Math.random() * (max - min) + min);\n }\n return randomNum();\n}", "range(min, max) {\n return lerp(min, max, Math.random())\n }", "function generateRandomNumber ( min, max ) {\n return Math.floor( Math.random() * max + 1 );\n}", "function generateRandomNum(min,max){\n return Math.floor(Math.random()*(max-min+1)+min);\n }", "function generateRandNum(min, max){\n return Math.random() * (max - min) + min;\n}", "function genRandNum(min,max){\n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "function randomNumber(min, max) {\n return Math.floor(Math.random() * max) + min;\n }", "function genValue(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function genRandRange(min,max) {\n return Math.floor(Math.random() * (max-min+1)) + min;\n }", "function createRandomNumber (min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n}", "function getRandomNumber(min, max) {\n return (Math.random() * (+max - +min) + min);\n }", "getRandomNumber(max,min){\n return Math.floor(Math.random()*max+min);\n }", "function getRandomNumber(min, max) {\n return Math.floor(Math.random() * max) + min;\n}", "function getRandomIntEx(min, max) {//max not inclusive\r\n return Math.floor(Math.random() * (max - min)) + min;\r\n}", "function randomGenerator(max, min) {\n min = Math.ceil(min);\n max = Math.floor(max);\n var intNUm = Math.floor(Math.random() * (max - min + 1)) + min;\n return intNUm;\n}", "getRandomIntInclusive (min, max) {\n min = Math.ceil(this.min);\n max = Math.floor(this.max);\n return Math.floor(Math.random() * (max-min +1)) +min;\n }", "function getRandomNumber(min, max){\r\n random = Math.floor(Math.random() * (max + 1 + min)) + min;\r\n return random;\r\n}", "generateRandom(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n }", "function genRandomNumber(min, max) {\n return randomNumber = Math.floor(Math.random() * (max - min) + 1) + min;\n}", "function randomRange(min_num, max_num){\r\n return Math.floor(Math.random() * (max_num) + min_num);\r\n}", "function math_randRange(num_min, num_max){\n return (Math.floor(Math.random() * (num_max - num_min + 1)) + num_min);\n}", "function getRandomNumber(min, max) {\n return min + Math.random() * (max - min);\n}", "function generateRandomNumber() {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function randomNumber(min,max){\n return Math.floor(Math.random()*(max-min+1)+min);\n }", "function randInt(min, max) { return Math.random() * (max - min) + min; }", "function randInt(min, max) { return Math.random() * (max - min) + min; }", "function getRandomNumber(min,max){\r\n return Math.floor(Math.random()*(max-min)+min);\r\n}", "function numberRandom (min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min );\n}", "function rng(min, max) {\n\tconst rand = Math.random() * (max - min) + min;\n\treturn Math.floor(rand);\n}", "function randomNumber(min,max) {\r\n var genNumber = Math.floor(Math.random() * (max - min + 1)) + min;\r\n return genNumber;\r\n}", "function getRandom(min,max){return Math.floor(Math.random()*(max+1-min))+min;}////", "function generateRandomNumber(min, max) {\n var result = Math.floor(Math.random() * (max - min + 1)) + min;\n return result;\n}", "generateRandomInteger(min, max){\n return Math.floor(min + Math.random()*(max+1 - min));\n }", "function generateRandomNum(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function randomGenerator(min, max) {\n var returnValue = Math.floor((max - min) * Math.random() + min);\n return returnValue;\n }", "function getRandomNumber(min, max) {\n return Math.random() * (max - min) + min;\n} // getRandomNumber", "function getRandomNumber(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}", "function getRandomNumber(min, max) {\n return Math.random() * (max - min) + min;\n }", "function getRandomNumber(min, max) {\n return Math.random() * (max - min) + min;\n }", "function getRandomNumber(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1) + min);\r\n }", "function randomNumber(min, max) { \r\n return Math.floor(Math.random() * (max - min) + min);\r\n}", "function getRandomNumber(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n }", "function randomNumber(min, max){\n return Math.floor(Math.random() * (1 + max - min) + min);\n}", "function randomNumber(min, max){\n return Math.floor(Math.random() * (1 + max - min) + min);\n}", "function randomNumber(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n }", "randNum (min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function genRandomNumber(min, max) {\n // syntax for random number: return Math.floor(Math.random()*(max-min+1)+min);\n minRange = min;\n maxRange = max;\n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "function randomNumber(min, max){\n return Math.floor(Math.random() * (1 + max - min) + min);\n}", "function randomNumber(min, max){\n return Math.floor(Math.random() * (1 + max - min) + min);\n}", "function randomNumber(min, max) { \n return Math.random() * (max - min) + min;\n}", "function genRanNum(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function getRandomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n }", "function randomNum(min, max){\n return(Math.random() * (+max - +min) + +min);\n }", "function genRandom(min,max){\n\n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "function RandomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "function range(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function range(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "randomNumber(min, max) { \n return Math.floor(Math.random() * (max - min) + min); \n }", "function randGen(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "getRandomNumber(min, max) {\n return Math.floor((Math.random() * max) + min);\n }", "function rando(min,max) {\n return (min + (Math.random()*(max-min)))\n}", "function randomNumber(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1)) + min\r\n}", "function randomNumber(min,max)\n{\n return Math.floor(Math.random()*(max-min+1)+min);\n}", "function randomNumber(min,max)\n{\n return Math.floor(Math.random()*(max-min+1)+min);\n}", "function randomNumber(min, max) {\r\n return Math.floor(Math.random() * (max - min)) + min;\r\n }", "function generateRandom(min, max) {\r\n return Math.ceil( Math.random() * ( max - min ) );\r\n }", "function randomInclusive(min, max){\r\n\treturn Math.floor(Math.random() * (max - min + 1)) + min;\r\n}", "function randomNumber(min, max) {\n return Math.random() * (max - min) + min;\n }", "function randomNumber(min, max){\n return Math.floor(Math.random()*(max-min+1)+min);\n}", "function getRandomNumber(min, max){\n return (Math.random() * (max - min)) + min;\n}", "function randomNumber(min, max)\n{\n\treturn Math.random() * (max - min) + min;\n}", "function rnd(min=0,max=1){return Math.random()*(max-min)+min;}", "function randomNumber(min, max){\n\treturn Math.floor(Math.random() * (1 + max - min) + min);\n}", "function getRandomIntInclusive (min, max) {\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}", "function randomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n }", "function rand_num(min, max){\r\n return Math.random() * (max - min) + min;\r\n}", "function randomNum(min,max){\n return Math.random() * (max-min) + min;\n }", "function numGenerator(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "getRandomInt (min:Number = 0, max:Number) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "function generateRandom(min, max) {\n return Math.floor( Math.random() * (max - min + 1) ) + min;\n }", "function randomNumber(min, max) {\n return Math.floor(Math.random() * (1 + max - min) + min);\n}" ]
[ "0.8899972", "0.8822758", "0.8809232", "0.8711913", "0.8700233", "0.8654521", "0.8649814", "0.86061054", "0.8588224", "0.8583019", "0.8582188", "0.85697657", "0.8562761", "0.85496867", "0.85425323", "0.8537246", "0.85292625", "0.85205245", "0.8518176", "0.8517652", "0.8516999", "0.85104924", "0.8503188", "0.8499761", "0.84983146", "0.8495964", "0.8493983", "0.84910053", "0.8490183", "0.8489932", "0.8487065", "0.8486999", "0.84850484", "0.84840685", "0.8481664", "0.84781516", "0.8474626", "0.84650445", "0.84629434", "0.8460884", "0.8457377", "0.84553695", "0.84534335", "0.8450009", "0.84477925", "0.84477925", "0.84439397", "0.84433156", "0.8441034", "0.84389806", "0.8436736", "0.84340364", "0.8431836", "0.84274405", "0.842438", "0.8418377", "0.8415991", "0.84157395", "0.84157395", "0.84131", "0.8412071", "0.8409276", "0.84090126", "0.84090126", "0.8406046", "0.8405602", "0.83997685", "0.8399366", "0.8399366", "0.83989257", "0.83985925", "0.8398142", "0.8396487", "0.83961797", "0.83950025", "0.8393558", "0.8393558", "0.8393274", "0.83925015", "0.8390218", "0.8389965", "0.8388008", "0.8387148", "0.8387148", "0.8386217", "0.83857965", "0.83857685", "0.838566", "0.8383162", "0.83829665", "0.83816296", "0.8378675", "0.8378065", "0.8377781", "0.8375441", "0.83747977", "0.8373451", "0.8371733", "0.83689237", "0.83680594", "0.83675826" ]
0.0
-1
Pixel color representation of this position
getPixelData() : PixelData { var c = Math.abs(this.height) * 255; return new PixelData(c, c, c); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPixelColor(img, x, y) {\n var data = img.data;\n var offset = ((y * (img.width * 4)) + (x * 4));\n var result = data[offset + 0] << 24; // r\n result |= data[offset + 1] << 16; // g\n result |= data[offset + 2] << 8; // b\n return result;\n }", "getColor() {\n var i = (this.speed * 255) / 255;\n var r = Math.round(Math.sin(0.024 * i + 0) * 127 + 128);\n var g = Math.round(Math.sin(0.024 * i + 2) * 127 + 128);\n var b = Math.round(Math.sin(0.024 * i + 4) * 127 + 128);\n var rgb = \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\n\n return rgb;\n }", "function getPixelColor(x, y) {\n\tvar canvas = document.getElementById('World');\n\tvar ctx = canvas.getContext('2d');\n\t// get color of pixel\n\tdata = ctx.getImageData(x, y, 1, 1).data;\n\t// build hex string from extracted data\n\treturn data[0].toString(16).padStart(2, '0') + data[1].toString(16).padStart(2, '0') + data[2].toString(16).padStart(2, '0');\n}", "get colorValue() {}", "get rgb_1() {\n let c = new Color(this.r, this.g, this.b);\n return [c.r / 255, c.g / 255, c.b / 255];\n }", "get rgb() { return [this.r, this.g, this.b]; }", "getPixel(x, y, width) {\n let color = x * 4 + y * (width * 4);\n return { red: color, green: color + 1, blue: color + 2, alpha: color + 3};\n }", "pixelToHex( p ) {\n let size = this.state.hexSize\n let origin = this.state.hexOrigin\n\n // KEY pointy or flat\n // flat\n // let q = ( p.x - origin.x ) * 2/3 / size\n // let r = ( -( p.x - origin.x ) / 3 + Math.sqrt(3)/3 * ( p.y - origin.y ) ) / size\n // return this.Hex( q, r, -q -r )\n\n // pointy\n let q = ( ( p.x - origin.x ) * Math.sqrt(3)/3 - ( p.y - origin.y ) / 3 ) / size\n let r = ( p.y - origin.y ) * 2/3 / size\n return this.Hex( q, r, -q -r )\n }", "getColor(x, y) {\n const distanceToNearestCircle = this.getDistance(x, y);\n\n const rgbaArray = this.getColorFromDistanceFromNearestCircle(distanceToNearestCircle);\n\n return rgbaArray;\n }", "function getColor(x, y) {\n var base = (Math.floor(y) * width + Math.floor(x)) * 4;\n var c = {\n r: pixels[base + 0],\n g: pixels[base + 1],\n b: pixels[base + 2],\n a: pixels[base + 3]\n };\n\n return \"rgb(\" + c.r + \",\" + c.g + \",\" + c.b + \")\";\n }", "equals (color) { return this.getPixel() === color.getPixel() }", "function getpixelcolour(x, y) {\r\n var pixels = ctx.getImageData(0, 0, canvas.width, canvas.height);\r\n var index = ((y * (pixels.width * 4)) + (x * 4));\r\n return {\r\n r: pixels.data[index],\r\n g: pixels.data[index + 1],\r\n b: pixels.data[index + 2],\r\n a: pixels.data[index + 3]\r\n };\r\n }", "function getPixel(data, pos){\n var position = getPixelPosition(pos.x, pos.y, pos.width);\n return {\n a: data[position + 3],\n position: {\n pixelPosition : position,\n x: pos.x,\n y: pos.y\n },\n color: {\n r: data[position],\n g: data[position + 1],\n b: data[position + 2]\n }\n };\n}", "get color() {return this._p.color;}", "byteAddress_xyc(x, y, c) {\n return 'rgba'.indexOf(c) + 4 * (x + y * this.buffer.width);\n }", "getColor() {\n return this._color;\n }", "getCurRGB() {\n return Helpers.hslToRgb(\n this.hue,\n this.saturation,\n this.brightness\n );\n }", "function point2ColorPos(pt, imgSize) {\n return ((pt.y - 1) * imgSize.w * 4) + (pt.x * 4 - 4);\n}", "get color() {\n\t\treturn this.__color;\n\t}", "function getColour(event){\n var mousePos = _this.getMousePos(canvas, event);\n var x = mousePos.x - padding;\n var y = mousePos.y - padding;\n\n var imageData = context.getImageData(padding, padding, imageObj.width, imageObj.height);\n var data = imageData.data;\n var red = data[((imageObj.width * y) + x) * 4];\n var green = data[((imageObj.width * y) + x) * 4 + 1];\n var blue = data[((imageObj.width * y) + x) * 4 + 2];\n var hexColor = _this.rgbToHex(red, green, blue);\n\n _this.updatePreview(hexColor);\n }", "getColor(x,y) {\r\n return this.board[x][y];\r\n }", "static get INACTIVE_COLOR() { return [128, 128, 128, 100]; }", "function getColorOfPixel(x, y) {\n\tlet p = bg_context.getImageData(x, y, 1, 1).data;\n\tlet color = \"#\" + (\"000000\" + rgbToHex(p[0], p[1], p[2])).slice(-6);\n\tif (color==\"#000000\") {\n\t\tcolor = \"#4e5c67\"\n\t}\n\treturn color;\n\n\tfunction rgbToHex(r, g, b) {\n\t if (r > 255 || g > 255 || b > 255)\n\t throw \"Invalid color component\";\n\t return ((r << 16) | (g << 8) | b).toString(16);\n\t}\n}", "getColor(){\n\t\treturn this.color;\n\t}", "get rgba() { return [this.r, this.g, this.b, this.a]; }", "get ASTC_RGB_8x8() {}", "getPixelValueAt(x, y, argByteArray) {\n let byteArray = argByteArray;\n if (!byteArray) {\n byteArray = this.getTexturePixelData();\n }\n let color = new _math_Vector4__WEBPACK_IMPORTED_MODULE_5__[\"default\"](byteArray[(y * this.width + x) * 4 + 0], byteArray[(y * this.width + x) * 4 + 1], byteArray[(y * this.width + x) * 4 + 2], byteArray[(y * this.width + x) * 4 + 3]);\n return color;\n }", "function pColor(piece){ return piece.charCodeAt(0) }", "get ASTC_RGB_4x4() {}", "get pixelRect() {}", "get ASTC_RGB_10x10() {}", "_extractColor(params, pos, attr) {\n // normalize params\n // meaning: [target, CM, ign, val, val, val]\n // RGB : [ 38/48, 2, ign, r, g, b]\n // P256 : [ 38/48, 5, ign, v, ign, ign]\n const accu = [0, 0, -1, 0, 0, 0];\n // alignment placeholder for non color space sequences\n let cSpace = 0;\n // return advance we took in params\n let advance = 0;\n do {\n accu[advance + cSpace] = params.params[pos + advance];\n if (params.hasSubParams(pos + advance)) {\n const subparams = params.getSubParams(pos + advance);\n let i = 0;\n do {\n if (accu[1] === 5) {\n cSpace = 1;\n }\n accu[advance + i + 1 + cSpace] = subparams[i];\n } while (++i < subparams.length && i + advance + 1 + cSpace < accu.length);\n break;\n }\n // exit early if can decide color mode with semicolons\n if ((accu[1] === 5 && advance + cSpace >= 2)\n || (accu[1] === 2 && advance + cSpace >= 5)) {\n break;\n }\n // offset colorSpace slot for semicolon mode\n if (accu[1]) {\n cSpace = 1;\n }\n } while (++advance + pos < params.length && advance + cSpace < accu.length);\n // set default values to 0\n for (let i = 2; i < accu.length; ++i) {\n if (accu[i] === -1) {\n accu[i] = 0;\n }\n }\n // apply colors\n switch (accu[0]) {\n case 38:\n attr.fg = this._updateAttrColor(attr.fg, accu[1], accu[3], accu[4], accu[5]);\n break;\n case 48:\n attr.bg = this._updateAttrColor(attr.bg, accu[1], accu[3], accu[4], accu[5]);\n break;\n case 58:\n attr.extended = attr.extended.clone();\n attr.extended.underlineColor = this._updateAttrColor(attr.extended.underlineColor, accu[1], accu[3], accu[4], accu[5]);\n }\n return advance;\n }", "function toPixelCoords(tilePosition) {\n return {\n x: (tilePosition.i + 0.5) * tileSize(),\n y: (tilePosition.j + 0.5) * tileSize()\n }\n }", "get ASTC_RGB_6x6() {}", "putPixel(x, y, color) {\n this.backbufferdata = this.backbuffer.data;\n // As we have a 1-D Array for our back buffer\n // we need to know the equivalent cell index in 1-D based\n // on the 2D coordinates of the screen\n var index = ((x >> 0) + (y >> 0) * this.workingWidth) * 4;\n\n\n\n // RGBA color space is used by the HTML5 canvas\n this.backbufferdata[index] = color.r * 255;\n this.backbufferdata[index + 1] = color.g * 255;\n this.backbufferdata[index + 2] = color.b * 255;\n this.backbufferdata[index + 3] = color.a * 255;\n }", "getPixel () { return this.pixelArray[0] }", "function mouseCoordToHex(x, y) {\n var ratio_x, ratio_y;\n x = x - allCanvas.pointer.offset().left;\n y = y - allCanvas.pointer.offset().top;\n\n if (framesize.decoded.height === 0) {\n ratio_x = x / getWidth();\n ratio_y = y / getHeight();\n } else {\n var calculated_height = framesize.decoded.height * framesize.displayed.width * framesize.displayed.scale / framesize.decoded.width;\n var calculated_width = framesize.displayed.width * framesize.displayed.scale; //framesize.decoded.width * framesize.displayed.height / framesize.decoded.height ;\n var offsetHeight = (calculated_height - framesize.displayed.height) / 2;\n var offsetWidth = (calculated_width - (framesize.displayed.width * framesize.displayed.scale)) / 2;\n ratio_x = ((x + offsetWidth)) / calculated_width;\n ratio_y = ((y + offsetHeight)) / calculated_height;\n }\n\n\n\n\n var hexX = that._percentToHex(ratio_x * 100);\n var hexY = that._percentToHex(ratio_y * 100);\n return hexX === 'FFFF' || hexY === 'FFFF' ? 'FFFFFFFF' : hexX + hexY;\n }", "get color() {\n\n\t}", "get_rgbColor() {\n return this.liveFunc._rgbColor;\n }", "toHexColor() {\n const R = this.R.toHex().valueOf();\n const G = this.G.toHex().valueOf();\n const B = this.B.toHex().valueOf();\n return new HexColor(`#${R}${G}${B}`);\n }", "function colorPart(offset) {\n return sketch.map(offset, -maxOffset, maxOffset, 0, 255)\n }", "get ASTC_RGB_5x5() {}", "pget(x0, y0) {\n let p = this.cr.renderer.getImageData(Math.round(x0) * this.cr.options.scaleFactor, Math.round(y0) * this.cr.options.scaleFactor, this.cr.options.scaleFactor, this.cr.options.scaleFactor).data;\n let hex = this.rgbToHex(p[0], p[1], p[2]);\n let l = this.palette.length;\n for (let p = 0; p < l; p++) {\n if (this.palette[p] === hex) {\n return p;\n }\n }\n }", "colorSeccion(x, y, wd, ht, color){ //Pintamos los pixeles, de una seccion.\n for (let j = 0; j < ht; j++){ //Recorremos la seccion de anchura x altura.\n for (let i = 0; i < wd; i++){\n let place = ((x+i) + (y+j)*this.imgWidth)*4; //Posicion del pixel en el arreglo data.\n if (i + x < this.imgWidth && j + y < this.imgHeight) { //Verificamos fronteras.\n this.data[place] = color[0];\n this.data[place+1] = color[1];\n this.data[place+2] = color[2];\n }\n }\n }\n }", "constructor() {\n this.rColor = 0;\n this.gColor = 244;\n this.bColor = 158;\n this.x = 750;\n this.y = 10;\n this.width = 200;\n this.height = 200;\n }", "getTileColor(x, y) {\n // bounds checking\n if (x >= 0 && x < this._width && y >= 0 && y < this._height)\n return this.getTile(x, y).color;\n }", "getTileColor(x, y) {\n // bounds checking\n if (x >= 0 && x < this._width && y >= 0 && y < this._height)\n return this.getTile(x, y).color;\n }", "constructor(x, y, color) {\r\n this.x = x;\r\n this.y = y;\r\n this.color = color;\r\n }", "get rgba_1() {\n let c = new Color(this.r, this.g, this.b, this.a);\n return [c.r / 255, c.g / 255, c.b / 255, c.a / 255];\n }", "get ASTC_RGB_12x12() {}", "colorPromedio(x, y, wd, ht){\n let sumaTotal = [0,0,0]; //Auxiliar para guardar los colores promedio.\n let total = 0; //Auxiliar para obtener el total de pixeles en la seccion.\n for (let j = 0; j < ht; j++) //Recorremos la seccion de anchura x altura.\n for (let i = 0; i < wd; i++){\n let place = ((x+i) + (y+j)*this.imgWidth)*4; //Posicion del pixel en el arreglo data.\n if (i + x < this.imgWidth && j + y < this.imgHeight) { //Verificamos fronteras.\n total += 1; //Contador para promediar.\n sumaTotal[0] += this.data[place];\n sumaTotal[1] += this.data[place+1];\n sumaTotal[2] += this.data[place+2];\n }\n }\n sumaTotal = sumaTotal.map(t => t/total);\n return sumaTotal;\n }", "toHexColor() {\n const R = this.R.toHex().valueOf();\n const G = this.G.toHex().valueOf();\n const B = this.B.toHex().valueOf();\n return new HexColor(`#${R}${G}${B}`);\n }", "function getCoordinateColorData(previewImage, imageWidth, imageHeight, ratio) {\r\n\r\n const canvas = document.getElementById('displayBaseImage');\r\n const context = canvas.getContext('2d');\r\n canvas.width = imageWidth;\r\n canvas.height = imageHeight;\r\n context.drawImage(previewImage, 0, 0);\r\n var colorDataSet = [];\r\n\r\n //Jumps to incremented points in the y axis every time the x axis repeats a full iteration\r\n for (let y = 0; y < imageHeight; y += ratio) {\r\n\r\n //Jumps to incremented points in the x axis every iteration\r\n for (let x = 0; x < imageWidth; x += ratio) {\r\n\r\n let colorDataSetInstance = {\r\n\r\n redValue: (context.getImageData(x, y, 1, 1).data[0]),\r\n greenValue: (context.getImageData(x, y, 1, 1).data[1]),\r\n blueValue: (context.getImageData(x, y, 1, 1).data[2]),\r\n //Shrinks the co-odinate set to increments of 1 so that scaling is made easier for the map later.\r\n xIndex: x / ratio,\r\n yIndex: y / ratio,\r\n minecraftBlockAssigned: \"\"\r\n\r\n }\r\n\r\n colorDataSet.push(colorDataSetInstance);\r\n console.log(\"xIndex \" + colorDataSetInstance.xIndex + \" yIndex \" + colorDataSetInstance.yIndex);\r\n\r\n }\r\n\r\n }\r\n displayPixelArt(colorDataSet, ratio)\r\n\r\n}", "function setColor() {\n \t\t\t$(this).setPixels({\n\t \t\tx: 260, y: 30,\n\t \t\twidth: 60, height: 40,\n\t \t\t// loop through each pixel\n\t \t\teach: function(px) {\n\t \t\t\tpx.r = rgb_r;\n\t \t\t\tpx.g = rgb_g;\n\t \t\t\tpx.b = rgb_b;\n\t \t\t}\n \t\t\t});\n\t\t}", "drawPixel(pos, val) {\n this.ctxOffscreen.fillStyle = val ? \"rgb(128, 128, 0)\" : \"rgb(0, 0, 0)\";\n this.ctxOffscreen.fillRect(this.reMap(pos[1]), this.reMap(pos[0]), this.cellSize, this.cellSize);\n this.setPixel(pos, val);\n }", "function color() {\n\t return {\n\t r: Math.floor(Math.random() * colorArray[0][0]),\n\t g: Math.floor(Math.random() * colorArray[0][1]),\n\t b: Math.floor(Math.random() * colorArray[0][2]),\n\t }\n\t}", "function colorPos2Point(colPos, imgSize) {\n var pt = {x: 0, y: 0};\n pt.y = parseInt(colPos / (imgSize.w * 4));\n pt.x = colPos / 4 - pt.y * imgSize.w;\n return pt;\n}", "toCSSValues() {\r\n return [this.h * 360, this.s * 100, this.l * 100];\r\n }", "decodeColor(){\n return this.colors[ this.extractBinaryNumber(this.hasAlpha ? 3 : 2) ];\n }", "function colorwheel(pos) {\n pos = 255 - pos;\n if (pos < 85) { return rgb2Int(255 - pos * 3, 0, pos * 3); }\n else if (pos < 170) { pos -= 85; return rgb2Int(0, pos * 3, 255 - pos * 3); }\n else { pos -= 170; return rgb2Int(pos * 3, 255 - pos * 3, 0); }\n }", "_get_color() {\n\t\t\t// last 7 digits of the name are a hex color code\n\t\t\tlet color_str = this.shape_name.slice(-7);\n\t\t\treturn this.config.color_map[color_str]\n\t\t}", "function ColorAtPoint(x, y) {\n currently_click_checking = 1;\n draw();\n var pixelColor = new Uint8Array(4);\n gl.readPixels(x, y, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixelColor);\n currently_click_checking = 0;\n draw();\n return pixelColor;\n}", "toString() {\r\n return \"rgba(\" + this.r + \",\" + this.g + \",\" + this.b + \",\" + this.a + \")\";\r\n }", "getColor(){\n\t\tvar r, g, b, a;\n\t\tvar hex = this.valueOf('color'); // always gets a hex string (ex., #rrggbb)\n\t\ta = this.valueOf('opacity');\n\t\tr = parseInt(hex.substring(1,3), 16);\n\t\tg = parseInt(hex.substring(3,5), 16);\n\t\tb = parseInt(hex.substring(5,7), 16);\n\t\treturn 'rgba('+r+','+g+','+b+','+a+')';\n\t}", "function color_at(x,y) {\n console.log(\"x=\"+x+\", y=\"+y+\", id=pixel-\"+x+\"-\"+y);\n return document.getElementById(\"pixel-\"+x+\"-\"+y).style.backgroundColor;\n }", "unpack(colour) {\n let bitShifts = [1.0, 1.0/255.0, 1.0/(255.0*255.0), 1.0/(255.0*255.0*255.0)];\n return this.dot4(colour, bitShifts);\n }", "get iconColor() {\n return brushToString(this.i.a4);\n }", "function calculateColor( begin, end, pos ) {\r\n\t\tvar color = 'rgb' + ( $.support[ 'rgba' ] ? 'a' : '' ) + '(' +\r\n\t\t\tparseInt( ( begin[ 0 ] + pos * ( end[ 0 ] - begin[ 0 ] ) ), 10 ) + ',' +\r\n\t\t\tparseInt( ( begin[ 1 ] + pos * ( end[ 1 ] - begin[ 1 ] ) ), 10 ) + ',' +\r\n\t\t\tparseInt( ( begin[ 2 ] + pos * ( end[ 2 ] - begin[ 2 ] ) ), 10 );\r\n\t\tif ( $.support[ 'rgba' ] ) {\r\n\t\t\tcolor += ',' + ( begin && end ? parseFloat( begin[ 3 ] + pos * ( end[ 3 ] - begin[ 3 ] ) ) : 1 );\r\n\t\t}\r\n\t\tcolor += ')';\r\n\t\treturn color;\r\n\t}", "getPixel(pos) {\n let row = this.cells[pos[0]];\n return !!row && !!row[pos[1]] * 1;\n }", "constructor() {\n this.red = null;\n this.green = null;\n this.blue = null;\n this.x = null;\n this.y = null;\n this.brightness = null;\n this.hue = null;\n this.saturation = null;\n this.temperature = null;\n this.originalColor = null;\n }", "getHexColorValue() {\n let hexRepresentation = _.map(_.slice(this.props.value, 0, 3), (val)=>{\n let hexVal = val.toString(16);\n return hexVal.length === 1 ? '0' + hexVal : hexVal;\n }).join('');\n return '#' + hexRepresentation;\n }", "function drawPixel (x, y) {\n var index = (x + y * canvasWidth) * 4\n canvasData.data[index + 0] = 255\n canvasData.data[index + 1] = 255\n canvasData.data[index + 2] = 255\n canvasData.data[index + 3] = 255\n }", "toRgb() {\n return {\n r: Math.round(this.r),\n g: Math.round(this.g),\n b: Math.round(this.b),\n a: this.a,\n };\n }", "get color() {}", "current_color() {\n return this._color;\n }", "function colorSet(raw) {\n this.rgb = {};\n this.yuv = {};\n this.raw = raw;\n\n this.rgb.r = (raw & 0xFF0000) >> 16;\n this.rgb.g = (raw & 0x00FF00) >> 8;\n this.rgb.b = (raw & 0x0000FF);\n\n // BT.709\n this.yuv.y = 0.2126 * this.rgb.r + 0.7152 * this.rgb.g + 0.0722 * this.rgb.b;\n this.yuv.u = -0.09991 * this.rgb.r - 0.33609 * this.rgb.g + 0.436 * this.rgb.b;\n this.yuv.v = 0.615 * this.rgb.r - 0.55861 * this.rgb.g - 0.05639 * this.rgb.b;\n\n return this;\n}", "function Color(val) {\n\t _classCallCheck(this, Color);\n\t\n\t this[r] = new Uint8ClampedArray(1);\n\t this[g] = new Uint8ClampedArray(1);\n\t this[b] = new Uint8ClampedArray(1);\n\t this[a] = 1;\n\t\n\t var init = [0, 0, 0, 1];\n\t\n\t for (var _len = arguments.length, params = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t params[_key - 1] = arguments[_key];\n\t }\n\t\n\t if (params.length == 0 && typeof val == 'number') {\n\t init = [val, val, val, 1];\n\t } else {\n\t if ((typeof val === 'undefined' ? 'undefined' : _typeof(val)) == 'object') {\n\t if (val.hasOwnProperty('constructor')) {\n\t if (val instanceof Uint8ClampedArray && val.length == 4) {\n\t init = val;\n\t } else if (val.constructor === this.constructor) {\n\t init[0] = val.r;\n\t init[1] = val.g;\n\t init[2] = val.b;\n\t init[3] = val.a;\n\t } else {\n\t init = multiConstructor(val, params);\n\t }\n\t }\n\t } else {\n\t init = multiConstructor(val, params);\n\t }\n\t }\n\t\n\t this.r = init[0];\n\t this.g = init[1];\n\t this.b = init[2];\n\t this.a = init[3];\n\t }", "pack(v) {\n let bias = [1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0];\n\n let r = v;\n let g = this.fract(r * 255.0);\n let b = this.fract(g * 255.0);\n let a = this.fract(b * 255.0);\n let colour = [r, g, b, a];\n\n let dd = [colour[1]*bias[0],colour[2]*bias[1],colour[3]*bias[2],colour[3]*bias[3]];\n\n return [colour[0]-dd[0],colour[1]-dd[1],colour[2]-dd[2],colour[3]-dd[3] ];\n }", "function Pixel(x, y, color) {\n this.x = x;\n this.y = y;\n this.color = color;\n this.draw = function () {\n drawPixel(this.x, this.y, this.color);\n }\n}", "get ETC_RGB4() {}", "constructor(x, y, width, height, color) {\r\n this.x = x;\r\n this.y = y;\r\n this.width = width;\r\n this.height = height;\r\n this.color = color;\r\n }", "function calculateColor(begin, end, pos) {\n var color = 'rgba('\n + parseInt((begin[0] + pos * (end[0] - begin[0])), 10) + ','\n + parseInt((begin[1] + pos * (end[1] - begin[1])), 10) + ','\n + parseInt((begin[2] + pos * (end[2] - begin[2])), 10);\n\n color += ',' + (begin && end ? parseFloat(begin[3] + pos * (end[3] - begin[3])) : 1);\n color += ')';\n return color;\n }", "function calculateColor(begin, end, pos) {\n var color = 'rgba('\n + parseInt((begin[0] + pos * (end[0] - begin[0])), 10) + ','\n + parseInt((begin[1] + pos * (end[1] - begin[1])), 10) + ','\n + parseInt((begin[2] + pos * (end[2] - begin[2])), 10);\n\n color += ',' + (begin && end ? parseFloat(begin[3] + pos * (end[3] - begin[3])) : 1);\n color += ')';\n return color;\n }", "function calculateColor(begin, end, pos) {\n var color = 'rgba('\n + parseInt((begin[0] + pos * (end[0] - begin[0])), 10) + ','\n + parseInt((begin[1] + pos * (end[1] - begin[1])), 10) + ','\n + parseInt((begin[2] + pos * (end[2] - begin[2])), 10);\n\n color += ',' + (begin && end ? parseFloat(begin[3] + pos * (end[3] - begin[3])) : 1);\n color += ')';\n return color;\n }", "getPixel( x, y ) {\n\t\tif ( x >= 0 && x <= this.width &&\n\t\t\ty >= 0 && y <= this.height ) {\n\t\t\treturn {\n\t\t\t\tr: this.matrix[x][y].r,\n\t\t\t\tg: this.matrix[x][y].g,\n\t\t\t\tb: this.matrix[x][y].b,\n\t\t\t\ta: this.matrix[x][y].a\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tr: -1,\n\t\t\tg: -1,\n\t\t\tb: -1,\n\t\t\ta: -1\n\t\t};\n\t}", "copy() {\r\n return new Color(this.r, this.g, this.b, this.a);\r\n }", "calcRGB() {\r\n let h = this.h/360;\r\n let s = this.s/100;\r\n let l = this.l/100;\r\n let r, g, b;\r\n if (s == 0){\r\n r = g = b = l; // achromatic\r\n } else {\r\n let q = l < 0.5 ? l * (1 + s) : l + s - l * s;\r\n let p = 2 * l - q;\r\n r = this.hue2rgb(p, q, h + 1/3);\r\n g = this.hue2rgb(p, q, h);\r\n b = this.hue2rgb(p, q, h - 1/3);\r\n }\r\n this._r = Math.round(r * 255); \r\n this._g = Math.round(g * 255); \r\n this._b = Math.round(b * 255);\r\n }", "constructor(x, y, width, height, color) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.color = color;\n }", "function Color(x, y, size, col){\n this.x=x;\n this.y=y;\n this.size=size;\n this.col=col;\n this.strokeCol = 'black';\n this.click=false;\n}", "hexToPixel( h ) {\n // KEY pointy or flat\n\n let hexOrigin = this.state.hexOrigin\n\n // flat\n // let y = this.state.hexSize * Math.sqrt(3) * ( h.q + h.r / 2 ) + hexOrigin.y\n // let x = this.state.hexSize * 3/2 * h.r + hexOrigin.x\n \n // pointy\n let x = this.state.hexSize * Math.sqrt(3) * ( h.q + h.r / 2 ) + hexOrigin.x\n let y = this.state.hexSize * 3/2 * h.r + hexOrigin.y\n\n return this.Point( x, y )\n }", "get color(){\n return this.getPalette(this.currentColor);\n }", "getColor() {\n if (this.type == 'home' || this.type == 'goal') {\n return ['#B5FEB4', '#B5FEB4'];\n }\n\n else if (this.type == 'board') {\n return ['#F7F7FF', '#E6E6FF'];\n }\n\n else if (this.type == 'back'){\n return ['#B4B5FE', '#B4B5FE'];\n }\n }", "function printPixel(event) {\n const selectedPixel = event.target;\n selectedPixel.style.backgroundColor = presentColor;\n}", "toHexString() {\n const intR = (this.r * 255) || 0;\n const intG = (this.g * 255) || 0;\n const intB = (this.b * 255) || 0;\n const intA = (this.a * 255) || 0;\n return \"#\" + _1.Scalar.ToHex(intR) + _1.Scalar.ToHex(intG) + _1.Scalar.ToHex(intB) + _1.Scalar.ToHex(intA);\n }", "set ASTC_RGB_8x8(value) {}", "function color(point) {\n\tvar temp = point;\n // console.log(\"temp \" + temp);\n\n\t// Calculate Red:\n\tif (temp <= 66) {\n\t\tvar red = 255\n\t}\n\telse {\n\t\tvar red = Math.floor(330 * (Math.pow(temp, -0.133)));\n\t\tif (red < 0) {red = 0};\n\t\tif (red > 255) {red = 255};\n\n var dimRed = Math.floor((330 * (Math.pow(temp, -0.133))) - (-100 * Math.cos(temp/1000) + 100));\n if (dimRed < 0) {dimRed = 0};\n\t\tif (dimRed > 255) {dimRed = 255};\n if (temp > 2000) {dimRed = 0};\n // console.log(\"dimRed \" + dimRed + \"; red \" + red);\n\t}\n\n\t// Calculate Green:\n\tif (temp <= 66) {\n\t\tvar green = temp;\n\t\tgreen = 99.5 * Math.log(green) - 161;\n\t\tgreen = Math.floor(green);\n\t\tif (green < 0) { green = 0};\n\t\tif (green > 255) { green = 255};\n\t}\n\telse {\n var green = Math.floor((288 * (Math.pow(temp, -0.075))));\n\t\tif (green < 0) { green = 0};\n\t\tif (green > 255) { green = 255};\n\n var dimGreen = Math.floor((288 * (Math.pow(temp, -0.075))) - (-100 * Math.cos(temp/1000) + 100));\n if (dimGreen < 0) { dimGreen = 0};\n\t\tif (dimGreen > 255) { dimGreen = 255};\n if (temp > 2000) {dimGreen = 0};\n // console.log(\"dimGreen \" + dimGreen + \"; green \" + green);\n\t}\n\n // Calculate Blue:\n\tif (temp <= 19) {\n\t\tvar blue = 0;\n\t}\n\telse {\n\t\tvar blue = Math.floor(138.5 * Math.log(temp) - 305);\n\t\tif (blue < 0) {blue = 0};\n\t\tif (blue > 255) {blue = 255};\n\n var dimBlue = Math.floor((139 * Math.log(temp)) - (-500 * Math.cos(temp/1000) + 800));\n if (dimBlue < 0) {dimBlue = 0};\n\t\tif (dimBlue > 255) {dimBlue = 255};\n if (temp > 2200) {dimBlue = 0};\n // console.log(\"dimBlue \" + dimBlue + \"; blue \" + blue);\n\t}\n\nvar colorTemp = \"rgb(\" + dimRed + \",\" + dimGreen + \",\" + dimBlue + \")\";\n// console.log(\"temp \" + temp + \"; colorTemp \" + colorTemp);\nreturn colorTemp;\n}", "function colorRGB(){\n var coolor = \"(\"+generarNumero(255)+\",\" + generarNumero(255) + \",\" + generarNumero(255) +\")\";\n return \"rgb\" + coolor;\n }", "function getRGB(col){\n return \"rgb(\"+col.r+\", \"+col.g+\", \"+col.b+\")\";\n}", "function rgb(r, g, b) {\n \n}", "function getColorIndex(r, g, b) {\r\n return (r << (2 * sigbits)) + (g << sigbits) + b;\r\n }" ]
[ "0.6665513", "0.65762424", "0.6492818", "0.6407672", "0.6374277", "0.6306999", "0.6287661", "0.6286929", "0.62740135", "0.6218362", "0.6188606", "0.61881405", "0.61701775", "0.6146235", "0.6138042", "0.6134426", "0.61268085", "0.60366184", "0.60306835", "0.60274863", "0.60261846", "0.60258275", "0.6005575", "0.60033065", "0.6002017", "0.59944445", "0.59928936", "0.5976988", "0.59691167", "0.59650093", "0.5957655", "0.5951579", "0.59423906", "0.59401643", "0.5931562", "0.5924555", "0.59187186", "0.59133327", "0.5897929", "0.58953196", "0.5891613", "0.5891427", "0.5886039", "0.58844453", "0.5882139", "0.5856277", "0.5856277", "0.5852197", "0.5848734", "0.5847957", "0.58477503", "0.5844785", "0.58389086", "0.5838502", "0.5837755", "0.58263236", "0.58233285", "0.58184135", "0.5810874", "0.5810225", "0.5810067", "0.5807027", "0.5799371", "0.57899", "0.5776595", "0.57634217", "0.57096255", "0.5706595", "0.5702182", "0.56938416", "0.569267", "0.569009", "0.56890506", "0.5683258", "0.56780565", "0.56708294", "0.5665413", "0.5660305", "0.5659599", "0.5657303", "0.5651483", "0.5648023", "0.5648023", "0.5648023", "0.5620617", "0.5615486", "0.5607858", "0.55993485", "0.5595108", "0.5586323", "0.5581244", "0.55807465", "0.55786437", "0.55773383", "0.5571431", "0.55682445", "0.5565376", "0.5556121", "0.5549879", "0.55491567" ]
0.6444274
3
return string of function
function GetName() { return "Hello, my name is jokosu"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callString(f) {\n return '(' + f.toString() + ')()';\n}", "static _functionToCode(fn, name) {\r\n var txt = fn.toString()\r\n .replace(/\\/\\/.*/g, '')\r\n .replace(/\\s+/g, '')\r\n .replace(/var/g,'var ')\r\n .replace('return','return ') + ';';\r\n return txt\r\n }", "function func() {\n return 'func1';\n}", "function retStr() { \n return \"hello world!!!\" ;\n }", "function myFunc2(name) {\nreturn (\"Hello \" + name + \".\")\n}", "function func(){\n return `${this.name}(${this.type}) - ${this.age}`;\n}", "function f(x)\n\t{\n\t\treturn \"f(\" + x + \")\";\n\t}", "static func1() {\n return 'func1';\n }", "functioncall() {\n return (\"Function called!\")\n }", "function printFunctionSourceCode(f) {\n return String(f);\n}", "function foo() {\n\treturn 'foo'\n\n}", "function msgar() {\r\n return \"Hellw this is return value function\"; \r\n}", "function whoAmI () { \n // create a function inside of the function\n function nameSomeoneGaveMe () { return \"Chris\"; }\n //we will return a string with the function value\n return \"You look out of it, \" + nameSomeoneGaveMe(); \n }", "function hello(str){\n return str;\n }", "function getFunc() { return \"gate\"; }", "function _function(obj) {\n return exports.PREFIX.function + ':' + obj.name + '=>' + obj.toString();\n}", "function my_function(name) {\n return \"Hello \" + name;\n}", "function yourFunctionRunner() {\n\tvar returnValues = [];\n\tfor (var i=0; i<arguments.length; i++) {\n\t\treturnValues.push(arguments[i]());\n\t}\n\treturn returnValues.join('');\n}", "function f(x) { return x + 'f'; }", "function myfunction(){\n\treturn(\"i am function\");\n}", "function pizzaVegeterijana() {\n return `Hello`;\n}", "function hai(){\n\treturn \"haiiii\"\n}", "function someFunction(param) { // function declaration\n return `It has some parameter: ${param}`;\n}", "function a(){return s}", "function OutString() {\r\n}", "function returndemo(){\n\n return \"Hello!!!\";\n\n}", "function hello(){\n return 'hello';\n}", "function hello(){\n return 'hello';\n}", "function hello() { return 'hello mundo'; }", "function getFunctionName( func ){\n\n\ttry {\n\t\tfunc = func.substr('function '.length);\n\t \tfunc = func.substr(0, func.indexOf('('));\n\n\t\tif( func == \"\" ) func = \"ANONYMOUS_FUNC\";\n\t\tif( func.indexOf( \"=>\" ) >= 0 ) func = \"ANONYMOUS_FUNC\";\n\n\t\treturn func;\n\t} catch( err ){\n\t\tconsole.log( \"\\x1b[31m%s\\x1b[0m\", \"[summer-mvc core]\", \"[logger.js]\", err );\n\t\tthrow err;\n\t}\n}", "function myFunc(name) {\n return 'Hello' + name;\n}", "function hello(){\n return 'hello';\n}", "function foo() { return 'foo'; }", "function Hello(){\r\n return \"Hello\";\r\n}", "function funname() {} //literals", "function hello() { return \"Hello\" }", "function namstey() {\n return \"Hello in India\";\n}", "function salut(){\r\n\treturn \"Salut !\";\r\n}", "function laughh() {\n\treturn 'hahahahahahahahahaha!';\n}", "function hello(){\n return \"hello\";\n}", "static fStr3(x) {\nreturn this.fStr(x, 3);\n}", "static fStr3(x) {\nreturn this.fStr(x, 3);\n}", "toStr() {\nreturn `trans=${this._t.asString4()} rot=${this._r.asString4()}`;\n}", "sayHi2(){ return 'sayHi2' }", "myTestFunction1(str){\r\n return str;\r\n\r\n }", "function printUsername(fn) {\n return fn(\"biggaji\");\n}", "function name1(param1) {\n return \"returning \" + param1;\n}", "static staticMeth(){\n return `This is a static method`\n }", "static vStr(xyz, n) {\nvar t, xs, ys, zs;\n//----\n[xs, ys, zs] = (function() {\nvar i, len1, results;\nresults = [];\nfor (i = 0, len1 = xyz.length; i < len1; i++) {\nt = xyz[i];\nresults.push(this.fStr(t, n));\n}\nreturn results;\n}).call(this);\nreturn `<${xs} ${ys} ${zs}>`;\n}", "function nombreFuncion(parametro){\n return \"regresan algo\"\n}", "function howdyEd(name){ \n return `Howdy ${name}!`\n}", "function hello() {\r\n return 'hello';\r\n}", "function funcName(func) {\n return func.name || \"{anonymous}\"\n }", "function hi () {\n return 'Hi'\n}", "function createFunctionPrinter(input) {\n function generatedFunc() {\n console.log(input)\n }\n\treturn generatedFunc;\n}", "function someFunction() { return 'something'; }", "function meYeah() {\n return 'Me, yeah Me.<br>';\n \n}", "function namastey() {\r\n return 'Hello in India';\r\n}", "function get_function_name(f) {\r\n\tvar str = f.toString();\r\n var name = str.split ('(')[0];\r\n name = name.split (/[' '{1,}]/)[1];\r\n return(name);\r\n}", "function nameFunc(name){\n\tconst html = `<p>hello ${name}</p>`\n\treturn html\n}", "function myFunction(string, p1, p2, p3) {\n console.log(\"P1 :\", p1);\n console.log(\"P2 :\", p2);\n console.log(\"P3 :\", p3);\n console.log(\"String is \", string);\n return string; \n}", "function laugh() {\n return \"hahahahahahahahahaha!\";\n}", "function Func_s() {\n}", "function stringReturnOne() {\n return \"This is string 1\"\n}", "function getFuncion(num) {\n if (num === void 0) { num = 1; }\n return 'Función normal de JS';\n}", "function caller(){\r\n return function(name){\r\n return 'caller calling you'+' '+name;\r\n }\r\n}", "function myFunction() {\n return \"You've called myFunction()!\";\n}", "function return_value(name){\n document.write(\"hello\"+\" \"+name);\n}", "function functionName(a){\nconsole.log(a);\nreturn(a);\n}", "function hello() {\n return 'hello';\n}", "function cde() {\n return 'hello';\n\n}", "function proxyToString(name){ // Wrap to always call the current version\n\treturn function toString(){if(typeof current[name]==='function'){return current[name].toString();}else {return '<method was deleted>';}};}", "function proxyToString(name){ // Wrap to always call the current version\n\treturn function toString(){if(typeof current[name]==='function'){return current[name].toString();}else {return '<method was deleted>';}};}", "function myName2(name){\n\treturn \"Hello \" + name + \". \";\n}", "function greeting(function1, function2) {\n return `${function1()}, ${function2()}`;\n}", "function MyNameE() {\n return \"Carles\";\n}", "function getString(firstName,lastName) {\r\n let gap = \" \";\r\n let outputStr = \"Hallo \" + firstName + gap + lastName + \"!\";\r\n return outputStr; // Daten -----> an die Stelle des calls\r\n console.log(\"Test\"); // nach return wird die Funktion abgebrochen!\r\n}", "function hello() {\n return \"hello\";\n}", "function hello() {\n return \"hello\";\n}", "function fooBar(a){ return \"\"+a}", "function returnString(str) {\nconst rs= 'i am returning' + str ;\n return rs;\n}", "function masti(){\r\n return \" Helo India\";\r\n}", "function hello_bud(){\n return \"Hello Bud\";\n}", "function name(name){\n return \"hi, my name is \" + name + \".\";\n}", "function CallSiteToString() {\n var fileName;\n var fileLocation = \"\";\n if (this.isNative()) {\n fileLocation = \"native\";\n } else {\n fileName = this.getScriptNameOrSourceURL();\n if (!fileName && this.isEval()) {\n fileLocation = this.getEvalOrigin();\n fileLocation += \", \"; // Expecting source position to follow.\n }\n\n if (fileName) {\n fileLocation += fileName;\n } else {\n // Source code does not originate from a file and is not native, but we\n // can still get the source position inside the source string, e.g. in\n // an eval string.\n fileLocation += \"<anonymous>\";\n }\n var lineNumber = this.getLineNumber();\n if (lineNumber != null) {\n fileLocation += \":\" + lineNumber;\n var columnNumber = this.getColumnNumber();\n if (columnNumber) {\n fileLocation += \":\" + columnNumber;\n }\n }\n }\n\n var line = \"\";\n var functionName = this.getFunctionName();\n var addSuffix = true;\n var isConstructor = this.isConstructor();\n var isMethodCall = !(this.isToplevel() || isConstructor);\n if (isMethodCall) {\n var typeName = this.getTypeName();\n // Fixes shim to be backward compatable with Node v0 to v4\n if (typeName === \"[object Object]\") {\n typeName = \"null\";\n }\n var methodName = this.getMethodName();\n if (functionName) {\n if (typeName && functionName.indexOf(typeName) != 0) {\n line += typeName + \".\";\n }\n line += functionName;\n if (methodName && functionName.indexOf(\".\" + methodName) != functionName.length - methodName.length - 1) {\n line += \" [as \" + methodName + \"]\";\n }\n } else {\n line += typeName + \".\" + (methodName || \"<anonymous>\");\n }\n } else if (isConstructor) {\n line += \"new \" + (functionName || \"<anonymous>\");\n } else if (functionName) {\n line += functionName;\n } else {\n line += fileLocation;\n addSuffix = false;\n }\n if (addSuffix) {\n line += \" (\" + fileLocation + \")\";\n }\n return line;\n}", "function CallSiteToString() {\n var fileName;\n var fileLocation = \"\";\n if (this.isNative()) {\n fileLocation = \"native\";\n } else {\n fileName = this.getScriptNameOrSourceURL();\n if (!fileName && this.isEval()) {\n fileLocation = this.getEvalOrigin();\n fileLocation += \", \"; // Expecting source position to follow.\n }\n\n if (fileName) {\n fileLocation += fileName;\n } else {\n // Source code does not originate from a file and is not native, but we\n // can still get the source position inside the source string, e.g. in\n // an eval string.\n fileLocation += \"<anonymous>\";\n }\n var lineNumber = this.getLineNumber();\n if (lineNumber != null) {\n fileLocation += \":\" + lineNumber;\n var columnNumber = this.getColumnNumber();\n if (columnNumber) {\n fileLocation += \":\" + columnNumber;\n }\n }\n }\n\n var line = \"\";\n var functionName = this.getFunctionName();\n var addSuffix = true;\n var isConstructor = this.isConstructor();\n var isMethodCall = !(this.isToplevel() || isConstructor);\n if (isMethodCall) {\n var typeName = this.getTypeName();\n // Fixes shim to be backward compatable with Node v0 to v4\n if (typeName === \"[object Object]\") {\n typeName = \"null\";\n }\n var methodName = this.getMethodName();\n if (functionName) {\n if (typeName && functionName.indexOf(typeName) != 0) {\n line += typeName + \".\";\n }\n line += functionName;\n if (methodName && functionName.indexOf(\".\" + methodName) != functionName.length - methodName.length - 1) {\n line += \" [as \" + methodName + \"]\";\n }\n } else {\n line += typeName + \".\" + (methodName || \"<anonymous>\");\n }\n } else if (isConstructor) {\n line += \"new \" + (functionName || \"<anonymous>\");\n } else if (functionName) {\n line += functionName;\n } else {\n line += fileLocation;\n addSuffix = false;\n }\n if (addSuffix) {\n line += \" (\" + fileLocation + \")\";\n }\n return line;\n}", "function CallSiteToString() {\n var fileName;\n var fileLocation = \"\";\n if (this.isNative()) {\n fileLocation = \"native\";\n } else {\n fileName = this.getScriptNameOrSourceURL();\n if (!fileName && this.isEval()) {\n fileLocation = this.getEvalOrigin();\n fileLocation += \", \"; // Expecting source position to follow.\n }\n\n if (fileName) {\n fileLocation += fileName;\n } else {\n // Source code does not originate from a file and is not native, but we\n // can still get the source position inside the source string, e.g. in\n // an eval string.\n fileLocation += \"<anonymous>\";\n }\n var lineNumber = this.getLineNumber();\n if (lineNumber != null) {\n fileLocation += \":\" + lineNumber;\n var columnNumber = this.getColumnNumber();\n if (columnNumber) {\n fileLocation += \":\" + columnNumber;\n }\n }\n }\n\n var line = \"\";\n var functionName = this.getFunctionName();\n var addSuffix = true;\n var isConstructor = this.isConstructor();\n var isMethodCall = !(this.isToplevel() || isConstructor);\n if (isMethodCall) {\n var typeName = this.getTypeName();\n // Fixes shim to be backward compatable with Node v0 to v4\n if (typeName === \"[object Object]\") {\n typeName = \"null\";\n }\n var methodName = this.getMethodName();\n if (functionName) {\n if (typeName && functionName.indexOf(typeName) != 0) {\n line += typeName + \".\";\n }\n line += functionName;\n if (methodName && functionName.indexOf(\".\" + methodName) != functionName.length - methodName.length - 1) {\n line += \" [as \" + methodName + \"]\";\n }\n } else {\n line += typeName + \".\" + (methodName || \"<anonymous>\");\n }\n } else if (isConstructor) {\n line += \"new \" + (functionName || \"<anonymous>\");\n } else if (functionName) {\n line += functionName;\n } else {\n line += fileLocation;\n addSuffix = false;\n }\n if (addSuffix) {\n line += \" (\" + fileLocation + \")\";\n }\n return line;\n}", "function CallSiteToString() {\n var fileName;\n var fileLocation = \"\";\n if (this.isNative()) {\n fileLocation = \"native\";\n } else {\n fileName = this.getScriptNameOrSourceURL();\n if (!fileName && this.isEval()) {\n fileLocation = this.getEvalOrigin();\n fileLocation += \", \"; // Expecting source position to follow.\n }\n\n if (fileName) {\n fileLocation += fileName;\n } else {\n // Source code does not originate from a file and is not native, but we\n // can still get the source position inside the source string, e.g. in\n // an eval string.\n fileLocation += \"<anonymous>\";\n }\n var lineNumber = this.getLineNumber();\n if (lineNumber != null) {\n fileLocation += \":\" + lineNumber;\n var columnNumber = this.getColumnNumber();\n if (columnNumber) {\n fileLocation += \":\" + columnNumber;\n }\n }\n }\n\n var line = \"\";\n var functionName = this.getFunctionName();\n var addSuffix = true;\n var isConstructor = this.isConstructor();\n var isMethodCall = !(this.isToplevel() || isConstructor);\n if (isMethodCall) {\n var typeName = this.getTypeName();\n // Fixes shim to be backward compatable with Node v0 to v4\n if (typeName === \"[object Object]\") {\n typeName = \"null\";\n }\n var methodName = this.getMethodName();\n if (functionName) {\n if (typeName && functionName.indexOf(typeName) != 0) {\n line += typeName + \".\";\n }\n line += functionName;\n if (methodName && functionName.indexOf(\".\" + methodName) != functionName.length - methodName.length - 1) {\n line += \" [as \" + methodName + \"]\";\n }\n } else {\n line += typeName + \".\" + (methodName || \"<anonymous>\");\n }\n } else if (isConstructor) {\n line += \"new \" + (functionName || \"<anonymous>\");\n } else if (functionName) {\n line += functionName;\n } else {\n line += fileLocation;\n addSuffix = false;\n }\n if (addSuffix) {\n line += \" (\" + fileLocation + \")\";\n }\n return line;\n}", "function CallSiteToString() {\n var fileName;\n var fileLocation = \"\";\n if (this.isNative()) {\n fileLocation = \"native\";\n } else {\n fileName = this.getScriptNameOrSourceURL();\n if (!fileName && this.isEval()) {\n fileLocation = this.getEvalOrigin();\n fileLocation += \", \"; // Expecting source position to follow.\n }\n\n if (fileName) {\n fileLocation += fileName;\n } else {\n // Source code does not originate from a file and is not native, but we\n // can still get the source position inside the source string, e.g. in\n // an eval string.\n fileLocation += \"<anonymous>\";\n }\n var lineNumber = this.getLineNumber();\n if (lineNumber != null) {\n fileLocation += \":\" + lineNumber;\n var columnNumber = this.getColumnNumber();\n if (columnNumber) {\n fileLocation += \":\" + columnNumber;\n }\n }\n }\n\n var line = \"\";\n var functionName = this.getFunctionName();\n var addSuffix = true;\n var isConstructor = this.isConstructor();\n var isMethodCall = !(this.isToplevel() || isConstructor);\n if (isMethodCall) {\n var typeName = this.getTypeName();\n // Fixes shim to be backward compatable with Node v0 to v4\n if (typeName === \"[object Object]\") {\n typeName = \"null\";\n }\n var methodName = this.getMethodName();\n if (functionName) {\n if (typeName && functionName.indexOf(typeName) != 0) {\n line += typeName + \".\";\n }\n line += functionName;\n if (methodName && functionName.indexOf(\".\" + methodName) != functionName.length - methodName.length - 1) {\n line += \" [as \" + methodName + \"]\";\n }\n } else {\n line += typeName + \".\" + (methodName || \"<anonymous>\");\n }\n } else if (isConstructor) {\n line += \"new \" + (functionName || \"<anonymous>\");\n } else if (functionName) {\n line += functionName;\n } else {\n line += fileLocation;\n addSuffix = false;\n }\n if (addSuffix) {\n line += \" (\" + fileLocation + \")\";\n }\n return line;\n}", "function lol(){\r\n return 'kelly';\r\n}", "function foo() {\n return 'asdf';\n}", "function caller(){\n return function(name){\n return \"Caller calling you \" + name;\n }\n }", "function MyNameReturn(name) {\n return \"Hello \" + name;\n}", "function saludar(){\n return 'hola'\n}", "function funRet1() {\n\n /*\n Skriv en metod \"superImportant\" som returnerar stjärnor och texten med stora bokstäver.\n\n Om den anropas såhär:\n\n let text = superImportant(\"Itch\");\n console.log(text);\n\n Så ska följande skrivas ut:\n\n ****** ITCH ******\n */\n\n function superImportant(someText) {\n return `****** ${someText.toUpperCase()} ******`;\n }\n\n let text = superImportant(\"atjoooo!\");\n console.log(text);\n}", "function hello(arg) {\n return `Hello, ${arg}!`\n}", "function saySomethingStupid() {\n return ('Al Gore rhythms are cool!');\n}", "function getName(){\n console.log('THIS IS MY FUNCTION');\n}", "function nameSomeoneGaveMe () { return \"Chris\"; }", "function myName(name){\n\treturn \"Hello \" + name + \". \";\n}", "function generateCode(){\n\n}" ]
[ "0.71539116", "0.6919739", "0.6912341", "0.6829076", "0.6804078", "0.6796927", "0.67792743", "0.6693347", "0.66748273", "0.6670561", "0.6634379", "0.6593228", "0.65864456", "0.6571324", "0.6564934", "0.6564515", "0.6534363", "0.652156", "0.6517803", "0.65071315", "0.6447898", "0.6446554", "0.64113116", "0.63971084", "0.639369", "0.6388122", "0.63749886", "0.63749886", "0.63613707", "0.63608164", "0.63604754", "0.635886", "0.6352532", "0.6319173", "0.62925816", "0.62886375", "0.628135", "0.6280981", "0.62761015", "0.62625444", "0.62406814", "0.62406814", "0.62400925", "0.623542", "0.62317866", "0.62218004", "0.62125844", "0.6207513", "0.6202669", "0.6198883", "0.619417", "0.6162522", "0.6160783", "0.61605096", "0.61585516", "0.6158095", "0.61522365", "0.6147297", "0.6146754", "0.6144231", "0.6142888", "0.61403865", "0.6138942", "0.6135221", "0.61330944", "0.6124235", "0.6115133", "0.61151123", "0.6103524", "0.61013937", "0.6097573", "0.60948265", "0.60948265", "0.6091925", "0.608416", "0.60749376", "0.606919", "0.60658425", "0.60658425", "0.6065513", "0.6063633", "0.6062219", "0.6048879", "0.60487074", "0.6043758", "0.6043758", "0.6043758", "0.6043758", "0.6043758", "0.60408074", "0.6037014", "0.60358584", "0.60314536", "0.6028898", "0.6024557", "0.6012512", "0.6009743", "0.6002468", "0.60008377", "0.60004085", "0.599826" ]
0.0
-1
example parameter in function
function multiply(val1, val2) { return val1 * val2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function example(param1, opt_param2, var_args){\n\t\n}", "function test_param(name, age, gender) {\n console.log(name);\n console.log(age);\n console.log(gender);\n}", "function passingValueToParamDemo(a,b,c) {\n\treturn \"This got passed to me A \" + a + \" B \" + b + \" C \" + c;\n}", "function example(fruit) {\r\n // function name\r\n // params (a.k.a. \"function signature\" -- this is where you name your params\r\n} // function body", "function parameterUnderstanding(gotParam) {\n\tconsole.log(\"Stored in gotParam in function: \"+gotParam)\n}", "function Parameter() {}", "function a(test){\nconsole.log(test)\n}", "function a(test){\nconsole.log(test)\n}", "function myFunction(kris) {\n // kris\n console.log('parameter value:', kris);\n}", "function greet(name, lastName) {\n console.log('Hello ' + name + ' ' + lastName);\n}//parameter", "function parameterFunc(num){\n console.log(num);\n}", "function exampleFunctionToRun(){\n\n }", "function a(test){\n\tconsole.log(test);\n}", "function a(test){\n\tconsole.log(test);\n}", "function parameterFunc (num) {\n console.log(num);\n}", "function parameterFunc(num) {\n console.log(num);\n}", "function parameterFunc(num) {\n console.log(num);\n}", "function myfun(param){\n console.log(param());\n}", "function exampleDef(a = 5, b = 10, c = 15) {\r\n console.log(`a=${a}, b=${b}, c=${c}`);\r\n}", "function soSomething (x, y=4){\n console.log(x,y);\n}", "function testFun(param1, param2) {\n console.log(\"My name is \" + param1 + \" \" + param2 + \" !\");\n}", "function greet(firstName, lastName){\n console.log (\"Hello \" + firstName + \" \" + lastName); \n //Inside of the function we have no idea what value firstName and lastName have \n\n}", "function person(name='John Doe', age=99) {\n console.log(name+' '+age)\n}", "function greet($greeting='Hello World'){\n console.log($greeting);\n}", "function bar(param) {\r\n console.log(param);\r\n}", "function foo({name, age}){\n\tconsole.log(`${name} is ${age} years old!`);\n}", "function WithParameters(fname, lname, age){\n document.getElementById('details').innerHTML = `My name is ${fname} ${lname}, I am ${age} years old.`;\n}", "function newFuction2(name = 'cristian',age = '26',country = 'COL'){\n console.log(name,age,country);\n}", "function displayResult (param){\n\tconsole.log(param);\n}", "function someFunction([small1],number) {\n console.log(small1)\n}", "function hello(param) {\n console.log(\"Hi \", param);\n return param;\n}", "function hello(name = 'Mystery Person'){\n console.log(`Hello ${name} !`)\n}", "function meaningOfLife(test = 42) {\n return \"The meaning of life is \" + test;\n }", "function sayHi(param) {\n console.log(\"hi \", param);\n param();\n}", "function awesomeMethod(param) {\r\n\tconsole.log(param);\r\n}", "function sayHiTo(first) {\r\n return `hello ${first}`; // without passing parameters error\r\n}", "function pepe2(nombre = \"desconocido\") {\n console.log(`hola soy ${nombre}`);\n}", "function example1() {\n\n function hi() {\n var name = arguments.length <= 0 || arguments[0] === undefined ? \"Guest\" : arguments[0];\n\n console.log(\"Hello, \" + name);\n }\n\n hi(); // Hello, Guest\n hi('Vlad'); // Hello, Vlad\n}", "function greet(parms){\n\tconsole.log(parms);\n}", "enterCallParameter(ctx) {\n\t}", "function fn(param) {\n // param();\n // console.log(\"current param is \", param());\n fn.invokCount++;\n}", "function greet(msg = 'hey there', person){\n console.log(`${msg}, ${person}`);\n}", "function PrintName(name){ // the set of a parameters.\n console.log(name);\n}", "function sayBye(name) { // parameters\n console.log('good bye ',name);\n}", "function sample(num1=100,num2){\n console.log(num1+num2)\n}", "function doIt (param) {\n param = 2\n}", "function potato(sweet, idaho){\n //does stuff\n}", "function nuevaFuncion(nombre = \"Tomas\", edad = \"21\", ciudad = \"Linares\")\n{\n console.log(nombre, edad, ciudad)\n}", "function boo({first=\"10\", second=\"true\"}) {\n\n}", "function greet(name, lastName) /* parameter */ {\n console.log('Hello ' + name + ' ' + lastName);\n}", "function greet ({ age, name:greeting='she' }) {\n console.log(`${greeting} is ${age} years old.`)\n}", "function helloSomeone(name = \"Frankie\"){\r\n console.log(\"Hello\" + name)\r\n}", "function iLove(name1, love1){\n console.log(`${name1} loves ${love1}`)\n}", "function argFunction(value = 'test') {\n console.log(value)\n}", "function wrapAdjective(parameter = \"*\"){\n//P A R E N T\n return function(singleParameter = \"special\"){\n return `You are ${parameter}${singleParameter}${parameter}!`\n }\n // I N N E R F U N C T I O N\n}", "function parametros(nombre = \"Edgar\", apellido = \"Tarquino\", edad = 33) {\n\tvar nombre = nombre;\n\tvar apellido = apellido;\n\tvar edad = edad;\n\tconsole.log(nombre, apellido, edad);\n}", "function a(test){\n test = \"p\";\n console.log(test)\n}", "function greetLessArgs(name,age = 20){\n console.log(`Hello ${name} , You are ${age} Yrs Old!`);\n}", "function myFunction(paramOne, paramTwo) {\n console.log(paramOne)\n console.log(paramTwo)\n}", "function grettings1(msg = \"Morning\", name = \"Mahesh\") {\n console.log(`Good ${msg} mr. ${name}`);\n}", "function myfunction(x, y){\n console.log(x + \" \" + y);\n }", "get example() {\n\t\tlet response = this._name;\n\n\t\tthis._parameters.forEach(\n\t\t\tfunction(param) {\n\t\t\t\tresponse += \" \" + param.example;\n\t\t\t}\n\t\t);\n\n\t\tif (this._remainderDescription) response += \" \" + this._remainderDescription + \"\"\n\n\t\treturn response;\n\t}", "function print(value){ // => the word value here is a parameter/placeholder/passenger\r\n console.log(value);\r\n }", "function hello(data = 1) {\n\n console.log('hey ' + data)\n}", "function someFunction([x1], number) {\n console.log(x1)\n}", "function newFunction2(name='Alice', age=32, country='MX'){\n console.log(name, age, country);\n}", "function greet(text, value, value2) {\n console.log(text);\n console.log(value);\n console.log(value2);\n}", "function foo() {\n var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'www.wikipedia.com';\n var message = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'Welcome to wikipedia';\n console.log(\"Argument with Default Parameter Url =\" + url);\n console.log(\"Argument with Default Parameter message =\" + message);\n}", "function storingExample(arg) {\n examples = arg;\n Output.printHeadingAndArrayElements(\"Example\", examples);\n}", "function SimpleArgs() {\r\n}", "function exampleFunc(a, b) { // a & b are parameters, local function variables\n return a + b; // code the function runs\n }", "function formal(name=\"Leah\", title='Miss') {\r\n return title+\" \"+name //this save the variable so you can assign it later\r\n}", "function a(){\n return param\n}", "function myFunctionWithParam(name) {\n alert('Hi ' + name);\n}", "function say({ age, name = 'Garry' }) {\n console.log(`My name is ${name} and my age is ${age}.`);\n}", "function test(parameterObject, parameterArray, parameterBoolean) {\n return console.log(\"test\");\n}", "function funcionParametro(fn) {\n\tfn();\n}", "function newFunction2(name = 'oscar', age = 32, country = \"MX\") {\n console.log(name, age, country);\n}", "function example3() {\n\n function hi() {\n for (var _len = arguments.length, fullName = Array(_len), _key = 0; _key < _len; _key++) {\n fullName[_key] = arguments[_key];\n }\n\n console.log(fullName.join(' '));\n }\n\n hi('vlad', 'argentum');\n}", "function a(x, y, z) {\n console.log(x);\n console.log(y);\n console.log(z);\n}", "function doSomething(a, b, c) {\n console.log('a is ' + a)\n console.log('b is ' + b)\n console.log('c is ' + c)\n}", "function someFunction(param) { // function declaration\n return `It has some parameter: ${param}`;\n}", "function greet(name) { // name --> parameter\n console.log('Hello ' + name);\n}", "function print(firstParameter = 5) {\n console.log(firstParameter);\n}", "function contador(cant=10){\n console.log(\"cantidad: \"+cant);\n}", "function innerFunc(){\n console.log(\"Number 1:\" + number1);\n console.log(\"Number 2:\" + number2);\n console.log(\"Param is: \" + param);\n }", "function newFunction2(name = 'oscar', age = '32', country = 'CO' ){\n console.log(name, age, country);\n}", "function showMyInfo2({ username, city, skills: { html, css, js: [ one, two, three ] } }) {\n console.log(`My name is ${username} and i live in ${city}.`);\n console.log(`My HTML skills progress is ${html} and CSS is ${css}.`);\n console.log(`I have knowledge in Js Frameworks, Like: ${one}, ${two} and ${three}.`);\n}", "function greetArgs(name,age) {\n console.log(`Hello ${name} You are ${age} yrs Old`);\n}", "function pet(animal){\n console.log(`i have a ${animal} for a pet`);\n}", "function greeting(name, age){\n console.log(\"jas sum \"+name+\" i imam\"+age+\" godini.\");\n}", "function helloWorldWithDefaultParam( name = \"student\" ) {\n return `Hello, ${name}!`;\n}", "function example4() {\n\n var me = {\n name: \"Vlad\",\n surname: \"Argentum\"\n };\n\n function hi(_ref) {\n var _ref$name = _ref.name;\n var name = _ref$name === undefined ? \"Guest\" : _ref$name;\n var _ref$surname = _ref.surname;\n var s = _ref$surname === undefined ? \"Anon\" : _ref$surname;\n\n console.log(\"Hi, \" + name + \" \" + s);\n }\n\n hi({}); //Guest Anon\n hi(me); //Vlad Argentum\n\n //even can call without params\n function hi() {\n var _ref2 = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n var _ref2$name = _ref2.name;\n var name = _ref2$name === undefined ? \"No\" : _ref2$name;\n var _ref2$surname = _ref2.surname;\n var s = _ref2$surname === undefined ? \"Params\" : _ref2$surname;\n\n console.log(\"Hi, \" + name + \" \" + s);\n }\n hi(); //No Params\n}", "function es1(params) {\n \n}", "function myFunction (w,x,y,z){\n console.log(w,x,y,z);\n}", "function dog(treat) {\n\t// prints parameter with strings\n\tprint('I want ' + treat + ' treats');\n}", "function question3(param1, param2) {\n return param1 + param2;\n\n}", "function firstThing(test) {\n console.log(\"First Thing: \" + test);\n}", "function firstThing(test) {\n console.log(\"First Thing: \" + test);\n}", "function saludo(nombre = 'Visitante')\r\n{\r\n return `Hola ${nombre}`\r\n}", "function something(greet, name) {\n function sayHi() {\n console.log(greet, name); // console.log(greet + ' ' + name)\n }\n\n sayHi();\n}" ]
[ "0.7048898", "0.6996498", "0.68308294", "0.6792636", "0.6736976", "0.6645436", "0.6621916", "0.6621916", "0.6582474", "0.65033996", "0.645862", "0.6454725", "0.6406795", "0.6406795", "0.63986915", "0.6393022", "0.6393022", "0.6378931", "0.634799", "0.63148475", "0.629058", "0.6261565", "0.62497777", "0.62380266", "0.623688", "0.6236365", "0.61670136", "0.61553985", "0.6149474", "0.6140976", "0.61404645", "0.61236566", "0.6116799", "0.6110743", "0.6110305", "0.60966575", "0.60813034", "0.6075424", "0.6071997", "0.6059909", "0.6052624", "0.6051875", "0.60307884", "0.6029917", "0.60162663", "0.60093457", "0.60073423", "0.59829295", "0.5982712", "0.5969553", "0.5958998", "0.59567446", "0.5946088", "0.5944174", "0.59439456", "0.5941642", "0.5931084", "0.59279805", "0.5919281", "0.59180945", "0.59100246", "0.59050393", "0.5900783", "0.5891957", "0.5888822", "0.58868515", "0.5877777", "0.58724654", "0.5870995", "0.5869285", "0.5864723", "0.5863958", "0.58630836", "0.5845976", "0.58454466", "0.5845337", "0.5845283", "0.5840619", "0.583945", "0.5838405", "0.58360636", "0.58314335", "0.5831383", "0.58304125", "0.58279485", "0.5822944", "0.5816436", "0.58132076", "0.5811", "0.5805157", "0.58040255", "0.58016384", "0.5801227", "0.5800777", "0.57981294", "0.5795679", "0.5793994", "0.5793715", "0.5793715", "0.579248", "0.57796556" ]
0.0
-1
the goal here isn't to be comprehensive (the RDKit has tests for that), just to make sure that the wrappers are working as expected
function test_basics(){ var bmol = RDKitModule.get_mol("c1ccccc"); assert.equal(bmol.is_valid(),0); var mol = RDKitModule.get_mol("c1ccccc1O"); assert.equal(mol.is_valid(),1); assert.equal(mol.get_smiles(),"Oc1ccccc1"); assert.equal(mol.get_inchi(),"InChI=1S/C6H6O/c7-6-4-2-1-3-5-6/h1-5,7H"); assert.equal(RDKitModule.get_inchikey_for_inchi(mol.get_inchi()),"ISWSIDIOOBJBQZ-UHFFFAOYSA-N"); var mb = mol.get_molblock(); assert(mb.search("M END")>0); var mol2 = RDKitModule.get_mol(mb); assert.equal(mol2.is_valid(),1); assert.equal(mol2.get_smiles(),"Oc1ccccc1"); var descrs = JSON.parse(mol.get_descriptors()); assert.equal(descrs.NumAromaticRings,1); assert.equal(descrs.NumRings,1); assert.equal(descrs.amw,94.11299); var fp1 = mol.get_morgan_fp(); assert.equal(fp1.length,2048); assert.equal((fp1.match(/1/g)||[]).length,11); var fp2 = mol.get_morgan_fp(0,512); assert.equal(fp2.length,512); assert.equal((fp2.match(/1/g)||[]).length,3); var svg = mol.get_svg(); assert(svg.search("svg")>0); var qmol = RDKitModule.get_qmol("Oc(c)c"); assert.equal(qmol.is_valid(),1); var match = mol.get_substruct_match(qmol); var pmatch = JSON.parse(match); assert.equal(pmatch.atoms.length,4); assert.equal(pmatch.atoms[0],6); var svg2 = mol.get_svg_with_highlights(match); assert(svg2.search("svg")>0); assert(svg.search("#FF7F7F")<0); assert(svg2.search("#FF7F7F")>0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "transient private protected internal function m182() {}", "transient private internal function m185() {}", "private public function m246() {}", "transient protected internal function m189() {}", "function DWRUtil() { }", "private internal function m248() {}", "transient private protected public internal function m181() {}", "transient final private internal function m170() {}", "static transient private protected internal function m55() {}", "function _____SHARED_functions_____(){}", "function testRelationHlpMethods(cb){\n\n var Parent = Model.define('P1', ['MemoryDataSource'], {\n content:{}\n });\n Parent.extendDefaults({ connection:{ collection:'parents' } });\n \n var Child = Model.define('CH1', ['MemoryDataSource'], {\n parentId:{ isString:true },\n content:{}\n });\n Child.extendDefaults({ connection:{ collection:'children' } });\n \n relations.create('CH1.parentId [parent] --> P1 [children]',{\n maintainIntegrity: true,\n required: true,\n bulkRemove: false\n });\n \n // same relation cannot be created more than one time\n assert.throws(function(){\n relations.create('CH1.parentId [parent] --> P1 [children]',{\n maintainIntegrity: true,\n require: true,\n bulkRemove: false\n });\n }, new Error('Same relation already exists: \"CH1.parentId [parent] --> P1 [children]\"'));\n \n // relation cannot use properties not defined in Model.propSchema\n assert.throws(function(){\n relations.create('CH1.fakeProp [parent1] --> P1 [children1]',{\n maintainIntegrity: true,\n require: true,\n bulkRemove: false\n });\n }, new Error('Cannot create relation, model \"CH1\" has not property \"fakeProp\" defined in property schema'));\n \n // relation cannot use already defined properties\n assert.throws(function(){\n relations.create('CH1.content [parent] --> P1 [children]',{\n maintainIntegrity: true,\n require: true,\n bulkRemove: false\n });\n }, new Error('Cannot create relation, model property name conflict: \"P1.children\"'));\n \n \n var parent = Parent.new().fill({\n id:'p1',\n content:'I am Parent'\n }).validate();\n \n var child = Child.new().fill({\n id:'c1',\n parentId:'p1',\n content:'I am Child of Parent \"p1\"'\n }).validate();\n \n parent.create(function(err, pDoc){\n if(err) throw err;\n parent = pDoc;\n child.create(function(err, cDoc){\n if(err) throw err;\n \n checkProps();\n });\n });\n \n function checkProps(){\n var s = new Series();\n \n // 1. one-to-one - parent().one(err, parent)\n s.add(function(next){\n child.parent().one(function(err, pDoc){\n assert.ok(pDoc.id === 'p1');\n assert.ok(pDoc.content === 'I am Parent');\n next();\n });\n });\n \n // 2. one-to-one - parent.valitade(parent)\n s.add(function(next){\n var valid = child.parent().validate({ id:999 });\n assert.deepEqual(valid.id, ['isString']);\n next();\n });\n \n // 3. one-to-many - children().all(err, [children])\n s.add(function(next){\n parent.children().all(function(err, children){\n assert.ok(children.length === 1);\n assert.ok(children[0].id === 'c1');\n next();\n });\n });\n \n // 4. one-to-many - children().create(child)\n s.add(function(next){\n parent.children().create({ id:'c2' }, function(err, newChild){\n if(err) throw err;\n assert.ok(newChild.id === 'c2');\n next();\n });\n });\n \n // 5. one-to-many - children().validate(child)\n s.add(function(next){\n var valid = parent.children().validate({ id:999 });\n assert.deepEqual(valid.id, ['isString']);\n next();\n });\n \n // execute\n s.execute(function(err){\n if(err) throw err;\n \n // remove parent, children\n parent.remove(function(err){\n if(err) throw err;\n console.log('relation defined properties - OK');\n cb();\n });\n });\n }\n}", "transient final protected internal function m174() {}", "static transient final private internal function m43() {}", "function test_candu_graphs_datastore_vsphere6() {}", "obtain(){}", "createWrapper() {\n return false;\n }", "protected internal function m252() {}", "static transient final protected public internal function m46() {}", "patch() {\n }", "function Adapter() {}", "static transient private protected public internal function m54() {}", "transient private public function m183() {}", "static transient final protected internal function m47() {}", "static final private internal function m106() {}", "function Adaptor() {}", "static transient final private protected internal function m40() {}", "static private internal function m121() {}", "init() {\n module_utils.patchModule(\n 'amazon-dax-client',\n '_makeWriteRequestWithRetries',\n DAXWrapper,\n AmazonDaxClient => AmazonDaxClient.prototype\n );\n\n module_utils.patchModule(\n 'amazon-dax-client',\n '_makeReadRequestWithRetries',\n DAXWrapper,\n AmazonDaxClient => AmazonDaxClient.prototype\n );\n }", "function Utils() {}", "function Utils() {}", "transient final private protected internal function m167() {}", "function mock() {\n\twindow.SegmentString = Rng.Range;\n}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "static transient private internal function m58() {}", "[registerBuiltInHelpers]() {\n this.registerHelper(\"set\", function(...args) {\n var obj, name, val, data, dot;\n\n //(1) arguments\n if (args.length >= 3) [name, val, data] = args;\n\n //(2) prepare environment\n data = data.data.root;\n\n\n if ((dot = name.indexOf(\".\")) >= 0) {\n obj = name.slice(0, dot);\n name = name.slice(dot+1);\n }\n\n //(2) set value\n if (obj) data[obj][name] = val;\n else data[name] = val;\n });\n\n this.registerHelper(\"and\", function(...args) {\n var res;\n\n //(1) check\n res = false;\n\n for (let value of args.slice(0, args.length-1)) {\n res = !!value;\n if (!res) break;\n }\n\n //(2) return\n return res;\n });\n\n this.registerHelper(\"or\", function(...args) {\n var res;\n\n //(1) check\n res = false;\n\n for (let value of args.slice(0, args.length-1)) {\n res = !!value;\n if (res) break;\n }\n\n //(2) return\n return res;\n });\n\n this.registerHelper(\"like\", function(value, pattern) {\n if (!(pattern instanceof RegExp)) pattern = new RegExp(pattern);\n return pattern.test(value);\n });\n\n this.registerHelper(\"length\", function(coll) {\n return coll.length;\n });\n\n this.registerHelper(\"contain\", function(coll, item) {\n var res = false;\n if (coll) res = (coll.indexOf(item) >= 0);\n return res;\n });\n\n this.registerHelper(\"esc\", function(text) {\n return text;\n });\n\n this.registerHelper(\"lowercase\", function(text) {\n return (text ? text.toString().toLowerCase() : \"\");\n });\n\n this.registerHelper(\"uppercase\", function(text) {\n return (text ? text.toString().toUpperCase() : \"\");\n });\n\n this.registerHelper(\"capitalize\", function(text) {\n return (text ? text[0].toUpperCase() + text.slice(1) : \"\");\n });\n\n this.registerHelper(\"decapitalize\", function(text) {\n return (text ? text[0].toLowerCase() + text.slice(1) : \"\");\n });\n\n this.registerHelper(\"concat\", function(...args) {\n return args.slice(0, args.length-1).join(\"\");\n });\n\n this.registerHelper(\"replace\", function(...args) {\n return args[0].replace(args[1], (typeof(args[2]) == \"string\" ? args[2] : \"\"));\n });\n\n this.registerHelper(\"http\", function(url) {\n if (!url) return \"\";\n else if (/^http[s]?:/.test(url)) return url;\n else return \"http://\" + url;\n });\n\n this.registerHelper(\"true\", function(x) {\n return ([true, \"true\", \"yes\"].indexOf(x) >= 0);\n });\n\n this.registerHelper(\"false\", function(x) {\n return ([false, \"false\", \"no\"].indexOf(x) >= 0);\n });\n\n this.registerHelper(\"eq\", function(x, y) {\n return (x == y);\n });\n\n this.registerHelper(\"ne\", function(x, y) {\n return (x != y);\n });\n\n this.registerHelper(\"lt\", function(x, y) {\n return (x < y);\n });\n\n this.registerHelper(\"le\", function(x, y) {\n return (x <= y);\n });\n\n this.registerHelper(\"gt\", function(x, y) {\n return (x > y);\n });\n\n this.registerHelper(\"ge\", function(x, y) {\n return (x >= y);\n });\n\n this.registerHelper(\"in\", function(value, ...rest) {\n var coll;\n\n //(1) get collection\n if (rest.length == 2) coll = rest[0];\n else coll = rest.slice(0, -1);\n\n //(2) check\n return coll.indexOf(value) >= 0;\n });\n\n this.registerHelper(\"nin\", function(value, ...rest) {\n var coll;\n\n //(1) get collection\n if (rest.length == 2) coll = rest[0];\n else coll = rest.slice(0, -1);\n\n //(2) check\n return coll.indexOf(value) < 0;\n });\n\n this.registerHelper(\"iif\", function(cond, tr, fls) {\n return cond ? tr : fls;\n });\n\n this.registerHelper(\"coalesce\", function(args) {\n var res;\n\n //(1) check\n for (let arg of args) {\n if (arg !== undefined && arg !== null) {\n res = arg;\n break;\n }\n }\n\n //(2) return\n return res;\n });\n }", "function test_crosshair_op_datastore_vsphere65() {}", "__previnit(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "static transient private public function m56() {}", "function r() {}", "function r() {}", "function r() {}", "function Rebelizer() {\n\n}", "static private protected internal function m118() {}", "static transient final protected function m44() {}", "function NXObject() {}", "function testInternalFunction(f) {\n var exec = f.factory();\n var args = [];\n\n for (var i = 1; i < arguments.length; i++) {\n args.push(new Result(arguments[i]));\n }\n return exec.execute(args);\n}", "initialize() {\n // Needs to be implemented by derived classes.\n }", "apply () {}", "function customHandling() { }", "function r(e,t,o){try{return{type:\"normal\",arg:e.call(t,o)}}catch(e){return{type:\"throw\",arg:e}}}// Dummy constructor functions that we use as the .constructor and", "function factory() {}", "function factory() {}", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "transient final private protected public internal function m166() {}", "static create () {}", "constructor(rtObject) {\n return new Proxy(rtObject, {\n get : function(rtObject, property, receiver) {\n return (...args) => {\n return rtObject.get(property).then((response) => {\n if(response.type == \"f\".charCodeAt(0)) {\n //TODO :: need to add condition to use sendReturns or send both.\n\t var methodName = property;\n return rtObject.sendReturns(methodName, ...args);\n } \n else {\n return response;\n\t }\n });\n\t };\n },\n set : function(rtObject, property, value) {\n return rtObject.get(property).then((response) => {\n\t var type = response.type;\n \t return rtObject.set(property, RTValueHelper.create(value, type)).then(() => {\n return rtObject.get(property).then((response) => {\n let result = false;\n\t if (type === RTValueType.UINT64 || type === RTValueType.INT64) {\n\t result = value.toString() === response.value.toString();\n\t } else {\n\t result = response.value === value;\n\t }\n\t logger_1.debug(`Set succesfull ? ${result}`);\n\t }).catch((err) => {\n\t logger_1.error(err);\n\t });\n\t })\n })\n }\t\n });\n }", "function __it() {}", "static fromTR(t, r) {\nreturn this.fromTRV(t.xyz, r.xyzw);\n}", "function AeUtil() {}", "prepare() {}", "make_box(src) {\n\n let proto = Object.getPrototypeOf(this.std)\n let std = ``\n for (var k of Object.getOwnPropertyNames(proto)) {\n if (k === 'constructor') continue\n std += `const std_${k} = self.std.${k}.bind(self.std)\\n`\n }\n\n let props = ``\n for (var k in src.props || {}) {\n if (src.props[k].val !== undefined) {\n var val = src.props[k].val\n } else if (this.src.sett[k] !== undefined) {\n val = this.src.sett[k]\n } else {\n val = src.props[k].def\n }\n props += `var ${k} = ${JSON.stringify(val)}\\n`\n }\n // TODO: add argument values to _id\n\n let tss = ``\n for (var k in this.shared) {\n if (this.shared[k] && this.shared[k].__id__) {\n tss += `const ${k} = shared.${k}\\n`\n }\n }\n\n // Datasets\n let dss = ``\n for (var k in src.data || {}) {\n let id = se.match_ds(this.id, src.data[k].type)\n if (!this.shared.dss[id]) {\n let T = src.data[k].type\n console.warn(`Dataset '${T}' is undefined`)\n continue\n }\n dss += `const ${k} = shared.dss['${id}'].data\\n`\n }\n\n try {\n return Function('self,shared,se', `\n 'use strict';\n\n // Built-in functions (aliases)\n ${std}\n\n // Modules (API / interfaces)\n ${this.make_modules()}\n\n // Timeseries\n ${tss}\n\n // Direct data ts\n const data = self.data\n const ohlcv = shared.dss.ohlcv.data\n ${dss}\n\n // Script's properties (init)\n ${props}\n\n // Globals\n const settings = self.src.sett\n const tf = shared.tf\n const range = shared.range\n\n this.init = (_id = 'root') => {\n ${this.prep(src.init_src)}\n }\n\n this.update = (_id = 'root') => {\n const t = shared.t()\n const iter = shared.iter()\n ${this.prep(src.upd_src)}\n }\n\n this.post = (_id = 'root') => {\n ${this.prep(src.post_src)}\n }\n `)\n } catch(e) {\n return Function('self,shared', `\n 'use strict';\n this.init = () => {}\n this.update = () => {}\n this.post = () => {}\n `)\n }\n }", "function Utils(){}", "function exposeTestFunctionNames()\n{\nreturn ['XPathResult_resultType'];\n}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "internalToExternal (metadata, v) {\n return v;\n }", "static transient final private protected public internal function m39() {}", "requiredOperations1() {}", "function TrueSpecification() {}", "expected( _utils ) {\n\t\t\treturn 'nothing';\n\t\t}", "function AndNodeFactory() {}", "_get () {\n throw new Error('_get not implemented')\n }", "function TestRoot() {}", "init () {\n\t\treturn null;\n\t}", "function test_bottleneck_datastore() {}", "function closeOverDocument(localDoc) {\n\nvar STYLE_KEY = 'STYLE';\nvar EVENT_KEY = 'EVENT';\nvar ATTR_KEY = 'ATTR';\nvar ATTR_NS_KEY = 'ATTR_NS';\n\n\n\n//////////// VIRTUAL DOM NODES ////////////\n\n\nfunction text(string)\n{\n\treturn {\n\t\ttype: 'text',\n\t\ttext: string\n\t};\n}\n\n\nfunction nodeHelp(tag, factList, kidList)\n{\n\tvar organized = organizeFacts(factList);\n\tvar namespace = organized.namespace;\n\tvar facts = organized.facts;\n\n\tvar children = [];\n\tvar descendantsCount = 0;\n\tfor (var i = 0; i < kidList.length; i++)\n\t{\n\t\t// xxx use read-only array as-is?\n\t\tvar kid = kidList[i];\n\t\tdescendantsCount += (kid.descendantsCount || 0);\n\t\tchildren.push(kid);\n\t}\n\tdescendantsCount += children.length;\n\n\treturn {\n\t\ttype: 'node',\n\t\ttag: tag,\n\t\tfacts: facts,\n\t\tchildren: children,\n\t\tnamespace: namespace,\n\t\tdescendantsCount: descendantsCount\n\t};\n}\n\n\nfunction keyedNode(tag, factList, kidList)\n{\n\tvar organized = organizeFacts(factList);\n\tvar namespace = organized.namespace;\n\tvar facts = organized.facts;\n\n\tvar children = [];\n\tvar descendantsCount = 0;\n\tfor (var i = 0; i < kidList.length; i++)\n\t{\n\t\tvar kid = kidList[i];\n\t\tdescendantsCount += (kid.value1.descendantsCount || 0);\n\t\tchildren.push(kid);\n\t}\n\tdescendantsCount += children.length;\n\n\treturn {\n\t\ttype: 'keyed-node',\n\t\ttag: tag,\n\t\tfacts: facts,\n\t\tchildren: children,\n\t\tnamespace: namespace,\n\t\tdescendantsCount: descendantsCount\n\t};\n}\n\n\nfunction custom(factList, model, impl)\n{\n\tvar facts = organizeFacts(factList).facts;\n\n\treturn {\n\t\ttype: 'custom',\n\t\tfacts: facts,\n\t\tmodel: model,\n\t\timpl: impl\n\t};\n}\n\n\nfunction map(tagger, node)\n{\n\treturn {\n\t\ttype: 'tagger',\n\t\ttagger: tagger,\n\t\tnode: node,\n\t\tdescendantsCount: 1 + (node.descendantsCount || 0)\n\t};\n}\n\n\nfunction thunk(func, args, thunk)\n{\n\treturn {\n\t\ttype: 'thunk',\n\t\tfunc: func,\n\t\targs: args,\n\t\tthunk: thunk,\n\t\tnode: undefined\n\t};\n}\n\nfunction lazy(fn, a)\n{\n\treturn thunk(fn, [a], function() {\n\t\treturn fn(a);\n\t});\n}\n\nfunction lazy2(fn, a, b)\n{\n\treturn thunk(fn, [a,b], function() {\n\t\treturn fn(a)(b);\n\t});\n}\n\nfunction lazy3(fn, a, b, c)\n{\n\treturn thunk(fn, [a,b,c], function() {\n\t\treturn fn(a)(b)(c);\n\t});\n}\n\n\n\n// FACTS\n\n\nfunction organizeFacts(factList)\n{\n\tvar namespace, facts = {};\n\n\tfor (var i = 0; i < factList.length; i++)\n\t{\n\t\tvar entry = factList[i];\n\t\tvar key = entry.key;\n\n\t\tif (key === ATTR_KEY || key === ATTR_NS_KEY || key === EVENT_KEY)\n\t\t{\n\t\t\tvar subFacts = facts[key] || {};\n\t\t\tsubFacts[entry.realKey] = entry.value;\n\t\t\tfacts[key] = subFacts;\n\t\t}\n\t\telse if (key === STYLE_KEY)\n\t\t{\n\t\t\tvar styles = facts[key] || {};\n\t\t\tvar styleList = entry.value;\n\t\t\tfor (var j = 0; j < styleList.length; j++)\n\t\t\t{\n\t\t\t\tvar style = styleList[j];\n\t\t\t\tstyles[style.value0] = style.value1;\n\t\t\t}\n\t\t\tfacts[key] = styles;\n\t\t}\n\t\telse if (key === 'namespace')\n\t\t{\n\t\t\tnamespace = entry.value;\n\t\t}\n\t\telse if (key === 'className')\n\t\t{\n\t\t\tvar classes = facts[key];\n\t\t\tfacts[key] = typeof classes === 'undefined'\n\t\t\t\t? entry.value\n\t\t\t\t: classes + ' ' + entry.value;\n\t\t}\n \t\telse\n\t\t{\n\t\t\tfacts[key] = entry.value;\n\t\t}\n\t}\n\n\treturn {\n\t\tfacts: facts,\n\t\tnamespace: namespace\n\t};\n}\n\n\n\n//////////// PROPERTIES AND ATTRIBUTES ////////////\n\n\nfunction style(value)\n{\n\treturn {\n\t\tkey: STYLE_KEY,\n\t\tvalue: value\n\t};\n}\n\n\nfunction property(key, value)\n{\n\treturn {\n\t\tkey: key,\n\t\tvalue: value\n\t};\n}\n\n\nfunction attribute(key, value)\n{\n\treturn {\n\t\tkey: ATTR_KEY,\n\t\trealKey: key,\n\t\tvalue: value\n\t};\n}\n\n\nfunction attributeNS(namespace, key, value)\n{\n\treturn {\n\t\tkey: ATTR_NS_KEY,\n\t\trealKey: key,\n\t\tvalue: {\n\t\t\tvalue: value,\n\t\t\tnamespace: namespace\n\t\t}\n\t};\n}\n\n\nfunction on(name, options, decoder)\n{\n\treturn {\n\t\tkey: EVENT_KEY,\n\t\trealKey: name,\n\t\tvalue: {\n\t\t\toptions: options,\n\t\t\tdecoder: decoder,\n\t\t\tfilter: defaultFilter,\n\t\t}\n\t};\n}\n\nfunction defaultFilter(ev) {\n return function() {\n return true;\n };\n}\n\nfunction filterOn(name, options, filter, decoder) {\n\treturn {\n\t\tkey: EVENT_KEY,\n\t\trealKey: name,\n\t\tvalue: {\n\t\t\toptions: options,\n\t\t\tdecoder: decoder,\n\t\t\tfilter: filter,\n\t\t}\n\t};\n}\n\n\nfunction equalEvents(a, b)\n{\n\tif (a.options !== b.options)\n\t{\n\t\tif (a.options.stopPropagation !== b.options.stopPropagation || a.options.preventDefault !== b.options.preventDefault)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// return _elm_lang$core$Native_Json.equality(a.decoder, b.decoder);\n\t// XXX: event equality?\n\t// console.log(\"event equality\", a.decoder, b.decoder, a.decoder === b.decoder);\n\treturn a.decoder === b.decoder && a.filter === b.filter;\n}\n\n\nfunction mapProperty(decodeMapper, func, property)\n{\n\tif (property.key !== EVENT_KEY)\n\t{\n\t\treturn property;\n\t}\n\n\treturn filterOn(\n\t\tproperty.realKey,\n\t\tproperty.value.options,\n property.value.filter,\n\t\tdecodeMapper(func)(property.value.decoder)\n\t);\n}\n\n\n//////////// RENDER ////////////\n\n\nfunction render(vNode, eventNode)\n{\n\tswitch (vNode.type)\n\t{\n\t\tcase 'thunk':\n\t\t\tif (!vNode.node)\n\t\t\t{\n\t\t\t\tvNode.node = vNode.thunk();\n\t\t\t}\n\t\t\treturn render(vNode.node, eventNode);\n\n\t\tcase 'tagger':\n\t\t\tvar subNode = vNode.node;\n\t\t\tvar tagger = vNode.tagger;\n\n\t\t\twhile (subNode.type === 'tagger')\n\t\t\t{\n\t\t\t\ttypeof tagger !== 'object'\n\t\t\t\t\t? tagger = [tagger, subNode.tagger]\n\t\t\t\t\t: tagger.push(subNode.tagger);\n\n\t\t\t\tsubNode = subNode.node;\n\t\t\t}\n\n\t\t\tvar subEventRoot = { tagger: tagger, parent: eventNode };\n\t\t\tvar domNode = render(subNode, subEventRoot);\n\t\t\tdomNode.elm_event_node_ref = subEventRoot;\n\t\t\treturn domNode;\n\n\t\tcase 'text':\n\t\t\treturn localDoc.createTextNode(vNode.text);\n\n\t\tcase 'node':\n\t\t\tvar domNode = vNode.namespace\n\t\t\t\t? localDoc.createElementNS(vNode.namespace, vNode.tag)\n\t\t\t\t: localDoc.createElement(vNode.tag);\n\n\t\t\tapplyFacts(domNode, eventNode, vNode.facts);\n\n\t\t\tvar children = vNode.children;\n\n\t\t\tfor (var i = 0; i < children.length; i++)\n\t\t\t{\n\t\t\t\tdomNode.appendChild(render(children[i], eventNode));\n\t\t\t}\n\n\t\t\treturn domNode;\n\n\t\tcase 'keyed-node':\n\t\t\tvar domNode = vNode.namespace\n\t\t\t\t? localDoc.createElementNS(vNode.namespace, vNode.tag)\n\t\t\t\t: localDoc.createElement(vNode.tag);\n\n\t\t\tapplyFacts(domNode, eventNode, vNode.facts);\n\n\t\t\tvar children = vNode.children;\n\n\t\t\tfor (var i = 0; i < children.length; i++)\n\t\t\t{\n\t\t\t\tdomNode.appendChild(render(children[i].value1, eventNode));\n\t\t\t}\n\n\t\t\treturn domNode;\n\n\t\tcase 'custom':\n\t\t\tvar domNode = vNode.impl.render(vNode.model);\n\t\t\tapplyFacts(domNode, eventNode, vNode.facts);\n\t\t\treturn domNode;\n\t}\n}\n\n\n\n//////////// APPLY FACTS ////////////\n\n\nfunction applyFacts(domNode, eventNode, facts)\n{\n\tfor (var key in facts)\n\t{\n\t\tvar value = facts[key];\n\n\t\tswitch (key)\n\t\t{\n\t\t\tcase STYLE_KEY:\n\t\t\t\tapplyStyles(domNode, value);\n\t\t\t\tbreak;\n\n\t\t\tcase EVENT_KEY:\n\t\t\t\tapplyEvents(domNode, eventNode, value);\n\t\t\t\tbreak;\n\n\t\t\tcase ATTR_KEY:\n\t\t\t\tapplyAttrs(domNode, value);\n\t\t\t\tbreak;\n\n\t\t\tcase ATTR_NS_KEY:\n\t\t\t\tapplyAttrsNS(domNode, value);\n\t\t\t\tbreak;\n\n\t\t\tcase 'value':\n\t\t\t\tif (domNode[key] !== value)\n\t\t\t\t{\n\t\t\t\t\tdomNode[key] = value;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tdomNode[key] = value;\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\n\nfunction applyStyles(domNode, styles)\n{\n\tvar domNodeStyle = domNode.style;\n\n\tfor (var key in styles)\n\t{\n\t\tdomNodeStyle[key] = styles[key];\n\t}\n}\n\nfunction applyEvents(domNode, eventNode, events)\n{\n\tvar allHandlers = domNode.elm_handlers || {};\n\n\tfor (var key in events)\n\t{\n\t\tvar handler = allHandlers[key];\n\t\tvar value = events[key];\n\n\t\tif (typeof value === 'undefined')\n\t\t{\n\t\t\tdomNode.removeEventListener(key, handler);\n\t\t\tallHandlers[key] = undefined;\n\t\t}\n\t\telse if (typeof handler === 'undefined')\n\t\t{\n\t\t\tvar handler = makeEventHandler(eventNode, value);\n\t\t\tdomNode.addEventListener(key, handler);\n\t\t\tallHandlers[key] = handler;\n\t\t}\n\t\telse\n\t\t{\n\t\t\thandler.info = value;\n\t\t}\n\t}\n\n\tdomNode.elm_handlers = allHandlers;\n}\n\nfunction makeEventHandler(eventNode, info)\n{\n\tfunction eventHandler(event)\n\t{\n\t\tvar info = eventHandler.info;\n\n var b = info.filter(event)();\n\n\t\t// keep the indentation the same as in the Elm version\n\t\t// in case of bugfixes upstream\n\t\tif (b)\n\t\t{\n\t\t // var value = A2(_elm_lang$core$Native_Json.run,info.decoder, event);\n\t\t var value = info.decoder(event);\n\n\t\t\t// event options stop propagation/preventdefault are only\n\t\t\t// applied after successful EventDecoder.\n\t\t\t// this is a feature: non standard options will\n\t\t\t// only apply to successful event decodes (= that emit\n\t\t\t// a command). Failures will bubble on.\n\t\t\tvar options = info.options;\n\t\t\tif (options.stopPropagation)\n\t\t\t{\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\t\t\tif (options.preventDefault)\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\n\t\t\t// error/success is all handled in the purescript mapping functions\n\t\t\tvar message = value;\n\n\t\t\tvar currentEventNode = eventNode;\n\t\t\tvar tn = topEventNode(eventNode);\n\t\t\tvar emitter = tn.emitter;\n\t\t\tvar cmdMap = tn.cmdMap;\n\n\t\t\twhile (currentEventNode)\n\t\t\t{\n\t\t\t\tvar tagger = currentEventNode.tagger;\n\t\t\t\temitter = currentEventNode.emitter;\n\n\t\t\t\tif (typeof tagger === 'function')\n\t\t\t\t{\n\t\t\t\t\tmessage = cmdMap(tagger)(message);\n\t\t\t\t}\n\t\t\t\telse if (typeof tagger === 'object')\n\t\t\t\t{\n\t\t\t\t\tfor (var i = tagger.length; i--; )\n\t\t\t\t\t{\n\t\t\t\t\t\tmessage = cmdMap(tagger[i])(message);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcurrentEventNode = currentEventNode.parent;\n\t\t\t}\n\n\t\t\t// emit the message to bonsai\n\t\t\tif (emitter(message)()) {\n\t\t\t\tconsole.log(\"triggering event: \", event);\n\t\t\t}\n\t\t}\n\t};\n\n\teventHandler.info = info;\n\n\treturn eventHandler;\n}\n\nfunction applyAttrs(domNode, attrs)\n{\n\tfor (var key in attrs)\n\t{\n\t\tvar value = attrs[key];\n\t\tif (typeof value === 'undefined')\n\t\t{\n\t\t\tdomNode.removeAttribute(key);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdomNode.setAttribute(key, value);\n\t\t}\n\t}\n}\n\nfunction applyAttrsNS(domNode, nsAttrs)\n{\n\tfor (var key in nsAttrs)\n\t{\n\t\tvar pair = nsAttrs[key];\n\t\tvar namespace = pair.namespace;\n\t\tvar value = pair.value;\n\n\t\tif (typeof value === 'undefined')\n\t\t{\n\t\t\tdomNode.removeAttributeNS(namespace, key);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdomNode.setAttributeNS(namespace, key, value);\n\t\t}\n\t}\n}\n\n\n\n//////////// DIFF ////////////\n\n\nfunction diff(a, b)\n{\n\tvar patches = [];\n\tdiffHelp(a, b, patches, 0);\n\treturn patches;\n}\n\n\nfunction makePatch(type, index, data)\n{\n\treturn {\n\t\tindex: index,\n\t\ttype: type,\n\t\tdata: data,\n\t\tdomNode: undefined,\n\t\teventNode: undefined\n\t};\n}\n\n\nfunction diffHelp(a, b, patches, index)\n{\n\tif (a === b)\n\t{\n\t\treturn;\n\t}\n\n\tvar aType = a.type;\n\tvar bType = b.type;\n\n\t// Bail if you run into different types of nodes. Implies that the\n\t// structure has changed significantly and it's not worth a diff.\n\tif (aType !== bType)\n\t{\n\t\tpatches.push(makePatch('p-redraw', index, b));\n\t\treturn;\n\t}\n\n\t// Now we know that both nodes are the same type.\n\tswitch (bType)\n\t{\n\t\tcase 'thunk':\n\t\t\tvar aArgs = a.args;\n\t\t\tvar bArgs = b.args;\n\t\t\tvar i = aArgs.length;\n\t\t\tvar same = a.func === b.func && i === bArgs.length;\n\t\t\twhile (same && i--)\n\t\t\t{\n\t\t\t\tsame = aArgs[i] === bArgs[i];\n\t\t\t}\n\t\t\tif (same)\n\t\t\t{\n\t\t\t\tb.node = a.node;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tb.node = b.thunk();\n\t\t\tvar subPatches = [];\n\t\t\tdiffHelp(a.node, b.node, subPatches, 0);\n\t\t\tif (subPatches.length > 0)\n\t\t\t{\n\t\t\t\tpatches.push(makePatch('p-thunk', index, subPatches));\n\t\t\t}\n\t\t\treturn;\n\n\t\tcase 'tagger':\n\t\t\t// gather nested taggers\n\t\t\tvar aTaggers = a.tagger;\n\t\t\tvar bTaggers = b.tagger;\n\t\t\tvar nesting = false;\n\n\t\t\tvar aSubNode = a.node;\n\t\t\twhile (aSubNode.type === 'tagger')\n\t\t\t{\n\t\t\t\tnesting = true;\n\n\t\t\t\ttypeof aTaggers !== 'object'\n\t\t\t\t\t? aTaggers = [aTaggers, aSubNode.tagger]\n\t\t\t\t\t: aTaggers.push(aSubNode.tagger);\n\n\t\t\t\taSubNode = aSubNode.node;\n\t\t\t}\n\n\t\t\tvar bSubNode = b.node;\n\t\t\twhile (bSubNode.type === 'tagger')\n\t\t\t{\n\t\t\t\tnesting = true;\n\n\t\t\t\ttypeof bTaggers !== 'object'\n\t\t\t\t\t? bTaggers = [bTaggers, bSubNode.tagger]\n\t\t\t\t\t: bTaggers.push(bSubNode.tagger);\n\n\t\t\t\tbSubNode = bSubNode.node;\n\t\t\t}\n\n\t\t\t// Just bail if different numbers of taggers. This implies the\n\t\t\t// structure of the virtual DOM has changed.\n\t\t\tif (nesting && aTaggers.length !== bTaggers.length)\n\t\t\t{\n\t\t\t\tpatches.push(makePatch('p-redraw', index, b));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// check if taggers are \"the same\"\n\t\t\tif (nesting ? !pairwiseRefEqual(aTaggers, bTaggers) : aTaggers !== bTaggers)\n\t\t\t{\n\t\t\t\tpatches.push(makePatch('p-tagger', index, bTaggers));\n\t\t\t}\n\n\t\t\t// diff everything below the taggers\n\t\t\tdiffHelp(aSubNode, bSubNode, patches, index + 1);\n\t\t\treturn;\n\n\t\tcase 'text':\n\t\t\tif (a.text !== b.text)\n\t\t\t{\n\t\t\t\tpatches.push(makePatch('p-text', index, b.text));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treturn;\n\n\t\tcase 'node':\n\t\t\t// Bail if obvious indicators have changed. Implies more serious\n\t\t\t// structural changes such that it's not worth it to diff.\n\t\t\tif (a.tag !== b.tag || a.namespace !== b.namespace)\n\t\t\t{\n\t\t\t\tpatches.push(makePatch('p-redraw', index, b));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar factsDiff = diffFacts(a.facts, b.facts);\n\n\t\t\tif (typeof factsDiff !== 'undefined')\n\t\t\t{\n\t\t\t\tpatches.push(makePatch('p-facts', index, factsDiff));\n\t\t\t}\n\n\t\t\tdiffChildren(a, b, patches, index);\n\t\t\treturn;\n\n\t\tcase 'keyed-node':\n\t\t\t// Bail if obvious indicators have changed. Implies more serious\n\t\t\t// structural changes such that it's not worth it to diff.\n\t\t\tif (a.tag !== b.tag || a.namespace !== b.namespace)\n\t\t\t{\n\t\t\t\tpatches.push(makePatch('p-redraw', index, b));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar factsDiff = diffFacts(a.facts, b.facts);\n\n\t\t\tif (typeof factsDiff !== 'undefined')\n\t\t\t{\n\t\t\t\tpatches.push(makePatch('p-facts', index, factsDiff));\n\t\t\t}\n\n\t\t\tdiffKeyedChildren(a, b, patches, index);\n\t\t\treturn;\n\n\t\tcase 'custom':\n\t\t\tif (a.impl !== b.impl)\n\t\t\t{\n\t\t\t\tpatches.push(makePatch('p-redraw', index, b));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar factsDiff = diffFacts(a.facts, b.facts);\n\t\t\tif (typeof factsDiff !== 'undefined')\n\t\t\t{\n\t\t\t\tpatches.push(makePatch('p-facts', index, factsDiff));\n\t\t\t}\n\n\t\t\tvar patch = b.impl.diff(a,b);\n\t\t\tif (patch)\n\t\t\t{\n\t\t\t\tpatches.push(makePatch('p-custom', index, patch));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treturn;\n\t}\n}\n\n\n// assumes the incoming arrays are the same length\nfunction pairwiseRefEqual(as, bs)\n{\n\tfor (var i = 0; i < as.length; i++)\n\t{\n\t\tif (as[i] !== bs[i])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\n\n// TODO Instead of creating a new diff object, it's possible to just test if\n// there *is* a diff. During the actual patch, do the diff again and make the\n// modifications directly. This way, there's no new allocations. Worth it?\nfunction diffFacts(a, b, category)\n{\n\tvar diff;\n\n\t// look for changes and removals\n\tfor (var aKey in a)\n\t{\n\t\tif (aKey === STYLE_KEY || aKey === EVENT_KEY || aKey === ATTR_KEY || aKey === ATTR_NS_KEY)\n\t\t{\n\t\t\tvar subDiff = diffFacts(a[aKey], b[aKey] || {}, aKey);\n\t\t\tif (subDiff)\n\t\t\t{\n\t\t\t\tdiff = diff || {};\n\t\t\t\tdiff[aKey] = subDiff;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\t// remove if not in the new facts\n\t\tif (!(aKey in b))\n\t\t{\n\t\t\tdiff = diff || {};\n\t\t\tdiff[aKey] =\n\t\t\t\t(typeof category === 'undefined')\n\t\t\t\t\t? (typeof a[aKey] === 'string' ? '' : null)\n\t\t\t\t\t:\n\t\t\t\t(category === STYLE_KEY)\n\t\t\t\t\t? ''\n\t\t\t\t\t:\n\t\t\t\t(category === EVENT_KEY || category === ATTR_KEY)\n\t\t\t\t\t? undefined\n\t\t\t\t\t:\n\t\t\t\t{ namespace: a[aKey].namespace, value: undefined };\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tvar aValue = a[aKey];\n\t\tvar bValue = b[aKey];\n\n\t\t// reference equal, so don't worry about it\n\t\tif (aValue === bValue && aKey !== 'value'\n\t\t\t|| category === EVENT_KEY && equalEvents(aValue, bValue))\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\tdiff = diff || {};\n\t\tdiff[aKey] = bValue;\n\t}\n\n\t// add new stuff\n\tfor (var bKey in b)\n\t{\n\t\tif (!(bKey in a))\n\t\t{\n\t\t\tdiff = diff || {};\n\t\t\tdiff[bKey] = b[bKey];\n\t\t}\n\t}\n\n\treturn diff;\n}\n\n\nfunction diffChildren(aParent, bParent, patches, rootIndex)\n{\n\tvar aChildren = aParent.children;\n\tvar bChildren = bParent.children;\n\n\tvar aLen = aChildren.length;\n\tvar bLen = bChildren.length;\n\n\t// FIGURE OUT IF THERE ARE INSERTS OR REMOVALS\n\n\tif (aLen > bLen)\n\t{\n\t\tpatches.push(makePatch('p-remove-last', rootIndex, aLen - bLen));\n\t}\n\telse if (aLen < bLen)\n\t{\n\t\tpatches.push(makePatch('p-append', rootIndex, bChildren.slice(aLen)));\n\t}\n\n\t// PAIRWISE DIFF EVERYTHING ELSE\n\n\tvar index = rootIndex;\n\tvar minLen = aLen < bLen ? aLen : bLen;\n\tfor (var i = 0; i < minLen; i++)\n\t{\n\t\tindex++;\n\t\tvar aChild = aChildren[i];\n\t\tdiffHelp(aChild, bChildren[i], patches, index);\n\t\tindex += aChild.descendantsCount || 0;\n\t}\n}\n\n\n\n//////////// KEYED DIFF ////////////\n\n\nfunction diffKeyedChildren(aParent, bParent, patches, rootIndex)\n{\n\tvar localPatches = [];\n\n\tvar changes = {}; // Dict String Entry\n\tvar inserts = []; // Array { index : Int, entry : Entry }\n\t// type Entry = { tag : String, vnode : VNode, index : Int, data : _ }\n\n\tvar aChildren = aParent.children;\n\tvar bChildren = bParent.children;\n\tvar aLen = aChildren.length;\n\tvar bLen = bChildren.length;\n\tvar aIndex = 0;\n\tvar bIndex = 0;\n\n\tvar index = rootIndex;\n\n\twhile (aIndex < aLen && bIndex < bLen)\n\t{\n\t\tvar a = aChildren[aIndex];\n\t\tvar b = bChildren[bIndex];\n\n\t\tvar aKey = a.value0;\n\t\tvar bKey = b.value0;\n\t\tvar aNode = a.value1;\n\t\tvar bNode = b.value1;\n\n\t\t// check if keys match\n\n\t\tif (aKey === bKey)\n\t\t{\n\t\t\tindex++;\n\t\t\tdiffHelp(aNode, bNode, localPatches, index);\n\t\t\tindex += aNode.descendantsCount || 0;\n\n\t\t\taIndex++;\n\t\t\tbIndex++;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// look ahead 1 to detect insertions and removals.\n\n\t\tvar aLookAhead = aIndex + 1 < aLen;\n\t\tvar bLookAhead = bIndex + 1 < bLen;\n\n\t\tif (aLookAhead)\n\t\t{\n\t\t\tvar aNext = aChildren[aIndex + 1];\n\t\t\tvar aNextKey = aNext.value0;\n\t\t\tvar aNextNode = aNext.value1;\n\t\t\tvar oldMatch = bKey === aNextKey;\n\t\t}\n\n\t\tif (bLookAhead)\n\t\t{\n\t\t\tvar bNext = bChildren[bIndex + 1];\n\t\t\tvar bNextKey = bNext.value0;\n\t\t\tvar bNextNode = bNext.value1;\n\t\t\tvar newMatch = aKey === bNextKey;\n\t\t}\n\n\n\t\t// swap a and b\n\t\tif (aLookAhead && bLookAhead && newMatch && oldMatch)\n\t\t{\n\t\t\tindex++;\n\t\t\tdiffHelp(aNode, bNextNode, localPatches, index);\n\t\t\tinsertNode(changes, localPatches, aKey, bNode, bIndex, inserts);\n\t\t\tindex += aNode.descendantsCount || 0;\n\n\t\t\tindex++;\n\t\t\tremoveNode(changes, localPatches, aKey, aNextNode, index);\n\t\t\tindex += aNextNode.descendantsCount || 0;\n\n\t\t\taIndex += 2;\n\t\t\tbIndex += 2;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// insert b\n\t\tif (bLookAhead && newMatch)\n\t\t{\n\t\t\tindex++;\n\t\t\tinsertNode(changes, localPatches, bKey, bNode, bIndex, inserts);\n\t\t\tdiffHelp(aNode, bNextNode, localPatches, index);\n\t\t\tindex += aNode.descendantsCount || 0;\n\n\t\t\taIndex += 1;\n\t\t\tbIndex += 2;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// remove a\n\t\tif (aLookAhead && oldMatch)\n\t\t{\n\t\t\tindex++;\n\t\t\tremoveNode(changes, localPatches, aKey, aNode, index);\n\t\t\tindex += aNode.descendantsCount || 0;\n\n\t\t\tindex++;\n\t\t\tdiffHelp(aNextNode, bNode, localPatches, index);\n\t\t\tindex += aNextNode.descendantsCount || 0;\n\n\t\t\taIndex += 2;\n\t\t\tbIndex += 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// remove a, insert b\n\t\tif (aLookAhead && bLookAhead && aNextKey === bNextKey)\n\t\t{\n\t\t\tindex++;\n\t\t\tremoveNode(changes, localPatches, aKey, aNode, index);\n\t\t\tinsertNode(changes, localPatches, bKey, bNode, bIndex, inserts);\n\t\t\tindex += aNode.descendantsCount || 0;\n\n\t\t\tindex++;\n\t\t\tdiffHelp(aNextNode, bNextNode, localPatches, index);\n\t\t\tindex += aNextNode.descendantsCount || 0;\n\n\t\t\taIndex += 2;\n\t\t\tbIndex += 2;\n\t\t\tcontinue;\n\t\t}\n\n\t\tbreak;\n\t}\n\n\t// eat up any remaining nodes with removeNode and insertNode\n\n\twhile (aIndex < aLen)\n\t{\n\t\tindex++;\n\t\tvar a = aChildren[aIndex];\n\t\tvar aNode = a.value1;\n\t\tremoveNode(changes, localPatches, a.value0, aNode, index);\n\t\tindex += aNode.descendantsCount || 0;\n\t\taIndex++;\n\t}\n\n\tvar endInserts;\n\twhile (bIndex < bLen)\n\t{\n\t\tendInserts = endInserts || [];\n\t\tvar b = bChildren[bIndex];\n\t\tinsertNode(changes, localPatches, b.value0, b.value1, undefined, endInserts);\n\t\tbIndex++;\n\t}\n\n\tif (localPatches.length > 0 || inserts.length > 0 || typeof endInserts !== 'undefined')\n\t{\n\t\tpatches.push(makePatch('p-reorder', rootIndex, {\n\t\t\tpatches: localPatches,\n\t\t\tinserts: inserts,\n\t\t\tendInserts: endInserts\n\t\t}));\n\t}\n}\n\n\n\n//////////// CHANGES FROM KEYED DIFF ////////////\n\n\nvar POSTFIX = '_elmW6BL';\n\n\nfunction insertNode(changes, localPatches, key, vnode, bIndex, inserts)\n{\n\tvar entry = changes[key];\n\n\t// never seen this key before\n\tif (typeof entry === 'undefined')\n\t{\n\t\tentry = {\n\t\t\ttag: 'insert',\n\t\t\tvnode: vnode,\n\t\t\tindex: bIndex,\n\t\t\tdata: undefined\n\t\t};\n\n\t\tinserts.push({ index: bIndex, entry: entry });\n\t\tchanges[key] = entry;\n\n\t\treturn;\n\t}\n\n\t// this key was removed earlier, a match!\n\tif (entry.tag === 'remove')\n\t{\n\t\tinserts.push({ index: bIndex, entry: entry });\n\n\t\tentry.tag = 'move';\n\t\tvar subPatches = [];\n\t\tdiffHelp(entry.vnode, vnode, subPatches, entry.index);\n\t\tentry.index = bIndex;\n\t\tentry.data.data = {\n\t\t\tpatches: subPatches,\n\t\t\tentry: entry\n\t\t};\n\n\t\treturn;\n\t}\n\n\t// this key has already been inserted or moved, a duplicate!\n\tinsertNode(changes, localPatches, key + POSTFIX, vnode, bIndex, inserts);\n}\n\n\nfunction removeNode(changes, localPatches, key, vnode, index)\n{\n\tvar entry = changes[key];\n\n\t// never seen this key before\n\tif (typeof entry === 'undefined')\n\t{\n\t\tvar patch = makePatch('p-remove', index, undefined);\n\t\tlocalPatches.push(patch);\n\n\t\tchanges[key] = {\n\t\t\ttag: 'remove',\n\t\t\tvnode: vnode,\n\t\t\tindex: index,\n\t\t\tdata: patch\n\t\t};\n\n\t\treturn;\n\t}\n\n\t// this key was inserted earlier, a match!\n\tif (entry.tag === 'insert')\n\t{\n\t\tentry.tag = 'move';\n\t\tvar subPatches = [];\n\t\tdiffHelp(vnode, entry.vnode, subPatches, index);\n\n\t\tvar patch = makePatch('p-remove', index, {\n\t\t\tpatches: subPatches,\n\t\t\tentry: entry\n\t\t});\n\t\tlocalPatches.push(patch);\n\n\t\treturn;\n\t}\n\n\t// this key has already been removed or moved, a duplicate!\n\tremoveNode(changes, localPatches, key + POSTFIX, vnode, index);\n}\n\n\n\n//////////// ADD DOM NODES ////////////\n//\n// Each DOM node has an \"index\" assigned in order of traversal. It is important\n// to minimize our crawl over the actual DOM, so these indexes (along with the\n// descendantsCount of virtual nodes) let us skip touching entire subtrees of\n// the DOM if we know there are no patches there.\n\n\nfunction addDomNodes(domNode, vNode, patches, eventNode)\n{\n\taddDomNodesHelp(domNode, vNode, patches, 0, 0, vNode.descendantsCount, eventNode);\n}\n\n\n// assumes `patches` is non-empty and indexes increase monotonically.\nfunction addDomNodesHelp(domNode, vNode, patches, i, low, high, eventNode)\n{\n\tvar patch = patches[i];\n\tvar index = patch.index;\n\n\twhile (index === low)\n\t{\n\t\tvar patchType = patch.type;\n\n\t\tif (patchType === 'p-thunk')\n\t\t{\n\t\t\taddDomNodes(domNode, vNode.node, patch.data, eventNode);\n\t\t}\n\t\telse if (patchType === 'p-reorder')\n\t\t{\n\t\t\tpatch.domNode = domNode;\n\t\t\tpatch.eventNode = eventNode;\n\n\t\t\tvar subPatches = patch.data.patches;\n\t\t\tif (subPatches.length > 0)\n\t\t\t{\n\t\t\t\taddDomNodesHelp(domNode, vNode, subPatches, 0, low, high, eventNode);\n\t\t\t}\n\t\t}\n\t\telse if (patchType === 'p-remove')\n\t\t{\n\t\t\tpatch.domNode = domNode;\n\t\t\tpatch.eventNode = eventNode;\n\n\t\t\tvar data = patch.data;\n\t\t\tif (typeof data !== 'undefined')\n\t\t\t{\n\t\t\t\tdata.entry.data = domNode;\n\t\t\t\tvar subPatches = data.patches;\n\t\t\t\tif (subPatches.length > 0)\n\t\t\t\t{\n\t\t\t\t\taddDomNodesHelp(domNode, vNode, subPatches, 0, low, high, eventNode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tpatch.domNode = domNode;\n\t\t\tpatch.eventNode = eventNode;\n\t\t}\n\n\t\ti++;\n\n\t\tif (!(patch = patches[i]) || (index = patch.index) > high)\n\t\t{\n\t\t\treturn i;\n\t\t}\n\t}\n\n\tswitch (vNode.type)\n\t{\n\t\tcase 'tagger':\n\t\t\tvar subNode = vNode.node;\n\n\t\t\twhile (subNode.type === \"tagger\")\n\t\t\t{\n\t\t\t\tsubNode = subNode.node;\n\t\t\t}\n\n\t\t\treturn addDomNodesHelp(domNode, subNode, patches, i, low + 1, high, domNode.elm_event_node_ref);\n\n\t\tcase 'node':\n\t\t\tvar vChildren = vNode.children;\n\t\t\tvar childNodes = domNode.childNodes;\n\t\t\tfor (var j = 0; j < vChildren.length; j++)\n\t\t\t{\n\t\t\t\tlow++;\n\t\t\t\tvar vChild = vChildren[j];\n\t\t\t\tvar nextLow = low + (vChild.descendantsCount || 0);\n\t\t\t\tif (low <= index && index <= nextLow)\n\t\t\t\t{\n\t\t\t\t\ti = addDomNodesHelp(childNodes[j], vChild, patches, i, low, nextLow, eventNode);\n\t\t\t\t\tif (!(patch = patches[i]) || (index = patch.index) > high)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlow = nextLow;\n\t\t\t}\n\t\t\treturn i;\n\n\t\tcase 'keyed-node':\n\t\t\tvar vChildren = vNode.children;\n\t\t\tvar childNodes = domNode.childNodes;\n\t\t\tfor (var j = 0; j < vChildren.length; j++)\n\t\t\t{\n\t\t\t\tlow++;\n\t\t\t\tvar vChild = vChildren[j].value1;\n\t\t\t\tvar nextLow = low + (vChild.descendantsCount || 0);\n\t\t\t\tif (low <= index && index <= nextLow)\n\t\t\t\t{\n\t\t\t\t\ti = addDomNodesHelp(childNodes[j], vChild, patches, i, low, nextLow, eventNode);\n\t\t\t\t\tif (!(patch = patches[i]) || (index = patch.index) > high)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlow = nextLow;\n\t\t\t}\n\t\t\treturn i;\n\n\t\tcase 'text':\n\t\tcase 'thunk':\n\t\t\tthrow new Error('should never traverse `text` or `thunk` nodes like this');\n\t}\n}\n\n\n\n//////////// APPLY PATCHES ////////////\n\n\nfunction applyPatches(rootDomNode, oldVirtualNode, patches, eventNode)\n{\n\tif (patches.length === 0)\n\t{\n\t\treturn rootDomNode;\n\t}\n\n\taddDomNodes(rootDomNode, oldVirtualNode, patches, eventNode);\n\treturn applyPatchesHelp(rootDomNode, patches);\n}\n\nfunction applyPatchesHelp(rootDomNode, patches)\n{\n\tfor (var i = 0; i < patches.length; i++)\n\t{\n\t\tvar patch = patches[i];\n\t\tvar localDomNode = patch.domNode\n\t\tvar newNode = applyPatch(localDomNode, patch);\n\t\tif (localDomNode === rootDomNode)\n\t\t{\n\t\t\trootDomNode = newNode;\n\t\t}\n\t}\n\treturn rootDomNode;\n}\n\nfunction applyPatch(domNode, patch)\n{\n\tswitch (patch.type)\n\t{\n\t\tcase 'p-redraw':\n\t\t\treturn applyPatchRedraw(domNode, patch.data, patch.eventNode);\n\n\t\tcase 'p-facts':\n\t\t\tapplyFacts(domNode, patch.eventNode, patch.data);\n\t\t\treturn domNode;\n\n\t\tcase 'p-text':\n\t\t\tdomNode.replaceData(0, domNode.length, patch.data);\n\t\t\treturn domNode;\n\n\t\tcase 'p-thunk':\n\t\t\treturn applyPatchesHelp(domNode, patch.data);\n\n\t\tcase 'p-tagger':\n\t\t\tif (typeof domNode.elm_event_node_ref !== 'undefined')\n\t\t\t{\n\t\t\t\tdomNode.elm_event_node_ref.tagger = patch.data;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdomNode.elm_event_node_ref = { tagger: patch.data, parent: patch.eventNode };\n\t\t\t}\n\t\t\treturn domNode;\n\n\t\tcase 'p-remove-last':\n\t\t\tvar i = patch.data;\n\t\t\twhile (i--)\n\t\t\t{\n\t\t\t\tdomNode.removeChild(domNode.lastChild);\n\t\t\t}\n\t\t\treturn domNode;\n\n\t\tcase 'p-append':\n\t\t\tvar newNodes = patch.data;\n\t\t\tfor (var i = 0; i < newNodes.length; i++)\n\t\t\t{\n\t\t\t\tdomNode.appendChild(render(newNodes[i], patch.eventNode));\n\t\t\t}\n\t\t\treturn domNode;\n\n\t\tcase 'p-remove':\n\t\t\tvar data = patch.data;\n\t\t\tif (typeof data === 'undefined')\n\t\t\t{\n\t\t\t\tdomNode.parentNode.removeChild(domNode);\n\t\t\t\treturn domNode;\n\t\t\t}\n\t\t\tvar entry = data.entry;\n\t\t\tif (typeof entry.index !== 'undefined')\n\t\t\t{\n\t\t\t\tdomNode.parentNode.removeChild(domNode);\n\t\t\t}\n\t\t\tentry.data = applyPatchesHelp(domNode, data.patches);\n\t\t\treturn domNode;\n\n\t\tcase 'p-reorder':\n\t\t\treturn applyPatchReorder(domNode, patch);\n\n\t\tcase 'p-custom':\n\t\t\tvar impl = patch.data;\n\t\t\treturn impl.applyPatch(domNode, impl.data);\n\n\t\tdefault:\n\t\t\tthrow new Error('Ran into an unknown patch!');\n\t}\n}\n\n\nfunction applyPatchRedraw(domNode, vNode, eventNode)\n{\n\tvar parentNode = domNode.parentNode;\n\tvar newNode = render(vNode, eventNode);\n\n\tif (typeof newNode.elm_event_node_ref === 'undefined')\n\t{\n\t\tnewNode.elm_event_node_ref = domNode.elm_event_node_ref;\n\t}\n\n\tif (parentNode && newNode !== domNode)\n\t{\n\t\tparentNode.replaceChild(newNode, domNode);\n\t}\n\treturn newNode;\n}\n\n\nfunction applyPatchReorder(domNode, patch)\n{\n\tvar data = patch.data;\n\n\t// remove end inserts\n\tvar frag = applyPatchReorderEndInsertsHelp(data.endInserts, patch);\n\n\t// removals\n\tdomNode = applyPatchesHelp(domNode, data.patches);\n\n\t// inserts\n\tvar inserts = data.inserts;\n\tfor (var i = 0; i < inserts.length; i++)\n\t{\n\t\tvar insert = inserts[i];\n\t\tvar entry = insert.entry;\n\t\tvar node = entry.tag === 'move'\n\t\t\t? entry.data\n\t\t\t: render(entry.vnode, patch.eventNode);\n\t\tdomNode.insertBefore(node, domNode.childNodes[insert.index]);\n\t}\n\n\t// add end inserts\n\tif (typeof frag !== 'undefined')\n\t{\n\t\tdomNode.appendChild(frag);\n\t}\n\n\treturn domNode;\n}\n\n\nfunction applyPatchReorderEndInsertsHelp(endInserts, patch)\n{\n\tif (typeof endInserts === 'undefined')\n\t{\n\t\treturn;\n\t}\n\n\tvar frag = localDoc.createDocumentFragment();\n\tfor (var i = 0; i < endInserts.length; i++)\n\t{\n\t\tvar insert = endInserts[i];\n\t\tvar entry = insert.entry;\n\t\tfrag.appendChild(entry.tag === 'move'\n\t\t\t? entry.data\n\t\t\t: render(entry.vnode, patch.eventNode)\n\t\t);\n\t}\n\treturn frag;\n}\n\n\n// BLOCK EVENTS\n\nfunction wrapViewIn(appEventNode, overlayNode, viewIn)\n{\n\tvar ignorer = makeIgnorer(overlayNode);\n\tvar blocking = 'Normal';\n\tvar overflow;\n\n\tvar normalTagger = appEventNode.tagger;\n\tvar blockTagger = function() {};\n\n\treturn function(model)\n\t{\n\t\tvar tuple = viewIn(model);\n\t\tvar newBlocking = tuple.value0.ctor;\n\t\tappEventNode.tagger = newBlocking === 'Normal' ? normalTagger : blockTagger;\n\t\tif (blocking !== newBlocking)\n\t\t{\n\t\t\ttraverse('removeEventListener', ignorer, blocking);\n\t\t\ttraverse('addEventListener', ignorer, newBlocking);\n\n\t\t\tif (blocking === 'Normal')\n\t\t\t{\n\t\t\t\toverflow = document.body.style.overflow;\n\t\t\t\tdocument.body.style.overflow = 'hidden';\n\t\t\t}\n\n\t\t\tif (newBlocking === 'Normal')\n\t\t\t{\n\t\t\t\tdocument.body.style.overflow = overflow;\n\t\t\t}\n\n\t\t\tblocking = newBlocking;\n\t\t}\n\t\treturn tuple.value1;\n\t}\n}\n\nfunction traverse(verbEventListener, ignorer, blocking)\n{\n\tswitch(blocking)\n\t{\n\t\tcase 'Normal':\n\t\t\treturn;\n\n\t\tcase 'Pause':\n\t\t\treturn traverseHelp(verbEventListener, ignorer, mostEvents);\n\n\t\tcase 'Message':\n\t\t\treturn traverseHelp(verbEventListener, ignorer, allEvents);\n\t}\n}\n\nfunction traverseHelp(verbEventListener, handler, eventNames)\n{\n\tfor (var i = 0; i < eventNames.length; i++)\n\t{\n\t\tdocument.body[verbEventListener](eventNames[i], handler, true);\n\t}\n}\n\nfunction makeIgnorer(overlayNode)\n{\n\treturn function(event)\n\t{\n\t\tif (event.type === 'keydown' && event.metaKey && event.which === 82)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tvar isScroll = event.type === 'scroll' || event.type === 'wheel';\n\n\t\tvar node = event.target;\n\t\twhile (node !== null)\n\t\t{\n\t\t\tif (node.className === 'elm-overlay-message-details' && isScroll)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (node === overlayNode && !isScroll)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tnode = node.parentNode;\n\t\t}\n\n\t\tevent.stopPropagation();\n\t\tevent.preventDefault();\n\t}\n}\n\nvar mostEvents = [\n\t'click', 'dblclick', 'mousemove',\n\t'mouseup', 'mousedown', 'mouseenter', 'mouseleave',\n\t'touchstart', 'touchend', 'touchcancel', 'touchmove',\n\t'pointerdown', 'pointerup', 'pointerover', 'pointerout',\n\t'pointerenter', 'pointerleave', 'pointermove', 'pointercancel',\n\t'dragstart', 'drag', 'dragend', 'dragenter', 'dragover', 'dragleave', 'drop',\n\t'keyup', 'keydown', 'keypress',\n\t'input', 'change',\n\t'focus', 'blur'\n];\n\nvar allEvents = mostEvents.concat('wheel', 'scroll');\n\nfunction topEventNode(eventNode) {\n\twhile(eventNode.parent) {\n\t\teventNode = eventNode.parent;\n\t}\n\treturn eventNode;\n}\n\nreturn {\n\t\tnodeHelp: nodeHelp,\n\t\ttext: text,\n\t\tmap: map,\n\t\tproperty: property,\n\t\tstyle: style,\n\t\tattribute: attribute,\n\t\tattributeNS: attributeNS,\n\t\ton: on,\n \t\tfilterOn: filterOn,\n\t\tlazy: lazy,\n\t\tlazy2: lazy2,\n\t\tlazy3: lazy3,\n\t\tkeyedNode: keyedNode,\n\n\t\trender: render,\n\t\tdiff: diff,\n\t\tapplyPatches: applyPatches,\n};\n// end of closed over document\n}", "function TruckFactory() {}", "function TruckFactory() {}", "init() { }" ]
[ "0.60372126", "0.6026086", "0.58066285", "0.57613343", "0.57321906", "0.5617579", "0.5460373", "0.5430532", "0.5397345", "0.5382316", "0.529554", "0.5259568", "0.52586263", "0.52450424", "0.52442235", "0.5217113", "0.5201096", "0.51987106", "0.51969045", "0.51147324", "0.50879586", "0.50816053", "0.50707996", "0.5052975", "0.50389147", "0.5036798", "0.500258", "0.49796838", "0.49790815", "0.49790815", "0.49722534", "0.4961993", "0.49203867", "0.49203867", "0.49203867", "0.49203867", "0.49203867", "0.49203867", "0.49145347", "0.48870665", "0.4885621", "0.4869222", "0.48669532", "0.48669532", "0.48669532", "0.48669532", "0.48669532", "0.48669532", "0.48669532", "0.48669532", "0.48669532", "0.48669532", "0.48669532", "0.48669532", "0.48669532", "0.48629382", "0.48579013", "0.48579013", "0.48579013", "0.48360834", "0.48231623", "0.48219016", "0.4805089", "0.48008996", "0.47960505", "0.47898552", "0.4769914", "0.4767033", "0.474879", "0.474879", "0.4731787", "0.4731787", "0.4731787", "0.47284475", "0.472129", "0.47209308", "0.4720692", "0.4715212", "0.47058532", "0.4698925", "0.46824837", "0.467051", "0.46695882", "0.4668728", "0.4668728", "0.4668728", "0.46629792", "0.46547174", "0.4651676", "0.46467742", "0.4639939", "0.46325833", "0.4628439", "0.46240157", "0.4624009", "0.46199116", "0.46154743", "0.46151206", "0.46151206", "0.46054015" ]
0.52096534
16
out" basis. People must adopt either the "oldest" (based on arrival time) of all animals at the shelter, or they can select whether they would prefer a dog or a cat (and will receive the oldest animal of that type). They cannot select which specific animal they would like. Create the data structures to maintain this system and implement operations such as enqueue, dequeueAny, dequeueDog, and dequeueCat. You may use the builtin LinkedList data structure. I like my solution: check l8r
function AnimalShelter() { this.dogQueue = new Queue(); this.catQueue = new Queue(); this.count=0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "animalShelterEnqueue(animal) {\n //if cat - enqueue into cat queue\n //if dog - enqueue into dog queue\n if (animal.value === 'cat') {\n this.cat.enqueue(animal);\n } else {\n this.dog.enqueue(animal);\n }\n }", "dequeueDog() {\n let adopted = this.DHead;\n if (adopted.acNext != null) {\n adopted.acNext.acPRev = adopted.acPRev;\n }\n if (this.ACHead === adopted) {\n this.ACHead = adopted.acPRev;\n }\n if (this.DHead.prev != null) {\n this.DHead = this.DHead.prev;\n this.DHead.next = null;\n } else {\n this.DHead = null;\n this.DTail = null;\n }\n }", "function Queue(){var _1=[];var _2=0;this.getSize=function(){return _1.length-_2;};this.isEmpty=function(){return (_1.length==0);};this.enqueue=function(_3){_1.push(_3);};this.dequeue=function(){var _4=undefined;if(_1.length){_4=_1[_2];if(++_2*2>=_1.length){_1=_1.slice(_2);_2=0;}}return _4;};this.getOldestElement=function(){var _5=undefined;if(_1.length){_5=_1[_2];}return _5;};}", "dequeueAny() {\n if (this.ACHead === this.CHead) {\n this.dequeueCat();\n } else {\n this.dequeueDog();\n }\n }", "dogQueue(name) {\n let dog = new Pet(name, this.DTail);\n if (this.DHead == null) {\n this.DTail = dog;\n this.DHead = dog;\n } else {\n this.DTail.prev = dog;\n dog.next = this.DTail;\n this.DTail = dog;\n }\n return dog;\n }", "enqueue(name, type) {\n let pet;\n if (type == \"dog\") {\n pet = this.dogQueue(name);\n } else {\n pet = this.catQueue(name);\n }\n if (this.ACHead == null) {\n this.ACTail = pet;\n this.ACHead = pet;\n } else {\n pet.acNext = this.ACTail;\n this.ACTail.acPRev = pet;\n this.ACTail = pet;\n }\n }", "function Queue(){var a=[],b=0;this.getLength=function(){return a.length-b};this.isEmpty=function(){return 0==a.length};this.enqueue=function(b){a.push(b)};this.dequeue=function(){if(0!=a.length){var c=a[b];2*++b>=a.length&&(a=a.slice(b),b=0);return c}};this.peek=function(){return 0<a.length?a[b]:void 0}}", "function Queue(){\n\n // initialise the queue and offset\n var queue = [];\n var offset = 0;\n\n // Returns the length of the queue.\n this.getLength = function(){\n return (queue.length - offset);\n }\n\n // Returns true if the queue is empty, and false otherwise.\n this.isEmpty = function(){\n return (queue.length == 0);\n }\n\n // Returns true if all values are the same\n this.isEquivalent = function(){\n\tlet value = queue[offset];\n\tfor (let item = offset; item < offset + queue.length; item++){\n\t\tif (queue[item] !== queue[offset])\n\t\t\treturn false;\n\t}\n\treturn true;\n }\n \n /* Enqueues the specified item. The parameter is:\n *\n * item - the item to enqueue\n */\n this.enqueue = function(item){\n queue.push(item);\n }\n\n /* Dequeues an item and returns it. If the queue is empty, the value\n * 'undefined' is returned.\n */\n this.dequeue = function(){\n\n // if the queue is empty, return immediately\n if (queue.length == 0) return undefined;\n\n // store the item at the front of the queue\n var item = queue[offset];\n\n // increment the offset and remove the free space if necessary\n if (++ offset * 2 >= queue.length){\n queue = queue.slice(offset);\n offset = 0;\n }\n\n // return the dequeued item\n return item;\n\n }\n\n /* Returns the item at the front of the queue (without dequeuing it). If the\n * queue is empty then undefined is returned.\n */\n this.peek = function(){\n return (queue.length > 0 ? queue[offset] : undefined);\n }\n\n}", "dequeue () {\n this.head.shift()\n }", "function Queue() {\n this._oldestIndex = 1;\n this._newestIndex = 1;\n this._storage = {};\n}", "dequeueCat() {\n let adopted = this.CHead;\n if (adopted.acNext != null) {\n adopted.acNext.acPRev = adopted.acPRev;\n }\n if (this.ACHead === adopted) {\n this.ACHead = adopted.acPRev;\n }\n if (this.CHead.prev != null) {\n this.CHead = this.CHead.prev;\n this.CHead.next = null;\n } else {\n this.CHead = null;\n this.CTail = null;\n }\n }", "function Queue(){\n this.first = undefined;\n this.last = undefined;\n this.size = 0;\n }", "function LinkedList (){\n\t\tvar _head;\n\t\tvar _tail;\n\t\tvar _length = 0;\n\n\t\tfunction enqueue(item) {\n\t\t\tvar newNode = Node(item);\n\t\t\t\n\t\t\tif(!_head){\n\t\t\t\t_head = newNode;\n\t\t\t\t_tail = newNode;\n\t\t\t}\n\t\t\telse { // Remember a real life queue has a tail that keeps moving\n\t\t\t\t_tail.next = newNode; // Set the last node's next to the new node\n\t\t\t\t_tail = newNode; // The new node is now the last node in the queue\n\t\t\t}\n\t\t\t\n\t\t\t_length++;\n\t\t}\n\t\t\n\t\tfunction dequeue() {\n\t\t\tvar item;\n\t\t\tif(_head){\n\t\t\t\titem = _head;\n\t\t\t\tvar newHead = _head.next;\n\t\t\t\t// delete _head;\n\t\t\t\t_head = _head.next;\n\t\t\t\t_length--;\n\t\t\t\t\n\t\t\t\tif(!_head){\n\t\t\t\t\t_tail = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn item;\n\t\t}\n\t\t\n\t\tfunction isFull(){\n\t\t\tvar result = false;\n\t\t\t\n\t\t\ttry{\n\t\t\t\tvar newNode = Node();\n\t\t\t}\n\t\t\tcatch{\n\t\t\t\tresult = true;\n\t\t\t}\n\t\t\t\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\tfunction isEmpty(){\n\t\t\treturn !_tail ? true : false;\n\t\t}\n\t\t\n\t\tfunction insert(index, item){\n\t\t\tvar curIndex = 0;\n\t\t\tvar iter = _head;\n\t\t\tvar foundNode;\n\t\t\t\n\t\t\t// The loop is neccessary only if the index is valid\n\t\t\tif(index >= 0 && index < _length){\n\t\t\t\t\twhile(iter && !foundNode){\n\t\t\t\t\tif(curIndex == index){\n\t\t\t\t\t\tfoundNode = iter;\n\t\t\t\t\t}\n\t\t\t\t\tcurIndex++;\n\t\t\t\t\titer = iter.next;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(foundNode){\n\t\t\t\tvar newNode = Node(item);\n\t\t\t\t// Link the new node to the node a head of it\n\t\t\t\tnewNode.next = foundNode.next;\n\t\t\t\tfoundNode.next = newNode;\n\t\t\t\t_length++;\n\t\t\t}\n\t\t\telse { // The new node should go to the back of the line\n\t\t\t\tenqueue(item);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* \n\t\t\tSearch: O(n)\n\t\t\tInsert: O(1)\n\t\t*/\n\t\tfunction remove(item){\n\t\t\tif(_head){\n\t\t\t\tif(_head.item == item){\n\t\t\t\t\tdequeue();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// Remember to use the iter.next technique\n\t\t\t\t\t// because access to the previous node for linking is required\n\t\t\t\t\tvar nodeToDelete;\n\t\t\t\t\tvar iter = _head;\n\t\t\t\t\twhile(iter.next && !nodeToDelete){\n\t\t\t\t\t\tif(iter.next.item == item){\n\t\t\t\t\t\t\tnodeToDelete = iter.next.item\n\t\t\t\t\t\t\t_length--;\n\t\t\t\t\t\t\t// Relink the list\n\t\t\t\t\t\t\titer.next = iter.next.next;\n\t\t\t\t\t\t}\n\t\t\t\t\t\titer = iter.next;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/*if(nodeToDelete){\n\t\t\t\t\t\tdelete nodeToDelete\n\t\t\t\t\t}*/\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction clear(){\n\t\t\twhile(_head){\n\t\t\t\tvar toDelete = _head;\n\t\t\t\t_head = _head.next;\n\t\t\t\t// delete toDelete\n\t\t\t}\n\t\t\t\n\t\t\t_tail = undefined;\n\t\t\t_length = 0;\n\t\t}\n\t\t\n\t\tfunction getDisplayString(){\n\t\t\tvar result = [];\n\t\t\tvar iter = _head;\n\t\t\twhile(iter){\n\t\t\t\tresult.push('['+iter.item+']');\n\t\t\t\titer = iter.next;\n\t\t\t}\n\t\t\t\n\t\t\treturn result.join('->');\n\t\t}\n\t\t\n\t\tfunction Node(item){\n\t\t\treturn {\n\t\t\t\titem: item,\n\t\t\t\tnext: undefined\n\t\t\t};\n\t\t}\n\t\t\n\t\tfunction getCount(){\n\t\t\treturn _length;\n\t\t}\n\t\t\n\t\tfunction getHeadNode(){\n\t\t\treturn _head;\n\t\t}\n\t\t\n\t\tfunction getNode(item){\n\t\t\tvar foundNode;\n\t\t\tvar iter = _head;\n\t\t\twhile(iter && !foundNode){\n\t\t\t\tif(iter.item == item){\n\t\t\t\t\tfoundNode = iter;\n\t\t\t\t}\n\t\t\t\titer = iter.next;\n\t\t\t}\n\t\t\t\n\t\t\treturn foundNode;\n\t\t}\n\t\t\n\t\t// This is a dangerous api that exposes some internals\n\t\t// Use this only for experimentation\n\t\tvar dangerous = {\n\t\t\tgetHeadNode,\n\t\t\tgetNode\n\t\t};\n\t\t\n\t\treturn {\n\t\t\tenqueue,\n\t\t\tdequeue,\n\t\t\tisFull,\n\t\t\tisEmpty,\n\t\t\tinsert,\n\t\t\tremove,\n\t\t\tclear,\n\t\t\tgetDisplayString,\n\t\t\tgetCount,\n\t\t\tdangerous\n\t\t}\n\t}", "function queue(){\n this.tail = 1;//index starts at 1\n this.head = 1;\n this.itemList = {};\n //return the size of the queue\n this.size = function(){\n return this.head - this.tail;\n }\n //Check if the queue is empty\n this.empty = function(){\n return this.size() <= 0 ? 1 : 0;\n }\n //push an item into the beginning of the queue\n this.push = function(item){\n this.itemList[this.head] = item;\n this.head++;\n return;\n }\n //return the item at the end of the queue and remove it from the queue\n this.pull = function(){\n if (this.empty()){\n return null;\n }\n var result;\n result = this.itemList[this.tail];\n delete this.itemList[this.tail];\n this.tail++;\n return result\n }\n //empty the queue\n this.init = function(){\n while (!this.empty()){\n this.pull;\n }\n return;\n }\n}", "function Queue(){\n\tvar count = 0;\n\tvar head = null;\n\tvar tail = null;\n\n\tthis.GetCount = function(){\n \treturn count;\n\t}\n\n\tthis.Enqueue = function (data) {\n\t\tvar node = {\n\t \tdata: data,\n\t \tnext: head\n\t\t};\n\n\t\tif (head === null) {\n\t \ttail = node;\n\t\t}\n\n\t\thead = node;\n\n\t\tcount++;\n\t}\n\n\n\tthis.Dequeue = function () {\n\t\tif (count === 0) {\n\t \treturn 'empty';\n\t\t}\n\t\telse {\n\t \tvar dq = tail.data;\n\t \tvar current = head;\n\t \tvar previous = null;\n\n\t \twhile (current.next) {\n\t \tprevious = current;\n\t \tcurrent = current.next;\n\t \t}\n\n\t \tif (count > 1) {\n\t \tprevious.next = null;\n\n\t \ttail = previous;\n\t \t}\n\t \telse {\n\t \thead = null;\n\t \ttail = null;\n\t \t}\n\n\t \tcount--;\n\t\t}\n\t \treturn dq;\n\t}\n\n}", "function queue(){\n var list = [];\n this.enqueue = function (value){\n list.push(value);\n }\n this.dequeue = function(){\n list.shift();\n }\n this.front = function(){\n return list[0];\n }\n this.isEmpty = function(){\n var tof = (list.length == 0)?true:false;\n return tof;\n }\n this.printf = function (){\n console.log(list.join(\"\"));\n }\n this.output = function (){\n for(var i = 0; i < list.length ; i++ ) {\n console.log(list[i]);\n } \n }\n this.list = function () {\n return list;\n }\n}", "dequeue(){\n if (this.end == null || this.start == null){\n return null\n }else if (this.end == this.start){\n let start = this.start\n thid.end = null;\n this.start = null;\n return start;\n }else{\n let oldl = this.start;\n let newl = this.start.next;\n oldl.break();\n this.start = newl;\n return oldl\n }\n }", "dequeue(){\n if(!this.isEmpty()){\n this.data.splice(this.head, 1, undefined);\n if(this.head === this.data.length-1){\n this.head = 0;\n }else{\n this.head ++;\n }\n }\n }", "dequeue() {\n // Time Complexity O(n)\n return this.list.shift();\n }", "function dequeue(){\n return queue.shift();\n }", "enqueue(value) {\n const node = new NodeDeque(value);\n // only happens under null condition\n if (this.first === null) {\n this.first = node;\n }\n // Add to the end of the queue, because last equals something\n if (this.last) {\n this.last.next = node;\n this.last.prev = this.last;\n }\n //make the new node the last item on the queue\n this.last = node;\n }", "dequeue () {\n this.head = this.head.next\n\n //make sure tail gets empty is it is the last item.\n if (!this.head) {\n this.tail = null\n }\n }", "dequeue(){\n if (!this.first) {\n return null;\n }else if (this.size === 1) {\n this.first = null;\n this.last = null;\n }else{\n let oldStart = this.first.next;\n this.first.next = null;\n this.first = oldStart;\n }\n this.size--;\n return this;\n }", "function priorityQueue () {\n //Items inside a normal array collection\n collection = [];\n //Declare a print method to show the contents of the array\n this.print = function() {\n console.log(collection);\n }\n //Method to add new element to the list\n //But in a priority queue we have to check the priority of each element before adding a new one.\n\n this.enqueue = function(newElement) {\n //if the queue is empty we need not check the priority, just add it.\n if(this.isEmpty()){\n collection.push(newElement);\n } else {\n let added = false;\n //create a loop for each item of the collection to check its priorities.\n for(let i = 0; i<collection.length; i++){\n // is the priority of the element we are passing into the queue\n // less than the element thats allready in the queue and we are right now checking\n // remember that index 1 is the priority of that item.\n if(newElement[1] < collection[i][1]) {\n //splice prototype from javascript\n //array.splice(start, deleteCount, element to insert);\n //so where do we insert, at i, we delete none ie. 0, and we insert newElement\n collection.splice(i, 0, newElement);\n added = true;\n break;\n } \n }\n // so if the priority is never above an item in the queue, \n // we still need to add the new Item at the end of the queue.\n if(!added) {\n collection.push(newElement)\n }\n }\n \n }\n //Method to take the first out of the list\n this.dequeue = function() {\n return collection.shift();\n }\n //Method to show the first item of the queue, or the front of the queue,\n //That is to say the next one out\n this.front = function () {\n return collection[0];\n }\n //Method to see the size of the queue\n this.size = function() {\n return collection.length;\n }\n //Method to check if the queue is empty. Returns true\n this.isEmpty = function() {\n return(collection.length === 0)\n }\n\n}", "dequeue() {\n const [next] = this.values;\n this.values[0] = this.values.pop();\n let childLeft, childRight;\n let curr = 0;\n while (true) {\n let childLeftIdx = 2 * curr + 1;\n let childRightIdx = childLeft + 1;\n let swap = null;\n if (childLeftIdx < this.values.length) {\n childLeft = this.values[childLeftIdx];\n if (childLeft.priority > this.values[curr].priority) {\n swap = childLeft;\n }\n\n if (childRightIdx < this.values.length) {\n childRight = this.values[childRight];\n if (\n (swap === null &&\n childRight.priority < this.values[curr].priority) ||\n (swap !== null && childRight < childLeft.priority)\n ) {\n swap = childRightIdx;\n }\n }\n\n if (swap === null) break;\n const temp = this.values[curr];\n this.values[curr] = this.values[swap];\n this.values[swap] = temp;\n curr = swap;\n }\n }\n }", "function Queue() {\n this.elements = [];\n\n // isEmpty :: () -> Boolean\n this.isEmpty = () => !length(this.elements);\n // put :: (String, Int) -> ()\n this.put = (element, priority) => {\n this.elements[0] && this.elements[0].priority > priority\n ? this.elements = [{element, priority}, ...this.elements]\n : this.elements = [...this.elements, {element, priority}];\n }\n // get :: () -> String\n this.get = () => {\n let [{element}, ...elements] = this.elements;\n this.elements = elements;\n return element;\n }\n}", "function Queue() {\n\tthis.arr = [];\n\tthis.head = function() {\n\t\treturn this.arr[0];\n\t};\n\tthis.dequeue = function() {\n\t\tif (this.arr.length == 0) {\n\t\t\treturn \"Queue underflow!\";\n\t\t} else {\n\t\t\treturn this.arr.shift();\n\t\t}\n\t};\n\tthis.enqueue = function(o) {\n\t\tthis.arr.push(o);\n\t};\n\tthis.isEmpty = function() {\n\t\t\treturn this.arr.length == 0;\n\t};\n}", "dequeue() {\n\n //如果是剛建立,沒有任何node的queue,this._head的初始數值就是null\n if (!this.head) {\n return null;\n }\n\n const valueOfHeadNode = this._head;\n\n if (this.head === this.tail) {\n // 如果目前queue只有一個元素,這樣頭跟尾都的地址都是同一個node\n // 所以 this._head === this._tail 等於拿同一個node做比較\n this.head = null;\n this.tail = null; // 利用null值來清空目前的queue\n } else {\n this.head = this.head.nextNode;\n // tail 不變\n }\n\n // 無論是if或是else condition,都會減少一個元素,所以要更新nodesCounts\n this._subtractNodesCounter();\n return valueOfHeadNode;\n }", "dequeue () {\n if (this.length <= 1) {\n this.first = null\n this.last = null\n this.length = 0\n } else {\n const secondNode = this.first.next\n secondNode.prev = null\n\n this.first = secondNode\n\n this.length--\n }\n this.printQueue()\n }", "function getNextThing(inQueue,maxInQueue) {\n console.log('in queue:',inQueue,'Max in Queue:',maxInQueue)\n munyFeatures.forEach(f=>showLabel(f))\n features.forEach(f=>showLabel(f,true))\n\n function setNextFeature(nf,isNeighborhood) {\n console.log(\"next feature: \",nf)\n highlight(nf,isNeighborhood)\n zoomToFeature(nf)\n\n const event=new CustomEvent('setName',{\n detail:isNeighborhood? nf.get('nhd_name') : getMunyText(nf)\n })\n document.dispatchEvent(event)\n }\n if(inQueue.length >= maxInQueue) {\n const nextIndex=Math.floor(Math.random()*maxInQueue)\n const needle=inQueue[nextIndex] || inQueue[0]\n const munyFeature=munyFeatures.find(f=>f.get('MUNICIPALITY').toLowerCase()==needle.toLowerCase())\n const cityFeature=features.find(f=>f.get('nhd_name').toLowerCase()==needle.toLowerCase())\n console.log(' city: ',cityFeature,' county: ',munyFeature,' in queue: ',inQueue,' max: ',maxInQueue,' finding: ',needle)\n if(munyFeature) {\n setNextFeature(munyFeature,false)\n } else {\n setNextFeature(cityFeature,true)\n }\n\n } else {\n const nextIndex=Math.floor(Math.random()*(munyFeatures.length+features.length-1))\n let nextFeature,isNeighborhood;\n if(nextIndex < munyFeatures.length) {\n nextFeature=munyFeatures[nextIndex]\n isNeighborhood=false; //todo: just add this as a property of the features\n } else {\n nextFeature=features[nextIndex-munyFeatures.length]\n if(nextFeature.get('MUNICIPALITY') == 'UNINCORPORATED') {\n console.log('got unincorporated') //this shouldn't happen anymore\n return getNextThing()\n }\n isNeighborhood=true\n }\n setNextFeature(nextFeature,isNeighborhood)\n }\n \n }", "dequeue() {\n if (!this.first) return null;\n let temp = this.first;\n if (this.first === this.last) {\n this.tail = null;\n } else {\n this.first = this.first.next;\n }\n this.size--;\n return this;\n }", "dequeue(){\n if(this.size === 0) return undefined;\n const node = this.first;\n\n this.first = this.first.next;\n\n this.size--;\n\n if(this.size === 0) this.last = undefined;\n\n node.next = undefined;\n return node;\n }", "function Queue() {\n let arr = [];\n return {\n push: (e) => {\n arr[arr.length] = e;\n return arr;\n },\n pop: () => {\n let result = arr[0] \n arr.splice(0, 1);\n return result;\n }\n }\n}", "function Queue() { \n this.stack = new Array();\n this.dequeue = function(){\n \treturn this.stack.pop(); \n } \n this.enqueue = function(item){\n \tthis.stack.unshift(item);\n \treturn;\n }\n this.empty = function(){\n \treturn ( this.stack.length == 0 );\n }\n this.clear = function(){\n \tthis.stack = new Array();\n \treturn;\n }\n}", "dequeue(){\n if(!this.first){\n return null;\n }\n if(this.first === this.last){\n this.last = null;\n }\n this.first = this.first.next\n this.length --; \n return this;\n }", "dequeue(){\n //if queue is empty return false\n if (this.size === 0) return false;\n //get dequeuednode\n const dequeuedNode = this.first;\n //get new first (could be NULL if stack is length 1)\n const newFirst = this.first.next;\n //if newFirst is null, reassign last to newFirst(null)\n if (!newFirst) {\n this.last = newFirst;\n }\n //assign new first\n this.first = newFirst;\n //remove reference to list\n dequeuedNode.next = null;\n //remove 1 from size\n this.size--;\n //return dequeuednode\n return dequeuedNode.value;\n }", "dequeue(){\n //if queue is empty there is nothing to return\n if(this.first === null){\n return;\n }\n const node = this.first;\n this.first = this.first.next;\n //if this is last item in queue\n if(node === this.last){\n this.last = null;\n }\n return node.value\n }", "dequeue() {\n if(! this.isEmpty()) return this.items.shift()\n else return undefined\n }", "dequeue() {\n if (this.size === 0) {\n return null\n }\n var temp = this.first;\n if (this.first === this.last) {\n this.last = null;\n }\n // remove from the head\n this.first = this.first.next\n this.size--\n return temp.value;\n }", "function Queue() {\n this.stack = new Array();\n this.dequeue = function(){\n \treturn this.stack.pop();\n }\n this.enqueue = function(item){\n \tthis.stack.unshift(item);\n \treturn;\n }\n this.empty = function(){\n \treturn ( this.stack.length == 0 );\n }\n this.clear = function(){\n \tthis.stack = new Array();\n \treturn;\n }\n}", "function hotPotato(nameList, number){\n\n\tvar queue = new Queue()\n\n\t//fill the queue\n\tfor(var i = 0; i< nameList.length; i++){\n\t\tqueue.enqueue(nameList[i])\n\t}\n\n\tvar eliminated = ''\n\twhile(queue.size() > 1){\n\t\tfor(var i = 0; i<number; i++){\n\t\t\t//this is what allows for the simulation of a circular hot potatoe. \n\t\t\t//first person is removed, and then added to the back of the list\n\t\t\t//this happends until we reach 'number' in the for loop\n\t\t\tqueue.enqueue(queue.dequeue())\n\t\t}\n\n\t\t//once 'number' is reached, the for loop ends and we eliminate whoever is at the front of the array.\n\t\t//the person at the front of the arrary always has the hot potatoe in this game\n\t\teliminated = queue.dequeue()\n\t\t// console.log(`${eliminated} has been eliminated!`)\n\t}\n\n\t// queue.print()\n\t// console.log(`${queue.front} is the winner!`)\n\tqueue.print()\n\treturn queue.dequeue()\n}", "enqueue(value){\n const current = new Node(value);\n if (this.length === 0){\n this.first = current;\n this.last = current;\n this.length++;\n return this;\n }else{\n //const holdingPointer = this.last;\n //this.last = current;\n //this.last.next = holdingPointer;\n this.last.next = current;\n this.last =current;\n this.length++;\n return this;\n }\n }", "dequeue() {\n if (this.tail > this.head) {\n const value = this.storage[this.head];\n delete this.storage[this.head];\n this.head++;\n return value;\n } else {\n return null;\n }\n }", "function Queue(){\n this.newSongs = [];\n this.oldSongs = [];\n}", "dequeue() {\n if (this.arr[this.head] != undefined) {\n this.arr[this.head] = undefined;\n }\n else if (!this.isEmpty()) {\n this.head = (this.head + 1) % this.capacty;\n this.arr[this.head] = undefined;\n }\n }", "function Queue() {\n this.tail = [];\n this.head = [];\n this.offset = 0;\n}", "function Queue(maxLen){\n\n // initialise the queue and offset\n var queue = [];\n var offset = 0;\n var maxLength = (typeof maxLen !== 'undefined' ? maxLen : 100000);\n\n // Returns the length of the queue.\n this.getLength = function(){\n return (queue.length - offset);\n }\n\n // Returns true if the queue is empty, and false otherwise.\n this.isEmpty = function(){\n return (queue.length == 0);\n }\n\n /* Enqueues the specified item. The parameter is:\n *\n * item - the item to enqueue\n */\n this.enqueue = function(item){\n queue.push(item);\n if(queue.length > maxLength) {\n this.dequeue(); //get rid of older images\n }\n }\n\n /* Dequeues an item and returns it. If the queue is empty, the value\n * 'undefined' is returned.\n */\n this.dequeue = function(){\n\n // if the queue is empty, return immediately\n if (queue.length == 0) return undefined;\n\n // store the item at the front of the queue\n var item = queue[offset];\n\n // increment the offset and remove the free space if necessary\n if (++ offset * 2 >= queue.length){\n queue = queue.slice(offset);\n offset = 0;\n }\n\n // return the dequeued item\n return item;\n\n }\n\n /* Returns the item at the front of the queue (without dequeuing it). If the\n * queue is empty then undefined is returned.\n */\n this.peek = function(){\n return (queue.length > 0 ? queue[offset] : undefined);\n }\n\n this.find = function(item) {\n for(var i = 0; i < queue.length; i++) {\n if(item == queue[i]) {\n return i;\n }\n }\n return -1;\n }\n\n}", "dequeue() {\n if (!this.first) return null;\n const temp = this.first;\n if (this.first === this.last) {\n this.first = null;\n }\n this.first = this.first.next;\n this.size -= 1;\n return temp.val;\n }", "function main(arr) {\n const SLL = new LinkedList\n for (let i = 0; i < arr.length; i++) {\n SLL.insertLast(arr[i])\n }\n \n // getSize(SLL)\n // isEmpty(SLL);\n // findPrevious('Starbuck', SLL);\n // findLast(SLL);\n // WhatDoesThisProgramDo(SLL)\n \n // SLL.reverseRecur()\n // SLL.logNthFromLast(SLL.head, 1)\n // display(SLL)\n \n SLL.middleOfTheList(SLL.head)\n \n // SLL.insertFirst('Tauhida');\n // SLL.remove('Husker')\n // SLL.remove('Tauhida')\n // SLL.insertBefore('Athena', 'Boomer');\n // SLL.insertAfter('Helo', 'Hotdog')\n // SLL.insertAt('Kat', '3')\n \n // console.log('Boomer: ', SLL.find('Boomer'))\n // console.log('Apollo: ', SLL.find(\"Apollo\"))\n // console.log('Husker: ', SLL.find('Husker'))\n // console.log(SLL.find('Apollo'))\n // console.log('Athena:', SLL.find(\"Athena\"))\n // console.log('Hotdog: ', SLL.find('Hotdog'))\n // console.log('Helo: ', SLL.find('Helo'))\n // console.log('Kat: ', SLL.find('Kat'))\n // console.log(SLL.find('Tauhida'))\n \n return SLL;\n }", "dequeue() {\n // If the queue is empty, there is nothing to dequeue\n if ( this.first === null ) {\n return;\n };\n\n // Declare our node to dequeue\n const node = this.first;\n // Set the 2nd item in queue to our first\n this.first = this.first.next;\n\n // If this is the last item in the queue\n if ( node === this.last ) {\n // Set our last to null\n this.last = null;\n };\n\n return node.val;\n }", "function Deque() {\n this.dataStore = [];\n this.enqueueFront = enqueueFront;\n this.enqueueBack = enqueueBack;\n this.dequeueFront = dequeueFront;\n this.dequeueBack = dequeueBack;\n this.front = front;\n this.back = back;\n this.toString = toString;\n this.empty = empty;\n \n function enqueueFront(element) {\n this.dataStore.unshift(element);\n }\n \n function enqueueBack(element) {\n this.dataStore.push(element);\n }\n \n function dequeueFront() {\n return this.dataStore.shift();\n }\n \n function dequeueBack() {\n return this.dataStore.pop();\n }\n \n function front() {\n return this.dataStore[0];\n }\n \n function back() {\n return this.dataStore[this.dataStore.length - 1];\n }\n \n // toString() function displays all the elements in a queue\n function toString() {\n var queueString = \"\";\n for (var i = 0; i < this.dataStore.length; i++) {\n queueString += this.dataStore[i] + \" \";\n }\n return queueString;\n }\n \n function empty() {\n if (this.dataStore.length === 0) {\n return true;\n }\n else {\n return false;\n }\n }\n}", "function Queue(){\n\tvar items = []\n\n\t//adds an item or more to the back of the queue\n\tthis.enqueue = function(elements){\n\t\titems.push(elements)\n\t}\n\n\t//removes the first item of the queue(item in front) and returns the removed element\n\tthis.dequeue = function(elements){\n\t\treturn items.shift()\n\t}\n\n\tthis.front = function(){\n\t\treturn items[0]\n\t}\n\n\tthis.isEmpty = function(){\n\t\treturn items.length == 0\n\t}\n\n\tthis.size = function(){\n\t\treturn items.length\n\t}\n\n\tthis.print = function(){\n\t\tconsole.log(items.toString())\n\t}\n}", "function sortedInsertionAStar (insertingThis) {\n\t\t// Empty list\n\t\tif (_pQueue.length === 0) {\n\t\t\tfor (var k = 0; k < insertingThis.length; k++) {\n\t\t\t\t_pQueue.push(insertingThis[k]);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Not empty\n\t\tvar j = 0;\n\t\tfor (var i = 0; i < insertingThis.length; i++) {\n\n\t\t\t// Finds where it should be...\n\t\t\twhile ((j < _pQueue.length) && (insertingThis[i].evaluation() > _pQueue[j].evaluation()))\n\t\t\t\t{ j++; }\n\n\t\t\t// ...and inserts it.\n\t\t\tif ((j < _pQueue.length) && ( !insertingThis[i].board().equals(_pQueue[j].board()) )) {\n\t\t\t\t_pQueue.splice(j, 0, insertingThis[i]);\n\t\t\t}\n\t\t\t\n\t\t\t// When it is the last one (the biggest), push it to the end\n\t\t\telse if (j === _pQueue.length) {\n\t\t\t\t_pQueue.push(insertingThis[i]);\n\t\t\t}\n\t\t}\n\t}", "dequeue() {\n if (this.first === null) {\n return;\n }\n // we need to save this first node before replacing it so that we can check\n // if it is the only item on the list\n const node = this.first;\n this.first = this.first.next;\n if (node === this.last) {\n this.last = null;\n }\n // need this to be returned so you can use its value later\n this.size--;\n return node.value;\n }", "enqueue(data, prior) {\r\n let nodo = new Nodo(data, prior);\r\n let cont = false;\r\n\r\n for (let i = 0; i < this.getSize(); i++) {\r\n if (this.items[i].priority > nodo.priority) {\r\n this.items.splice(i, 0, nodo);\r\n cont = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!cont) {\r\n this.items.push(nodo);\r\n }\r\n }", "function hotPotato(nameList, number){\n var queue = new Queue();\n\n for(var i=0;i<nameList.length;i++){\n queue.enqueue(nameList[i]);\n }\n\n var eliminated = '';\n while (queue.size() > 1){\n for(var i=0;i<number;i++){\n queue.enqueue(queue.dequeue());\n }\n eliminated = queue.dequeue();\n console.log(eliminated + '在击鼓传花游戏中被淘汰。 ');\n }\n\n return queue.dequeue();\n}", "function Queue() {\n var collection = [];\n this.print = function() {\n console.log(collection);\n };\n \n this.enqueue = function(elem) {\n // pushes elem to tail of queue\n return collection.push(elem);\n };\n\n this.dequeue = function() {\n // removes and returns front elem\n return collection.shift();\n };\n\n this.front = function() {\n // lets us see front element\n return collection[0];\n };\n\n this.size = function() {\n // shows the queue length\n return collection.length;\n };\n\n this.isEmpty = function() {\n // check if queue is empty\n return collection.length === 0;\n };\n}", "enqueue(data){\n const node = new _Node(data);\n\n //makes new node first if null\n if(this.first === null){\n this.first = node;\n }\n\n //moves last node up in the queue\n if(this.last){\n this.last.next = node;\n }\n\n //make new node the last item\n this.last = node;\n }", "dequeue(){\n //if queue is empty, nothing to remove\n if(this.first === null){\n return;\n }\n\n //set pointer to first item\n const node = this.first\n\n //move pointer to next in the queue and make it first\n this.first = this.first.next;\n\n //if this is the last item in the queue\n if(node === this.last){\n this.last = null;\n }\n return node.value;\n }", "catQueue(name) {\n let cat = new Pet(name, this.CTail);\n if (this.CHead == null) {\n this.CTail = cat;\n this.CHead = cat;\n } else {\n this.CTail.prev = cat;\n cat.next = this.CTail;\n this.CTail = cat;\n }\n return cat;\n }", "dequeue (){\n // let removedRoot = this.values[0];\n //replace with last added value\n //TEACHERS SOLUTION\n const min = this.values[0];\n const end = this.values.pop();\n //EDGE CASE IF NOTHING LEFT IN\n if(this.values.length > 0){\n //LINE 97 CAUSES A FOREVER LOOP WITH THE LAST ELEMENT IF WE DON'T ADD THE CONDITIONAL, BECAUSE WE REASSIGN THE ROOT TO BE END (WHICH WAS THE ORIGINAL ROOT IF THERE'S ONLY ONE ELEMENT)\n this.values[0] = end;\n //START TRICKLE DOWN\n this.sinkDown();\n }\n \n \n return min;\n }", "enqueue (node) {\n //if head is not found, get node.\n if (!this.head){\n this.tail.next = node\n } else {\n this.head = node\n }\n //storing a tail as the first items come in.\n this.tail.next = node\n this.tail = node\n }", "dequeue() {\n\t\tif (this.head == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (this.head == this.tail) {\n\t\t\tvar temp = this.head;\n\t\t\tthis.head = null;\n\t\t\tthis.tail = null;\n\t\t\treturn temp.value\n\t\t}\n\n\t\tvar runner = this.head;\n\t\ttemp = this.tail;\n\t\tif (this.head == null || this.tail == null) {\n\t\t\treturn undefined;\n\t\t}\n\t\t// 2nd to last's next will be tail\n\t\twhile (runner.next.next != null) {\n\t\t\trunner = runner.next;\n\t\t}\n\t\trunner.next = null;\n\t\tthis.tail = runner;\n\n\t\treturn temp.value;\n\t}", "function PriorityQueue() {\n let item = []\n\n function QueueElement(element, priority) {\n this.element = element\n this.priority = priority\n }\n\n this.enqueue = (element, priority)=>{\n const queueElement = new QueueElement(element, priority)\n if(this.isEmpty) {\n items.push(queueElement)\n } else {\n let added = false\n //iterate the items, if the priority of queueElement is lower than items[i], then insert queueElement to the front of items[i]\n for (let i = 0; i < items.length; i++) {\n if(queueElement.priority < items[i].priority) {\n items.splice(i, 0, queueElement)\n added = true\n break\n }\n }\n if(!added) {\n items.push(queueElement)\n }\n }\n }\n\n this.dequeue = ()=>{\n return items.shift()\n }\n\n this.front = ()=>{\n return items[0]\n }\n\n this.isEmpty = ()=>{\n return items.length === 0\n }\n\n this.clear = ()=>{\n items = []\n }\n\n this.size = ()=>{\n return items.length\n }\n\n this.print = ()=>{\n //because every element in items is an object, so it has to use JSON.stringify() to print items\n console.log(JSON.stringify(items))\n }\n}", "dequeue() {\n if (!this.head) return; // empty\n this.size--;\n if (this.head === this.tail) { // one element\n this.head = undefined; // check with null\n this.tail = undefined; // check with null\n return;\n }\n this.head = this.head.next;\n this.head.prev = undefined;\n }", "enqueue(val) {\n // Declare our new item\n const node = new _Node(val);\n\n // If we don't have a first item, make this node first\n if ( this.first === null ) {\n this.first = node;\n };\n\n // If we have a last item, point it to this node\n if ( this.last ) {\n this.last.next = node;\n };\n\n // Make the new node the last item on the queue\n this.last = node;\n }", "dequeue() {\n this._treatNoValues();\n return this.storage.shift();\n }", "dequeue()\r\n {\r\n if (this.isEmpty()){\r\n return null;\r\n }\r\n return this.items.shift();\r\n }", "dequeue() {\n this.list.remove(this.peekFront)\n }", "dequeue() {\n // check is size is greater than zero\n if (this.size() > 0) {\n // incrememnt depostion\n this.deposition++;\n // create temp var to hold storage at deposition\n var tempHold = this.storage[this.deposition];\n // delete storage at deposition\n delete this.storage[this.deposition];\n // return tempHold\n return tempHold;\n }\n }", "dequeue() {\n if (!this.first) throw new Error(\"Cannot dequeue! Queue is empty\");\n let removed = this.first;\n // only one item in queue: remove it and set last to be null\n if (this.first === this.last) {\n this.last = null;\n }\n // set first to be what came after first, which will be null if queue has only one item\n this.first = this.first.next;\n this.size -= 1;\n return removed.val;\n }", "function parseAdviserAnime(data, k){\r\n\tif (data.data.MediaListCollection.lists[0].entries[k].media.format !== 'TV' || data.data.MediaListCollection.lists[0].entries[k].score < minimumScore)\r\n\t\treturn;\r\n\r\n\r\n\tif (sequelsIDs.includes(data.data.MediaListCollection.lists[0].entries[k].media.id) || (userList.includes(data.data.MediaListCollection.lists[0].entries[k].media.id))) // check if we already know if this is a sequel via memoization\r\n\t\treturn;\r\n\r\n\tfor (var i=0; i<data.data.MediaListCollection.lists[0].entries[k].media.relations.edges.length; i++){\r\n\t\tif (data.data.MediaListCollection.lists[0].entries[k].media.relations.edges[i].relationType === 'PREQUEL' && adviserList.includes(data.data.MediaListCollection.lists[0].entries[k].media.relations.edges[i].node.id)) {// anime has a prequel we can move on and remove highlyAdvisedAnime\r\n\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\tif ((data.data.MediaListCollection.lists[0].entries[k].media.relations.edges[i].node.format === 'TV') && !(sequelsIDs.includes(data.data.MediaListCollection.lists[0].entries[k].media.relations.edges[i].node.id)))\r\n\t\t\tsequelsIDs.push(data.data.MediaListCollection.lists[0].entries[k].media.relations.edges[i].node.id) // we know this is not the first prequel, won't bother with it\r\n\t}\r\n\r\n\t//this is the first anime in a series and user user never saw it\t\r\n\t\r\n\t//now to check if this anime has one of the users favorite genres\r\n\tfor (var i=0; i<data.data.MediaListCollection.lists[0].entries[k].media.genres.length; i++){\r\n\r\n\t\tvar loopLength = (bestGenres.length>3)?3:bestGenres.length;\r\n\r\n\t\tfor (var j=0; j<loopLength; j++){\r\n\t\t\tif (data.data.MediaListCollection.lists[0].entries[k].media.genres[i] === bestGenres[j]){\t\t\r\n\t\t\t\thighlyAdvisedAnime[data.data.MediaListCollection.lists[0].entries[k].media.id] = [data.data.MediaListCollection.lists[0].entries[k].media.title.romaji, data.data.MediaListCollection.lists[0].entries[k].media.coverImage.large];\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\r\n\t}\r\n\r\n\tadvisedAnime[data.data.MediaListCollection.lists[0].entries[k].media.id] = [data.data.MediaListCollection.lists[0].entries[k].media.title.romaji, data.data.MediaListCollection.lists[0].entries[k].media.coverImage.large];\r\n\treturn;\r\n\t\t\t\r\n}", "function main() {\n const SLL = new LinkedList()\n\n SLL.insertFirst('Apollo')\n SLL.insertLast('Boomer')\n SLL.insertLast('Helo')\n SLL.insertLast('Husker')\n SLL.insertLast('Starbuck')\n SLL.insertLast('Tauhida')\n SLL.remove('Tauhida')\n\n console.log(SLL.head.value)\n displayLinkedList(SLL)\n listSize(SLL)\n console.log(isEmpty(SLL))\n console.log(findPrevious(SLL, 'Husker'))\n}", "dequeue(){\n if (this.head === null){\n return null\n }\n \n let currentHead = this.head\n this.head = currentHead.next \n this.length--\n if( this.length === 0 ){ \n return this.tail = null\n }\n}", "function Queue(){\n\tvar item = [];\n\tthis.enqueue = function(element){\n\t\titem.push(element);\n\t};\n\tthis.dequeue = function(){\n\t\titem.shift();\n\t};\n\tthis.front = function(){\n\t\treturn item[0];\n\t};\n\tthis.isEmpty = function(){\n\t\treturn item.length == 0;\n\t};\n\tthis.clear = function(){\n\t\titem = [];\n\t};\n\tthis.size = function(){\n\t\treturn item.length;\n\t};\n\tthis.print = function(){\n\t\tconsole.log(item.toString());\n\t};\n}", "function addToQueue() {\n if (people.length < 5) {\n people.enqueue(getRandom(randomPeople))\n petsService.enqueue('dogs', getRandom(store.dogs))\n petsService.enqueue('cats', getRandom(store.cats))\n console.log(petsService.get())\n }\n}", "constructor() {\n this.catQueue = new Queue();\n this.dogQueue = new Queue();\n }", "dequeue() {\n // save item to return\n const item = this.first.item;\n\n // delete first node\n this.first = this.first.next;\n\n if (this.isEmpty()) {\n this.last = null;\n }\n \n // return saved item\n return item;\n }", "dequeue(){\n if(!this.first) return null\n var node;\n if(this.length===1){\n node = this.first;\n this.first = null;\n this.last = null;\n }\n else{\n node = this.first;\n this.first = this.first.next;\n }\n this.length--;\n return node;\n }", "function squareDance(queue) {\n const spareQueue = new Queue();\n let m = '';\n let f = '';\n\n let current = queue.first;\n while (current) {\n\n\n if (current.data.startsWith('F')) {\n if (f === '') {\n f = current.data.split(' ')[1];\n }\n else {\n spareQueue.enqueue(current.data);\n } \n }\n\n if (current.data.startsWith('M')) {\n\n if (m === '') {\n m = current.data.split(' ')[1];\n }\n else {\n spareQueue.enqueue(current.data);\n } \n }\n \n\n if (m && f) {\n console.log(`Female dancer is ${f}, and the male dancer is ${m}`);\n m = '';\n f = '';\n }\n \n if (spareQueue.first) {\n if (spareQueue.first.data.startsWith('M')) {\n if (m === '') {\n m = spareQueue.dequeue();\n m = m.split(' ')[1];\n }\n } else if (spareQueue.first.data.startsWith('F')) {\n if (f === '') {\n f = spareQueue.dequeue();\n f = m.split(' ')[1];\n }\n }\n }\n current = current.next;\n }\n\n let maleCount = 0;\n let femaleCount = 0;\n let spareCurrent = spareQueue.first;\n\n while (spareCurrent) {\n //console.log(spareCurrent);\n if (spareCurrent.data.startsWith('M')) {\n maleCount++;\n }\n if (spareCurrent.data.startsWith('F')) {\n femaleCount++;\n }\n\n spareCurrent = spareCurrent.next;\n }\n\n if (m) {\n maleCount++;\n }\n\n if (f) {\n femaleCount++;\n }\n\n if (maleCount) {\n console.log(`There are ${maleCount} male dancers waiting to dance`);\n }\n if (femaleCount) {\n console.log(`There are ${femaleCount} female dancers waiting to dance`);\n }\n}", "dequeue() {\n // Check if queue is empty\n if (this.first === null) {\n return null;\n }\n\n // Get the first node in the list\n let node = this.first;\n\n // Shift the next node in the queue to first\n this.first = this.first.next;\n\n // If the node is in the last position of the queue\n if (node === this.last) {\n this.last = null;\n }\n return node.value;\n }", "dequeue() { \n let removed = this.front\n this.front = this.front.next\n return removed\n }", "dequeue() {\n //if the queue is empty, there is nothing to return\n if (this.first === null) {\n return;\n }\n const node = this.first;\n this.first = node.next;\n //if this is the last item in the queue\n if (node === this.last) {\n this.last = null;\n }\n return node.value;\n }", "liveAnotherDay() {\n\t\t//console.log(\"Before sort\", JSON.stringify(this.Dudes[0].decodeGenome()));\n\t\tthis.sort();\n\t\t//console.log(\"After sort\", JSON.stringify(this.Dudes[0].decodeGenome()));\n\t\tthis.kill();\n\t\t//console.log(\"After kill\", JSON.stringify(this.Dudes[0].decodeGenome()));\n\t\tthis.mate();\n\t\t//console.log(\"After mate\", JSON.stringify(this.Dudes[0].decodeGenome()));\n\t\tthis.fill();\n\t\t//console.log(\"After fill\", JSON.stringify(this.Dudes[0].decodeGenome()));\n\t\tthis.sort();\n\t}", "function Queue() {\n this.els = new Array();\n this.head = 0;\n this.size = 0;\n}", "enqueue(data) {\n const node = new _Node(data);\n\n if (this.first === null) {\n this.first = node;\n }\n\n if (this.last) {\n this.last.next = node;\n }\n //make the new node the last item on the queue\n this.last = node;\n }", "dequeue() {\n if (this.isEmpty()) {\n return null;\n }\n\n return this.list.shift().value;\n }", "dequeue() {\n // set a variable equal to the object keys array\n var keys = Object.keys(this.storage);\n // set a variable equal to the lowest key value\n var lowest = this.storage[keys[0]];\n // delete the lowest key value\n delete this.storage[keys[0]];\n // return the lowest key value variable\n return lowest;\n }", "dequeue() {\n\t\tif (this.stack2.length === 0) {\n\t\t\t// store length of second stack in variable\n\t\t\tconst length = this.stack1.length;\n\t\t\t// iterate length amount of times until\n\t\t\t// stack 1 is empty.\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tthis.stack2.add(this.stack1.remove());\n\t\t\t}\n\t\t}\n\t\t// return the first item in the queue (first person in line)\n\t\treturn this.stack2.remove();\n\t}", "dequeue() {\n //if the queue is empty, there is nothing to return\n if (this.first === null) {\n return;\n }\n const node = this.first;\n this.first = this.first.next;\n //if this is the last item in the queue\n if (node === this.last) {\n this.last = null;\n }\n return node.value;\n }", "function Queue() {\n this.size = 0;\n this.inStack = new Stack();\n this.outStack = new Stack();\n}", "dequeue() {\n if (!this.first) return null;\n\n let temp = this.first;\n // 1 node left\n if (this.first === this.last) {\n this.last = null;\n }\n // so if one node left, this.first.next is also null\n // first and last pointer overlap\n this.first = this.first.next;\n this.size--;\n\n return temp.value;\n }", "enqueue(value) {\n // Create a new node to store the value\n let node = new _Node(value);\n\n // If the node is the first to be added\n if (this.first === null) {\n this.first = node;\n this.size++;\n }\n\n // Shift existing node in last to the next position in queue\n if (this.last) {\n this.last.next = node;\n }\n\n // Make the new node last\n this.last = node;\n this.size++;\n }", "function Queue(){\n this.data= new LinkedList()\n}", "dequeue() {\n if (!this.first) {\n return null;\n }\n if (this.first === this.last) {\n this.last = null;\n }\n this.first = this.first.next;\n this.length--;\n\n return this;\n }", "async poll() {\n let qual = Object.values(this.all).\n filter(follow => !this.updating.includes(follow) && isOutOfDate(follow, this.fetched))\n if (qual.length > 0) {\n let oldest = qual.reduce((old, follow) =>\n (fetchedAt(this.fetched, old.id) || 0) > (fetchedAt(this.fetched, follow.id) || 0) ? follow : old)\n if (oldest) {\n let lastFetch = this.fetched[oldest.id]\n this.updating.push(oldest)\n console.log(`Updating ${oldest.title || oldest.actualTitle}`)\n await feedycat(this, oldest, lastFetch)\n this.markFetched(oldest)\n this.updating = this.updating.filter(follow => follow != oldest)\n if (lastFetch.status != 304) {\n this.update({op: 'replace', path: `/all/${oldest.id}`, value: oldest})\n this.write({update: false, follows: [oldest.id]})\n }\n }\n }\n }", "function createQueue() {\n const queue = [];\n return {\n enqueue(item) {\n queue.unshift(item); // this adds to the begining of the array. [third-item, second-item, first-item]\n },\n dequeue(){\n return queue.pop();\n },\n peek() {\n return queue[queue.length - 1];\n },\n get length() {\n return queue.length;\n },\n isEmpty(){\n return queue.length === 0;\n },\n get getQueue() {\n return queue;\n }\n }\n}", "dequeue() {\n\n }", "enqueue(data) {\n const node = new _Node(data);\n \n if(this.first === null) {\n this.first = node;\n }\n\n if(this.last) {\n this.last.next = node;\n }\n //make the new node the last item on the queue\n this.last = node;\n }", "dequeue() {\n if(!this.front) return null;\n if(this.size === 1) {\n let retVal = this.front.value;\n this.front = null;\n this.back = null;\n this.size--;\n return retVal;\n } else {\n let iteratorNode = this.front;\n while(iteratorNode.next !== this.back) {\n iteratorNode = iteratorNode.next;\n }\n let retVal = this.back.value;\n iteratorNode.next = null;\n this.back = iteratorNode;\n this.size--;\n return retVal;\n }\n }" ]
[ "0.62584984", "0.576285", "0.55758286", "0.5560069", "0.5538194", "0.52656466", "0.52072173", "0.5205057", "0.5041291", "0.49671936", "0.49667248", "0.49003905", "0.48999786", "0.48996174", "0.48979107", "0.4886936", "0.487786", "0.48574534", "0.483921", "0.48326865", "0.48274812", "0.48172292", "0.48106533", "0.4808253", "0.48052993", "0.47940242", "0.47864392", "0.4776686", "0.4767706", "0.4765354", "0.47595698", "0.47554842", "0.47528285", "0.47512794", "0.47462672", "0.473673", "0.47336546", "0.47318655", "0.47306573", "0.47216383", "0.4721563", "0.47048292", "0.47025537", "0.47024786", "0.4701081", "0.4697339", "0.46908644", "0.4686163", "0.46842006", "0.46775907", "0.46765906", "0.4670461", "0.46687457", "0.46669257", "0.46664283", "0.46647352", "0.46641725", "0.4660916", "0.46585926", "0.46580744", "0.46523434", "0.4652325", "0.46393064", "0.46389323", "0.462844", "0.46262047", "0.46230918", "0.4622484", "0.46197233", "0.461645", "0.461156", "0.46100324", "0.46052057", "0.46010554", "0.46002668", "0.46001416", "0.458746", "0.45865875", "0.45857322", "0.4583754", "0.45812237", "0.4580422", "0.45789185", "0.457038", "0.4567993", "0.45624402", "0.4559178", "0.45559925", "0.4555877", "0.45540693", "0.45500562", "0.45442256", "0.45438132", "0.45417348", "0.4538324", "0.45360962", "0.45302197", "0.452591", "0.4523558", "0.45229763" ]
0.59708124
1
[[[0,0],[0,0],[0,0]],[[0,0],[0,0],[0,0]],[[0,0],[0,0],[0,0]],[[0,0],[0,0],[0,0]],[[0,0],[0,0],[0,0]],[[0,0],[0,0],[0,0]]]; //Seasontotals = [grade totals[gender totals[boy and girl]]]
function onOpen() { var ui = SpreadsheetApp.getUi(); ui.createMenu('Athletics Totals') .addItem('Count Totals', 'myFunction') .addToUi(); //console.log("test1"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTotalGrades(section) {\n var grades = [];\n var grade;\n for (var repo in section.students) {\n grade = section.students[repo].totalGrade;\n if ($.type(grade) != \"null\") grades.push(grade);\n };\n\n return grades;\n}", "function getGrades(){\n return [8,8.5,6,7]\n}", "function getTotals(){\n \n var totals = []; \n var totalCalories =0; \n var totalProtein= 0; \n var totalFat=0 ; \n var totalCarbs= 0; \n var totalFiber=0 ; \n \n //searching through the loop \n for(var i = 0 ; i < menu.length; i++){\n \n var foodObj = menu[i]; \n \n for(var info in foodObj){\n \n var array = foodObj[info]; \n \n switch(info){\n \n case 'Calories':\n totalCalories+=array[0];\n break;\n case 'Protein':\n totalProtein+=array[0];\n break;\n case 'Fat':\n totalFat+=array[0]; \n break;\n case 'Carbs':\n totalCarbs+=array[0];\n break;\n case 'Fiber':\n totalFiber+=array[0]; \n break; \n \n }\n }\n }\n \n totals.push(totalCalories, totalProtein, totalFat, totalCarbs, totalFiber);\n \n calcStats(totals); \n}", "function totals(arr){\n\tvar total = 0;\n\tvar t_M = 0;\n\tvar ft_M = 0;\n\tvar f_M = 0;\n\tarr.forEach(function totals(element){\n\t\tt_M += element.threesMade;\n\t\tft_M += element.freeThrowsMade;\n\t\tf_M += element.fieldGoalsMade;\n\t});\n\tf_M -= t_M;\n\tf_M *= 2;\n\tt_M *= 3;\n\ttotal += f_M + t_M + ft_M;\n\treturn total;\n}", "function accumulateFemalePopulationPerCounty(population_arr,counties_arr)\n{\n const female_population_pre_county = [];\n for (let i = 0; i < counties_arr.length; i++)\n {\n let female = 0;\n for (let j = i; j < population_arr.length; j++)\n {\n if (counties_arr[i] === population_arr[j].county)\n {\n female += population_arr[j].female; \n }\n }\n female_population_pre_county.push(female);\n }\n return female_population_pre_county;\n}", "function salesReport() {\n var totalSales = 0;\n \n // [ [ 102, 103, 104 ], [ 106, 107 ], [], [], [] ]\n for(var i = 0; i < bookedRooms.length; i++) {\n totalSales += bookedRooms[i].length * roomPrices[i]\n \n }\n \n return totalSales;\n}", "function accumulatePopulationPerCounty(male_per_county,female_per_county)\n{\n let population_pre_county = [];\n for (let i = 0; i < male_per_county.length; i++)\n {\n population_pre_county.push(male_per_county[i] + female_per_county[i])\n }\n return population_pre_county;\n}", "function accumulateMalePopulationPerCounty(population_arr,counties_arr)\n{\n const male_population_pre_county = [];\n for (let i = 0; i < counties_arr.length; i++)\n {\n let male = 0;\n for (let j = i; j < population_arr.length; j++)\n {\n if (counties_arr[i] === population_arr[j].county)\n {\n male += population_arr[j].male; \n }\n }\n male_population_pre_county.push(male);\n }\n return male_population_pre_county;\n}", "function cals() {\n let age = document.getElementById(\"age\").value;\n let height = document.getElementById(\"height\").value * 2.54;\n let weight = document.getElementById(\"weight\").value / 2.2;\n let resul = 0;\n let BMR\n const numbers = [ height, age, weight ];\n if (document.getElementById(\"male\").checked){\n BMR= numbers.reduce(function(total, curr, index){\n if(index === 0){\n total+= (12.7 * curr);\n }\n if(index === 1){\n total+= (6.8 * curr);\n }\n if(index === 2){\n total+= (6.23 * curr) + 622;\n }\n return total;\n });\n }\n else if (document.getElementById(\"female\").checked){\n BMR= numbers.reduce(function(total, curr, index){\n if(index === 0){\n total+= (4.7 * curr);\n }\n if(index === 1){\n total+= (4.7 * curr);\n }\n if(index === 2){\n total+= (4.35 * curr) + 655;\n }\n return total;\n });\n }\n result = [1.2, 1.375,1.55,1.725,1.9].map( function(num) {\n return Math.round(num * BMR);\n });\n document.getElementById(\"totalCals\").innerHTML =\"<label id='kcals'><br><u><b>\" + result[0] + \"</u></b> kcal per day if you are sedentary (little or no exercise)<br><u><b>\"\n + result[1] + \"</u></b> kcal per day if you are lightly active (light exercise/sports 1-3 days/week)<br><u><b>\" \n + result[2] + \"</u></b> kcal per day if you are moderatetely active (moderate exercise/sports 3-5 days/week)<br><u><b>\" \n + result[3] + \"</u></b> kcal per day if you are very active (hard exercise/sports 6-7 days a week)<br><u><b>\" \n + result[4] + \"</u></b> kcal per day if you are extra active (very hard exercise/sports & physical job or 2x training)</label><br><br><br>\";\n}", "function addTotal(arr){\n arr.forEach(function(ele){\n let total=0;\n total=ele.science+ele.maths+ele.english\n ele.total=total;\n })\n }", "function accumulateFemalePopulation(population_arr)\n{\n const female = population_arr.reduce((acc, curr) => acc + curr.female, 0);\n return female;\n}", "function getGrades(assignment, type, section) {\n var grades = [];\n var grade;\n for (var repo in section.students) {\n grade = section.students[repo].scores[type][assignment];\n if ($.type(grade) != \"null\") grades.push(grade);\n };\n\n return grades;\n}", "function accumulateMalePopulation(population_arr)\n{\n const total_male = population_arr.reduce((acc, curr) => acc + curr.male, 0);\n return total_male;\n}", "function calculateTotals(group,groups) {\n if(group.__meta.indentLevel==0) {\n let M = 0, F = 0;\n for(let i=0; i<group.__meta.children.length; i++) {\n let row = group.__meta.children[i];\n let sex = row[\"Sex\"]\n if(sex=='M') M++; else F++;\n }\n // Set the category values to be displayed as columne\n group._M = M\n group._F = F\n group.CommonName = group.key\n group.Sex = M+\"M, \"+F+\"F\"\n // Add a new row to the list\n let totals = {\n Sex: group.Sex,\n __meta: {\n totals: true\n }\n }\n group.__meta.children.push(totals)\n } else if(group.__meta.indentLevel==-1) {\n let M = 0, F = 0;\n for(let i=0; i<group.__meta.children.length; i++) {\n let row = group.__meta.children[i];\n M += row._M; F += row._F;\n }\n // Add a new row to the list\n let totals = {\n EMail: _t(\"bystate.gtotal\",\"Grand Total:\"),\n Sex: M+\"M, \"+F+\"F\",\n __meta: {\n totals: true\n }\n }\n group.__meta.children.push(totals)\n }\n}", "function estuSupePuntos(generacion){\n var sumaScore=0;\n for(var i=0;i<generacion.students.length;i++){\n var sumaHse=0;\n var sumaTech=0;\n var total=0;\n for(var j=0;j<generacion.students[i]['sprints'].length;j++){\n var tech=generacion.students[i]['sprints'][j]['score']['tech'];\n var hse=generacion.students[i]['sprints'][j]['score']['hse'];\n\n sumaTech+=tech;\n sumaHse+=hse;\n }\n\n if((sumaHse/j)>840 && (sumaTech/j) >1260){\n sumaScore++;\n }\n\n \n }\n return (sumaScore);\n}", "function achievement(sede, generation) {\n var array = [];\n var goals = 0;\n var students = data[sede][generation]['students'];\n var numStudets = students.length;\n for (var i = 0; i < numStudets; i++) {\n if (students[i].active) {\n var pointTech = 0;\n var pointHse = 0;\n var studentsSprints = students[i]['sprints'].length;\n for (var j = 0; j < studentsSprints ; j++) {\n pointTech += students[i].sprints[j].score.tech;\n pointHse += students[i].sprints[j].score.hse;\n }\n var promedioTech = pointTech / studentsSprints;\n var promedioHse = pointHse / studentsSprints;\n var promedioTotal = promedioTech + promedioHse;\n array.push([promedioTotal]);\n }\n }\n\n for (var k = 0; k < array.length; k++) {\n if (array[k] >= 2100) {\n goals++;\n }\n }\n document.getElementById('meta').textContent = goals;\n var poc = Math.round(promedioTotal / 100);\n document.getElementById('porcentaje-metas').textContent = poc;\n return goals;\n}", "function pollTotals()\n{\n totalOfTotals = 0;\n totalOfStaffTotals = 0;\n //Fill string with blank values\n for(var k = 0; k < hours.length; k++)\n {\n var blank = 0;\n hourlyTotal[k] = blank;\n staffTotal[k] = blank;\n }\n for(var i = 0; i < hours.length; i++)\n {\n for(var j = 0; j < locations.length; j++)\n {\n hourlyTotal[i] = hourlyTotal[i] + locations[j].cookiesHourly[i];\n // console.log (`${hourlyTotal} += ${locations[0].cookiesHourly[i]}`)\n staffTotal[i] = staffTotal[i] + locations[j].staffNeeded[i];\n // console.log (`${hourlyTotal} += ${locations[0].cookiesHourly[i]}`)\n }\n totalOfTotals += hourlyTotal[i]\n totalOfStaffTotals += staffTotal[i]\n }\n return(totalOfTotals, totalOfStaffTotals);\n}", "function stairsIn20(s){\n //your code here\n var sum = 0;\n for (i in s) {\n for (j in s[i][0]) {\n sum += s[i][0][j];\n }\n }\n return (sum*20);\n}", "function porEstuSupePuntos(generacion){\n var sumaScore=0;\n for(var i=0;i<generacion.students.length;i++){\n var sumaHse=0;\n var sumaTech=0;\n var total=0;\n for(var j=0;j<generacion.students[i]['sprints'].length;j++){\n var tech=generacion.students[i]['sprints'][j]['score']['tech'];\n var hse=generacion.students[i]['sprints'][j]['score']['hse'];\n\n sumaTech+=tech;\n sumaHse+=hse;\n }\n\n if((sumaHse/j)>840 && (sumaTech/j) >1260){\n sumaScore++;\n }\n var porcentaje=parseInt((sumaScore*100)/generacion.students.length);\n \n }\n return (porcentaje);\n}", "function subarray(sum) {\n\n}", "function totalAndInactives(sede,turma){\n var nameTotal = \"Alunas presentes e desistentes\"\n var inactives = 0;\n var actives = 0;\n\tvar totalStudents = data[sede][turma]['students'].length;\n\tfor (i in data[sede][turma]['students']){\n\t\tif (data[sede][turma]['students'][i]['active'] === false){\n\t\t\tinactives += 1;\n\t\t}\n }\n actives = totalStudents - inactives; \n var total = [actives,inactives]\n var legendGraph = [];\n legendGraph[0] = \"Ativas\";\n legendGraph[1] = \"Inativas\";\n pieGraph(total, nameTotal, legendGraph);\n}", "function totalGoldInRiver(){\n allGoldInRiver = 0;\n for(let i=0;i<theRiver.length;i++){\n for(let j=0;j<theRiver[i].length;j++){\n allGoldInRiver += theRiver[i][j].amt;\n }\n }\n console.log(allGoldInRiver);\n}", "function task14_16_8(){\n var names =[\"Michael\",\"John\",\"Tony\"];\n var score =[320,230,480];\n var total = 500;\n document.write(\"Score of \"+names[0]+ \" is \"+score[0]+ \" Percentage: \"+ score[0]/total * 100 + \"% <br>\");\n document.write(\"Score of \"+names[1]+ \" is \"+score[1]+ \" Percentage: \"+ score[1]/total * 100 + \"% <br>\");\n document.write(\"Score of \"+names[2]+ \" is \"+score[2]+ \" Percentage: \"+ score[2]/total * 100 + \"% <br>\");\n}", "function branchestotal() {\n let arraytotal = [];\n\n for (let i = 0; i < hours.length; i++) {\n let sum = Seattle.salesbyhour[i] + Tokyo.salesbyhour[i] + Dubai.salesbyhour[i] +\n Paris.salesbyhour[i] + Lima.salesbyhour[i];\n arraytotal.push(sum);\n }\n\n return arraytotal;\n\n}", "function findMatch() {\n\n var sums = [];\n var values = 0;\n var calcResult = calc(scores);\n\n function getSum(total, num) {\n return total + num;\n }\n\n for (var i = 0; i < calc(scores).length; i++) {\n\n values = (calcResult[i].reduce(getSum));\n sums.push(values);\n }\n\n return sums;\n }", "function avgCandies(students){\n let totalCandies = 0;\n students.forEach( e => {\n totalCandies += e.candies;\n })\n console.log('average candies is: ', totalCandies / students.length);\n}", "function avgCostPerDesigner(shoes){\n return (shoes.reduce(function(total,item){\n return total += item.price ;\n },0))/shoes.length ;\n}", "function renderTable() {\n // addstudent();\n // this is the table\n var STDtable = document.getElementById(\"studentinfo\");\n // this is student table data\n var data1 = document.createElement(\"tr\");\n STDtable.appendChild(data1);\n var td = document.createElement('td');\n data1.appendChild(td);\n td.textContent = STD.studentName;\n var td2 = document.createElement('td');\n data1.appendChild(td2);\n td2.textContent = STD.studentId;\n var td3 = document.createElement('td');\n data1.appendChild(td3);\n td3.textContent = STD.gender;\n var td4 = document.createElement('td');\n data1.appendChild(td4);\n td4.textContent = STD.parentId;\n var total = 0;\n //this is the for loop to get each mark in math subject\n for (var j = 0; j < mathMark.length; j++) {\n var td5 = document.createElement('td');\n data1.appendChild(td5);\n td5.textContent = STD.mathMark[j];\n mathTotal += parseInt(STD.mathMark[j]);\n total = total + parseInt(mathMark[j]);\n }\n mathTotal = parseInt(grade1) + parseInt(grade2) + parseInt(grade3);\n\n\n //this is the for loop to get each mark in english subject\n for (var d = 0; d < englishMark.length; d++) {\n var td6 = document.createElement('td');\n data1.appendChild(td6);\n total = total + parseInt(englishMark[d]);\n td6.textContent = STD.englishMark[d];\n }\n englishTotal = parseInt(gradeE1) + parseInt(gradeE2) + parseInt(gradeE3);\n\n\n //this is the for loop to get each mark in science subject\n for (var k = 0; k < scienceMark.length; k++) {\n var td7 = document.createElement('td');\n data1.appendChild(td7);\n td7.textContent = STD.scienceMark[k];\n total = total + parseInt(scienceMark[k]);\n }\n scienceTotal = parseInt(gradeS1) + parseInt(gradeS2) + parseInt(gradeS3);\n\n\n\n var td8 = document.createElement(\"td\");\n data1.appendChild(td8);\n avg = ((mathTotal + englishTotal + scienceTotal)/3);\n td8.textContent = avg;\n // STDtable.deleteRow(-1);\n var td9 = document.createElement(\"td\");\n data1.appendChild(td9);\n td9.setAttribute(\"border-collapse\", \" collapse\");\n td9.textContent = feedBack;\n addStudent.reset();\n // this is to count the number of female students\n if (gender === 'Male') {\n maleTotal++;\n }\n else if (gender === 'Female') {\n femaleTotal++;\n }\n}", "function loopingData4() {\n// var candies = dates[i][2]\nvar total = 0;\nvar dates = Object.keys(store1)\nfor (var i = 0; i < dates.length; i++) {\nfor (var j = 0; j < store1[dates[i]].length; j++){\ntotal += store1[dates[i]][j][2]\n}\n}\nreturn total\n}", "function gpaCalc() { \n var grCount = 12; //Define valid grades and their values\n \n // Calculate GPA\n var totalGrades = 0;\n var totalCredits = 0;\n var gpa = 0;\n \n for (var x=0; x<document.getElementById('semester_tbody').rows.length; x++) {\n var valid = true;\n for (var y = 0; y < grCount; y++) {\n if (inGrades[x] == grades[y]) {\n totalGrades += (parseInt(inCredits[x], 10) * credits[y]);\n totalCredits += parseInt(inCredits[x], 10);\n }\n }\n }\n \n // GPA formula\n gpa = Math.round(totalGrades/totalCredits*100)/100;\n report(gpa);\n}", "function gradingStudents(grades){\n return grades.map(g=>{\n var r =(g % 10) % 5;\n if ( r > 2 ){\n return g + ( 5 - r);\n } else {\n return g;\n }\n });\n}", "function subtotals(array) {\n var subtotalArray = Array(array.length);\n for (var i = 0; i < array.length; i++) {\n var subtotal = 0;\n for (var j = 0; j <= i; j++) {\n subtotal += array[j];\n }\n subtotalArray[i] = subtotal;\n }\n return subtotalArray;\n}", "function subsetSums(var = deckCards[], var index, var deckCards.length)\n{\n // Print current subset\n if (index==size1)\n {\n // printf(\" ((1)) %d %d %d \\n\\n\",l,r,sum);\n cout << sum << \" \";\n return;\n }\n // cout<<\"hiiii\"<<endl;\n sum+=arr[index];\n // Subset including arr[l]\n subsetSums(arr, index+1, size1, sum );\n//printf(\" ((2)) %d %d %d \\n\\n\",l,r,sum);\nsum-=arr[index];\n // Subset excluding arr[l]\n subsetSums(arr, index+1, size1, sum);\n//printf(\" ((3)) %d %d %d \\n\\n\",l,r,sum);\n}", "function sectionate(students) {\n\tfor (var i=0; i < students.length; i++) {\n\t\tif (students[i].cpo == \"cch\") {\n\t\t\tcchStudents.push(students[i]);\n\t\t}\n\t\telse if (students[i].cpo == \"cmb\") {\n\t\t\tcmbStudents.push(students[i]);\n\t\t}\n\t\telse if (students[i].cpo == \"pch\") {\n\t\t\tpchStudents.push(students[i]);\n\t\t}\n\t\telse if (students[i].cpo == \"pmb\") {\n\t\t\tpmbStudents.push(students[i]);\n\t\t}\n\t\telse if (students[i].cpo == \"oth\") {\n\t\t\tothStudents.push(students[i]);\n\t\t}\n\t\telse if (students[i].cpo == \"udg\") {\n\t\t\tudgStudents.push(students[i]);\n\t\t}\n\t\telse {\n\t\t\tnonNumStudents.push(students[i]);\n\t\t}\n\t}\n}", "function costOfGroceries(groceries) {\n let total = 0;\n\n for (let x = 0; x < groceries.length; x++) {\n if (groceries[x] === \"butter\") {\n total++;\n } else if (groceries[x] === \"eggs\") {\n total += 2;\n } else if (groceries[x] === \"milk\") {\n total += 3;\n } else if (groceries[x] === \"bread\") {\n total += 4;\n } else if (groceries[x] === \"cheese\") {\n total += 5;\n }\n }\n\n return total;\n}", "function supePuntosTech(generacion){\n var sumaScore=0;\n for(var i=0;i<generacion.students.length;i++){\n \n var sumaTech=0;\n \n for(var j=0;j<generacion.students[i]['sprints'].length;j++){\n var tech=generacion.students[i]['sprints'][j]['score']['tech']; \n\n sumaTech+=tech;\n \n }\n\n if((sumaTech/j) >1260){\n sumaScore++;\n }\n //var porcentaje=parseInt((sumaScore*100)/i);\n \n }\n return (sumaScore);\n}", "function porSupePuntosTech(generacion){\n var sumaScore=0;\n for(var i=0;i<generacion.students.length;i++){\n \n var sumaTech=0;\n \n for(var j=0;j<generacion.students[i]['sprints'].length;j++){\n var tech=generacion.students[i]['sprints'][j]['score']['tech']; \n\n sumaTech+=tech;\n \n }\n\n if((sumaTech/j) >1260){\n sumaScore++;\n }\n var porcentaje=parseInt((sumaScore*100)/generacion.students.length);\n \n }\n return (porcentaje);\n}", "calcGrade() {\n const assignments = this.props.row.assignments;\n let grades = {};\n\n // Put grades into buckets by weight.\n for (let x in assignments) {\n const a = assignments[x];\n if (a.grade) {\n const type = a.grade.assignment.type.weight;\n\n if (!grades[type]) grades[type] = [];\n\n grades[type].push(a.grade.gradeAverage);\n }\n }\n\n console.log(grades);\n\n // Calculate average for each bucket. Then multiply by weight.\n // x is weight.\n let weighted = [];\n for (let x in grades) {\n const total = grades[x].reduce((total, num) => total + num);\n console.log(total);\n // Average in weighted bucket.\n const average = (total / grades[x].length).toFixed(2);\n console.log(average);\n console.log(x);\n weighted.push(average * x);\n }\n\n console.log(weighted);\n if (weighted.length) {\n return Math.round(weighted.reduce((total,num) => total + num) * 100);\n }\n\n }", "function sedePromo(sede, promo) {\n // respondiendo primera pregunta. Hallando la cantidad de alumnas y el porcentaje recorriendo un array se puede contar cuantas alumnas hay\n var arr = data[sede][promo]['students'];\n var cant = 0;\n var nocant = 0;\n for (var i = 0; i < arr.length; i++) {\n if (arr[i].active === true) {\n cant++;\n } else {\n nocant++;\n }\n }\n var calculandoPorcentaje = parseInt((nocant / arr.length) * 100);\n total.textContent = cant;\n porcentaje.textContent = calculandoPorcentaje + '%';\n /* ***************************************************Cantida de alumnas que superan el objetivo*****************************************************/\n var sumaScore = 0;\n for (var i = 0; i < arr.length; i++) {\n debugger;\n var sumaHse = 0;\n var sumaTech = 0;\n for (var j = 0; j < data[sede][promo]['students'][i]['sprints'].length; j++) {\n var tech = data[sede][promo]['students'][i]['sprints'][j]['score']['tech'];\n var hse = data[sede][promo]['students'][i]['sprints'][j]['score']['hse'];\n sumaHse = sumaHse + hse;\n sumaTech = sumaTech + tech;\n }\n if (sumaHse > 3360 && sumaTech > 5040) {\n sumaScore++;\n }\n }\n meta.innerHTML = sumaScore;\n /* ***************************************************************cantida de nps*********************************************************************/\n var arrNps = data[sede][promo]['ratings'];\n var sum = 0;\n var npsTotal = 0;\n for (var i = 0; i < arrNps.length; i++) {\n var npsPromoters = data[sede][promo]['ratings'][i]['nps']['promoters'];\n var npsDetractors = data[sede][promo]['ratings'][i]['nps']['detractors'];\n var npsPassive = data[sede][promo]['ratings'][i]['nps']['passive'];\n var npsResta = npsPromoters - npsDetractors;\n sum = sum + npsResta;\n var npsSuma = npsPromoters + npsDetractors + npsPassive;\n npsTotal = npsTotal + npsSuma;\n }\n var promoterPorcentaje = parseInt((npsPromoters / npsTotal) * 100);\n var detractorsPorcentaje = parseInt((npsDetractors / npsTotal) * 100);\n var passivePorcentaje = parseInt((npsPassive / npsTotal) * 100);\n var totalNps = sum / arrNps.length;\n nps.textContent = totalNps.toFixed(2);\n npsPorciento.innerHTML = promoterPorcentaje + '% Promoters' + '<br>' + detractorsPorcentaje + '% Passive' + '<br>' + passivePorcentaje + '% Detractors';\n /* *********************************************calculando los puntos obtenidos en tech********************************************************************/\n var cantidadTech = 0;\n for (var i = 0; i < arr.length; i++) {\n var arrSprint = data[sede][promo]['students'][i]['sprints'];\n var sumTech = 0;\n for (var j = 0; j < arrSprint.length; j++) {\n var tech2 = data[sede][promo]['students'][i]['sprints'][j]['score']['tech'];\n sumTech = sumTech + tech2;\n if (sumTech > (1260 * 4)) {\n cantidadTech++;\n }\n }\n }\n pointTech.textContent = cantidadTech;\n /* ********************************************************calculando los puntos en hse*******************************************************************/\n var cantidadHse = 0;\n for (var i = 0; i < arr.length; i++) {\n var arrSprint = data[sede][promo]['students'][i]['sprints'];\n var sumHse = 0;\n for (var j = 0; j < arrSprint.length; j++) {\n var hse2 = data[sede][promo]['students'][i]['sprints'][j]['score']['hse'];\n sumHse = sumHse + hse2;\n if (sumHse > (840 * 4)) {\n cantidadHse++;\n }\n }\n }\n pointHse.textContent = cantidadHse;\n /* **************************************porcentaje de la expectativa de las alumnas respecto a laboratoria**************************************************/\n var sumaExpectativa = 0;\n for (var i = 0; i < arrNps.length; i++) {\n var studentNoCumple = data[sede][promo]['ratings'][i]['student']['no-cumple'];\n var studentCumple = data[sede][promo]['ratings'][i]['student']['cumple'];\n var studentSupera = data[sede][promo]['ratings'][i]['student']['supera'];\n var Expectativa = ((studentSupera + studentCumple) / (studentNoCumple + studentCumple + studentSupera)) * 100;\n sumaExpectativa = sumaExpectativa + Expectativa;\n }\n var porcentajeExpectativa = parseInt(sumaExpectativa / arrNps.length);\n boxExpectativa.textContent = porcentajeExpectativa + '%';\n /* *********************************************promedio de los profesores********************************************************************/\n var promedioTeacher = 0;\n for (var i = 0; i < arrNps.length; i++) {\n var teacher = data[sede][promo]['ratings'][i]['teacher'];\n promedioTeacher = (promedioTeacher + teacher) / arrNps.length;\n }\n boxTeacher.textContent = promedioTeacher.toFixed(2);\n /* *************************************************promedio jedi*****************************************************************/\n var promedioJedi = 0;\n for (var i = 0; i < arrNps.length; i++) {\n var jedi = data[sede][promo]['ratings'][i]['jedi'];\n promedioJedi = (promedioJedi + jedi) / arrNps.length;\n }\n boxJedi.textContent = promedioJedi.toFixed(2);\n }", "function poinCalculator(array) {\r\n let totalG = 0;\r\n let totalS = 0;\r\n let totalB = 0;\r\n let totalPoint = 0;\r\n\r\n for (let i = 0; i < array.length; i++) {\r\n if (array[i] === 'G') {\r\n totalG++;\r\n totalPoint += 2;\r\n } else if (array[i] === 'S') {\r\n totalS++;\r\n totalPoint += 1;\r\n } else if (array[i] === 'B') {\r\n totalB++;\r\n totalPoint += 0.5;\r\n }\r\n }\r\n\r\n return 'jumlah Gold: '+totalG+', jumlah Silver: '+totalS+', jumlah Bronze: '+totalB+'. Dan totalnya adalah: '+totalPoint;\r\n}", "function woodCalculator(chair, table, bed){\n const woodForChair =chair * 1; //sft\n const woodForTable =table * 3; //sft\n const woodForBed =bed * 5; //sft\n const totalWood = woodForChair + woodForTable + woodForBed;\n let returnData =[woodForChair, woodForTable, woodForBed, totalWood];\n return returnData;\n}", "function total(index) {\n\n var total = 0\n matrix[index].forEach(element => {\n total += element\n })\n return total; \n\n }", "function contaMedaglie(array, n) {\n var somma = d3.sum(array, function(d,i){\n // conta tutti\n if (n=='athletes') return 1\n if (n=='gold') return (d.gold_medals > 0) ? 1 : 0\n if (n=='silver') return (d.silver_medals > 0) ? 1 : 0\n if (n=='bronze') return (d.bronze_medals > 0) ? 1 : 0\n if (n=='any') return (d.total_medals > 0) ? 1 : 0\n if (n=='none') return (d.total_medals == 0) ? 1 : 0\n })\n return somma\n }", "function computeAverage (anArray) {\n var average, sum = 0, count = 0; // initialize variables\n anArray.forEach(function(object) {\n if (object.occupation === \"programmer\") {\n count++;\n sum += object.awesomeIndex;\n } // end if\n }); // end .forEach\n average = sum / count;\n return average;\n} // end computeAverage", "function getFemalePopulationPerHousehold(household_data)\n{\n let female_household_population = [];\n for (let i = 0; i < household_data.length; i++)\n {\n female_household_population.push(household_data[i].female);\n }\n return female_household_population;\n}", "function estuSupePuntosHse(generacion){\n var sumaScore=0;\n for(var i=0;i<generacion.students.length;i++){\n var sumaHse=0;\n \n \n for(var j=0;j<generacion.students[i]['sprints'].length;j++){\n \n var hse=generacion.students[i]['sprints'][j]['score']['hse'];\n\n sumaHse+=hse;\n }\n\n if((sumaHse/j)>840){\n sumaScore++;\n }\n \n \n }\n return (sumaScore);\n}", "function count_sets(arr, total){\n\n\n}", "function notaHse(sede, generation) {\n var ratings = data[sede][generation]['ratings'];\n var array = [];\n for (var i = 0 ; i < ratings.length; i++) {\n array[i] = ratings[i].teacher;\n }\n document.getElementById('total-enrollment').innerHTML = ratings;\n document.getElementById('total-enrollment blue').innerHTML = array;\n return array;\n}", "function sumExp(arr) {\n return arr.reduce((exp, pokemon) => {\n return exp + ( pokemon.isSelected ? pokemon.base_experience : 0 );\n }, 0);\n}", "getAvgFitnessSum() {\n let averageSum = 0;\n for (let s of this.species) {\n averageSum += s.averageFitness;\n }\n return averageSum;\n }", "function grandTotal(array) {\n let GT = array[4].reduce((total, curr) => {\n total = total + curr;\n return total;\n }, 0);\n\n let newGT = GT < 10 ? \"0\" + GT : GT;\n display.innerHTML = `মোট খরচঃ ${newGT} টাকা`;\n}", "function poinCalculator(array) {\r\n // your code here\r\n let gold = 0;\r\n let silver = 0;\r\n let bronze = 0;\r\n let totalGold = 0;\r\n let totalSilver = 0;\r\n let totalBronze = 0;\r\n for (let i = 0; i < array.length; i++) {\r\n if (array[i] === 'G') {\r\n gold += 2;\r\n totalGold++;\r\n } else if (array[i] === 'S') {\r\n silver += 1;\r\n totalSilver++;\r\n } else if (array[i] === 'B') {\r\n bronze += 0.5;\r\n totalBronze++;\r\n }\r\n }\r\n let result = gold + silver + bronze;\r\n return 'jumlah gold: ' + totalGold + ', jumlah Silver: ' + totalSilver + ', jumlah Bronze: ' + totalBronze + '. Dan totalnya adalah: ' + result;\r\n}", "function getTotalScores(result){\n var len = result.length;\n var total = 0;\n\n for (var i = 0; i < len; i++){\n total += parseInt(result[i][0]);\n }\n return total;\n}", "function percentageReport(){\n let totalRocks = (allRocks().length / totalCells()) * 100;\n let totalCurrents = (allCurrents().length / totalCells()) * 100;\n return [totalRocks.toFixed(2), totalCurrents.toFixed(2)];\n}", "findAverage(mat){\n\n var size = [mat.length,mat[0].length];\n var sum = Array.apply(null, Array(size[1])).map(Number.prototype.valueOf,0);\n\n for(var i=0;i<size[0];i++) {\n for(var j=0;j<size[1];j++) {\n sum[j] += parseFloat(mat[i][j]);\n }\n }\n\n sum = sum.map(currentValue => currentValue/size[0]);\n sum = sum.map(currentValue => Math.round(currentValue*100)/100);\n return sum;\n }", "studentsPerInstructor() {\n // Return an object of how many students per teacher there are in each cohort e.g.\n // {\n // cohort1806: 9,\n // cohort1804: 10.5\n // }\n\n //divide studentCount by the amount of teachers in each module\n \n\n\n\n const result = cohorts.reduce((acc, cur) => {\n acc[`cohort${cur.cohort}`] = cur.studentCount / instructors.reduce((accInst, curInst) => {\n if(curInst.module === cur.module) {\n accInst++;\n }\n return accInst;\n }, 0);\n return acc;\n }, {});\n\n\n return result;\n\n // Annotation:\n // This one was crazy. Basically, we start by reducing the cohorts module because we are basing our length off our new object off of the cohorts array.\n //we create our values using interpolation, then to assign it our value is where it gets tricky. Basically, we need to divide the total number of students in a cohort by the amount of instructors there are. So we can iterate through instructors, and if the instructor module matches the module of the Current Cohort, we add to our second accumulator. We divide the total count by this accumulator. \n }", "function calculateSubtotals() {\n for (i=0; i<cartList.length; i++) {\n tipus=cartList[i].type;\n cartList.map(v => Object.assign(v, {quantity: 1}));//afegim atribut quantity a tots els objectes de cartList amb valor 1\n if (tipus=='grocery'){\n subtotal.grocery.value+=cartList[i].price;\n \n }else if(tipus=='beauty'){\n subtotal.beauty.value+=cartList[i].price;\n }else{\n subtotal.clothes.value+=cartList[i].price;\n }\n }\n console.log('Subtotals:')\n console.log(' Grocery: '+subtotal.grocery.value);\n console.log(' Beauty: '+subtotal.beauty.value);\n console.log(' Clothes: '+subtotal.clothes.value);\n \n}", "function donut(location, healthGender){\n var dataDonut = [];\n for (var loc = 0; loc < healthGender.length; loc++){\n if (location == healthGender[loc].COU){\n dataDonut.push(healthGender[loc]);\n };\n };\n return dataDonut;\n}", "function fresult() {\n var sumWeight = 0;\n var sumSpecial = 0;\n for (var i = 0; i < categories.length; i++) {\n if (isNaN(categories[i].avg)) { //checks if category has some grades in it\n //console.log(\"NAN\" + categories[i].name);\n } else {\n sumWeight += categories[i].weight;\n }\n }\n for (var i = 0; i < categories.length; i++) {\n if (isNaN(categories[i].avg)) {\n //console.log(\"NAN\" + categories[i].name);\n } else {\n sumSpecial += categories[i].specialNum;\n }\n }\n let finalGrade = Math.round(sumSpecial / sumWeight * 1000) / 10;\n if(isNaN(finalGrade)) {\n finalGrade = \"An error has occured or you are using an unsupported grade system. Please contact the developer (13skarupa@opengate.cz). Switch off grade calculation in the settings to use the other features\";\n }\n return finalGrade + \"%\";\n }", "function accumulatePopulation(total_female, total_male)\n{\n let total_population = total_female + total_male;\n return total_population;\n}", "function calculateSubtotals(cartList) {\n for (i=0; i<cartList.length; i++) {\n tipus=cartList[i].type;\n cartList.map(v => Object.assign(v, {quantity: 1}));//afegim atribut quantity a tots els objectes de cartList amb valor 1\n if (tipus=='grocery'){\n subtotal.grocery.value+=cartList[i].price;\n \n }else if(tipus=='beauty'){\n subtotal.beauty.value+=cartList[i].price;\n }else{\n subtotal.clothes.value+=cartList[i].price;\n }\n }\n console.log('Subtotals:')\n console.log(' Grocery: '+subtotal.grocery.value);\n console.log(' Beauty: '+subtotal.beauty.value);\n console.log(' Clothes: '+subtotal.clothes.value);\n}", "function techSkills(branch, generation) {\n var students = data[branch][generation]['students'];\n var totalTechArray = [];\n var countTechSp1 = 0, countTechSp2 = 0, countTechSp3 = 0, countTechSp4 = 0;\n\n for (var i = 0; i < students.length; i++) {\n var quantitySprints = students[i].sprints.length;\n if (students[i].active === true) {\n for (var j = 0; j < quantitySprints; j++) {\n if (students[i].sprints[j].number === 1) {\n var techScoreSp1 = students[i].sprints[j].score.tech;\n if (techScoreSp1 >= 1260) {\n countTechSp1++;\n }\n } else if (students[i].sprints[j].number === 2) {\n var techScoreSp2 = students[i].sprints[j].score.tech;\n if (techScoreSp2 >= 1260) {\n countTechSp2++;\n }\n } else if (students[i].sprints[j].number === 3) {\n var techScoreSp3 = students[i].sprints[j].score.tech;\n if (techScoreSp3 >= 1260) {\n countTechSp3++;\n }\n } else if (students[i].sprints[j].number === 4) {\n var techScoreSp4 = students[i].sprints[j].score.tech;\n if (techScoreSp4 >= 1260) {\n countTechSp4++;\n }\n }\n }\n }\n }\n totalTechArray.push(countTechSp1, countTechSp2, countTechSp3, countTechSp4);\n return totalTechArray;\n }", "function porEstuSupePuntosHse(generacion){\n var sumaScore=0;\n for(var i=0;i<generacion.students.length;i++){\n var sumaHse=0;\n \n \n for(var j=0;j<generacion.students[i]['sprints'].length;j++){\n \n var hse=generacion.students[i]['sprints'][j]['score']['hse'];\n\n sumaHse+=hse;\n }\n\n if((sumaHse/j)>840){\n sumaScore++;\n }\n var porcentaje=parseInt((sumaScore*100)/generacion.students.length);\n \n }\n return (porcentaje);\n}", "function staffTotal(staffData){\n const staffBalance = staffData.map(function(cost){\n return cost.balance;\n });\n const totalBalance = staffBalance.reduce(function(prev, curr){\n return prev + curr;\n });\n console.log(staffBalance);\n console.log(totalBalance);\n}", "function getTotal(obj) {\n\t\tvar score = 0;\n\t\tvar points = 0;\n\t\tassignmentTypes.forEach(function(type) {\n\t\t\tif (obj[type]) {\n\t\t\t\tscore += obj[type].score;\n\t\t\t\tpoints += obj[type].points;\n\t\t\t}\n\t\t});\n\t\treturn {\n\t\t\tscore: score,\n\t\t\tpoints: points\n\t\t};\n\t}", "function addUpTotals(mycourse, teeIndex) {\n for(let i = 0; i < mycourse.length; i++) {\n if (i <= 8) {\n totalYardsIn += Number(mycourse[i].teeBoxes[teeIndex].yards);\n totalParIn += Number(mycourse[i].teeBoxes[teeIndex].par);\n totalHCPIn += Number(mycourse[i].teeBoxes[teeIndex].hcp);\n }\n if (i < mycourse.length && i >= 9) {\n totalYardsOut += Number(mycourse[i].teeBoxes[teeIndex].yards);\n totalParOut += Number(mycourse[i].teeBoxes[teeIndex].par);\n totalHCPOut += Number(mycourse[i].teeBoxes[teeIndex].hcp);\n }\n }\n}", "getAverageGrades() {\n let total = 0\n for (let i = 0; i < students.length; i++) {\n const student = students[i];\n total += student.getAverageGrades();\n }\n return total / students.length\n }", "function calcTotalNutritionalValue(dish) { // receive an array\n return {\n calories: {\n total: sumNutrientVal('calories', dish),\n unit: 'kcal'\n },\n protein: {\n total: sumNutrientVal('proteins', dish),\n unit: 'g'\n },\n carbohydrates: {\n total: sumNutrientVal('carbohydrates',dish),\n unit: 'g'\n },\n fats: {\n total: sumNutrientVal('fats',dish),\n unit: 'g'\n },\n sugar: {\n total: sumNutrientVal('sugars', dish),\n unit: 'g'\n }\n }\n}", "function getLMSValues_0_5(array, age_days, gender){\n for(let i = 0, l = array.length; i < l; i++) {\n if (array[i].gender == gender && array[i].age_days == age_days){\n return [array[i].l, array[i].m, array[i].s];\n //return lms == 'l' ? array[i].l : lms == 'm' ? array[i].m : lms == 's' ? array[i].s : null; //for returning individual lms values\n }\n }\n}", "function getTotalBiomass(reef_fish_arr, c_timeStep, netlock_arr){\n\t\t\t\n\t\t\ttotal_biomass = reef_fish_arr.model[c_timeStep-1].total_biomass;\n\t\t\ttotal_bioRes = reef_fish_arr.model[c_timeStep-1].biomass_inside;\n\t\t\ttotalBiomass_data.push(total_biomass);\n\t\t\tbiomass_reserve_data.push(total_bioRes);\n\t\t\t//kg to metric tons\n\t\t\ttotal_bioRes = total_bioRes / 1000;\n\t\t\ttotal_biomass = total_biomass / 1000;\n\t\t\t\n\t\t\t// push data to data sets \n\t\t\tif(total_bioRes != 0){\n\t\t\t\treserveBio_perArea = total_bioRes / reserve_area;\n\t\t\t}else{\n\t\t\t\treserveBio_perArea = 0;\n\t\t\t}\n\t\t\treserveBiomass_perArea.push(reserveBio_perArea); \n\t\t\t\n\t\t\ttotal_biomass = total_biomass - total_bioRes;\n\t\t\t\n\t\t\tnon_reserve_bioMass.push(total_biomass);\n\t\t\t\n\t\t\tnonReserve_bioPerArea = total_biomass / reef_fish_area;\n\t\t\tnon_reserve_data_perArea.push(nonReserve_bioPerArea);\n\t\n\t}", "function mostrar_resultados($frames){\n var total_juego = $frames.reduce(($acumulador, $item, $indice, $array) => {\n console.log('FRAME: ' + ($indice + 1) + ($item.es_strike ? ' Strike!' : '') + ($item.es_spare ? ' Spare!' : ''));\n console.log('Frame Total: ' + $item.total + '\\n');\n return $acumulador + $item.total;\n }, 0);\n console.log('\\nTOTAL DEL JUEGO: ' + total_juego);\n}", "function goukei_4_10() {\n var total_c1 = 0;\n var total_c2 = 0;\n var total_c3 = 0;\n var total_c4 = 0;\n if (vm.property.men4_10_5 && vm.property.men4_10_5.length > 0) {\n vm.property.men4_10_5.forEach(function (item) {\n total_c1 += item.c1;\n total_c2 += item.c2;\n total_c3 += item.c3;\n var c4 = item.c2 + item.c3;\n item.c4 = c4;\n total_c4 += c4;\n });\n }\n\n vm.property.men4_10_1 = total_c1;\n vm.property.men4_10_2 = total_c2;\n vm.property.men4_10_3 = total_c3;\n vm.property.men4_10_4 = total_c4;\n }", "function dramaMoviesScore(array) {\n\n \n let dramaArray = array.reduce( (sum, elem) => {\n if (elem.genre.includes('Drama')) {\n return sum + Number( (elem.genre.includes('Drama')))\n }\n }, 0 )\n\n \nlet average = Number( (elem.genre.includes('Drama')))\nreturn average;\n}", "function helper(root)\n{\n var partial = { 'jojoy' : 0, 'reyes' : 0, 'piedad' : 0}\n stack = [root];\n while(stack.length > 0)\n {\n var actual = stack.pop();\n if(actual.match(\"^mesa\")==\"mesa\")\n {\n for( i in totales[actual])\n partial[i] += totales[actual][i]\n }\n else\n for( i in totales[actual])\n stack.push(totales[actual][i]);\n }\n return partial;\n}", "totalFood() {\r\n return this.passengers.map(passenger => passenger.food).reduce((sum, food) => sum + food, 0)\r\n\r\n }", "function studentReport(obj){\n let {m1,m2} =obj;\n let avg = m1+m2/2\n return avg;\n}", "asistenciasTotalesPorDia(equipo){\n let len = equipo.length;\n let asistencia_total = [];\n let total_lunes=0;\n let total_martes=0;\n let total_miercoles=0;\n let total_jueves=0;\n let total_viernes=0;\n let total_sabado=0;\n let total_domingo=0;\n \n for (var i = 0; i <len; ++i) {\n total_lunes = total_lunes + (equipo[i].asistencia.lunes * equipo[i].factor_dias_laborados);\n total_martes = total_martes+ (equipo[i].asistencia.martes * equipo[i].factor_dias_laborados);\n total_miercoles = total_miercoles + (equipo[i].asistencia.miercoles * equipo[i].factor_dias_laborados);\n total_jueves = total_jueves + (equipo[i].asistencia.jueves * equipo[i].factor_dias_laborados);\n total_viernes = total_viernes + (equipo[i].asistencia.viernes * equipo[i].factor_dias_laborados);\n total_sabado = total_sabado + (equipo[i].asistencia.sabado * equipo[i].factor_dias_laborados);\n // total_domingo = total_domingo + (equipo[i].asistencia.domingo * equipo[i].factor_dias_laborados);\n }\n\n asistencia_total.push(total_lunes);\n asistencia_total.push(total_martes);\n asistencia_total.push(total_miercoles);\n asistencia_total.push(total_jueves);\n asistencia_total.push(total_viernes);\n asistencia_total.push(total_sabado);\n // asistencia_total.push(total_domingo);\n\n \n return asistencia_total;\n }", "function question4 () {\n let woodItems = [];\n for (var i = 0; i < data.length; i++) {\n for (var m = 0; m < data[i].materials.length; m++) {\n if(data[i].materials[m] === \"wood\"){\n woodItems.push(data[i].title);\n }\n }\n }\n\n\n // to print out answer without brackets\n for (var i = 0; i < woodItems.length; i++) {\n console.log(woodItems[i] + \" is made of wood.\");\n }\n}", "function getTotals(refs) {\n frefs.reduce(getSum); //Getting the sum of refugees year wise\n console.log(total);\n\n }", "function compileResult(result) {\n var totalStds = 0;\n var subTotalScore = 0;\n angular.forEach(result, function (stdResult, key) {\n var total = 0;\n var mean = 0;\n var noSub = 0;\n var student = new Object();\n\n angular.forEach(stdResult, function (value, key) {\n student[key] = value;\n if (!isNaN(parseInt(value))) {\n total = total + parseInt(value);\n student[key + 'grade'] = computeGrade(parseInt(value));\n //console.log(computeGrade(value)); \n //stdResult.push(\"Grade:\"+grade);\n noSub++;\n }\n }, this);\n student.total = total;\n student.avg = Math.round(total / noSub);\n student.grade = computeGrade(Math.round((total / noSub)));\n $scope.classResults.push(student);\n subTotalScore += total;\n student = new Object(); //Reset the object\n\n //mean=total/noSub; \n //stdResult.push(\"Mean:\"+mean); \n //stdResult.push(\"total:\"+total); \n totalStds++;\n }, this);\n\n function computeGrade(marks) {\n //Dependent on school grading system//Grading system should be passed into this function\n if (marks >= 80) {\n return 'A';\n } else if (marks >= 75 && marks < 80) {\n return 'A-';\n } else if (marks >= 70 && marks < 75) {\n return 'B+';\n } else if (marks >= 65 && marks < 70) {\n return 'B';\n } else if (marks >= 60 && marks < 65) {\n return 'B-';\n } else if (marks >= 55 && marks < 60) {\n return 'C+';\n } else if (marks >= 50 && marks < 55) {\n return 'C';\n } else if (marks >= 45 && marks < 50) {\n return 'C-';\n } else if (marks >= 40 && marks < 45) {\n return 'D+';\n } else if (marks >= 35 && marks < 40) {\n return 'D-';\n } else if (marks >= 30 && marks < 35) {\n return 'D';\n } else if (marks < 30) {\n return 'E';\n }\n }\n\n\n function computeTotals() {}\n\n function computeMean() {}\n\n }", "function getMemberNoForEachParty() {\n var arrayDemocrats = [];\n var arrayRepublicans = [];\n var arrayIndependents = [];\n var myArray = Array.from(arrayMembers);\n\n for (var i = 0; i < myArray.length; i++) {\n if (myArray[i].party === \"D\") {\n arrayDemocrats.push(myArray[i]);\n } else if (myArray[i].party === \"R\") {\n arrayRepublicans.push(myArray[i]);\n } else {\n arrayIndependents.push(myArray[i]);\n }\n }\n\n // append all data to Statistics object\n statistics.members[0].no_representatives = arrayDemocrats.length;\n statistics.members[1].no_representatives = arrayRepublicans.length;\n statistics.members[2].no_representatives = arrayIndependents.length;\n statistics.members[3].no_representatives =\n myArray.length;\n\n // to calculate the avg, call the avg function to do the task and put the approriate array inside parameter \n statistics.members[0].avg_votes = calculateAverage(arrayDemocrats);\n statistics.members[1].avg_votes = calculateAverage(arrayRepublicans);\n statistics.members[2].avg_votes = calculateAverage(arrayIndependents);\n statistics.members[3].avg_votes =\n calculateAverage(myArray);\n}", "function addTotalAndLetterGrades(student, section) {\n\tsection.students[student].totalGrade = getTotalGrade(student, section);\n\tsection.students[student].letterGrade = getLetterGrade(student, section);\n\t\n\tif (section.students[student].totalGrade == -1\n\t || section.students[student].letterGrade == -1)\n\t \treturn false;\n\t// else\n\treturn true;\n}", "function stairsIn20(s) {\n let total = 0\n for (i = 0; i < s.length; i++) {\n let dayCount = 0\n for (j = 0; j < s[i].length; j++) {\n dayCount += s[i][j]\n }\n total += dayCount\n }\n return total * 20\n}", "function thomsOtherInventory() {\n let inventory = thomsCloset[0].length + thomsCloset[1].length + thomsCloset[2].length;\n console.log(inventory);\n}", "function getMalePopulationPerHousehold(household_data)\n{\n let male_household_population = [];\n for (let i = 0; i < household_data.length; i++)\n {\n male_household_population.push(household_data[i].male)\n }\n return male_household_population;\n}", "function prepareIngreToIngreMatrix(data){\n // console.log(data);\n var matrix = {};\n for (var i = 0; i < data.length; i++) {\n var ingredients = data[i].ingredients;\n // console.log(ingredients);\n for (var j = 0; j < ingredients.length; j++) {\n var ingredient = ingredients[j];\n\n // Create a matrix row if the ingredient is not in the matrix\n if (matrix[ingredient] === undefined) {\n matrix[ingredient] = {};\n }\n\n // Find the pairs and counts of that particular ingredient\n for (var k = 0; k < ingredients.length; k++) {\n var ingredient2 = ingredients[k];\n if (matrix[ingredient][ingredient2] === undefined) {\n matrix[ingredient][ingredient2] = 0;\n }\n matrix[ingredient][ingredient2] ++;\n }\n }\n }\n // console.log(matrix);\n return matrix;\n}", "function process (data){\n var positions = [];\n data.forEach (function (a, i) {\n data.forEach (function (b, j) {\n if (a + b === 0) {positions.push (i +\",\"+ j )}\n });\n });\n positions.forEach (function (a){\n console.log (\"You can sum these pairs of numbers and get zero:\" + a);\n // console.log (positions);\n});\n}", "function calculation(value1, value2) {\r\n let totalSum = value1 + value2 + value1*value2;\r\n let totalSum2 = value1 / value2;\r\n return [totalSum, totalSum2];\r\n}//return multiple values, using array", "tableMostLoyalLeastEngaged() {\n function mostArray(array, property) {\n let orderedArrayDos = array.filter(arr => arr[property] > 0)\n .sort((a, b) => {\n if (a[property] > b[property]) {\n return -1\n } else if (a[property] < b[property]) {\n return 1\n }\n return 0\n })\n tenPercent = Math.round(orderedArrayDos.length * 10 / 100)\n\n return orderedArrayDos\n }\n this.statistics.mostLoyal = mostArray(this.members, \"votes_with_party_pct\").slice(0, (tenPercent))\n // los que tienen mas missed votes - los que no votaron mas veces(menos comprometidos)\n this.statistics.leastEngaged = mostArray(this.members, \"missed_votes_pct\").slice(0, (tenPercent))\n\n \n }", "function appleAndOrange(s, t, a, b, apple, orange) {\n // Complete this function\n var apples = 0;\n var oranges = 0;\n for (i = 0; i < apple.length; i++) {\n if (a + apple[i] >= s && a + apple[i] <= t) {\n apples++;\n }\n }\n for (j = 0; j < orange.length; j++) {\n if (b + orange[j] >= s && b + orange[j] <= t) {\n oranges++;\n }\n }\n return [apples, oranges];\n \n}", "function cadastrarUsuario(usuarios, ...novosUsuarios){\n let cadastroTotal = [ //quando passa o spred operator ele junta os dois arrays\n ...usuarios, // se nao passar o SpredOperator => ...XXXX ele nao junta os arrays\n ...novosUsuarios,\n ];\n return console.log(cadastroTotal);\n\n\n}", "function students(total, part) {\n const percentage = d3\n .scaleLinear()\n .domain([0, 100]) // pass in a percent\n .range([0, total]);\n\n return percentage(part);\n }", "function participantsSummary(data) {\n var country = [];\n var check = false;\n var i = 1;\n var JSON = {};\n for (let a = 0; a < data.length; a++) {\n if (country == []) {\n country.push(data[a][i]);\n }\n for (let j = 0; j < country.length; j++) {\n if (data[a][i] == country[j]) {\n check = true;\n }\n }\n\n if (check == false) {\n country.push(data[a][i]);\n }\n\n check = false;\n }\n\n for (let k = 0; k < country.length; k++) {\n JSON[country[k]] = {\n total: getTotal(country[k]),\n names: getNames(country[k])\n };\n }\n\n function getTotal(params) {\n var jml = 0;\n for (let l = 0; l < data.length; l++) {\n if (data[l][1] == params) {\n jml++;\n }\n }\n\n return jml;\n }\n\n function getNames(params) {\n var arrName = [];\n for (let l = 0; l < data.length; l++) {\n if (data[l][1] == params) {\n arrName.push(data[l][0]);\n }\n }\n return arrName\n }\n return JSON;\n}", "function angryProfessor(k, a) {\n //array of present students\n let lateAr = a.map((item) => {\n if(item <= 0) {\n return 1\n } else {\n return 0\n }\n })\n \n \n //number of present students\n let result = lateAr.reduce((a,b) => a+b)\n console.log(lateAr);\n console.log(result);\n \n \n return result < k ? \"YES\" : \"NO\"\n\n}", "function niveau1() {\n\ttable = [\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n\t];\n}", "getValueCount(category, value){\n // ++ gets angry at you if you don't initialize value :v\n let result = [0, 0];\n let categoryNumber = this.getCategoryNumber(category);\n for(let row of mushroom.data){\n if(row[categoryNumber] === value){\n if(row[0] === 'e'){\n result[0]++;\n }\n else{\n result[1]++;\n }\n }\n }\n return result;\n }", "function getAveGymQual() {\n\tvar totalB=0\n\tvar totalb=0\n\tfor (var i=0; i<gymQuant.length; i++) {\n\t\tif (gymQuant[i]===1) {\n\t\t\ttotalb=totalb+1\n\t\t\ttotalB=totalB+gymQual[i]\n\t\t}\n\t}\n\taveGymQual=Math.round((totalB/totalb)*10)/10\n\t$(\"#aveGymQual\").html(aveGymQual)\n}", "function solve(a0, a1, a2, b0, b1, b2){\n let result = [0, 0];\n\n let alice = [a0, a1, a2];\n let bob = [b0, b1, b2];\n\n alice.forEach((aRating, index) => {\n let bRating = bob[index];\n aRating > bRating && result[0]++;\n bRating > aRating && result[1]++;\n })\n\n return result;\n\n}", "function boredom(staff){\n let obj = { accounts : 1,\n finance : 2,\n canteen : 10,\n regulation : 3,\n trading : 6,\n change : 6,\n IS : 8,\n retail : 5,\n cleaning : 4,\n 'pissing about' : 25};\n \n let ans = ['kill me now', 'i can handle this', 'party time!!'];\n let s = Object.values(staff).map(x => obj[x]).reduce((a,b) => a + b, 0);\n return (s <= 80) ? 'kill me now' : (s > 100 ? 'party time!!' : 'i can handle this'); \n \n}", "function updateArrays() {\n diceArray += result + ' ';\n totalArray.push(result);\n}", "function calculate_respondable(values) {\r\n if(isNaN(values.fleschKincaidGradeLevel)) {\r\n return 0;\r\n }\r\n values.gradeLevel = values.fleschKincaidGradeLevel;\r\n return values.questionCount<=.5?values.wordCount<=8.5?values.wordCount<=1.5?values.subjectWordCount<=1.5?.0733218726262:values.wordCount<=.5?values.subjectWordCount<=3.5?.122914695147:values.subjectWordCount<=6.5?.145072640304:.136819773707:.198588629296:values.subjectWordCount<=1.5?.183093642547:values.gradeLevel<=-.5?.233720662678:values.gradeLevel<=6.60000038147?values.wordCount<=5.5?.298683848408:.331874554526:.239006626723:values.subjectWordCount<=8.5?values.wordCount<=27.5?values.gradeLevel<=9.55000019073?values.subjectWordCount<=1.5?.293673297115:values.wordCount<=14.5?.364595175403:.404888696187:values.subjectWordCount<=2.5?.222421363921:values.wordCount<=18.5?.270453843779:.310890101508:values.gradeLevel<=8.35000038147?values.wordCount<=42.5?values.gradeLevel<=6.94999980927?.440158977657:.342750033472:values.subjectWordCount<=5.5?.488104735817:.444063461816:values.gradeLevel<=12.6499996185?values.wordCount<=45.5?.368664498767:.422755603703:values.subjectWordCount<=2.5?.301067569327:.362248185477:values.subjectWordCount<=11.5?values.gradeLevel<=7.55000019073?values.gradeLevel<=5.75?values.wordCount<=27.5?.358084714549:.395812603648:.349450481024:values.wordCount<=51.5?.279985077411:.32959622704:values.wordCount<=45.5?values.gradeLevel<=5.25?.353435874737:.283088917765:values.subjectWordCount<=14.5?.274152329667:.217044023225:values.gradeLevel<=5.25?values.wordCount<=6.5?.420758888124:values.wordCount<=128.5?values.wordCount<=77.5?values.subjectWordCount<=6.5?values.subjectWordCount<=2.5?.67648619614:.709810436737:values.subjectWordCount<=8.5?.677379753211:.650595011842:values.questionCount<=1.5?.614993253257:.678938269094:values.wordCount<=225.5?.594625955588:.536892361111:values.subjectWordCount<=7.5?values.gradeLevel<=15.0500001907?values.wordCount<=217.5?values.gradeLevel<=6.15000009537?values.wordCount<=57.5?.419728703201:.650999617694:values.gradeLevel<=9.94999980927?.643357674014:.570643437792:values.gradeLevel<=8.35000038147?values.questionCount<=2.5?.527971302363:.564875018061:.498302465998:.35612802498:values.subjectWordCount<=11.5?values.wordCount<=219.5?values.wordCount<=57.5?.436006795099:.556456089708:.413799723545:.371808875454;\r\n }" ]
[ "0.54651976", "0.5465191", "0.5415287", "0.5413548", "0.5358031", "0.53241587", "0.531455", "0.53112364", "0.52799904", "0.5251307", "0.52482045", "0.52427524", "0.5212709", "0.516348", "0.51621807", "0.5132255", "0.512879", "0.51266783", "0.51217353", "0.5114977", "0.5110615", "0.5093966", "0.505252", "0.50438017", "0.50395066", "0.5028307", "0.50238156", "0.5013754", "0.49989995", "0.499352", "0.4969211", "0.49685565", "0.49621046", "0.495586", "0.4950154", "0.494684", "0.49453503", "0.4937181", "0.49214664", "0.49202636", "0.4916504", "0.49123034", "0.49114016", "0.49013692", "0.48956287", "0.4885419", "0.48792055", "0.48780358", "0.48771393", "0.48634282", "0.4863379", "0.48556054", "0.48542714", "0.48407105", "0.48385945", "0.48224685", "0.48218387", "0.48213488", "0.48085102", "0.4801255", "0.47987026", "0.4789227", "0.47839552", "0.47749642", "0.47749037", "0.47730398", "0.47724736", "0.4768877", "0.4764119", "0.47621512", "0.47614872", "0.47565985", "0.47519216", "0.4750546", "0.4740624", "0.47394216", "0.47297522", "0.4727398", "0.47207132", "0.47077748", "0.4704453", "0.46986037", "0.46984863", "0.46984807", "0.4698206", "0.46972865", "0.46859932", "0.46842298", "0.46802473", "0.46786904", "0.46752402", "0.46743536", "0.46724588", "0.4667481", "0.46672976", "0.46649835", "0.46619606", "0.46616974", "0.46578833", "0.46568003", "0.46562433" ]
0.0
-1
calling function to show temperature
function C() { $("#farenheit").css("background-color", "grey"); //setting button color $("#celcius").css("background-color","grey"); a="metric"; ab(); show(); //calling main method }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayTemperature(temperature) {\n\tlet returnTemp = temperature\n\tif (!isMetric()) {\n\n\t\t\treturnTemp = temperature * (9 / 5) + 32;\n\t\t// this equation was wrong returnTemp = (temperature - 32) * (5 / 9)\n\t}\n\t//rounding the temp\n\treturn Math.round(returnTemp)\n}", "function showTemperature(response) {\n document.querySelector(\"#city\").innerHTML = response.data.name;\n document.querySelector(\"#currentTemp\").innerHTML = Math.round(\n response.data.main.temp\n );\n}", "function getTemperature() {\n local supplyVoltage = hardware.voltage();\n local voltage = supplyVoltage * Temperature.read() / 65535.0;\n local c = (voltage - 0.5) * 100 ;\n local celsius = format(\"%.01f\", c);\n return(celsius);\n}", "function updateHVACDriverTempDisplay(temp) {\n\t$(\"#environmentData .temperature .value\").text(temp);\n}", "function convertTempToFahrFunc(){\n $(\"#temp\").html(tempInFahrenheit);\n $(\"#convertTemp\").html(\"Convert to Celsius\");\n }", "function displayTemperature(response) {\n // step 5\n let temperature = document.querySelector(\"#temperature\");\n // step 6\n temperature.innerHTML = `${Math.round(response.data.main.temp)}°C`;\n let city = document.querySelector(\"#city\");\n city.innerHTML = response.data.name;\n}", "function getTemperature(tempUnits){\n $.getJSON(api, function(data){\n if (tempUnits ==\"celsius\"){\n var tempSulfix = \"C\";\n var temp = (data.current.temp_c);\n var feelslike = (data.current.feelslike_c);\n }\n else if (tempUnits == \"farenheit\"){\n var tempSulfix = \"F\";\n var temp = (data.current.temp_f);\n var feelslike = (data.current.feelslike_f);\n }\n document.getElementById(\"pTemp\").innerHTML = temp + \"&deg\" + tempSulfix;\n document.getElementById(\"pFeel\").innerHTML = feelslike + \"&deg\" + tempSulfix;\n });\n }", "temp(celsius, fahrenheit)\n\n {\n const cTemp = celsius;\n const cToFahr = cTemp * 9 / 5 + 32;\n console.log(\"Celsius to Fahrenheit:\" + celsius + \"to\" + cToFahr); // (°C × 9/5) + 32 = °F\n const fTemp = fahrenheit;\n const fToCel = (fTemp - 32) * 5 / 9;\n console.log(\"Fahrenheit to Celsius:\" + fahrenheit + \"to\" + celsius);\n\n\n }", "function temperatureConverter(valNum) {\n valNum = parseFloat(valNum);\n document.getElementById(\"outputFahrenheit\").innerHTML=((valNum-273.15)*1.8)+32;\n \n }", "function showTemp(response){\n //console.log(response.data);\n let temperature = Math.round(reponse.data.main.temp);\n let temperatureElement = document.querySelector(\"#temperature\");\n temperatureElement.innerHTML = `${response.data.main.temp}°C`;\n}", "function getTemp(weatherData) {\n var tempKelvin = weatherData;\n // console.log(tempKelvin);\n var degFInt = Math.floor(tempKelvin);\n // console.log(degFInt);\n $temp2.html(degFInt + \"\\u00B0F\");\n}", "function showTemp(response) {\n console.log(response);\n let searchCity = document.querySelector(\"#currentCityName\");\n searchCity.innerHTML = response.data.name;\n\n let temperature = Math.round(response.data.main.temp);\n let temperatureElement = document.querySelector(\"#metricT\");\n temperatureElement.innerHTML = `${temperature}˚C`;\n\n let description = document.querySelector(\"#description\");\n description.innerHTML = response.data.weather[0].description;\n\n let maxTemp = document.querySelector(\"#highTemp\");\n maxTemp.innerHTML = `${Math.round(response.data.main.temp_max)}˚C`;\n\n let minTemp = document.querySelector(\"#lowTemp\");\n minTemp.innerHTML = `${Math.round(response.data.main.temp_min)}˚C`;\n\n let feelsLike = document.querySelector(\"#feelsTemp\");\n feelsLike.innerHTML = `${Math.round(response.data.main.feels_like)}˚C`;\n}", "function showTemperature(response) {\n console.log(response)\n document.querySelector(\"#city\").innerHTML = response.data.name;\n\n let temperature = Math.round(response.data.main.temp);\n \n let temp = document.querySelector(\"#now-temp\");\n temp.innerHTML = temperature;\n \n let highTemp = document.querySelector(\"#high-temp\");\n highTemp.innerHTML = Math.round(response.data.main.temp_max);\n \n let lowTemp = document.querySelector(\"#low-temp\");\n lowTemp.innerHTML = Math.round(response.data.main.temp_min);\n \n let description = document.querySelector(\"#description\");\n description.innerHTML = response.data.weather[0].description;\n \n let wind = document.querySelector(\"#wind\");\n wind.innerHTML = Math.round(response.data.wind.speed * 3.6);\n\n let humidity = document.querySelector(\"#humidity\");\n humidity.innerHTML = Math.round(response.data.main.humidity);\n\n let mainIcon = document.querySelector('#main-weather-icon')\n mainIcon.setAttribute('src', `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`);\n mainIcon.setAttribute('alt', response.data.weather[0].description);\n}", "function showTemp(response) {\n let currentTemp = Math.round(response.data.list[0].main.temp);\n let currentTemperature = document.querySelector(\"#temp\");\n currentTemperature.innerHTML = currentTemp;\n\n let currentHumid = Math.round(response.data.list[0].main.humidity);\n let humidity = document.querySelector(\"#humid\");\n humidity.innerHTML = `${currentHumid}%`;\n\n let currentWind = (response.data.list[0].wind.speed) * 100;\n let windSpeed = document.querySelector(\"#speed\");\n windSpeed.innerHTML = currentWind;\n\n let cityName = response.data.list[0].name;\n let currentCity = document.querySelector(\"#city-name\");\n currentCity.innerHTML = cityName;\n}", "function changeTemp() {\n\t\tvar temperature = Math.round(days[document.getElementById(\"slider\").value].\n\t\t\tquerySelector(\"temperature\").textContent);\n\t\tdocument.getElementById(\"currentTemp\").innerHTML = temperature + \"&#8457\";\t\n\t}", "function showTemp(response) {\n // Identify Celcius Temp\n celciusTemperature = Math.round(response.data.main.temp);\n // Locate Metric\n let currentTemperature = Math.round(celciusTemperature);\n // Identify Element to Change\n let currentTemperatureElement = document.querySelector(\"#temp\");\n // Change Element to Metric\n currentTemperatureElement.innerHTML = `${currentTemperature} °C`;\n // Change Country and City in HTML\n let city = response.data.name;\n let country = response.data.sys.country;\n let locationElement = document.querySelector(\"#searched-city\");\n locationElement.innerHTML = `${city}, ${country}`;\n // Change Weather Details\n document.querySelector(\n \"#humidity\"\n ).innerHTML = ` Humidity: ${response.data.main.humidity}%`;\n document.querySelector(\n \"#wind-speed\"\n ).innerHTML = ` Wind: ${response.data.wind.speed} mph`;\n\n // Change Icon\n let weatherIcon = document.querySelector(\"#current-weather-icon\");\n weatherIcon.innerHTML = `<img src=\"https://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png\" alt=\"weather-icon\">`;\n\n // Change Weather Description\n let weatherDescriptionElement = document.querySelector(\n \"#weather-description\"\n );\n if (currentTemperature <= 0) {\n weatherDescriptionElement.innerHTML =\n \"It's very cold out there. Wrap up warm!\";\n } else if (currentTemperature >= 10 === currentTemperature <= 19) {\n weatherDescriptionElement.innerHTML = \"Maybe put on a jumper.\";\n } else if (currentTemperature > 19) {\n weatherDescriptionElement.innerHTML =\n \"It's a lovely warm day. <br /> Get outside and enjoy it!\";\n }\n\n getForecast(response.data.coord);\n}", "function temperatureConverter(valNum) {\n valNum = parseFloat(valNum);\n document.getElementById(\"outputCelcius\").innerHTML=(valNum-32)/1.8;\n}", "function showFahrenheitTemperature(event) {\n event.preventDefault();\n let temp = document.querySelector(\".degree\");\n let fahrenheitTemperature = (celsiusTemperature * 9) / 5 + 32;\n temp.innerHTML = Math.round(fahrenheitTemperature);\n}", "function stuffTemperature(temp, units) {\n // console.log(\"stuffTemperature:\", temp, units);\n $('#temperature').html(temp.toString() + '&#176; ');\n var unitString = units == 'metric'\n ? 'C'\n : 'F';\n $(\"#units\").html(unitString);\n}", "function showTemp(data){\r\n\tconsole.log(data.temp);\r\n\tCurrentTemp = data.temp;\r\n}", "function printWeather(weather) {\n var temp = (weather.list.main.temp -32)*(5/9);\n var message = \"Current temperature in \" + weather.city.name + \" is \" + temp;\n console.log(message);\n}", "get temperature() {\n return (5 / 9) * (this.fahrenheit - 32);\n }", "function displayTemperature(response) {\n let cityName = response.data.name;\n let cityElement = document.querySelector(\"#city\");\n let dateElement = document.querySelector(\"#day-time\");\n let temperature = Math.round(response.data.main.temp);\n let currentTemp = document.querySelector(\"#degree\");\n let tempDescription = document.querySelector(\"#conditions\");\n let humidity = document.querySelector(\"#humidity-stat\");\n let wind = document.querySelector(\"#wind-stat\");\n let icon = document.querySelector(\"#weather-icon\");\n\n celsiusTemp = response.data.main.temp;\n\n cityElement.innerHTML = `${cityName}`;\n dateElement.innerHTML = formatDate(response.data.dt * 1000);\n currentTemp.innerHTML = `${temperature}`;\n tempDescription.innerHTML = response.data.weather[0].description;\n humidity.innerHTML = response.data.main.humidity;\n wind.innerHTML = Math.round(response.data.wind.speed);\n icon.setAttribute(\"src\", `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`);\n icon.setAttribute(\"alt\", response.data.weather[0].description);\n}", "get temperature() {\n // convertimos los grados F a C\n this.temperature_F = 5 / 9 * (this.temperature_F - 32)\n return this.temperature_F;\n }", "function showTemperature(response) {\n let temperature = Math.round(response.data.main.temp);\n temperatureDisplay.innerHTML = temperature;\n let description = response.data.weather[0].description;\n descriptionDisplay.innerHTML = description;\n let wind = Math.round(response.data.wind.speed);\n windDisplay.innerHTML = `Wind: ${wind}km/h`;\n let humidity = Math.round(response.data.main.humidity);\n humidityDisplay.innerHTML = `Humidity: ${humidity}%`;\n let tempMin = Math.round(response.data.main.temp_min);\n let tempMax = Math.round(response.data.main.temp_max);\n tempRangeDisplay.innerHTML = `${tempMin}℃/${tempMax}℃`;\n console.log(response);\n let cityApi = response.data.name;\n cityDisplay.innerHTML = cityApi;\n}", "function farenheitToCelcius(){\n if (tempUnits == \"celsius\"){\n tempUnits = \"farenheit\";\n document.getElementById(\"buttonFC\").innerHTML = \"Temperature in Celcius\";\n }\n else if (tempUnits == \"farenheit\"){\n tempUnits = \"celsius\";\n document.getElementById(\"buttonFC\").innerHTML = \"Temperature in Farenheit\";\n }\n getTemperature(tempUnits);\n }", "function convertTempToCelsius(){\n $(\"#temp\").html(tempInCelsiusPlusSymbol);\n $(\"#convertTemp\").html(\"Convert to Fahrenheit\");\n }", "function FXweatherPrint (){\n }", "function displayTemperature(response) {\n let cityElement = document.querySelector(\"#city-name\");\n let humid = response.data.main.humidity;\n let humidityElement = document.querySelector(\"#humidity-read\");\n let precipitation = Math.round(response.data.main.temp);\n let precipitationElement = document.querySelector(\"#precip-read\"); \n let wind = Math.round(response.data.wind.speed);\n let windElement = document.querySelector(\"#wind-read\");\n let feel = Math.round(response.data.main.feels_like);\n let feelElement = document.querySelector(\"#feel-read\");\n let temp = Math.round(response.data.main.temp);\n let temperatureElement = document.querySelector(\"#read-out\");\n let description = response.data.weather[0].main;\n let descriptionElement = document.querySelector(\"#describe-read\");\n let dateElement = document.querySelector(\"#current-data\");\n let visualElement = document.querySelector(\"#representation\");\n \n farenheitTemp = response.data.main.temp;\n\n cityElement.innerHTML = response.data.name;\n humidityElement.innerHTML = `Humidity: ${humid}%`;\n precipitationElement.innerHTML = `Precipitation: ${precipitation}%`;\n windElement.innerHTML = `Wind Speed: ${wind} km/h`;\n feelElement.innerHTML = `It feels like ${feel}°F`;\n temperatureElement.innerHTML = `${temp}°F`;\n descriptionElement.innerHTML = `Currently: ${description}`;\n dateElement.innerHTML = formatDate(response.data.dt * 1000)\n visualElement.setAttribute(\n \"src\",\n `https://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n\n getForecast(response.data.coord)\n}", "function temperature(params) {\n var temperature = params[0];\n return Math.floor(temperature) + \"°\";\n }", "function displayTemperature(response) {\n let temperatureElement = document.querySelector(\"#temperature\");\n let cityElement = document.querySelector(\"#city\");\n let descriptionElement = document.querySelector(\"#description\");\n let humidityElement = document.querySelector(\"#humidity\");\n let windElement = document.querySelector(\"#wind\");\n let dateElement = document.querySelector(\"#date\");\n let iconElement = document.querySelector(\"#icon\");\n\n temperatureElement.innerHTML = Math.round(celsiusTemperature);\n cityElement.innerHTML = response.data.name;\n descriptionElement.innerHTML = response.data.weather[0].description;\n humidityElement.innerHTML = response.data.main.humidity;\n windElement.innerHTML = Math.round(response.data.wind.speed);\n dateElement.innerHTML = formatDate(response.data.dt * 1000);\n iconElement.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n iconElement.setAttribute(\"alt\", response.data.weather[0].description);\n\n getForecast(response.data.coord);\n}", "function displayTemp(mainKey, mainValue) {\n if(mainKey == \"temp\") {\n $(\".temp\").html(\"<span id='tempValue'>\" + Math.floor(mainValue + 0.5) + \"</span>&deg;<a id='tempScale' href='#tempScale'>F</a>\");\n fTemp = $(\"#tempValue\").text();\n }\n}", "function showTemp(response){\n //search Temp\n let currentTemp = Math.round(response.data.main.temp);\n let currentCelcius = document.querySelector(\"#degrees\");\n currentCelcius.innerHTML = currentTemp;\n //search Desc\n let descValue = response.data.weather[0].description;\n let currentDesc = document.querySelector(\"#desc\");\n currentDesc.innerHTML = descValue;\n //search Temp Min & Max\n let tempMinValue = Math.round(response.data.main.temp_min);\n let tempMin = document.querySelector(\"#min\");\n tempMin.innerHTML = tempMinValue;\n let tempMaxValue = Math.round(response.data.main.temp_max);\n let tempMax = document.querySelector(\"#max\");\n tempMax.innerHTML = tempMaxValue;\n //change icon\n let iconValue = response.data.weather[0].icon;\n let weatherIcon = document.querySelector(\"#icon\");\n weatherIcon.setAttribute(\"src\", `http://openweathermap.org/img/wn/${iconValue}@2x.png`);\n weatherIcon.setAttribute(\"alt\", response.data.weather[0].description)\n //show info\n //humidity - you asked for precipitation but is not on the API\n let humidityValue = Math.round(response.data.main.humidity);\n let currentHum = document.querySelector(\"#humidity\");\n currentHum.innerHTML = humidityValue;\n //Wind\n let windValue = Math.round(response.data.wind.speed);\n let currentWind = document.querySelector(\"#wind\");\n currentWind.innerHTML = windValue;\n\n celsiusTemp = response.data.main.temp;\n\n getForecast(response.data.coord);\n //Change Background Image\n updateBackgroundImg(iconValue);\n\n}", "function temp_sensor() {\r\n var celsius = temp.value();\r\n var fahrenheit = celsius * 9.0/5.0 + 32.0;\r\n console.log(celsius + \" degrees Celsius, or \" +\r\n Math.round(fahrenheit) + \" degrees Fahrenheit\");\r\n\r\n deviceClient.publish(\"status\",\"json\",'{\"d\" : { \"temperature\" : '+ celsius +'}}');\r\n setTimeout(temp_sensor,1000);\r\n\r\n}", "function formatCelsiusMain(temperature) {\n let mainTemperatureSpace = document.querySelector(\"#temperaturevalue\");\n mainTemperatureSpace.innerHTML = temperature;\n celsiusorfarenheitSpace.innerHTML = \"°C\";\n}", "function displayWeather(){\n \n temperature.innerHTML = `${weather.temperature}°C`;\n loc.innerHTML = `${weather.city}`;\n}", "function drawTemp(obj) {\n let temperature = document.createElement('p');\n let temp = obj.main.temp;\n temp = ((temp - 273.15) * 9 / 5 + 32).toFixed(1);\n temperature.textContent = `Temperature: ${temp} °F`;\n return temperature;\n}", "function formatFarenheitMain(temperature) {\n let temperatureSpace = document.querySelector(\"#temperaturevalue\");\n temperatureSpace.innerHTML = temperature;\n celsiusorfarenheitSpace.innerHTML = \"°F\";\n}", "function showTemperature(response) {\n let sug = document.querySelector(\"#see\");\n sug.innerHTML = response.data.weather[0].description;\n let ptemperature = response.data.main.temp;\n let temperature = Math.round(ptemperature * 1.8 + 32);\n let hum = document.querySelector(\"#humidity\");\n hum.innerHTML = Math.round(response.data.main.humidity) + \"%\";\n let wind = document.querySelector(\"#wind\");\n wind.innerHTML = Math.round(response.data.wind.speed) + \"mph\";\n document.querySelector(\"#degree\").innerHTML = `${temperature} °C`;\n let lon = response.data.coord.lon;\n let lat = response.data.coord.lat;\n \n let apiUrl = `https://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${lon}&exclude=hourly,minutely&appid=${apiKey}&units=metric`\n axios.get(apiUrl).then(showForecast);\n console.log(apiUrl);\n}", "function toggleTemp() {\n var t1 = 0;\n var suffix = \"Z\";\n if (showTempInCflag_ == 1) {\n t1 = KtoC(tempK_);\n showTempInCflag_ = 0;\n suffix = \"C\";\n }\n else {\n t1 = KtoF(tempK_);\n showTempInCflag_ = 1;\n suffix = \"F\";\n }\n document.getElementById(\"temperature\").innerHTML = t1.toFixed(2) + suffix;\n return t1;\n}", "function fahrenheit(){\n var tempfar=(celsius*9/5)+32\n console.log('La temperatura en grados fahrenheit es: ')\n console.log(tempfar +' °F')\n}", "function chg_temp(temp){\n \n if (temp == \"celsius\"){\n \n document.getElementById(\"curr_temp\").innerHTML = \"<small>Current temperature: </small>\" + \"<b>\" + data.main.temp +\"</b>\"+ \"<b> C </b>\";\n document.getElementById(\"hi_temp\").innerHTML = \"<small>Expected High: </small>\" + \"<b>\" + data.main.temp_max + \"</b>\" + \" <b> C </b>\";\n document.getElementById(\"low_temp\").innerHTML = \"<small>Expected Low: </small>\" + \"<b>\" + data.main.temp_min + \" </b>\" + \"<b>C </b>\";\n btn.innerHTML = \"Press for Farenheit\";\n temp = \"farenheit\";\n }\n else{\n\n var curr_temp_faren = parseFloat((data.main.temp * 1.8) + 32).toFixed(2);\n var hi_temp_faren = parseFloat((data.main.temp_max * 1.8) + 32).toFixed(2);\n var low_temp_faren = parseFloat((data.main.temp_min * 1.8) + 32).toFixed(2);\n\n document.getElementById(\"curr_temp\").innerHTML = \"<small>Current temperature: </small>\" + \"<b>\" + curr_temp_faren +\"</b>\"+ \"<b> F </b>\";\n document.getElementById(\"hi_temp\").innerHTML = \"<small>Expected High: </small>\" + \"<b>\" + hi_temp_faren + \"</b>\" + \" <b> F </b>\";\n document.getElementById(\"low_temp\").innerHTML = \"<small>Expected Low: </small>\" + \"<b>\" + low_temp_faren + \" </b>\" + \"<b>F </b>\";\n btn.innerHTML = \"Press for celsius\"\n temp = \"celsius\";\n }\n}", "function drawVandenbergWeather(d) {\n var celcius = Math.round(parseFloat(d.main.temp)-273.15);\n\n document.getElementById('description1').innerHTML = d.weather[0].description;\n document.getElementById('temp1').innerHTML = celcius + '&deg;';\n document.getElementById('location1').innerHTML = d.name;\n}", "function displayTemperature(response) {\n let cityElement = document.querySelector(\"#Location\");\n let tempElement = document.querySelector(\"#todayTemp\");\n let describElement = document.querySelector(\"#description\");\n let humidElement = document.querySelector(\"#humid\");\n let windElement = document.querySelector(\"#wind\");\n let dateElement = document.querySelector(\"#date\");\n let iconElement = document.querySelector(\"#icon\");\n cityElement.innerHTML = response.data.name;\n tempElement.innerHTML = Math.round(response.data.main.temp);\n describElement.innerHTML = response.data.weather[0].description;\n humidElement.innerHTML = response.data.main.humidity;\n windElement.innerHTML = Math.round(response.data.wind.speed);\n dateElement.innerHTML = formateDate(response.data.dt * 1000);\n iconElement.setAttribute(\n \"src\",\n `https://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n\n iconElement.setAttribute(\"alt\", response.data.weather[0].description);\n}", "function getTemperatureHumidity(){\n\t$.ajax({\n\t\turl: ipURL+'/HouseTempHumid',\n\t\ttype: 'GET',\n\t\tcache: false,\n\t\theaders: {\n\t\t\t\"Authorization\": serviceAuth\n\t\t},\n\t\tsuccess:function(data){\n\t\t\ttemperatura = data.temperature;\n\t\t\tif(temperatura <= 0 || temperatura >=60){\n\t\t\t\ttemperatura = '-';\n\t\t\t}\n\t\t\t$(\"#TemperatureContainer\").text(temperatura+\" ºC\")\n\t\t\t\n\t\t},\n\t\terror:function(data){\n\t\t\t$(\"#TemperatureContainer\").text(\"? ºC\")\n\t\t\tconsole.log(\"Erro na leitura de temperatura e humidade\")\n\t\t}\n\t})\n}", "function displayWeather(temp){\n document.getElementById('result-id').innerHTML = temp;\n}", "function convertTemperature (temp) {\n if ($(\".celsius\").is(\":checked\")) {\n return ((temp - 32) * (5/9)).toFixed(0) + \"°C\";\n } else {\n return (temp.toFixed(0) + \"F\");\n }\n }", "function convertTemp(){\n //Calculate the temperature here\n fah = parseFloat(document.getElementById(\"f-input\").value);\n console.log(fah);\n let cel = (fah-32)*5/9;\n //Send the calculated temperature to HTML\n document.getElementById(\"c-output\").innerText = cel;\n}", "function changeUnitsF(event) {\n let fahrenheit = document.querySelector(\".currentTemp\");\n fahrenheit.innerHTML = `${Math.round(temperature * 9) / 5 + 32}˚F`;\n}", "status() {\n let phrase = \n 'The current temperature is ' +\n this.root.innerHTML.trim();\n\n if( this.display == Thermometer.FAHRENHEIT ) {\n phrase = phrase + ' fahrenheit.';\n } else {\n phrase = phrase + ' celcius.';\n }\n\n return phrase;\n }", "function show(data){ \n return `<h3 class='temp'> The Weather in ${location} is Currently ${data.main.temp} C°</h3>`;\n }", "function showTemperature(response) {\n celsuisTemp = Math.round(response.data.main.temp);\n let apiLocation = response.data.name;\n let cityPlaceholder = document.querySelector(\".location\");\n cityPlaceholder.innerHTML = `${apiLocation}`;\n let temperaturePlaceholder = document.querySelector(\".temperature\");\n temperaturePlaceholder.innerHTML = `${celsuisTemp}°C`;\n let description = response.data.weather[0].main;\n let descriptionPlaceholder = document.querySelector(\".weatherDescription\");\n descriptionPlaceholder.innerHTML = `${description}`;\n let humidity = response.data.main.humidity;\n let humuidityPlaceholder = document.querySelector(\".humidityValue\");\n humuidityPlaceholder.innerHTML = `Humidity: ${humidity}%`;\n let windSpeed = response.data.wind.speed;\n let windPlaceholder = document.querySelector(\".windSpeed\");\n windPlaceholder.innerHTML = `Wind Speed: ${windSpeed}m/s`;\n fahrenheitLink.classList.remove(\"active\");\n celsiusLink.classList.add(\"active\");\n let iconToday = document.querySelector(\".weather-icon\");\n iconToday.setAttribute(\"class\", showIcon(response.data.weather[0].icon));\n}", "function showTemperature(response) {\n let temperatureElement = document.querySelector(\".current-temperature\");\n let cityElement = document.querySelector(\".current-city\");\n let descriptionElement = document.querySelector(\".description\");\n let minimumTemperature = document.querySelector(\".min-temp\");\n let maximumTemperature = document.querySelector(\".max-temp\");\n let humidityElement = document.querySelector(\".humidity-percent\");\n let windElement = document.querySelector(\".wind-speed\");\n let currentEmoji = document.querySelector(\".currentemoji\");\n let img = document.querySelector(\"#artwork\");\n let textElement = document.querySelector(\"#cartel\");\n\n celsiusTemperature = response.data.main.temp;\n\n let emojiElement = response.data.weather[0].icon;\n if (emojiElement === \"01d\" || emojiElement === \"01n\") {\n currentEmoji.innerHTML = \"☀️\";\n img.setAttribute(\"src\", \"img/tarsila-doamaral.jpg\");\n textElement.innerHTML = `<div> Tarsila do Amaral, <i>Abaporu</i>, 1928 </br>© Tarsila do Amaral </div>`;\n }\n\n if (emojiElement === \"02d\" || emojiElement === \"02n\") {\n currentEmoji.innerHTML = \"🌤\";\n img.setAttribute(\"src\", \"img/swynnerton-landscape.jpg\");\n textElement.innerHTML = `<div>Annie Louisa Swynnerton, <i>Italian Landscape</i>, 1920 </br>© Manchester Art Gallery </div>`;\n }\n\n if (emojiElement === \"03d\" || emojiElement === \"03n\") {\n currentEmoji.innerHTML = \"🌥\";\n img.setAttribute(\"src\", \"img/etel-adnan.jpg\");\n textElement.innerHTML = `<div>Etel Adnan, <i>Untitled</i>, 2010</br>© Rémi Villaggi / Mudam Luxembourg</div>`;\n }\n\n if (emojiElement === \"04d\" || emojiElement === \"04n\") {\n currentEmoji.innerHTML = \" ☁️\";\n img.setAttribute(\"src\", \"img/georgia-okeefe-clouds.jpg\");\n textElement.innerHTML = `<div> Georgia O’Keeffe, <i>Sky Above Clouds IV</i>, 1965</div>`;\n }\n if (emojiElement === \"09d\" || emojiElement === \"09n\") {\n currentEmoji.innerHTML = \"🌧\";\n img.setAttribute(\"src\", \"img/vangogh-rain.jpg\");\n textElement.innerHTML = `<div>Vincent Van Gogh, <i>Auvers in the Rain</i>, 1890</div>`;\n }\n if (emojiElement === \"10d\" || emojiElement === \"10n\") {\n currentEmoji.innerHTML = \"🌦\";\n img.setAttribute(\"src\", \"img/munch-lecri.jpg\");\n textElement.innerHTML = `<div>Edvard Munch, <i>Le Cri</i>, 1893 </br>© National Gallery of Norway</div>`;\n }\n if (emojiElement === \"11d\" || emojiElement === \"11n\") {\n currentEmoji.innerHTML = \"🌩\";\n img.setAttribute(\"src\", \"img/william-turner.jpg\");\n textElement.innerHTML = `<div>William Turner, <i>Fishermen at Sea</i>, 1796</div>`;\n }\n if (emojiElement === \"13d\" || emojiElement === \"13n\") {\n currentEmoji.innerHTML = \"❄️\";\n img.setAttribute(\"src\", \"img/monet-snow.jpg\");\n textElement.innerHTML = `<div>Claude Monet, <i>Wheatstacks, Snow Effect, Morning</i>, 1891</div>`;\n }\n if (emojiElement === \"50d\" || emojiElement === \"50n\") {\n currentEmoji.innerHTML = \"🌫\";\n img.setAttribute(\"src\", \"img/friedrich-seafog.jpg\");\n textElement.innerHTML = `<div>Caspar David Friedrich, </br><i>Wanderer above the Sea of Fog</i>, 1818</div>`;\n }\n\n let parisTemperature = Math.round(celsiusTemperature);\n temperatureElement.innerHTML = `• ${parisTemperature}°C`;\n cityElement.innerHTML = response.data.name;\n descriptionElement.innerHTML = response.data.weather[0].description;\n minimumTemperature.innerHTML = Math.round(response.data.main.temp_min) + \"°C\";\n maximumTemperature.innerHTML = Math.round(response.data.main.temp_max) + \"°C\";\n humidityElement.innerHTML = response.data.main.humidity + \"%\";\n windElement.innerHTML = Math.round(response.data.wind.speed) + \" km/h\";\n\n getForecast(response.data.coord);\n}", "function displayWeather(data) {\n nyWeather = f2k(data.main.temp);\n // debugger\n $('p.NY-Weather').text(`The weather in New York is ${nyWeather} F`);\n}", "function convertTemp(temperature, type) {\n if (temperature > 0){\n console.log((temperature - 32) * 5/9 + type);\n} else {\n console.log((temperature * 9/5) + 32 + type);\n}\n}", "function showTemperature(response) {\n //Select HTML parts, which have to be substitute with the api data:\n let temp = document.querySelector(\".degree\");\n let hum = document.querySelector(\"#local-humidity\");\n let wind = document.querySelector(\"#local-wind\");\n let weatherDescription = document.querySelector(\"#weather-description\");\n let bigWeatherIcon = document.querySelector(\"#big-icon\");\n let cityName = document.querySelector(\"#city-name\");\n\n celsiusTemperature = response.data.main.temp; //you don't need \"let\" because it is already defined in 4.1.1\n\n //Select data from the apiUrl:\n let temperature = Math.round(celsiusTemperature);\n let humidity = response.data.main.humidity;\n let windSpeed = response.data.wind.speed;\n let weatherDescr = response.data.weather[0].description;\n let iconSource = response.data.weather[0].icon;\n let currentCityName = response.data.name;\n console.log(currentCityName);\n\n temp.innerHTML = `${temperature}`;\n hum.innerHTML = `${humidity}`;\n wind.innerHTML = `${windSpeed}`;\n cityName.innerHTML = `${currentCityName}`;\n weatherDescription.innerHTML = `${weatherDescr}`;\n bigWeatherIcon.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${iconSource}@2x.png`\n );\n}", "function showWeather() {\n document.getElementById(\"summary\").innerHTML = summary;\n document.getElementById(\"temp\").innerHTML = `Temperature ${tempF} F`;\n document.getElementById(\"tempConvert\").classList.add(\"fahrenheit\");\n document.getElementById(\"humidT\").innerHTML = `Humidity: ${humidT.toFixed(0)}%`\n document.getElementById(\"windS\").innerHTML = `Wind Speed: ${windS} mi/h`\n skycons.set(\"icon\", icon)\n skycons.play();\n document.getElementById(\"tempConvert\").classList.remove(\"hidden\")\n}", "function convertTemp(){\n //Calculate the temperature here\n temp = (parseInt(field.value) - 32)*(5/9);\n //Send the calculated temperature to HTML\n document.getElementById(\"c-output\").innerHTML = temp;\n}", "function showWeather() {\ngiveCity()\npreForecast()\nfutureFore() \n}", "function show(data) {\n // DATE\n document.getElementById('date').innerHTML = data.forecast.forecastday[0].date\n\n // TIME\n let time = (data.location.localtime).split('')\n document.getElementById('temperature-time').innerHTML = 'Updated' + ' ' + (time.slice(11,25).join(''))\n\n // DELHI\n document.getElementById('delhiTemp').innerHTML = data.current.temp_c\n document.getElementById('temperature-comment').innerHTML = data.current.condition.text\n\n // VISIBILITY\n document.getElementById('precipitation-value').innerHTML = (data.current.vis_km) + ' ' + 'km'\n document.getElementById('wind-value').innerHTML = (data.current.wind_kph) + ' ' + 'kph'\n document.getElementById('humidity-value').innerHTML = (data.current.humidity) + ' ' + '%'\n document.getElementById('pressure-value').innerHTML = (data.current.pressure_mb) + ' ' + 'mb'\n \n console.log(data)\n }", "function getTemp(temp, id){\n const tempDiv = document.getElementById('temp');\n tempDiv.innerHTML = `${convertTo(temp)}&deg;F <i class=\"owf owf-${id}\"></i>`;\n}", "function displayT() {\n\n\t\t\t// Get the f value in select with ID t-value\n\t\t\tvar t = $( \"#t-value\" ).val();\n\n\t\t\t// Print in p with ID t\n\t\t\tif (t < 1) {\n\n\t\t\t\t// If t is less than 1sec print fraction\n\t\t\t\t$( \"#t\" ).html( \"Time 1/\" + Math.round(1/t) );\n\n\t\t\t} else if ( t >= 1 && t < 120 ) {\n\n\t\t\t\t// Else if t is between 1sec and 120sec print sec \"\n\t\t\t\t$( \"#t\" ).html( \"Time \" + t + '\"' );\n\t\t\t} else {\n\n\t\t\t\t// Else print min '\n\t\t\t\t$( \"#t\" ).html( \"Time \" + t/60 + \"'\" );\n\t\t\t};\n\n\t\t\t// Calculate the Aperture Value\n\t\t\t// AV = EV - TV\n\t\t\t// Aperture Value = Exposure value - Time Value\n\t\t\t// If t is not defined\t\t\t\n\t\t\tif ( !f ) {\n\n\t\t\t\t// Var tv redifine with new value\n\t\t\t\ttv = Math.log2(1/t);\n\n\t\t\t\t// Var f for f value\n\t\t\t\tvar f = Math.sqrt( Math.pow(2, ev - tv) );\n\t\t\t\t\n\t\t\t\t// This switch case is to set the right parameter\n\t\t\t\tswitch(true) {\n\t\t\t\t\tcase f < 0.96:\n\t\t\t\t\t\tf = null;\n\t\t\t\t\t\t$( \"#f-value\" ).val( f );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase f >= 0.96 && f < 1.2:\n\t\t\t\t\t\tf = 1.0;\n\t\t\t\t\t\t$( \"#f-value\" ).val( f + '.0' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase f >= 1.2 && f < 1.9:\n\t\t\t\t\t\tf = 1.4;\n\t\t\t\t\t\t$( \"#f-value\" ).val( f );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase f >= 1.9 && f < 2.5:\n\t\t\t\t\t\tf = 2.0;\n\t\t\t\t\t\t$( \"#f-value\" ).val( f + '.0' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase f >= 2.5 && f < 3.5:\n\t\t\t\t\t\tf = 2.8;\n\t\t\t\t\t\t$( \"#f-value\" ).val( f );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase f >= 3.5 && f < 5:\n\t\t\t\t\t\tf = 4.0;\n\t\t\t\t\t\t$( \"#f-value\" ).val( f + '.0' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase f >= 5 && f < 6.5:\n\t\t\t\t\t\tf = 5.6;\n\t\t\t\t\t\t$( \"#f-value\" ).val( f );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase f >= 6.5 && f < 10:\n\t\t\t\t\t\tf = 8.0;\n\t\t\t\t\t\t$( \"#f-value\" ).val( f + '.0' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase f >= 10 && f < 13:\n\t\t\t\t\t\tf = 11;\n\t\t\t\t\t\t$( \"#f-value\" ).val( f );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase f >= 13 && f < 19:\n\t\t\t\t\t\tf = 16;\n\t\t\t\t\t\t$( \"#f-value\" ).val( f );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase f >= 19 && f < 27:\n\t\t\t\t\t\tf = 22;\n\t\t\t\t\t\t$( \"#f-value\" ).val( f );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase f >= 27 && f < 38.5:\n\t\t\t\t\t\tf = 32;\n\t\t\t\t\t\t$( \"#f-value\" ).val( f );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase f >= 38.5 && f < 54.5:\n\t\t\t\t\t\tf = 45;\n\t\t\t\t\t\t$( \"#f-value\" ).val( f );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase f >= 54.5:\n\t\t\t\t\t\tf = 64;\n\t\t\t\t\t\t$( \"#f-value\" ).val( f );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase f > 70:\n\t\t\t\t\t\tf = null;\n\t\t\t\t\t\t$( \"#f-value\" ).val( f );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tnull;\n\t\t\t\t}\n\n\t\t\t\t// Print f value in p with ID f\n\t\t\t\t$( \"#f\" ).html( \"f \" + f );\n\t\t\t\t// $( \"#f-value\" ).val(f + '.0');\n\t\t\t\t// if ( f >= 0.96 || f <= 70 ) {\n\t\t\t\t// \t$( \"#f-value\" ).css('background-color', 'red');\n\t\t\t\t// };\n\n\t\t\t};\n\t\t}", "function weatherInfo() {\n $.ajax({\n url: \"http://api.openweathermap.org/data/2.5/weather?id=\" + weatherID + \"&APPID=ef9e7e6d82e6945b2f61368cb1d538c7\",\n type: \"GET\",\n dataType: \"jsonp\",\n success: function(responseData) {\n var tempData = responseData.main.temp,\n temp;\n\n if (measurements === metric) {\n temp = parseInt(tempData - 273.15);\n } else {\n temp = parseInt(1.8 * (tempData - 273) + 32);\n }\n\n document.getElementById('temp').innerHTML = temp + '&deg;' + tempUnit;\n\n beachLatCoord = responseData.coord.lat;\n beachLonCoord = responseData.coord.lon;\n\n sunInfo();\n mapOptions();\n }, //end success\n error: function(err) {\n console.log(\"ERR\", err);\n }\n });\n}", "function showTempo() {\n utils.each(trackers, function (t, index, key) {\n elements.labels[key].innerText = t.bpm; //tempo.msToBPM(item);\n });\n }", "function getTemp(celsius, bool){\n var temp;\n if(bool == true){\n temp = celsius*1.8 + 32;\n }else{\n temp = celsius;\n }\n return temp.toFixed(1);\n }", "function drawKennedyWeather(d) {\n var celcius = Math.round(parseFloat(d.main.temp)-273.15);\n\n document.getElementById('description2').innerHTML = d.weather[0].description;\n document.getElementById('temp2').innerHTML = celcius + '&deg;';\n document.getElementById('location2').innerHTML = d.name;\n}", "function displayWeather() {\n locationElement.innerHTML = `${weather.city}, ${weather.country}`; // City/Country name\n iconElement.innerHTML = `<img src=\"icons/${weather.iconId}.png\"/>`; // Icon\n tempElement.innerHTML = `${weather.temperature.value}°<span>F</span>`; // Temp\n descElement.innerHTML = `${weather.description}`; // Short description\n descElementDaily.innerHTML = dailyDescription(); // Daily description\n sunRiseElement.innerHTML = `<span class=\"lightText\">Sunrise</span> <br>${weather.sunrise} AM`; // Sunrise\n sunSetElement.innerHTML = `<span class=\"lightText\">Sunset</span> <br>${weather.sunset} PM`; // Sunset\n windElement.innerHTML = `<span class=\"lightText\">Wind</span> <br>${weather.wind} mph`; // Wind speed\n gustElement.innerHTML = `<span class=\"lightText\">Gust</span> <br>${weather.gust} mph`; // Gust speed\n feelsLikeElement.innerHTML = `<span class=\"lightText\">Feels-like</span> <br>${weather.feels_like} °F`; // Feels-like\n humidityElement.innerHTML = `<span class=\"lightText\">Humidity</span> <br>${weather.humidity}%`; // Humidity \n tempMinElement.innerHTML = `<span class=\"lightText\">Min-temp</span> <br>${weather.temp_min} °F`; // Temp_min\n tempMaxElement.innerHTML = `<span class=\"lightText\">Max-temp</span> <br>${weather.temp_max} °F`; // Temp_max\n}", "static async updateTemp() { \n\t\tlet weatherData = await Weather.getWeather();\n document.querySelector(\".wind-dir\").innerHTML = `${weatherData[0].wind_deg} <sup>o</sup>`;\n document.querySelector(\".wind-speed\").innerText = `${weatherData[0].wind_speed} km/h`;\n\t\tlet forecasts = Array.from(forecastContents);\n\t\tforecasts.forEach(item => {\n\t\t\tlet temp = Math.round(weatherData[forecasts.indexOf(item)].temp.day);\n\t\t\titem.querySelector(\".degree-num\").innerText = `${temp}`;\t\t\n\t\t})\n\t}", "function getCurrentWeatherData (){\n //need to find way to get city name and date\n //convert from kelvin to fahrenheit. Remove decimals\n var temperature = Math.floor(((data.current.temp)-273) * 1.8 + 32);\n var humidity =data.current.humidity;\n var windSpeed =data.current.wind_speed;\n var uvIndex = data.current.uvi;\n \n $(\"#temp\").append(temperature + \"*F\");\n $(\"#humidity\").append(humidity + \"%\");\n $(\"#wind\").append(windSpeed + \"mph\");\n $('#uv-index').append(uvIndex)\n}", "function showTemp(response) {\n //obj destructuring\n console.log(response.data);\n const {\n coord: { lat, lon },\n dt,\n main: { temp, temp_min, temp_max, feels_like, humidity },\n name,\n wind: { speed },\n } = response.data;\n\n const { main, description, icon } = response.data.weather[0];\n\n //formate time from value given in response mill secs\n formatDate(dt * 1000);\n\n place.innerHTML = name || city.value;\n cityTemp.textContent = `${temp} ℃`;\n tempDesc.textContent = description;\n\n tempDesc.textContent =\n tempDesc.innerHTML.charAt(0).toUpperCase() + tempDesc.innerHTML.slice(1);\n tempMaxMin.textContent = `${Math.round(temp_min)}℃/${Math.round(\n temp_max\n )}℃ `;\n tempRealFeel.textContent = `Feels Like: ${feels_like}℃`;\n humidityNow.textContent = ` Humidity: ${humidity}% `;\n windSpeedElem.textContent = ` Wind: ${speed} km/h`;\n\n let tempIcon = icon;\n let iconURL = `http://openweathermap.org/img/wn/${tempIcon}@2x.png`;\n //setting def value\n weatherImgElem.setAttribute(\"src\", iconURL);\n weatherImgElem.setAttribute(\"alt\", description);\n\n weatherImgIlus[main] &&\n weatherImgElem.setAttribute(\"src\", weatherImgIlus[main]);\n\n //to display the hourly forecast\n let forecastUrl = `https://api.openweathermap.org/data/2.5/forecast?q=${name}&units=metric&appid=${apiKey}`;\n\n //display hourly(3) weather;\n axios.get(forecastUrl).then(showForeCast);\n\n //get daily wether\n getDailyWeather(lat, lon);\n\n //get hourly forecast\n // getHourlyWeather(lat, lon);\n}", "function kelvin(){\n var tempkelvin=celsius+273.15\n console.log('La temperatura en grados kelvin es: ')\n console.log(tempkelvin +' °K')\n}", "function getTemperature() {\n try {\n var weatherJson = storage.readJSON('weather.json');\n var weather = weatherJson.weather;\n return \"Temp: \" + Math.round(weather.temp - 273.15);\n } catch (ex) {\n return \"\";\n }\n}", "function displayWeather(lat,lon){\n\n var currentUrl = api+lat+'&'+lon;\n\n $.ajax({\n url: currentUrl,\n // url: 'https://freegeoip.net/json/' // alternative url API (NOT USED - future growth)\n datatype: 'jsonp',\n\n success: function(data) {\n\n console.log(data);\n var celsiusTemprature = data.main.temp\n var fahrenheitTemprature = cToF(celsiusTemprature);\n var $weatherDescription = data.weather[0].description;\n\n $('#location').append(data.name + '<br>' + data.sys.country);\n $('#weatherIcon').append('<img src='+ data.weather[0].icon + ' alt=' +\"'\" +$weatherDescription+\"'\" +'>' );\n\n $('#temprature').append(data.main.temp+ '\\xB0C ');\n $('#weatherDescription').append($weatherDescription.toUpperCase());\n\n // show Farenheit function upon click showFarenheit button\n $('#showFarenheit').click(function(){\n $('#temprature').replaceWith( '<span id=\"temprature\">' + fahrenheitTemprature + ' \\xB0F' + '</span>' );\n });\n\n // show Celsius function upon click showCelsius button\n $('#showCelsius').click(function(){\n $('#temprature').replaceWith( '<span id=\"temprature\">' + celsiusTemprature +' \\xB0C' + '</span>' );\n });\n\n }// END success: function(data)\n\n }); // END ajax GET\n\n }", "function farenheitCelsius() {\n const fah = 10;\n const cel = ((fah - 32) * (5/9));\n console.log(cel);\n }", "function temperature() {\n var roll = dice.d(20);\n // Its a normal day\n if (roll < 15) {\n return 90 + dice.d(9);\n }\n // extreme heat\n if (roll > 17) {\n return 100 + dice.d(10);\n }\n // random heavy cold front\n if (roll > 14 && roll < 18) {\n return 95 - (dice.d(4) * 10);\n }\n}", "function farenheitCelsius(temp) {\n return temp - 32 * 5 / 9\n }", "function convertTemp() {\n //Calculate the temperature here\n const Ftemp = finput.value;\n const Ctemp = Math.round((Ftemp - 32 )/9*5)\n //Send the calculated temperature to HTML\n document.getElementById(\"c-output\").innerHTML=Ctemp\n}", "function getTemperature (event) {\n // read variables from the event\n let ev = JSON.parse(event.data);\n let evData = ev.data; // the data from the argon event: \"pressed\" or \"released\"\n let evDeviceId = ev.coreid; // the device id\n let evTimestamp = Date.parse(ev.published_at); // the timestamp of the event\n let alrtDevice = 0;\n\n // helper variables that we need to build the message to be sent to the clients\n let message = \"Verbindung zu deinem smarten Brandmelder ist aktiv.\";\n var floatValue = parseFloat(evData);\n var correctednewTempValue = ((floatValue - 4)*10)/10;\n let difference = correctednewTempValue-correctedoldTempValue;\n correctedoldTempValue = correctednewTempValue;\n let newTempValue = correctednewTempValue;\n if( difference > 0.5 ){\n alrtDevice = 1;\n }\n else{\n alrtDevice = 0;\n }\n // send data to all connected clients\n sendData(\"temperature\", newTempValue, message, evDeviceId, evTimestamp, alrtDevice);\n}", "function switchTempUnit() {\r\n temperatureF = (temperatureC * 9 / 5 + 32).toFixed(2);\r\n var whatTemp = $(\"#tempUnit\").html();\r\n var whatTempCode = whatTemp.charCodeAt(0);\r\n $(\"#temp-display\").html(temperatureF);\r\n //If temperature is in celsius\r\n if (whatTempCode === 8451) {\r\n $(\"#temp-switch\").html('Switch to Celsius');\r\n $(\"#tempUnit\").html('&#8457');\r\n $(\"#temp-display\").html(temperatureF);\r\n tempUnit = '&#8457';\r\n tempType = 'imperial';\r\n } else {\r\n $(\"#temp-switch\").html('Switch to Farenheit');\r\n $(\"#tempUnit\").html('&#8451');\r\n $(\"#temp-display\").html(temperatureC);\r\n tempUnit = '&#8451';\r\n tempType = 'metric';\r\n }\r\n }", "function currentWeather(data) {\r\n document.getElementById(\"currentweathervalue\").innerHTML = `${Math.round(data.main.temp)}&deg;`;\r\n document.getElementById(\"hightempvalue\").innerHTML = `${Math.round(data.main.temp_max)}&deg;`;\r\n document.getElementById(\"lowtempvalue\").innerHTML= `${Math.round(data.main.temp_min)}&deg`;\r\n document.getElementById(\"humidityvalue\").innerHTML= `${data.main.humidity}%`;\r\n document.getElementById(\"windvalue\").innerHTML= `${Math.round(data.wind.speed)} MPH`;\r\n document.getElementById(\"currentstatus\").innerHTML= `${data.weather[0].main}`\r\n document.getElementById(\"weathericon\").src= `http://openweathermap.org/img/wn/${data.weather[0].icon}@2x.png`\r\n}", "function getWeather () {\n $.ajax({\n url: weatherUrl+city+\",\"+country+\"&appid=\"+apiKey,\n success:function(res){\n temp = res.main.temp;\n function convert(){\n convertedTemp = temp * 9 / 5 - 459.67;\n // errorAlert.innerText = \"Here is the weather you desire:\" + convertedTemp;\n }\n convert();\n if (country === \"\") {\n errorAlert.innerText = \"Please fill in the correct fields\";\n } else {\n errorAlert.innerText = \"Here is the weather you desire:\" + convertedTemp;\n }\n },\n error:function(err){\n console.log(\"something went wrong\");\n }\n })\n }", "function temper(){\n if(units === \"metric\"){\n units = \"imperial\";\n //insted of transforming C to F, we tell jquery to load again the URL\n $.ajax({\n url:\"http://api.openweathermap.org/data/2.5/weather?lat=\"+lat+ \"&lon=\"+lon+\"&units=\"+units+\"&APPID=5aaea9d5abf322d7da2ae0b00f58c945\",\n type: \"GET\",\n success: function(data){\n $(\".temp\").html(Math.ceil(data.main.temp)+\"ºF\");\n $(\"button\").html(\"To Celcius\");\n }\n })\n }\n\n else {\n units = \"metric\";\n $.ajax({\n url:\"http://api.openweathermap.org/data/2.5/weather?lat=\"+lat+ \"&lon=\"+lon+\"&units=\"+units+\"&APPID=5aaea9d5abf322d7da2ae0b00f58c945\",\n type: \"GET\",\n success: function(data){\n $(\".temp\").html(Math.ceil(data.main.temp)+\"ºC\");\n $(\"button\").html(\"To Farenheit\");\n }\n })\n }\n }", "formatTemp(temp) {\n return `${(temp - 273.15).toFixed(0)} °C`;\n }", "function changeToF() {\n\t\t// get numbers from temperature div\n\t\tvar currTempC = $('#temperature').text().match(/\\d+/),\n\t\t\ttempF = (currTempC * 1.8) + 32,\n\t\t\tupdateTemp = document.getElementById('temperature');\n\n\t\t//console.log(tempF);\n\t\t// Round temperature to 0 decimal places\n\t\ttempF = Number(tempF).toFixed(0);\n\t\t// Print temp in Fahrenheit\n\t\tupdateTemp.innerHTML = '<p>' + tempF + '&#176;F</p>';\n\t}", "function displayWeather() {\n currentLocation.innerHTML = `<h2>Welcome to ${currentWeather.city}, ${currentWeather.country}</h2>`;\n tempValue.innerHTML = `<p>Current Temperature: ${currentWeather.temperature.value} °${currentWeather.temperature.unit}</p>`;\n tempDescText.innerHTML = `<p>Current Weather: ${currentWeather.tempDescText}</p>`;\n if (currentLandmarkCode == undefined) { // for current location\n sunriseTime.innerHTML = `<p>Sunrise: ${currentWeather.sunrise.toLocaleString(dateFormat, timeFormatCurrent)}</p>`;\n sunsetTime.innerHTML = `<p>Sunset: ${currentWeather.sunset.toLocaleString(dateFormat, timeFormatCurrent)}</p>`;\n currentDateTime.innerHTML = `<p>Current Date: ${currentWeather.time.toLocaleString(dateFormat, timeDateFormatCurrent)}</p>`;\n }\n else { // for landmark location\n sunriseTime.innerHTML = `<p>Sunrise: ${currentWeather.sunrise.toLocaleString(dateFormat, timeFormat)}</p>`;\n sunsetTime.innerHTML = `<p>Sunset: ${currentWeather.sunset.toLocaleString(dateFormat, timeFormat)}</p>`;\n currentDateTime.innerHTML = `<p>Current Date: ${currentWeather.time.toLocaleString(dateFormat, timeDateFormat)}</p>`;\n }\n}", "function showWeather(location) {\n $.simpleWeather({\n location: location,\n unit: 'f',\n success: function(weather) {\n\n // Set variables with local data...\n loc = weather.city+\", \"+weather.region+\" \"+weather.country;\n tempF = weather.temp+'&deg;'+weather.units.temp;\n currently = weather.currently;\n\n $(\"#temp\").html(tempF);\n $(\"#location\").text(loc);\n $(\"#currently\").text(currently);\n $(\"#latlon\").text(location);\n\n },\n error: function(error) {\n $(\"#location\").html('<p>'+error+'</p>');\n }\n });\n}", "function formatTemperature(kelvin) {\n \n \n var clicked = false;\n var fahr = ((kelvin * 9 / 5) - 459.67).toFixed(0);\n var cels = (kelvin - 273.15).toFixed(1);\n //initial temperature display\n $tempText.html(fahr);\n\n var firstClick = false;\n //click handler to update the temperature unit of measurement.\n $tempMode.off(\"click\").on(\"click\", function() {\n firstClick = true;\n console.log(clicked);\n clicked === false ? clicked = true : clicked = false;\n clicked === true ? $tempMode.html(\"C&deg\") : $tempMode.html(\"F&deg\");\n if (clicked) {\n $tempText.html(cels);\n } else\n $tempText.html(fahr);\n });\n\n if (cels > 24) {\n $(\"#temp-text\").css(\"color\", \"red\");\n } else if (cels < 18) {\n $(\"#temp-text\").css(\"color\", \"blue\");\n }\n }", "function tempCall(tempUnit) {\n let s = \"\";\n if (tempUnit == 0) {\n CurrentTempHigh.innerHTML =\n \"High: \" + celToFar(prev_weather.soles[0].max_temp) + \"&deg; F\";\n CurrentTempLow.innerHTML =\n \"Low: \" + celToFar(prev_weather.soles[0].min_temp) + \"&deg; F\";\n\n for (let i = 0; i < 7; i++) {\n s += `<div class=\"card\"> \n <h1>Sol ${prev_weather.soles[i].sol}</h1> \n <h3>${dateconvert(prev_weather.soles[i].terrestrial_date)}</h3>\n <h4>High: ${celToFar(prev_weather.soles[i].max_temp)}&deg;F</h4> \n <h4>Low: ${celToFar(\n prev_weather.soles[i].min_temp\n )}&deg;F</h4> <button> More Info </button> </div>`;\n }\n cards.innerHTML = s;\n } else {\n CurrentTempHigh.innerHTML =\n \"High: \" + prev_weather.soles[0].max_temp + \"&deg; C\";\n CurrentTempLow.innerHTML =\n \"Low: \" + prev_weather.soles[0].min_temp + \"&deg; C\";\n for (let i = 0; i < 7; i++) {\n s += `<div class=\"card\"> \n <h1>Sol ${prev_weather.soles[i].sol}</h1> \n <h3>${dateconvert(prev_weather.soles[i].terrestrial_date)}</h3>\n <h4>High: ${prev_weather.soles[i].max_temp}&deg;C</h4> \n <h4>Low: ${\n prev_weather.soles[i].min_temp\n }&deg;C</h4> <button> More Info </button> </div>`;\n }\n cards.innerHTML = s;\n }\n}", "function temperature_change(){\n a_FAO_i='temperature_change';\n initializing_change();\n change();\n}", "function displayWeather() {\r\n\tvar theMessage = \"\";\r\n\ttheMessage += \"Right now in \" + theCurrentCity + \" it's \" + Math.round(theCurrentTemp, \"p\") + \" degrees \" + weatherCodeToText(theWeatherCategory, \"p\");\r\n\t\r\n\ttheMessage += \". \";\r\n\t\r\n\ttheMessage += \"Later today the high is expected to be \" + maxTemp + \" \" + weatherCodeToText(futureWeather, \"f\") + \". \";\r\n\treturn theMessage;\r\n}", "function toggleTemps(){\n\n if (temperatureUnit.textContent === \"F\"){\n \n temperatureUnit.textContent = \"C\";\n temperatureDegree.textContent = celsius.toFixed(1);\n \n } else {\n \n temperatureUnit.textContent = \"F\";\n temperatureDegree.textContent = temperature\n }\n }", "function displayForecast(times) {\n ++count;\n var temp = times[i].main.temp;\n $('.temp' + j).text(temp);\n\n var current = times[i].weather[0].description;\n $('.info' + j + ' h3').text(current);\n\n var wind = times[i].wind.speed;\n $('.info' + j + ' .wind span[data-wind]').text(wind);\n\n var humidity = times[i].main.humidity;\n $('.info' + j + ' span[data-humidity]').text(humidity);\n\n var weatherIconId = times[i].weather[0].icon;\n var weatherURL = \"http://openweathermap.org/img/w/\" +\n weatherIconId + \".png\";\n\n var weatherImg = \"<img src='\" + weatherURL + \"' class='icon-img'>\";\n $('.icon' + j).html(weatherImg);\n\n j++;\n }", "function showWeather(response) {\n let temperature = Math.round(response.data.main.temp);\n let weather = document.querySelector(\"#tempDisplay\");\n weather.innerHTML = `${temperature}°C`;\n let mainCity = document.querySelector(\"h1\");\n mainCity.innerHTML = response.data.name;\n}", "function displayCelsiusTemperature(event) {\n event.preventDefault();\n\n celsiusLink.classList.add(\"active\");\n fahrenheitLink.classList.remove(\"active\");\n let tempElement = document.querySelector(\"#degree\");\n tempElement.innerHTML = Math.round(celsiusTemp);\n}", "function printOutput({ temperature: t, city, iconId, country, description }) {\n //some code\n weatherIcon.innerHTML = `\n <img src=\"icons/${iconId}.png\" alt=\"\">\n `;\n temperature.innerHTML = `\n <p>${t.value}°<span>C</span></p>\n `;\n tD.innerHTML = `\n <p>${description}</p>\n `\n locationElement.innerHTML = `\n <p>${city}, ${country}</p>\n `\n}", "function displayCelsiusTemperature(event) {\n event.preventDefault();\n celsiusLink.classList.add(\"active\");\n fahrenheitLink.classList.remove(\"active\");\n let temperatureElement = document.querySelector(\"#temperature\");\n temperatureElement.innerHTML = Math.round(celsiusTemperature);\n}", "async function measureTemperature() {\n try {\n const temperature = await bme680.temperatureSensor.read();\n console.log(`Temperature (degrees C): ${temperature}`);\n } catch(err) {\n console.error(`Failed to measure temperature: ${err}`);\n }\n}", "function ftcclick(){\r\n //define the number\r\n let F = Number(document.getElementById('tif').value);\r\n \r\n //creat the formula\r\n let answerf = 'Temperature in Celsius:' + (F- 32) * 5/9 \r\n\r\n //output\r\n document.getElementById('result').innerHTML = answerf;\r\n}", "function showTemp(currentCity, temp) {\n const tempH2 = document.createElement(\"h2\");\n tempH2.innerText = `Current Temperture in ${currentCity}: ${temp}`;\n tempH2.setAttribute(\"id\", \"tempH2\");\n document.body.appendChild(tempH2);\n }", "function showGeoInfo(){\n $('#location').html(geo.city);\n $('#day').html(geo.day);\n $('#weather').html(geo.weather);\n $('#weather-icon').attr('src',geo.weather_icon);\n $('#precip').html(geo.precip + '&#37;');\n $('#humidity').html(geo.humidity + '&#37;');\n \n isFahren(true);\n \n //timestamp//\n $('#update').html(geo.update);\n }", "function temperature() {\n let temperature1 = document.querySelector('#temperature1').value;\n let temperature2 = document.querySelector('#temperature2').value;\n let number1 = document.querySelector('#number1').value;\n let number2 = document.querySelector('#number2').value;\n let temp1 = document.querySelector('#temp1');\n let temp2 = document.querySelector('#temp2');\n if ((temperature1 === 'celsius') && number2 !== '' && number1 !== ''){\n temp1.innerHTML = ' &deg;C';\n switch (temperature2) {\n case 'celsius':\n document.querySelector('#number2').value = number1;\n temp2.innerHTML = ' &deg;C';\n break;\n case 'fahrenheit':\n document.querySelector('#number2').value = ((parseFloat(number1) * 9 / 5) + 32).toFixed(document.querySelector('#empty').innerHTML);\n temp2.innerHTML = ' &deg;F';\n break;\n case 'kelvin':\n document.querySelector('#number2').value = ((parseFloat(number1) + 273.15)).toFixed(document.querySelector('#empty').innerHTML);\n temp2.innerHTML = ' K';\n break;\n default:\n temp2.innerHTML = '';\n temp1.innerHTML = '';\n document.querySelector('#number2').value = 1;\n document.querySelector('#number1').value = 1;\n break;\n }\n }\n if ((temperature1 === 'fahrenheit') && number2 !== '' && number1 !== ''){\n temp1.innerHTML = ' &deg;F';\n switch (temperature2) {\n case 'celsius':\n document.querySelector('#number2').value = ((parseFloat(number1) - 32)* 5 / 9).toFixed(document.querySelector('#empty').innerHTML);\n temp2.innerHTML = ' &deg;C';\n break;\n case 'fahrenheit':\n document.querySelector('#number2').value = number1;\n temp2.innerHTML = ' &deg;F';\n break;\n case 'kelvin':\n document.querySelector('#number2').value = ((parseFloat(number1) - 32) * 5/9 + 273.15).toFixed(document.querySelector('#empty').innerHTML);\n temp2.innerHTML = ' K';\n break;\n default:\n temp2.innerHTML = '';\n temp1.innerHTML = '';\n document.querySelector('#number2').value = 1;\n document.querySelector('#number1').value = 1;\n break;\n }\n }\n if ((temperature1 === 'kelvin') && number2 !== '' && number1 !== ''){\n temp1.innerHTML = ' K';\n switch (temperature2) {\n case 'celsius':\n document.querySelector('#number2').value = (parseFloat(number1) - 273.15).toFixed(document.querySelector('#empty').innerHTML);\n temp2.innerHTML = ' &deg;C';\n break;\n case 'fahrenheit':\n document.querySelector('#number2').value = ((parseFloat(number1) - 273.15) * 9/5 + 32).toFixed(document.querySelector('#empty').innerHTML);\n temp2.innerHTML = ' &deg;F';\n break;\n case 'kelvin':\n document.querySelector('#number2').value = number1;\n temp2.innerHTML = ' K';\n break;\n default:\n temp2.innerHTML = '';\n temp1.innerHTML = '';\n document.querySelector('#number2').value = 1;\n document.querySelector('#number1').value = 1;\n break;\n }\n }\n if ((temperature1 === '')){\n temp2.innerHTML = '';\n temp1.innerHTML = '';\n document.querySelector('#number2').value = 1;\n document.querySelector('#number1').value = 1;\n }\n if ((temperature2 === '')){\n temp2.innerHTML = '';\n temp1.innerHTML = '';\n document.querySelector('#number2').value = 1;\n document.querySelector('#number1').value = 1;\n}\n\n\n}" ]
[ "0.7343239", "0.7270051", "0.72476256", "0.72159004", "0.71925384", "0.7174653", "0.7172118", "0.7091579", "0.7050322", "0.7041601", "0.6974273", "0.6969376", "0.6955603", "0.6938071", "0.6935195", "0.69336414", "0.6929843", "0.69291514", "0.6902335", "0.6894778", "0.6883336", "0.68692446", "0.6838168", "0.68355846", "0.683525", "0.68231", "0.68228865", "0.6818305", "0.68144184", "0.6795325", "0.6748849", "0.6733894", "0.6697778", "0.6691027", "0.66780084", "0.66749984", "0.66697377", "0.6669004", "0.6665268", "0.6646886", "0.6625377", "0.66198057", "0.659095", "0.6563951", "0.65603423", "0.6546046", "0.6544717", "0.6539194", "0.6528089", "0.6527649", "0.6519121", "0.6517541", "0.65142184", "0.6513118", "0.65033007", "0.64882857", "0.64700395", "0.64651513", "0.64512664", "0.64392245", "0.64350647", "0.6431959", "0.64299935", "0.64294094", "0.64291865", "0.6421887", "0.64068437", "0.6397685", "0.63976413", "0.6391416", "0.63808376", "0.63703495", "0.6357629", "0.6350557", "0.6350096", "0.6345715", "0.6345684", "0.63408136", "0.6332541", "0.6329798", "0.63244134", "0.631247", "0.6312351", "0.63076377", "0.6304052", "0.6303013", "0.6283418", "0.6279099", "0.6274041", "0.62720054", "0.62599605", "0.6251009", "0.6250151", "0.6249511", "0.62440974", "0.62308407", "0.6207342", "0.62045217", "0.620397", "0.6195372", "0.61925226" ]
0.0
-1
Fetch all users stored
getUsers() { this.showLoader(600); axios .get(`users-list${this.request.toString()}`, { params: { page: this.page } }) .then(response => { this.users = response.data.data; this.pagination = { total: response.data.total, per_page: response.data.per_page, current_page: response.data.current_page }; }) .finally(() => this.hideLoader()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "allUsers() {\r\n this.log(`Getting list of users...`);\r\n return this.context\r\n .retrieve(`\r\n SELECT emailAddress, password\r\n FROM Users\r\n `\r\n )\r\n }", "function findAllUsers() {\n return fetch(self.url).then(response => response.json())\n }", "function fetchAllUsers() {\n return fetch(`${SERVER_URL}/users`, {\n headers: {\n Authorization: `Bearer ${userToken}`,\n },\n })\n .then(response => response.json())\n .then(data => setAllUsers(data))\n }", "function getUsers() {\n User.query(function(data){\n return self.all = data.users;\n });\n }", "allUsers() { return queryAllUsers() }", "function findAllUsers() {\n return fetch('https://wbdv-generic-server.herokuapp.com/api/alkhalifas/users')\n .then(response => response.json())\n }", "function get_users(){\n\tconst q = datastore.createQuery(USER);\n\treturn datastore.runQuery(q).then( (entities) => {\n\t\t\treturn entities[0].map(ds.fromDatastore);\n\t\t});\n}", "static async getAll() {\n\t\tconst usersRes = await db.query(`SELECT * FROM users ORDER BY username`);\n\t\treturn usersRes.rows;\n\t}", "function get_users(){\n var q = datastore.createQuery(USERS);\n\n return datastore.runQuery(q).then( (entities) => {\n return entities;\n });\n}", "static async getAll() {\n return await user_model.find({});\n }", "async list() {\n\t\treturn this.store.User.findAll()\n\t}", "function getAllUsers(){\n return UserService.getAllUsers();\n }", "async function getUsers() {\n const allUsers = await User.findAll();\n return allUsers.map((user) => user.get({ plain: true }));\n}", "function getAllUsers() {\n return Users.find({});\n}", "async getAllUsers() {\n return User.findAll();\n }", "function fetchAllUsers() {\n var deferred = $q.defer();\n $http.get(REST_SERVICE_URI)\n .then(\n function (response) {\n deferred.resolve(response.data);\n },\n function(errResponse){\n console.error('Error while fetching Users');\n deferred.reject(errResponse);\n }\n );\n return deferred.promise;\n }", "function findAllUsers() {\n userService\n .findAllUsers()\n .then(renderUsers);\n }", "function get_users(){\n var q = datastore.createQuery(USER);\n return datastore.runQuery(q).then( (entities) => {\n return entities[0];\n });\n}", "function getUsers() {\n return db(\"users\").select(\"users.*\");\n}", "fetchAllUsers() {\n let account = JSON.parse(localStorage.getItem(\"cachedAccount\")).id;\n let url = (\"./admin/admin_getusers.php?allusers=\" + account);\n\n\t\t\tfetch(url)\n\t\t\t.then(res => res.json())\n\t\t\t.then(data => {\n\t\t\t\tthis.userList = data;\n\t\t\t})\n\t\t\t.catch((err) => console.error(err));\n }", "function getallusers() {\n\n\t}", "function listUsers (req, res) {\n promiseResponse(userStore.find({}), res);\n}", "static async getAllUsers() {\n try {\n logger.info('[user]: listing all users');\n const userList = await UserService.findAllUsers();\n\n return userList;\n } catch (e) {\n throw new InternalServerException();\n }\n }", "function getUsers() {\r\n apiService.getEntity('users')\r\n .then(function (response) {\r\n vm.users = response.data;\r\n notifyService.success('Users loaded.');\r\n }, function (error) {\r\n vm.message = 'Unable to load data: ' + error.message;\r\n });\r\n }", "static async findAllUsers() {\n const userList = await User.find({});\n return userList;\n }", "function findAllUsers(callback) {\n \treturn fetch(this.url)\n .then(function(response) {\n return response.json();\n });\n }", "function getUsers() {\n\n intakeTaskAgeDatalayer.getUsersInFirm()\n .then(function (response) {\n self.allUser = response.data;\n }, function (error) {\n notificationService.error('Users not loaded');\n });\n }", "async getUsers() {\n let userResult = await this.request(\"users\");\n return userResult.users;\n }", "async getUsers(){\n let users = await db.query('SELECT id, name, email FROM users');\n\n return users;\n }", "static async getAll() {\n let result = await db.query(\n `SELECT username, first_name, last_name, email FROM users`\n );\n return result.rows;\n }", "getAllUsers() {\n return Api.get(\"/admin/user-list\");\n }", "retrieveUsers() {\n\n this.__updateToken__()\n return fetch(`${this.url}/users`, {\n\n headers: {\n authorization: `Bearer ${this.__userToken__}`\n }\n })\n .then(response => response.json())\n .then(response => {\n if (response.error) throw Error(response.error)\n\n return response\n })\n }", "function getAllUsers() {\n return User.find();\n}", "function findAllUsers(){//https://developers.google.com/web/ilt/pwa/working-with-the-fetch-api\n return fetch(this.url).then(function(res){\n if( !(res.ok) ){\n throw Error(res.statusText)\n }\n return res\n }).then(function(response){\n return response.json()\n }).catch(function(error){alert(\"error try refresh\")})\n }", "async getAllUsers(){\n data = {\n URI: `${ACCOUNTS}`,\n method: 'GET'\n }\n return await this.sendRequest(data)\n }", "static getAllUsers() {\n return fetch('https://dev-selfiegram.consumertrack.com/users').then(response => {\n return response.json();\n }).catch(error => {\n return error;\n });\n }", "function getUsers(){\n\t\t\tgetUsersService.getUserList().then(function(data){\n\t\t\t\tlc.listOfUser = data;\n\t\t\t})\n\t\t\t.catch(function(message){\n\t\t\t\texception.catcher('getUserList Service cannot succeed')(message);\n\t\t\t});\n\t\t}", "function getAllUsers() {\n return User.find({}).select({username: \"test\", email: \"test@gmail.com\", whitelisted: true});\n}", "function getUsers() {\n return db('users')\n .select('id', 'username')\n}", "function getAllUsers() {\n var allUsers = User.find(function (err, users) {\n if (err) return handleError(err);\n return users\n })\n return allUsers\n}", "getAllUsers() {\n return dbConnection.sync().then(() => {\n return User.findAll().then((users) => {\n //** Check for users records in db, if no usres recored return err message */\n if (users.length == 0) {\n return Promise.reject(\"No users in db yet!\")\n }\n console.log(`All users, num of users: ${users.length} => ${users}`);\n return Promise.resolve(users);\n });\n });\n }", "static async getUsers (token) {\n const query = `*[_type == 'user'] {\n name,\n _id\n }\n `\n client.config({ token })\n return client.fetch(query)\n }", "async function getUsers() {\n let serverResponse = await userService.getUsers();\n if (serverResponse.status === 200) {\n setUsers(serverResponse.data);\n };\n }", "static getUsers() {\n return API.fetcher(\"/user\");\n }", "async function getAllUsers() {\n try {\n const { rows: userIds } = await client.query(`\n SELECT id\n FROM users;\n `);\n\n const users = Promise.all(userIds.map((user) => getUserById(user.id)));\n\n return users;\n } catch (error) {\n throw error;\n }\n}", "async AllUsers(p, a, { app: { secret, cookieName }, req, postgres, authUtil }, i) {\n const getUsersQ = {\n text: 'SELECT * FROM schemaName.users'\n }\n\n const getUsersR = await postgres.query(getUsers)\n\n return getUsersR.rows\n }", "function getUsers() {\n\treturn fetch(userURL).then((resp) => resp.json())\n}", "async retrieveUsers(){cov_1m9telhrda.f[14]++;const _users=(cov_1m9telhrda.s[163]++,await User.find({}));const users=(cov_1m9telhrda.s[164]++,_users.map(user=>{cov_1m9telhrda.f[15]++;cov_1m9telhrda.s[165]++;return{name:user.name,id:user._id,email:user.email};}));cov_1m9telhrda.s[166]++;return users;}", "async getUsers() {\n let res = await fetch('/users', {credentials: 'include', headers: {'Content-Type': 'application/json'}})\n let v = await res.json()\n return v\n }", "static async getUsers() {\n return await this.request('users/', 'get');\n }", "function getAllUsers() {\n let todoUsersDB = storage.getItem('P1_todoUsersDB');\n\n if (todoUsersDB) { return JSON.parse(todoUsersDB); }\n else { return []; }\n }", "static async getAllUsers() {\n try {\n //establish connection with db server\n const [ db, client ] = await getConnection();\n\n //retrieve CURSOR OBJECT containing pointers to all users from database\n const result = await db.collection('users').find({});\n\n //get object array from cursor\n const resultArray = await result.toArray();\n\n //if no users, throw 404\n if (!resultArray.length) throw new ExpressError('There are no users in the database', 404);\n\n //close database connection\n client.close();\n\n //return array\n return resultArray;\n } catch(err) {\n //throw express error\n if (client) client.close();\n throw new ExpressError(err.message, err.status || 500);\n }\n }", "async findAll() {\n const users = await fetch(\n \"https://run.mocky.io/v3/f7f2db83-197c-4941-be3e-fffd2ad31d26\"\n )\n .then((r) => r.json())\n .then((data) => {\n const list = [];\n data.map((row) => {\n let user = new User();\n user.id = row.id;\n user.fullName = row.name;\n user.email = row.email;\n user.avatar = row.avatar;\n list.push(user);\n });\n\n return list;\n });\n\n return users;\n }", "function getAllUsers(callback) {\n requester.get('user', '', 'kinvey')\n .then(callback)\n}", "function getUsers() {\n fetch(userUrl)\n .then((res) => res.json())\n .then((users) => {\n sortUsers(users);\n displayLeaderBoard();\n })\n .catch((error) => console.error(\"ERROR:\", error));\n }", "async readAllUsers() {\n try {\n wlogger.silly(\"Enteried cassandra-db/readUser()\")\n\n await this.client.connect()\n\n const data = await this.client.execute(`\n SELECT * FROM users\n `)\n\n //console.log(`users: ${JSON.stringify(data.rows, null, 2)}`)\n return data.rows\n } catch (err) {\n wlogger.error(`Error in cassandra-db/readAllUsers()`, err)\n throw err\n }\n }", "fetchUsers() {\n\t\treturn fetch(\"http://127.0.0.1:4120/v0/notify/cf/users\", {\n\t\t\tmethod: \"GET\",\n\t\t})\n\t\t\t.then(response => {\n\t\t\t\treturn response.json();\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\tconsole.error(err);\n\t\t\t});\n\t}", "async getAllUsers() {\r\n\r\n const userCollection = await usersList();\r\n const listOfUsers = await userCollection.find().toArray();\r\n\r\n\r\n allusers = [];\r\n oneUser = {};\r\n\r\n //NM - Corrected spelling of orientation, added email and contact_info attributes\r\n for (var val of listOfUsers) {\r\n oneUser = {};\r\n oneUser._id = val._id;\r\n oneUser.user_id = val.user_id;\r\n oneUser.name = val.name;\r\n oneUser.hashedPassword = val.hashedPassword;\r\n oneUser.dob = val.dob;\r\n oneUser.gender = val.gender;\r\n oneUser.activity = val.activity;\r\n oneUser.location = val.location;\r\n oneUser.occupation = val.occupation;\r\n oneUser.email = val.email;\r\n oneUser.weight = val.weight;\r\n oneUser.activity = val.activity;\r\n allusers.push(oneUser);\r\n }\r\n\r\n return allusers;\r\n }", "function getAllUsers (req, res, next) {\n db.any('SELECT * FROM \"user\";')\n .then((users) => {\n res.rows = users;\n next();\n })\n .catch(err => next(err));\n}", "function getUsers(db){\n return db('users')\n .select('*')\n}", "function getAllUsers() {\n\treturn JSON.parse(localStorage.getItem('users')); \n}", "async function queryAllUsers(){\n return await user.findAll();\n}", "async function findAllUsers() {\n console.log(\"reached finallusers\");\n try {\n const response = await fetch(USER_URL);\n console.log(\"findAllUsers: \" + response);\n return response.json();\n } catch(err) {\n console.log(err);\n console.log(err.message);\n }\n}", "function getUsers (db = connection) {\n return db('users').select()\n}", "function getUsers() {\n return userService.getUsers().then(function (data) {\n vm.users = data;\n return vm.users;\n })\n }", "function fetchUsers () {\n return knex('users')\n .select('id', 'firstName', 'lastName', 'email')\n .then(function (data) {\n return data\n })\n .catch(console.error)\n}", "async function getUsers() {\n const response = await api.get(`/users/?_sort=id&_order=desc`);\n\n if (response.data) {\n setCompletedListUsers(response.data);\n setListUsers(response.data);\n refreshCountPages(response.data);\n }\n }", "function getAllUsers() {\n var getUser = partial(getValue, relationsCache);\n return map(getUser, Object.keys(relationsCache));\n}", "getUsers(callback) {\n let getUsers = `select * from user`;\n\n this._db.all(getUsers, function(err,resolve) {\n callback(err,resolve);\n })\n }", "async function getExistingUsers() {\n let result = []\n let apiData = await fetch(\n 'http://localhost:8080/user',\n {method: 'get'}\n )\n apiData = await apiData.json()\n if (apiData.success) {\n let users = apiData.data\n users.forEach(function(user) {\n if (user.deleted == 0) {\n result.push(user)\n }\n })\n }\n\n return result\n}", "getAllUserData() {\n\n return new Promise((resolve, reject) => {\n var client = redis.createClient();\n \n client.hgetall('users', (err, users) => {\n client.quit();\n\n if (err) {\n return reject({ status: 500, error: err });\n } \n \n // Return no content status and no users found message if no users exist\n if (!users) {\n return resolve({ status: 200, userData: {} });\n }\n\n // Otherwise parse all users into json and remove private fields before returning\n for (let id in users) {\n users[id] = JSON.parse(users[id]);\n delete users[id].password;\n }\n \n return resolve({ status: 200, userData: users }); \n });\n });\n }", "static getUsers() {\n const req = new Request('/api/users/', {\n method : 'GET',\n headers : this.requestHeaders()\n });\n return fetch(req).then(res => this.parseResponse(res))\n .catch(err => {\n throw err;\n });\n }", "function findAllUsers(req, res, next){\r\n connection.query('SELECT * FROM Usuarios', function (error, results){\r\n if(error) throw error;\r\n res.send(200, results);\r\n return next();\r\n });\r\n}", "function getUsers(cb) {\n const users = app.get('users');\n\n // Return a copy of the data\n const foundUsers = users.map(function(user) {\n return Object.assign({}, user);\n });\n\n debug(`#getUsers: found users: ${JSON.stringify(foundUsers, 0, 2)}`);\n return cb(null, foundUsers);\n}", "function findAll () {\n return UserModel.findAll()\n }", "function getUsers(res, mysql, context, complete) {\n mysql.pool.query(\"SELECT * FROM users\", (error, results, fields) => {\n if (error) {\n res.write(JSON.stringify(error));\n res.end();\n }\n context.users = results;\n complete();\n });\n }", "function getUsers() {\n let ourQuery = 'SELECT employeeID, name FROM QAA.user_TB';\n return makeConnection.mysqlQueryExecution(ourQuery, mySqlConfig);\n}", "function precargarUsers() {\n fetch(`${baseUrl}/${groupID}/${collectionID}`, {\n 'method': 'GET'\n }).then(res => {\n return res.json();\n }).then(json => {\n if (json.status === 'OK') {\n mostrarDatos(json.usuarios);\n };\n }); //agregar catch\n }", "findAll(req, res) {\n UserModel.find()\n .then((users) => res.status(200).send(users))\n .catch((err) => res.status(500).send(err));\n }", "function getAllUsers(req, res) {\n User.find((err, users) => {\n if (err) {\n res.status(500).send(\"No se pudo traer los usuarios\");\n } else {\n res.status(200).send(users);\n }\n });\n}", "async function getAllUsers() {\n const aUsers = await throwIf(\n User.findAll({ raw: true }).then(users => {\n return users;\n }),\n {\n type: ERROR_TYPES.DB_ERROR,\n msg: \"Unable to fetch list of users\"\n }\n );\n\n return aUsers;\n}", "function getUsers() {\n return getItem('users');\n}", "async GetAllUsers(req, res) {\n //returns all users in array\n await User.find({})\n .populate('posts.postId')\n .populate('chatList.receiverId')\n .populate('chatList.msgId')\n .populate('notifications.senderId')\n .then(result => {\n res.status(httpStatus.OK).json({ message: 'All users', result });\n })\n .catch(err => {\n res.status(httpStatus.INTERNAL_SERVER_ERROR).json({ message: 'Error occured when getting all users' });\n });\n }", "static getAllUsers(req, res) {\n userService.getAllUsers(db, function (returnvalue) {\n res.status(200).send(returnvalue);\n })\n\n }", "getAllUsers() {\r\n return this.users;\r\n }", "async function getUsers(req, res) {\n let users = await User.find({});\n res.json({\n status: \"success\",\n users: users\n });\n}", "static getAllUsers(req, res){\n User.find((err, users) => {\n if (err) return res.json({ success: false, error: err });\n return res.json({ success: true, data: users });\n });\n }", "getAll(req, res, next) {\n userModel.all().then(\n users => {\n res.data = {\n ...res.data,\n users,\n }\n next()\n }\n )\n }", "function getUsers() {\n subscribeService.getUsersContent()\n .then(function(data) {\n vm.data = data.slice(0, vm.data.length + 3);\n });\n }", "function getUsers(res, mysql, context, complete){\n mysql.pool.query(\"SELECT `first_name`, `username`, `user_id` FROM Users\", function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.users = results;\n complete();\n });\n}", "function retrieve_all_users(){\n\tlet params = {\n\t\t\t\t method: \"GET\",\n\t\t\t\t url: \"/api/admin/all/\"\n \t\t\t\t}\n\t$.ajax(params).done(function(data) {\n\t\tvar allUsers = '<div style=\"border:1px solid black\"><h3>All users</h3><table><tr><th>Username</th>'+\n\t\t'<th>First Name</th><th>Last Name</th><th>e-mail</th><th>Account Type</th><th>Last Login</th></tr>';\n\t\tconsole.log(data[\"users\"].length);\n\t\tfor(i=0;i<data[\"users\"].length;i++){\n\t\t\tallUsers += \"<tr><th>\"+data[\"users\"][i].username+\"</th><th>\"+\n\t\t\tdata[\"users\"][i].firstName+\"</th><th>\"+data[\"users\"][i].lastName+\n\t\t\t\"</th><th>\"+data[\"users\"][i].email+\"</th><th>\"+data[\"users\"][i].userType+\n\t\t\t\"</th><th>\"+data[\"users\"][i].lastLogin+\"</th></tr>\";\n\t\t}\n\t\tallUsers+= \"</table>\";\n\t\t$(\"#allUsers\").html(allUsers);\n\t});\n}", "async getUsers (req, res) {\n try {\n const usersData = await UserDB.find();\n console.log(`All users data find: ${usersData}`);\n\n return res.json(usersData);\n } catch (error) {\n console.log(error);\n return;\n }\n }", "async function getUsers(req, res) {\n try {\n const users = await User.find({}); // Use the model to retrieve all users\n res.json({\n message: \"Successfully retrieved all users\",\n data: users\n });\n } catch (err) {\n res.json({\n message: \"There was an error retrieving users\",\n data: err.message\n });\n }\n}", "function getUsers(){\n return users;\n}", "function getAllData() {\n return Promise.all(gitHubUsers.map( item => getUserData(item)))\n }", "function getUsers() {\n return userService.getUsers().then(function(data) {\n vm.users = data;\n vm.loading = false;\n return vm.users;\n });\n }", "async function listUsers() {\n try {\n const users = await UserModel.find();\n console.log(users);\n } catch (error) {\n console.log(error);\n }\n }", "function getAllUsers(req, res) {\n User.find({}, function(err, users) {\n if (err) throw err;\n return res.json(users);\n }); \n}", "function getUsers() {\n if(localStorage.getItem(\"users\") == null) {\n users = [];\n return users;\n } else {\n users = JSON.parse(localStorage.getItem(\"users\"));\n return users;\n }\n }", "function getAll(req, res, next){\n userModel.getAll()\n .then(function(data){\n res.send({ data })\n })\n .catch(next)\n}", "function getAllUsers(req, res, next) {\n db.any('select * from users')\n .then(function (data) {\n res.status(200)\n .json({\n status: 'success',\n data: data,\n message: 'Users found'\n });\n })\n .catch(function (err) {\n return next(err);\n });\n}" ]
[ "0.8307446", "0.82482874", "0.81875855", "0.8144547", "0.81061953", "0.80567026", "0.8007273", "0.8001755", "0.79701596", "0.79686254", "0.7899519", "0.7886442", "0.7876225", "0.7872559", "0.78491473", "0.7835855", "0.7769026", "0.7765347", "0.77543014", "0.7748183", "0.7734346", "0.7731878", "0.77231896", "0.77173775", "0.76834667", "0.76773685", "0.76657677", "0.76375145", "0.76306844", "0.76062036", "0.7591267", "0.7591099", "0.75900704", "0.7566719", "0.75618356", "0.7549296", "0.7547595", "0.7544382", "0.7543575", "0.7542613", "0.75314206", "0.7502401", "0.7498008", "0.749784", "0.74964833", "0.7495497", "0.748507", "0.7480167", "0.7462435", "0.7458734", "0.7451081", "0.7430385", "0.74087477", "0.73911166", "0.7379237", "0.73760027", "0.7375978", "0.7366428", "0.7357274", "0.7355596", "0.73505473", "0.7350514", "0.73447084", "0.7340917", "0.73176676", "0.7316979", "0.73159486", "0.7307669", "0.7303722", "0.72922766", "0.7289558", "0.7282789", "0.7257258", "0.7248074", "0.7236344", "0.72360206", "0.72341317", "0.7228243", "0.7221583", "0.72192323", "0.721701", "0.7216031", "0.7212518", "0.7210018", "0.72094876", "0.7204106", "0.72037494", "0.72022253", "0.72001654", "0.7199656", "0.7191254", "0.7184308", "0.71837294", "0.7176253", "0.7172867", "0.7161861", "0.7156867", "0.7155908", "0.71532774", "0.7146396", "0.714381" ]
0.0
-1
Update all edited users in storage.
update() { this.showLoader(); axios .put(`users`, { users: this.users }) .then(response => { if (response.data.success) { this.alert("Users updated", " ", "success", 2000); this.getUsers(); } }) .catch(error => { this.alert( "Something went wrong", "Your changes could not be saved", "error", false ); }) .finally(() => { this.hideLoader(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateUsers (store, users) {\n store.users = users;\n }", "async updateUsers () {\n\t\tconst usersToUpdate = this.renderedEmails.map(userAndHtml => userAndHtml.user);\n\t\tawait Promise.all(usersToUpdate.map(async user => {\n\t\t\tawait this.updateUser(user);\n\t\t}));\n\t}", "function editUsers(){\n\tvar position=JSON.parse(localStorage.getItem('CurrentUser')).Position;\n\tvar users= JSON.parse(localStorage.getItem('Users'));\n\tvar user =users[position];\n\tif(document.getElementById('widget_password').value !== document.getElementById('widget_password_confirmation').value){\n\t\talert(\"The password doesn't match\");\n\t\treturn;\n\t}\n\tuser.FirstName=document.getElementById('widget_first_name').value;\n\tuser.LastName=document.getElementById('widget_last_name').value;\n\tuser.UserName=document.getElementById('widget_userName').value;\n\tuser.Email=document.getElementById('widget_email').value;\n\tuser.Password=document.getElementById('widget_password').value;\n\tuser.Admin=document.getElementById('box').checked;\n\tdocument.getElementById('welcomeUser').innerHTML='Welcome '+ user.FirstName + ' ' + user.LastName;\n\tlocalStorage.setItem('Users',JSON.stringify(users));\n\tlocalStorage.setItem(\"CurrentUser\",JSON.stringify(user));\n\t$('.overlay-bg, .overlay-content').hide();\n\talert(\"The user has been edited successfully\");\n}", "function updateUsers() {\n mongoDB.collection(MONGO_COLLECTION_NAME).find()\n .toArray(function(err, userTable) {\n if (err) return;\n\n allUsers = userTable;\n currentUser = allUsers[count];\n });\n}", "function update_users(callback){\n\tchrome.storage.local.get(\"posts\", function(result){\n\t\tresult = result[\"posts\"];\n\t\tresult = (result === undefined ? {} : result);\n\t\t\n\t\tlet objArray = Object.values(result);\n\t\t\n\t\tchrome.storage.local.get(\"users\", function(usersTable){\n\t\t\tusersTable = usersTable[\"users\"];\n\t\t\tusersTable = (usersTable === undefined ? {} : usersTable);\n\t\t\t\n\t\t\tlet usersArray = Object.values(usersTable);\n\t\t\t\n\t\t\tobjArray.forEach(function(value){\n\t\t\t\tlet userName = value[\"user\"];\n\t\t\t\tconsole.log(\"username: \" + userName);\n\t\t\t\tif (!userExists(userName, usersTable))\n\t\t\t\t\tusersTable[userName.toUpperCase()] = {name: userName, aliases: []};\t\n\t\t\t});\n\t\t\t\n\t\t\tchrome.storage.local.set({\"users\" : usersTable}, function() {\n\t\t console.log('Users Table Updated!');\n\t\t if (callback !== undefined) return callback();\n\t\t\t});\n\t\t});\n\t});\n}", "function setAllUsers(users) {\n storage.setItem('P1_todoUsersDB', JSON.stringify(users));\n }", "async updateMentionedUsers () {\n\t\tawait Promise.all((this.mentionedUsers || []).map(async user => {\n\t\t\tawait this.updateMentionsForUser(user);\n\t\t}));\n\t}", "async putUsers(users) {\n console.log('PUT /users')\n for (let user of users) {\n console.log(await user)\n }\n return this.server.putUsers(users)\n }", "function updateUserList(users) {\n users.forEach(function(user) {\n if (user.id == me.id) {return;}\n addUser(user);\n });\n}", "function refreshStoredUsers() {\n getStoredUsers();\n refreshTableUsers();\n}", "edit({ email, name, password, image }) {\n let details = { email, name, password, image };\n for (const key in details)\n if (details[key]) {\n currentUser[key] = details[key];\n }\n callFuture(updateUserListeners);\n }", "async publishUserUpdates () {\n\t\tconst userUpdates = this.transforms.userUpdateOps || [];\n\t\tawait Promise.all(userUpdates.map(async userUpdate => {\n\t\t\tawait this.publishUserUpdate(userUpdate);\n\t\t}));\n\t}", "update() {\n localStorage.setItem('user', JSON.stringify(user))\n\n dataStore.set('config', user.config)\n dataStore.set('palette', user.palette)\n dataStore.set('projectPalette', user.projectPalette)\n dataStore.set('log', user.log)\n\n Log.refresh()\n }", "function saveSettings() {\n \n const curUser = getCurrentUser();\n const editedUser = curUser;\n \n editedUser.firstName = document.getElementById('first2').value;\n editedUser.lastName = document.getElementById('last2').value;\n editedUser.email = document.getElementById('email3').value;\n editedUser.password = document.getElementById('pass3').value;\n \n const index = (editedUser.userId-1);\n let allUsers = getAllUsers();\n allUsers[index] = editedUser;\n setAllUsers(allUsers);\n }", "async putUsers(users) {\n let out = {}\n for (let body of users) {\n let {id, user} = await body\n\n out[id] = user\n }\n this.user = out\n }", "function updateUsers(){\n\n\t\t//send just the usernames. Just like an Array –Followed Online\n\t\tio.sockets.emit('getUsers', Object.keys(users));\n\t}", "function updateUsers() {\n\tupdateUsersFunc(function() {\n\t});\n}", "setAppliedUsers(users) {\n this.appliedUsers = users;\n console.log(this.appliedUsers);\n }", "function updateUsers(u) {\n if (u) {\n alldir(\"update_users\", u);\n }\n sem.take(function() {\n var usersstring = JSON.stringify(users);\n fs.writeFile(DEMPATH + 'users_' + name + '.json', usersstring, function(\n err) {\n if (err) {\n console.log(\"Error creating user\");\n } else {\n console.log(\"Created user successfully\");\n }\n console.log(\"leaving! from \" + name);\n sem.leave();\n });\n })\n}", "function updateUserNames(){ \n io.emit('get users', users); // users is the array with all user names\n\n }", "function editUserInfo(user){\n fetch(`https://students-3d096.firebaseio.com/${user.id}.json`, {\n method:\"PUT\",\n headers: {\n \"Content-type\": \"application/json\"\n }, \n body: JSON.stringify(user)\n })\n .then(res => res.json())\n .then(data => {\n debugger \n users = users.map(user => {\n if(user.id == data.id) user = data;\n return user;\n })\n showUsersInfo(users);\n isAdd = true;\n currentId = null;\n })\n}", "async refreshUsers (users) {\n await DBInstance.query('DELETE from users;')\n \n const valuesToInsert = users\n .map(({email, first_name, last_name, avatar}) => `,('${first_name}', '${last_name}', '${avatar}', '${email}') `)\n .join('')\n .substring(1)\n \n return DBInstance.query(`INSERT INTO users\n (first_name, last_name, avatar, email)\n VALUES\n ${valuesToInsert};`)\n }", "function editUserField(data) {\n var employeeDetails = getStorage();\n employeeDetails.forEach(function (user, index) {\n if (user.employeeId == data) {\n employeeId.value = user.employeeId;\n firstName.value = user.firstName;\n lastName.value = user.lastName;\n address.value = user.address;\n emailId.value = user.emailId;\n updateBtn.style.display = \"block\";\n submitBtn.style.display = \"none\";\n position = index;\n }\n });\n}", "function updateusers(){\n io.emit('usernames',users);\n}", "function updateUsernames() {\n\tio.sockets.emit('update users', users);\n}", "function multiUpdate(req, user, callback){\n // Updates all twitter data of specified user\n Twitter.update({user: req.body.oldEmail}, {$set: {user: user.email}}, {multi: true},\n function (err, doc) {\n if(err){\n callback(true);\n } else {\n // Updates all tweets data of specified user\n Tweets.update({user: req.body.oldEmail}, {$set: {user: user.email}}, {multi: true},\n function (err, doc) {\n if(err){\n callback(true);\n } else {\n // Updates all shortened data of specified user\n Shortened.update({user: req.body.oldEmail}, {$set: {user: user.email}},\n {multi: true}, function (err, doc) {\n if(err){\n callback(true);\n } else {\n callback();\n }\n });\n }\n });\n }\n });\n }", "function updateUsernames() {\n io.sockets.emit('get users', users);\n }", "addUsers(state, users) {\n for (let u of users) {\n Vue.set(state.allUsers, u.id,\n new User(u.id, u.first_name, u.last_name, u.picture_url));\n }\n }", "updateRegisteredUsers ({commit}) {\n let updatedRegusteredUsers = []\n db.collection('wolluk-users').onSnapshot(snapshot => {\n snapshot.docChanges().forEach(change => {\n let doc = change.doc\n let newUser = {\n id: doc.id,\n email: doc.data().email,\n displayName: doc.data().displayName,\n slug: doc.data().slug,\n roles: doc.data().roles\n }\n updatedRegusteredUsers.push(newUser)\n })\n commit('updateRegisteredUsers', updatedRegusteredUsers)\n commit('clearFilteredUsers')\n })\n }", "function editSaveAcc() {\n const editUserId = accounts.find(update => update.username == (document.getElementById(\"editUsernameTitle\").innerHTML)).username;\n console.log(editUserId);\n \n for (let i = 0; i < accounts.length; i++) {\n if (accounts[i].username == editUserId) {\n console.log(accounts[i]);\n\n accounts[i].name = document.getElementById(\"editFullName\").value;\n console.log(accounts[i].name);\n\n accounts[i].username = document.getElementById(\"editUsername\").value;\n console.log(accounts[i].username);\n\n accounts[i].email = document.getElementById(\"editEmail\").value;\n console.log(accounts[i].email);\n\n accounts[i].suspended = document.getElementById(\"editSuspended\").checked;\n console.log(accounts[i].suspended);\n\n // Update password\n if (document.getElementById(\"editPassword\").value) {\n accounts[i].password = document.getElementById(\"editPassword\").value;\n console.log(\"Password changed to\", document.getElementById(\"editPassword\").value);\n }\n\n // Update userType\n const userTypes = document.getElementsByName(\"editUserType\");\n console.log(userTypes);\n \n for (let j = 0; j < userTypes.length; j++) {\n const userType = userTypes[j];\n if (userType.checked) {\n console.log(\"User type checked:\", userType.value);\n accounts[i].userType = userType.value;\n }\n }\n }\n }\n saveAcc();\n window.location.reload();\n console.log({accounts});\n}", "function editInfo() {\n io.emit('usernames', userNameList);\n socket.emit('updateUser', currentUsers[socket.id]);\n }", "async doUserUpdate () {\n\t\tconst now = Date.now();\n\t\tconst op = {\n\t\t\t$set: {\n\t\t\t\tisRegistered: true,\n\t\t\t\tmodifiedAt: now,\n\t\t\t\tregisteredAt: now,\n\t\t\t\t\"preferences.acceptedTOS\": true\n\t\t\t}, \n\t\t\t$unset: {\n\t\t\t\tconfirmationCode: true,\n\t\t\t\tconfirmationAttempts: true,\n\t\t\t\tconfirmationCodeExpiresAt: true,\n\t\t\t\t'accessTokens.conf': true,\n\t\t\t\tinviteCode: true,\n\t\t\t\tneedsAutoReinvites: true,\n\t\t\t\tautoReinviteInfo: true\n\t\t\t}\n\t\t};\n\n\t\tif (this.passwordHash) {\n\t\t\top.$set.passwordHash = this.passwordHash;\n\t\t}\n\n\t\t['email', 'username', 'fullName', 'timeZone'].forEach(attribute => {\n\t\t\tif (this.data[attribute]) {\n\t\t\t\top.$set[attribute] = this.data[attribute];\n\t\t\t}\n\t\t});\n\t\tif (this.data.email) {\n\t\t\top.$set.searchableEmail = this.data.email.toLowerCase();\n\t\t}\n\n\t\tif ((this.user.get('teamIds') || []).length > 0) {\n\t\t\tif (!this.user.get('joinMethod')) {\n\t\t\t\top.$set.joinMethod = 'Added to Team';\t// for tracking\n\t\t\t}\n\t\t\tif (!this.user.get('primaryReferral')) {\n\t\t\t\top.$set.primaryReferral = 'internal';\n\t\t\t}\n\t\t\tif (\n\t\t\t\t!this.user.get('originTeamId') &&\n\t\t\t\tthis.teamCreator && \n\t\t\t\tthis.teamCreator.get('originTeamId')\n\t\t\t) {\n\t\t\t\top.$set.originTeamId = this.teamCreator.get('originTeamId');\n\t\t\t}\n\t\t}\n\n\t\tthis.request.transforms.userUpdate = await new ModelSaver({\n\t\t\trequest: this.request,\n\t\t\tcollection: this.request.data.users,\n\t\t\tid: this.user.id\n\t\t}).save(op);\n\t}", "setEditingUser(state, payload) {\n state.editingUserIndex = payload.index;\n state.users[payload.index] = payload.user;\n }", "function updateUserList() {\n io.emit('online-users',Object.keys(oUsers));\n\n}", "function updateUsernames() {\n io.sockets.emit('get users', Object.keys(users));\n }", "function updateUserList() {\r\n\tsocket.emit(\"appUpdateUsers\", username, fileName);\r\n}", "function updateExpirations() {\n client.hgetall(`supermute-users`, (err, users) => { if (users) {\n const now = new Date();\n _.each(users, (blob, id_str) => {\n var userdata = JSON.parse(blob);\n if (userdata.supermutes) {\n // remove any records that are muting no users (all unmuted)\n userdata.supermutes = userdata.supermutes\n .filter(supermute => ((supermute.mutedUsers.length > 0) || !supermute.isExpired));\n client.hset(`supermute-users`, id_str, JSON.stringify(userdata), redis.print);\n\n // go through the rest and unmute as needed\n for (var supermute of userdata.supermutes) {\n var d = new Date(supermute.expirationDate);\n if ((now > d)) {\n supermute.isExpired = true;\n unmute(id_str, supermute);\n }\n }\n }\n });\n }});\n setTimeout(updateExpirations, 1000*60*10);\n}", "async updateMentions () {\n\t\tawait this.getMentionedUsers();\n\t\tawait this.updateMentionedUsers();\n\t}", "function editUser(e) {\r\n if (e.target.className === \"save\") {\r\n let newUserData = prepareEditedUser(e);\r\n putEditedUser(newUserData);\r\n clearEditBox();\r\n }\r\n}", "function updateAll(data) {\n _todos.forEach(function(todo, id, todos) {\n update(id, data);\n });\n}", "function updateUsernames(){\r\n\t\tconsole.log(\"#Update User\");\r\n\t\tpicsy = [];\r\n\t\tfor(i = 0; i< profilpics.size;i++){\r\n\t\t\tpicsy[i]=profilpics.get(Object.keys(users)[i]);\r\n\t\t\tconsole.log('##'+i+\"##\"+picsy[i]);\r\n\t\t}\r\n\t\tio.sockets.emit('get users', Object.keys(users), picsy);\r\n\t\tdatabaseGetUserNames();\r\n\t}", "function updateUsernames(){\r\n io.sockets.emit('get users', users);\r\n}", "function updateAllUsersLS() {\n\tif(DEBUG) console.info(\"Updating Last Seen info of everybody.\");\n\t\n\tfor (var i in usersOnThisPage) {\n\t\tgetUserOptions(i);\n\t}\n}", "_updateAllEntities() {\n for (let i = this._entities.length - 1; i >= 0; i--) {\n this._entities[i].update();\n }\n }", "SET_USERS( state, data ){\n state.users = data;\n }", "function setUsers(users) {\n setItem('users', JSON.stringify(users));\n}", "static update(id, content) {\n const usr = users.filter(usr => {\n return usr._id === id;\n });\n if (usr) {\n this.delete(id);\n users.push(content);\n }\n }", "function updateAllUsers(socket) {\n socket.emit(\"update_all_users\", clientsToSend);\n socket.broadcast.emit(\"update_all_users\", clientsToSend);\n}", "async updateUser () {\n\t// add the team's ID to the user's teamIds array, and the company ID to the companyIds array\n\t\tconst op = {\n\t\t\t$addToSet: {\n\t\t\t\tcompanyIds: this.attributes.companyId,\n\t\t\t\tteamIds: this.model.id\n\t\t\t},\n\t\t\t$unset: {\n\t\t\t\tcompanyName: true\n\t\t\t},\n\t\t\t$set: {\n\t\t\t\tmodifiedAt: Date.now()\n\t\t\t}\n\t\t};\n\t\tthis.updateUserJoinMethod(this.user, op);\n\t\tthis.transforms.userUpdate = await new ModelSaver({\n\t\t\trequest: this.request,\n\t\t\tcollection: this.data.users,\n\t\t\tid: this.user.id\n\t\t}).save(op);\n\t}", "onUpdate() {\n let game = this;\n for (let player in this.players) {\n this.getClientData(player).then(data => {\n if (game.players[player].update)\n game.players[player].update(data)\n }).catch(err => {\n logger.error(err);\n });\n }\n }", "function editUpdate( req, userid, files, userName ) {\n if (!files) return {};\n var res = {};\n properties(files).forEach( function(fname) {\n if (!fname || fname[0] !== \"/\") return;\n var info = files[fname];\n if (!info) return;\n if (typeof info === \"string\") info = { kind: info, line: 0 }; //legacy\n if (typeof info !== \"object\") return;\n if (info.kind==null || info.kind==\"remove\") info.kind = \"none\";\n var realname = resolveAlias(fname);\n updateEditInfo( userid, realname, info, userName);\n res[fname] = getEditInfo(userid, realname);\n console.log(\"user: \" + (userName || userid) + \": \" + fname + \": \" + (realname == fname ? \"\" : \"as \" + realname + \": \") +\n info.kind + \":\" + info.line + \"\\n \" + JSON.stringify(res[fname]));\n });\n return res;\n}", "function updateAll(){\n\tvar tsUser = document.getElementsByName('tsUserId')\n for(i=0;i<7;i++){\n for(j=0;j<tsUser.length;j++){\n\t\tupdateTotal(tsUser[j].value,i,1);\n }\n\t}\n}", "function editUsersForSite() {\n\tvar button = $(this),\n\tsiteID = button.attr('data-id'),\n\tsiteName = button.attr('data-name'),\n\taccessCheckboxes = $('#dialog').find($('.accessSelection')),\n\tuserAccess = {},\n\tuserCheckboxes = $('#searchResults').find($('.selection')),\n\tusers = [];\n\t// Loop through access checkboxes and build access values.\n\taccessCheckboxes.each(function () {\n\t\tvar checkbox = $(this),\n\t\tchecked = checkbox.prop('checked'),\n\t\toption = checkbox.attr('data-id'),\n\t\taccess = 0;\n\t\tif (checked) {\n\t\t\taccess = 1;\n\t\t}\n\t\tuserAccess[option] = access;\n\t});\n\t// Loop through user checkboxes and define access values to each user.\n\tuserCheckboxes.each(function () {\n\t\tvar checkbox = $(this),\n\t\tchecked = checkbox.prop('checked'),\n\t\tid = checkbox.attr('data-id');\n\t\tif (checked) {\n\t\t\tusers.push({\n\t\t\t\tid: id,\n\t\t\t\taccess: userAccess\n\t\t\t});\n\t\t}\n\t});\n\tif (users.length > 0) {\n\t\tvar num = 10,\n\t\titeration = 1,\n\t\tremainder = users.length % num,\n\t\ttotalIterations = 0,\n\t\tgroup = '';\n\t\t// Reset total processed.\n\t\ttotalProcessed = 0;\n\t\t// Add 1 iteration if remainder is greater than 0.\n\t\tif (remainder > 0) {\n\t\t\ttotalIterations = Math.floor(users.length / num) + 1;\n\t\t} else {\n\t\t\ttotalIterations = Math.floor(users.length / num);\n\t\t}\n\t\t$('#dialogMessage').html('<p>Editing users for site...</p>');\n\t\t$('#dialogButtons').hide();\n\n\t\tfor (var i = 0; i < users.length; i += num) {\n\t\t\tgroup = users.slice(i, i + num); \n // Ajax to edit all user for site\n $.ajax({\n url: \"scripts/update.php\",\n type: \"POST\",\n data: {\n data: [{\n siteID: siteID,\n users: JSON.stringify(group)\n }\n ],\n script: 'editUsersForSite.sql'\n },\n dataType: \"json\",\n // Callback to update access table after update\n success: function (data) {\n usersEditedForSite(data,siteID,siteName,iteration,totalIterations,users.length,group.length);\n }\n }); \n\t\t\titeration++;\n\t\t}\n\t}\n}", "async _onStorageEvent() {\r\n if (this._deleted) {\r\n return;\r\n }\r\n const user = await this.assertedPersistence.getCurrentUser();\r\n if (!this.currentUser && !user) {\r\n // No change, do nothing (was signed out and remained signed out).\r\n return;\r\n }\r\n // If the same user is to be synchronized.\r\n if (this.currentUser && user && this.currentUser.uid === user.uid) {\r\n // Data update, simply copy data changes.\r\n this._currentUser._assign(user);\r\n // If tokens changed from previous user tokens, this will trigger\r\n // notifyAuthListeners_.\r\n await this.currentUser.getIdToken();\r\n return;\r\n }\r\n // Update current Auth state. Either a new login or logout.\r\n await this._updateCurrentUser(user);\r\n }", "function updateOnlineUsers(){\n \t io.emit('online users', onlineUsers);\n }", "async _onStorageEvent() {\r\n if (this._deleted) {\r\n return;\r\n }\r\n const user = await this.assertedPersistence.getCurrentUser();\r\n if (!this.currentUser && !user) {\r\n // No change, do nothing (was signed out and remained signed out).\r\n return;\r\n }\r\n // If the same user is to be synchronized.\r\n if (this.currentUser && user && this.currentUser.uid === user.uid) {\r\n // Data update, simply copy data changes.\r\n this._currentUser._assign(user);\r\n // If tokens changed from previous user tokens, this will trigger\r\n // notifyAuthListeners_.\r\n await this.currentUser.getIdToken();\r\n return;\r\n }\r\n // Update current Auth state. Either a new login or logout.\r\n // Skip blocking callbacks, they should not apply to a change in another tab.\r\n await this._updateCurrentUser(user, /* skipBeforeStateCallbacks */ true);\r\n }", "usersUpdated(users) {\n console.log(users);\n this.setState({\n ...this.state,\n users: users,\n });\n }", "submitEditUser(values) {\n const pageNumber = this.props.activePage;\n this.props.requestUpdateUsers(values, pageNumber);\n this.setState({\n isEditing: false\n })\n }", "function storeUsers() {\n localStorage.setItem(\"users\", JSON.stringify(users));\n}", "function storeUsers() {\n localStorage.setItem(\"users\", JSON.stringify(users));\n}", "setUsers(state, users) { // set user value in state\n state.users = users;\n }", "function updateUserController(request, response) {\n const userId = request.params.userId;\n const newValues = request.body;\n\n model.updateById(userId, newValues)\n\n response.status(httpStatus.NO_CONTENT).send();\n}", "function editarUsers(){\n\t//debugger;\n\t// variable que obtengo el arreglo donde estan guardados los usuarios\n\tvar listChamba = JSON.parse(localStorage.getItem(\"usuarios\"));\n\t// obtengo el id para poder modificar el elemento actual\n\tmodificar = JSON.parse(localStorage.getItem(\"id\"));\n\t// recorro el arreglo de arreglos de los usuarios\n\tfor (var i = 0; i < listChamba.length; i++) {\n\t\t// recorro cada uno de los arreglos\n\t\tfor (var j = 0; j < listChamba[i].length; j++) {\n\t\t\t// pregunto que si el modificar es igual al id actual\n\t\t\tif(modificar == listChamba[i][j]){\n\t\t\t\t// si si es igual obtener id\n\t\t\t\tvar n = document.getElementById(\"numero\").value;\n\t\t\t// obtener el nombre completo\n\t\t\tvar fn = document.getElementById(\"fullName\").value;\n\t\t\t// obtener el nombre de usuario\n\t\t\tvar u = document.getElementById(\"user\").value;\n\t\t\t// obtener la contraseña\n\t\t\tvar p = document.getElementById(\"password\").value;\n\t\t\t// obtener la contraseña repetida\n\t\t\tvar pr = document.getElementById(\"password_repeat\").value;\n\t\t\t// pregunto si las contraseñas son vacias o nulas\n\t\t\tif(fn == \"\" || fn == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de nombre completo vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no, pregunto que si el nombre de usuario es vacio o nulo\n\t\t\t}else if(u == \"\" || u == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de nombre de usuario vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no \n\t\t\t}else{\n\t\t\t\t// pregunto que si nas contraseñas son iguales\n\t\t\t\tif(p == pr){\n\t\t\t\t\t// si es asi, le digo que elemento actual en la posicion 0 es igual al id\n\t\t\t\t\tlistChamba[i][j] = n;\n\t\t\t\t\t// la posicion 1 es igual al nombre completo\n\t\t\t\t\tlistChamba[i][j+1] = fn;\n\t\t\t\t\t// la posicion 2 es igual a el nombre de usuario\n\t\t\t\t\tlistChamba[i][j+2] = u;\n\t\t\t\t\t// la posicion 3 es igual a la contraseña\n\t\t\t\t\tlistChamba[i][j+3] = p;\n\t\t\t\t\t// y la posicion 4 es igual a la contraseña repetida\n\t\t\t\t\tlistChamba[i][j+4] = pr;\n\t\t\t\t\t// agrego la modificacion al localstorage\n\t\t\t\t\tlocalStorage['usuarios'] = JSON.stringify(listChamba);\n\t\t\t\t\t// muestro el mensaje para que se de cuenta el usuario que fue modificado\n\t\t\t\t\talert(\"Se Modificó correctamente\");\n\t\t\t\t\t// me voy a la tabla para corroborar que se modificó\n\t\t\t\t\tlocation.href = \"ver_usuarios.html\";\n\t\t\t\t\t// si no fuera asi\n\t\t\t\t}else{\n\t\t\t\t\t// muestro el mensaje de error porque las contraseñas son diferentes\n\t\t\t\t\talert(\"No puede modificar el usuario porque las contraseñas son diferentes\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n};\n}", "function putEditedUser(updatedUserInfo) {\r\n toggleSpinner();\r\n fetch(`https://jsonplaceholder.typicode.com/users/${updatedUserInfo.id}`, {\r\n method: \"PUT\",\r\n body: JSON.stringify(updatedUserInfo),\r\n headers: {\r\n \"Content-type\": \"application/json; charset=UTF-8\"\r\n }\r\n })\r\n .then(response => {\r\n if (!response.ok) throw new Error();\r\n return response.json();\r\n })\r\n .then(json => {\r\n console.log(json);\r\n toggleSpinner();\r\n })\r\n .catch(err => { \r\n alert(`Sorry, error: ${err.message}`);\r\n toggleSpinner();\r\n });\r\n }", "function updateOnAvatarItems() {\n var update = {};\n update[user_avatarItemsKey] = avatar_items;\n refAvatar.update(update);\n console.log(\"Updated avatar\");\n\n\n}", "updateUser(userId, data) {\n return this.userStore.updateUser(userId, data)\n }", "function updateAllProvider(req,res){\n providers.updateMany({firstName: req.params.firstName},{ $set: { firstName: req.body.firstName }},{ multi: true },(err, provider) => {\n if (err) return handleError(err);\n res.send(\"Your data is actualized\");\n })\n }", "function updateUsersFunc(func) {\n\t\n\t//Get from the user URI\n\tvar getting = $.get(usersURI);\n\tgetting.done(function(data) {\n\t\tuser_list = JSON.parse(JSON.stringify(data));\n\t\t//Add new users to the known user list\n\t\tfor (var i = 0; i < user_list.length; i++) {\n\t\t\tif ($.inArray(user_list[i].id, user_id_list) == -1) {\n\t\t\t\tuser_id_list.push(user_list[i].id);\n\t\t\t}\n\t\t}\n\n\t\tfunc();\n\t});\n}", "function UpdateUsuarios(){\r\n socket.emit('UpdateUsuarios',usuarios);\r\n socket.broadcast.emit('UpdateUsuarios',usuarios);\r\n }", "async function editUsername() {\n try {\n // get Userinfo to fill out the missing variables in put requests\n const current = await api.get(`/users/${sessionStorage.getItem('id')}`);\n\n const requestBody = JSON.stringify({\n name: current.data.name,\n username: username,\n matrikelNr: current.data.matrikelNr\n });\n\n // Edit is sent to backend\n await api.put(`/users/${sessionStorage.getItem('id')}`, requestBody);\n\n } catch (error) {\n alert(`Something went wrong while editing the user: \\n${handleError(error)}`);\n }\n }", "update()\n {\n let entitiesCount = this.entities.length;\n\n for (let i = 0; i < entitiesCount; i++)\n {\n let entity = this.entities[i];\n\n entity.update();\n }\n }", "function updateUsers(id, adminClicked, paymentClicked) {\n $.ajax({\n type: 'PUT',\n url: '/admins/users/' + id + \"/\" + adminClicked + \"/\" + paymentClicked,\n dataType: 'json'\n });\n}", "updateUser (context, user) {\n context.commit('updateUser', user)\n }", "function putUsersOnPage(users) {\n // debugger\n\n userSection.innerHTML = \"\"\n\n // const userArray = []\n\n users.forEach(function (user) {\n// debugger\n // userSection\n\n addUserToUI(user)\n\n \n // const updatedArray = userArray.push(user.name)\n })\n\n\n \n\n}", "function updateAll()\n{\n\twindow.clearTimeout( timeID );\n\tgetUserList();\n\tsetTimers();\n}", "function updateUsers(json){\n\tlet users = JSON.parse(json.users);\n\n\tif (document.getElementById(\"userCount\") != null){\n\t\tdocument.getElementById(\"userCount\").innerHTML = users.length + \"/\" + json.roomsize;\n\t}\n\t\n\tif (document.getElementsByClassName(\"identifier\") != null){\n\t\tlet ids = document.getElementsByClassName(\"identifier\");\n\t\t\n\t\tlet names = \"<span style=\\\"color:\" + sessionStorage[\"nameColor\"] + \";\\\">\" + sessionStorage[\"name\"] + \"</span>\";\n\t\t\n\t\tfor (let i = 0; i < users.length; i++){\n\t\t\tlet userDetails = users[i].split(\";\");\n\t\t\tif (userDetails[0] === sessionStorage[\"name\"])\n\t\t\t\tcontinue;\n\t\t\n\t\t\tnames += \"<br/>\" + \"<span style=\\\"color:\" + userDetails[1] + \";\\\">\" + userDetails[0] + \"</span>\";\n\t\t}\n\t\t\n\t\tif (names.length != 0)\n\t\t\tids[ids.length - 1].innerHTML = names;\n\t}\n}", "function updateUsersView(request,users_list){\n var user_list_array = [];\n\n $.each(users_list,function(){\n if (this.USER.ID == uid)\n dashboardQuotasHTML(this.USER);\n user_list_array.push(userElementArray(this));\n });\n updateView(user_list_array,dataTable_users);\n SunstoneMonitoring.monitor('USER', users_list)\n if (mustBeAdmin())\n updateSystemDashboard(\"users\",users_list);\n updateUserSelect();\n}", "updatePlayers(){\n var players = this.getAllPlayers();\n for(var i = 0; i < players.length; i++){\n var player = players[i];\n player.update();\n }\n }", "async updateUser() {\n // get all input names upsert the value of each to the database\n var updateList = this.state.inputNamesToBeUpdated\n // get tag input\n var tag = this.state.tag\n // make lowercase and add to state\n await this.setState({tag: tag.toLowerCase()})\n // was tag changed\n var tagChanged = (this.state.tag !== this.state.saved_tag)\n\n // check if tag was changed\n if (updateList.includes(\"tag\")) {\n // confirm tag is available, otherwise use saved tag\n const available = await this.tagIsAvailable()\n if (!available) {\n // remove from update list\n updateList.splice(updateList.indexOf(\"tag\"), 1)\n if (tagChanged)\n // show unavailable message\n this.setState({tagError: true, tagHelpText: \"Unavailable\"})\n }\n else {\n this.setState({tagError: false, tagHelpText: \"\", showTagUpdatedMessage: true, saved_tag: tag})\n }\n }\n for (const inputName of updateList) {\n console.log(\"Updating \" + inputName + \" to \" + this.state[inputName])\n await updateValue(inputName, this.state[inputName])\n }\n // reset list of input names to be updated\n this.setState({\n inputNamesToBeUpdated: [],\n showTagUpdatedMessage: true,\n })\n }", "function updateCurrentUser(){\n console.log(\"update\");\n firebase.database().ref(\"/users\").child(thisUserId).update({\n sessions: thisSession,\n ipAddresses: ips\n });\n}", "update(user) {\n return __awaiter(this, void 0, void 0, function* () {\n if (user == null) {\n throw new nullargumenterror_1.NullArgumentError('user');\n }\n let index = this.users.findIndex(u => u.id == user.id);\n if (index != -1) {\n this.users[index].name = user.name;\n this.users[index].email = user.email;\n this.users[index].isVerified = user.isVerified;\n }\n });\n }", "async _updateAccounts() {\n const nicknames = this.accounts.map(acc => acc.nickname)\n const updatedAccounts = await Account.find({nickname: {$in: nicknames}})\n this.accounts = updatedAccounts\n }", "async setNumInvited () {\n\t\tconst numInvited = this.invitedUsers.reduce((total, userData) => {\n\t\t\tif (!userData.wasOnTeam) {\n\t\t\t\ttotal++;\n\t\t\t}\n\t\t\treturn total;\n\t\t}, 0);\n\t\tif (numInvited === 0) { return; }\n\t\tconst op = {\n\t\t\t$set: {\n\t\t\t\tnumUsersInvited: (this.user.get('numUsersInvited') || 0) + numInvited,\n\t\t\t\tmodifiedAt: Date.now()\n\t\t\t}\n\t\t};\n\t\tthis.transforms.invitingUserUpdateOp = await new ModelSaver({\n\t\t\trequest: this.request,\n\t\t\tcollection: this.data.users,\n\t\t\tid: this.user.id\n\t\t}).save(op);\n\t}", "updateUser(updates) {\n\t\tconst user = _userFromAccessToken(_accessToken);\n\n\t\t// Only allow device updates for now\n\t\tlet data = {\n\t\t\tdevices: updates.devices\n\t\t};\n\n\t\treturn _makeRequest('/users/' + user.id, {needsAuth: true, method: 'PATCH', body: data});\n\t}", "function updateUsers(updatedUsers) {\n\n // update the users in memory and update the users in the DOM and the message thread to reflect user name changes\n users = updatedUsers;\n selectors.userList.html(userListTemplate(users));\n selectors.messageThread.html(messageThreadTemplate(currentChannelMessages));\n}", "function handleUpdate() {\n var palList = AvatarList.getPalData().data;\n\n // Add users to userStore\n for (var a = 0; a < palList.length; a++) {\n var currentUUID = palList[a].sessionUUID;\n\n var hasUUID = palList[a].sessionUUID;\n var isInUserStore = userStore[currentUUID] !== undefined;\n\n if (hasUUID && !isInUserStore) {\n // UUID exists and is NOT in userStore\n addUser(currentUUID);\n } else if (hasUUID) {\n // UUID exists and IS in userStore already\n userStore[currentUUID].audioLoudness = palList[a].audioLoudness;\n userStore[currentUUID].currentPosition = palList[a].position;\n updateAudioForAvatar(currentUUID);\n if (settings.ui.isExpandingAudioEnabled && userStore[currentUUID].overlayID) {\n updateOverlaySize(currentUUID);\n }\n }\n }\n\n // Remove users from userStore\n for (var uuid in userStore) {\n // if user crashes, leaving domain signal will not be called\n // handle this case\n var hasUUID = uuid;\n var isInNewList = palList.map(function (item) {\n return item.sessionUUID;\n }).indexOf(uuid) !== -1;\n\n if (hasUUID && !isInNewList) {\n removeUser(uuid);\n }\n }\n doUIUpdate();\n }", "saveChanges(){\n\t\tthis.state.users[this.state.changeUser].role = this.state.changeNewRole;\n\t\tthis.setState({\n\t\t\tusers: this.state.users\n\t\t})\n\t\talert('All is Okay!!!');\n\t}", "function updateInfo() {\n let newVals = grabFormValues();\n $.ajax({\n dataType: 'json',\n type: 'PUT',\n data: newVals,\n async: false,\n url: 'api/employees/' + curUser._id,\n success: function(response) {\n console.log(response);\n localStorage.setItem('currentUser', JSON.stringify(response));\n curUser = JSON.parse(localStorage.getItem('currentUser'));\n showInfo();\n },\n });\n }", "function valuesUpdate() {\n var savedInputs = JSON.parse(localStorage.getItem(\"savedInputs\")) || [\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", ];\n for (let i = 0; i < input.length; i++) {\n const element = input[i];\n element.value = savedInputs[i];\n }\n\n}", "function updateUser() {\n try {\n selectedUser.username = $usernameFld.val();\n selectedUser.password = $passwordFld.val();\n selectedUser.firstName = $firstNameFld.val();\n selectedUser.lastName = $lastNameFld.val();\n selectedUser.role = $roleFld.val();\n userService.updateUser(selectedUserId, selectedUser)\n .then(function (userServerInfo) {\n users[editIndex] = selectedUser;\n renderUsers(users);\n resetInputFields();\n clearSelected();\n });\n }\n // In future could catch null error or could grey out checkmark icon.\n catch (err) {\n console.log(err.name + \": \" + err.message);\n }\n }", "_updateUsers() {\n const users = this.slackUsers;\n return new Promise((resolve, reject) => {\n let i = 0; // Counter\n\n // Loop through the user list from Slack\n _.forEach(users, (user) => {\n i++;\n\n // Check if we should store this user (not a bot, not deleted)\n if (!user.is_bot && user.id !== 'USLACKBOT' && user.name !== 'jetbrains' && !user.deleted) {\n // Look up if this user is already stored\n this.rdsCli.hget(`user:${user.id}`, 'id', (err, reply) => {\n if (err) {\n reject();\n }\n\n if (reply === null) {\n // User is not in redis - we should add it\n const newUser = {\n id: user.id,\n name: user.name,\n partTime: false, // Assume it is a full time employee as default\n cleaningDisabledUntil: '2099-01-01', // Cleaning duty disabled as default\n lastCleaningDuty: 0,\n };\n\n // Add user\n this.rdsCli.hmset(`user:${user.id}`, newUser, () => {\n console.log(`${user.name} added!`);\n\n // Resolve promise if this was the last user in the Slack user list\n if (i === users.length) {\n resolve();\n }\n });\n } else if (i === users.length) {\n // User already stored\n // Resolve promise if this was the last user in the Slack user list\n resolve();\n }\n });\n }\n });\n });\n }", "function syncUser (newval) {\n storage.set('user', newval);\n}", "function updateUsernames() {\n //io.sockets.emit('get users', users);\n\n if (nConnections > 4) {\n \n var nUsersInRoom = nConnections%4;\n var startPos = nConnections - nUsersInRoom;\n var tempUsers = users;\n var subsetOfUsers = tempUsers.splice(startPos, nUsersInRoom);\n io.sockets.in(roomName).emit('get users', subsetOfUsers);\n newRoomFull = false;\n \n } else\n io.sockets.in(roomName).emit('get users', users);\n }", "async function update(data) {\n console.debug(\"Update\");\n const user = await JoblyApi.updateUserInfo(currentUser.username, data);\n setCurrentUser(user);\n }", "function refreshListOfAddedUsers(l) { User.downloadListOfAddedUsers(l); }", "mutateUser (state, payload) {\n let userToUpdate = state.registeredUsers.find(user => user.id === payload.id)\n let userIndex = state.registeredUsers.indexOf(userToUpdate)\n state.registeredUsers[userIndex] = payload\n }", "function editASingleUser(userID){\r\n var newUserID = document.getElementById(\"userID\").value;\r\n var userEmail = document.getElementById(\"userEmail\").value;\r\n var userFirstName = document.getElementById(\"userFirstName\").value;\r\n var userLastName = document.getElementById(\"userLastName\").value;\r\n var userAvatar = document.getElementById(\"userAvatarEdit\").value;\r\n\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(\"PUT\",\"api/users/\" + String(userID), true);\r\n xhr.onload = function() {\r\n if (xhr.readyState === 4 && xhr.status >= 200 && xhr.status < 300) {\r\n JSON.parse(xhr.responseText);\r\n }\r\n else {\r\n alert(\"Error \" + xhr.status);\r\n }\r\n };\r\n xhr.setRequestHeader('Content-Type', 'application/json');\r\n try {\r\n xhr.send(JSON.stringify({\"id\": newUserID, \"email\": userEmail, \"first_name\": userFirstName, \"last_name\": userLastName, \"avatar\": userAvatar}));\r\n }\r\n catch (error) {\r\n alert.error(\"Cannot edit user ID\");\r\n }\r\n\r\n\r\n}", "function updateUserInformation(){\n\tconsole.log('function: updateUserInformation');\n\t$().SPServices({\n\t\toperation: \"UpdateListItems\",\n\t\twebURL: siteUrl,\n\t\taync: false,\n\t\tbatchCmd: \"Update\",\n\t\tlistName: \"ccUsers\",\n\t\tID: userId,\n\t\tvaluepairs:[\n\t\t\t\t\t\t[\"Title\", personInformation().pseudoName ], \n\t\t\t\t\t\t[\"PERSON_EMAIL\", personInformation().personEmail], \n\t\t\t\t\t\t[\"P_LAST_NAME\", personInformation().personLastName],\t\n\t\t\t\t\t\t[\"P_FIRST_NAME\", personInformation().personFirstName], \n\t\t\t\t\t\t[\"PERSON_ROLE\", personInformation().personRole], \n\t\t\t\t\t\t[\"PERSON_RANK\", personInformation().personRank], \n\t\t\t\t\t\t[\"PERSON_DIRECTORATE\", personInformation().personDirectorate],\n\t\t\t\t\t\t[\"PERSON_ACTIVE\", personInformation().personActive], \n\t\t\t\t\t\t[\"PERSON_ATTRIBUTES\", personAttributes()],\n\t\t\t\t\t\t[\"PERSON_TRAINING\", personTraining()]\n\t\t\t\t\t],\n\t\tcompletefunc: function(xData, Status){\n\t\t\tconsole.log('update user account succesfully');\n\t\t}\n\t});\n\tsetTimeout(function(){\n\t\tsetUserInformationRedirect(userId);\n\t}, 2000);\n}", "editUsers(values) {\n this.setState({\n isEditing: values\n })\n }", "function updateUserInTable({userName, email, userId}){\n let userListRows = $userListTable.childNodes\n let userListLength = userListRows.length\n\n for(let i = 1; i < userListLength; i++){\n let row = userListRows[i]\n if(row.getAttribute('user-id') == userId){\n let userNameEl = row.querySelector(\".et-username\")\n let emailEl = row.querySelector(\".et-email\")\n\n userNameEl.innerText = userName,\n emailEl.innerText = email\n break\n }\n }\n}" ]
[ "0.6823774", "0.68002427", "0.6529465", "0.65098983", "0.6427899", "0.63050556", "0.6248189", "0.61273175", "0.61272883", "0.6035844", "0.6024873", "0.59589046", "0.5939948", "0.5916023", "0.5879827", "0.5853611", "0.5845426", "0.58162373", "0.5766659", "0.5758862", "0.5721103", "0.56852007", "0.5677839", "0.564916", "0.56337094", "0.56295645", "0.56100184", "0.5577879", "0.55745286", "0.55659574", "0.55504405", "0.5536739", "0.55293083", "0.5521812", "0.5505717", "0.5477153", "0.5458048", "0.54575306", "0.545619", "0.5455359", "0.5455106", "0.54545546", "0.54523575", "0.545159", "0.544578", "0.5418435", "0.54125834", "0.5396526", "0.53914374", "0.53839886", "0.53788954", "0.53758526", "0.53725696", "0.5369895", "0.5365121", "0.53613836", "0.5359457", "0.53477824", "0.53470683", "0.53470683", "0.5337246", "0.5328973", "0.53244203", "0.53235525", "0.53223705", "0.53100187", "0.53098947", "0.5302336", "0.5282397", "0.52814513", "0.5280192", "0.5271743", "0.526649", "0.5264974", "0.52618456", "0.5260845", "0.52584606", "0.5249882", "0.52395684", "0.52378386", "0.52351344", "0.52342176", "0.5231581", "0.5226326", "0.52216595", "0.52196", "0.5217015", "0.52163684", "0.5215316", "0.5210663", "0.5209109", "0.5209022", "0.52067226", "0.5205042", "0.51719725", "0.5170287", "0.5165162", "0.5163074", "0.5159327", "0.5158996" ]
0.6566679
2
Set an object as primitive to be ignored traversing children in clone or merge
function setAsPrimitive(obj) { obj[primitiveKey] = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n }", "function setAsPrimitive(obj) {\n\t obj[primitiveKey] = true;\n\t}", "function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n }", "function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n }", "function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n}", "_insertReal( obj ) {\n if( this.#nodes.length ) {\n let indices = this._indices(obj.rect);\n indices.forEach(idx => this.#nodes[idx]._insertReal(obj));\n } else {\n this.#objects.push(obj);\n obj.inNodes.push(this);\n if(this.#objects.length > this.#config.maxObjects && this.#depth < this.#config.maxDepth){\n this._rebalance();\n }\n }\n }", "function isPrimitive(o) {\r\n return o !== Object(o);\r\n }", "function manipulationBareObj( value ) {\n\treturn value;\n}", "makeOrphan(){\n if(!this.parent) return;\n if(this === this.parent.left) this.parent.left = null;\n else this.parent.right = null;\n }", "function isPrimitive(obj)\r\n{\r\n\treturn (obj !== Object(obj));\r\n}", "function clonePlainObject(obj) {\n return $.extend(true, {}, obj);\n }", "function coercePrimitiveToObject(obj) {\n if(isPrimitiveType(obj)) {\n obj = object(obj);\n }\n if(noKeysInStringObjects && isString(obj)) {\n forceStringCoercion(obj);\n }\n return obj;\n }", "clone() {\n // this class should not be cloned since it wraps\n // around a given object. The calling function should check\n // whether the wrapped object is null and supply a new object\n // (from the clone).\n return this.nodes = null;\n }", "function toObject(primitive) {\n if(typeof primitive == \"object\" && null != primitive) {\n return primitive;\n }\n else {\n /* if input isn't null, undefined, boolean, or infinity */\n if(typeof primitive != \"undefined\" &&\n typeof primitive != \"boolean\" &&\n primitive != Infinity &&\n null != primitive) {\n /* return an object */\n return new String(primitive);\n }\n else {\n /* otherwise, return an empty object */\n return [];\n }\n }\n }", "function set_unselectable(obj)\n{\n\tif (!is_ie4 && typeof obj.tagName != 'undefined')\n\t{\n\t\tif (obj.hasChildNodes())\n\t\t{\n\t\t\tfor (var i = 0; i < obj.childNodes.length; i++)\n\t\t\t{\n\t\t\t\tset_unselectable(obj.childNodes[i]);\n\t\t\t}\n\t\t}\n\t\tobj.unselectable = 'on';\n\t}\n}", "applyToObjects ( to_obj ) {\n\t\tthis.applyIn( this.root, to_obj )\n\t}", "function markRaw(obj) {\r\n if (!(isPlainObject(obj) || isArray(obj)) || !Object.isExtensible(obj)) {\r\n return obj;\r\n }\r\n // set the vue observable flag at obj\r\n var ob = createObserver();\r\n ob.__raw__ = true;\r\n def(obj, '__ob__', ob);\r\n // mark as Raw\r\n rawSet.set(obj, true);\r\n return obj;\r\n}", "function markRaw(obj) {\r\n if (!(isPlainObject(obj) || isArray(obj)) || !Object.isExtensible(obj)) {\r\n return obj;\r\n }\r\n // set the vue observable flag at obj\r\n var ob = createObserver();\r\n ob.__raw__ = true;\r\n def(obj, '__ob__', ob);\r\n // mark as Raw\r\n rawSet.set(obj, true);\r\n return obj;\r\n}", "function OBJECT_FOR_TREE(id) {\n this.id = id || 0;\n this.cell = this.obj = this.pre = this.next = null;\n }", "set child(value) {\n this._child = isUndefined(value) ?\n null : value;\n\n return value;\n }", "function setIn(obj,path,value){var res=clone(obj);// this keeps inheritance when obj is a class\nvar resVal=res;var i=0;var pathArray=toPath(path);for(;i<pathArray.length-1;i++){var currentPath=pathArray[i];var currentObj=getIn(obj,pathArray.slice(0,i+1));if(currentObj&&(isObject$2(currentObj)||Array.isArray(currentObj))){resVal=resVal[currentPath]=clone(currentObj);}else {var nextPath=pathArray[i+1];resVal=resVal[currentPath]=isInteger(nextPath)&&Number(nextPath)>=0?[]:{};}}// Return original object if new value is the same as current\nif((i===0?obj:resVal)[pathArray[i]]===value){return obj;}if(value===undefined){delete resVal[pathArray[i]];}else {resVal[pathArray[i]]=value;}// If the path array has a single element, the loop did not run.\n// Deleting on `resVal` had no effect in this scenario, so we delete on the result instead.\nif(i===0&&value===undefined){delete res[pathArray[i]];}return res;}", "makeNormal() {\n this.type = Node.NORMAL;\n this.state = Node.UNVISITED;\n }", "function toggle(obj) {\n if (obj !== bunny) {\n obj.factor = 1.0 - obj.factor;\n obj.tint = obj.factor ? 0xff0033 : 0x00ff00;\n }\n }", "filter( o){\n\t\tvar has= this.has( o)\n\t\t// bail false if we already know it\n\t\tif( !has){\n\t\t\treturn\n\t\t}\n\t\t// add the newcomer\n\t\tif( this._wasPrimitive){\n\t\t\tthis._primitives.push( o)\n\t\t}else{\n\t\t\tthis._objects.add( o)\n\t\t}\n\t\t// return it\n\t\treturn o\n\t}", "#isPrimitive(value) {\n return value !== Object(value); \n }", "function normalizeToObject(doc, ret) {\n delete ret.__v;\n}", "function preventChanges(obj) {\n Object.freeze(obj);\n obj.noChanges = false;\n obj.signature = \"whatever\";\n return obj;\n }", "function isPrimative(val) { return (typeof val !== 'object') }", "static cleanObject(obj) {\n const validObj = (o) =>\n (Object.keys(o).length || (Array.isArray(o) && o.length)) && o;\n const itemToBool = (item) => {\n return typeof item !== 'object' || item === null\n ? item\n : // eslint-disable-next-line no-use-before-define\n validObj(clean(item));\n };\n\n const clean = (o) =>\n validObj(\n Array.isArray(o)\n ? o.map(itemToBool).filter(Boolean)\n : Object.entries(o).reduce((a, [key, val]) => {\n const newVal = itemToBool(val);\n if (\n // Here is the magic check null, undefined and type change (=> undefined recursively)\n newVal !== undefined &&\n newVal !== null &&\n typeof val === typeof newVal\n )\n a[key] = newVal;\n return a;\n }, {})\n );\n\n return clean(obj);\n }", "function test() {\n 'use strict';\n\n let obj1 = { a: 0 , b: { c: 0}};\n let obj2 = Object.assign({}, obj1);\n console.log(JSON.stringify(obj2)); // { a: 0, b: { c: 0}}\n\n obj1.a = 1;\n console.log(JSON.stringify(obj1)); // { a: 1, b: { c: 0}}\n console.log(JSON.stringify(obj2)); // { a: 0, b: { c: 0}}\n\n obj2.a = 2;\n console.log(JSON.stringify(obj1)); // { a: 1, b: { c: 0}}\n console.log(JSON.stringify(obj2)); // { a: 2, b: { c: 0}}\n\n obj2.b.c = 3;\n console.log(JSON.stringify(obj1)); // { a: 1, b: { c: 3}}\n console.log(JSON.stringify(obj2)); // { a: 2, b: { c: 3}}\n\n // Deep Clone\n obj1 = { a: 0 , b: { c: 0}};\n let obj3 = JSON.parse(JSON.stringify(obj1));\n obj1.a = 4;\n obj1.b.c = 4;\n console.log(JSON.stringify(obj3)); // { a: 0, b: { c: 0}}\n}", "function safeDeepClone(circularValue, refs, obj) {\n var copy;\n\n // object is a false or empty value, or otherwise not an object\n if (!obj || 'object' !== typeof obj || obj instanceof Error || obj instanceof ArrayBuffer || obj instanceof Blob || obj instanceof File) return obj;\n\n // Handle Date\n if (obj instanceof Date) {\n copy = new Date();\n copy.setTime(obj.getTime());\n return copy;\n }\n\n // Handle Array - or array-like items\n if (obj instanceof Array || obj.length) {\n \n refs.push(obj);\n copy = [];\n for (var i = 0, len = obj.length; i < len; i++) {\n if (refs.indexOf(obj[i]) >= 0) {\n copy[i] = circularValue;\n } else {\n copy[i] = safeDeepClone(circularValue, refs, obj[i]);\n }\n }\n refs.pop();\n return copy;\n }\n\n // Handle Object\n refs.push(obj);\n\n // Bring a long prototype\n if (obj.constructor && obj.constructor !== Object) {\n copy = Object.create(obj.constructor.prototype);\n } else {\n copy = {};\n }\n\n for (var attr in obj) {\n if (obj.hasOwnProperty(attr) && attr !== '$$hashKey') {\n if (refs.indexOf(obj[attr]) >= 0) {\n copy[attr] = circularValue;\n } else {\n copy[attr] = safeDeepClone(circularValue, refs, obj[attr]);\n }\n }\n }\n refs.pop();\n return copy;\n}", "function operateOnObject(o) {\n return;\n}", "function preProcessServerUpdateObject(obj) {\n\tdebugObject(\"preProcessServerUpdateObject() obj=\", obj);\n\tif (obj.objType == QUESTIONNAIRE_OBJECT) {\n\t\t// Don't lose the factHandle.\n\t\tobj.factHandle = persistentState.questionnaire.factHandle;\n\t\tpersistentState.questionnaire = obj;\n\t\ttemporaryState.questionnaireChanged = true;\n\t\tbuildHierarchy(obj);\n\t}\n\telse if (obj.objType == GROUP_OBJECT) {\n\t\tbuildHierarchy(obj);\n\t}\n}", "function normalize(obj) {\n if(!obj) return;\n\n if(obj._id) {\n obj.id = obj._id.toString();\n delete obj._id;\n }\n\n return obj;\n}", "static _coalesceConvert_doRecurse (obj, fn) {\n\t\tif (typeof obj !== \"object\") throw new TypeError(`Non-object ${obj} passed to object handler!`);\n\n\t\tif (obj instanceof Array) {\n\t\t\tfn(obj);\n\n\t\t\tobj.forEach(it => {\n\t\t\t\tif (typeof it !== \"object\") return;\n\t\t\t\tthis._coalesceConvert_doRecurse(it, fn)\n\t\t\t});\n\t\t} else {\n\t\t\tif (obj.type) {\n\t\t\t\tconst childMeta = Renderer.ENTRIES_WITH_CHILDREN.find(it => it.type === obj.type && obj[it.key]);\n\t\t\t\tif (childMeta) {\n\t\t\t\t\tthis._coalesceConvert_doRecurse(obj[childMeta.key], fn);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function isPrimitive(v) {\n if (v === undefined) return false;\n if (v === null) return true;\n if (v.constructor == String) return true;\n if (v.constructor == Number) return true;\n if (v.constructor == Boolean) return true;\n if (v.constructor.name == 'ObjectID') return true;\n return false;\n }", "function Object(primitives) {\r\n this.primitives = primitives;\r\n}", "function canSetProperty(object, property, primitives){\n if (property === '__proto__' || primitives.isPrimitive(object)){\n return false\n } else if (object != null){\n\n if (hasOwnProperty(object, property)){\n if (propertyIsEnumerable(object, property)){\n return true\n } else {\n return false\n }\n } else {\n return canSetProperty(primitives.getPrototypeOf(object), property, primitives)\n }\n\n } else {\n return true\n }\n}", "function canSetProperty(object, property, primitives){\n if (property === '__proto__' || primitives.isPrimitive(object)){\n return false\n } else if (object != null){\n\n if (hasOwnProperty(object, property)){\n if (propertyIsEnumerable(object, property)){\n return true\n } else {\n return false\n }\n } else {\n return canSetProperty(primitives.getPrototypeOf(object), property, primitives)\n }\n\n } else {\n return true\n }\n}", "function cloneIfNode(obj, deep, withoutLoc) {\n if (obj && typeof obj.type === \"string\") {\n return cloneNode(obj, deep, withoutLoc);\n }\n\n return obj;\n}", "function clone(obj) {\n var i, p, ps;\n\n function OmegaNum(input, input2) {\n var x = this;\n if (!(x instanceof OmegaNum)) return new OmegaNum(input, input2);\n x.constructor = OmegaNum;\n var parsedObject = null;\n if (typeof input == \"string\" && (input[0] == \"[\" || input[0] == \"{\")) {\n try {\n parsedObject = JSON.parse(input);\n } catch (e) {\n //lol just keep going\n }\n }\n var temp, temp2;\n if (typeof input == \"number\" && !(input2 instanceof Array)) {\n temp = OmegaNum.fromNumber(input);\n } else if (parsedObject) {\n temp = OmegaNum.fromObject(parsedObject);\n } else if (typeof input == \"string\" && input[0] == \"E\") {\n temp = OmegaNum.fromHyperE(input);\n } else if (typeof input == \"string\") {\n temp = OmegaNum.fromString(input);\n } else if (input instanceof Array || input2 instanceof Array) {\n temp = OmegaNum.fromArray(input, input2);\n } else if (input instanceof OmegaNum) {\n temp = input.array.slice(0);\n temp2 = input.sign;\n } else if (typeof input == \"object\") {\n temp = OmegaNum.fromObject(input);\n } else {\n temp = [NaN];\n temp2 = 1;\n }\n if (typeof temp2 == \"undefined\") {\n x.array = temp.array;\n x.sign = temp.sign;\n } else {\n x.array = temp;\n x.sign = temp2;\n }\n return x;\n }\n OmegaNum.prototype = P;\n\n OmegaNum.JSON = 0;\n OmegaNum.STRING = 1;\n\n OmegaNum.NONE = 0;\n OmegaNum.NORMAL = 1;\n OmegaNum.ALL = 2;\n\n OmegaNum.clone = clone;\n OmegaNum.config = OmegaNum.set = config;\n\n //OmegaNum=Object.assign(OmegaNum,Q);\n for (var prop in Q) {\n if (Q.hasOwnProperty(prop)) {\n OmegaNum[prop] = Q[prop];\n }\n }\n\n if (obj === void 0) obj = {};\n if (obj) {\n ps = ['maxArrow', 'serializeMode', 'debug'];\n for (i = 0; i < ps.length;)\n if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p];\n }\n\n OmegaNum.config(obj);\n\n return OmegaNum;\n }", "function example6() {\n var o = { a: 1 };\n o.a = 2; //allowed: change ref object\n o.b = 1; //allowed: change ref object\n\n // o = {a: 1} //not allowed: change referece itself\n}", "set objectReferenceValue(value) {}", "function deepClone(obj) {\n switch (typeof obj) {\n case 'object':\n return JSON.parse(JSON.stringify(obj)); //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case 'undefined':\n return null; //this is how JSON.stringify behaves for array items\n default:\n return obj; //no need to clone primitives\n }\n }", "function set(obj) {\n registerSetChange.call(this, obj);\n if (obj) {\n if (util.isArray(obj)) {\n this._id = _.pluck(obj, '_id');\n this.related = obj;\n }\n else {\n this._id = obj._id;\n this.related = obj;\n }\n }\n else {\n this._id = null;\n this.related = null;\n }\n}", "function clean( node ){\n\tvar l = node.c.length;\n\twhile( l-- ){\n\t\tif( typeof node.c[l] == 'object' )\n\t\t\tclean( node.c[l] );\n\t}\n\tnode.n = node.a = node.c = null;\n}", "static fork(obj) {\n var ret, key, value;\n\n if (obj && obj.constructor === Object) {\n ret = Object.setPrototypeOf({}, obj);\n\n for (key in obj) {\n value = obj[key];\n\n if (value) {\n if (value.constructor === Object) {\n ret[key] = this.fork(value);\n } else if (value instanceof Array) {\n ret[key] = value.slice();\n }\n }\n }\n } else {\n ret = obj;\n }\n\n return ret;\n }", "function deepFreezeAndThrowOnMutation(object) {\n // Some objects in IE11 don't have a hasOwnProperty method so don't even bother trying to freeze them\n if (typeof object !== 'object' || object === null || Object.isFrozen(object) || Object.isSealed(object)) {\n return object;\n }\n for (var key in object) {\n if (object.hasOwnProperty(key)) {\n object.__defineGetter__(key, identity.bind(null, object[key])); // eslint-disable-line no-underscore-dangle\n object.__defineSetter__(key, throwOnImmutableMutation.bind(null, key)); // eslint-disable-line no-underscore-dangle\n }\n }\n Object.freeze(object);\n Object.seal(object);\n for (var key in object) {\n if (object.hasOwnProperty(key)) {\n deepFreezeAndThrowOnMutation(object[key]);\n }\n }\n return object;\n}", "static fork(obj) {\n var ret, key, value;\n\n if (obj && obj.constructor === Object) {\n ret = Object.setPrototypeOf({}, obj);\n\n for (key in obj) {\n value = obj[key];\n\n if (value) {\n if (value.constructor === Object) {\n ret[key] = OH.fork(value);\n } else if (value instanceof Array) {\n ret[key] = value.slice();\n }\n }\n }\n } else {\n ret = obj;\n }\n\n return ret;\n }", "function PrimitiveType(noFreeze) {\n Type.call(this);\n this._branchConstructor = this._createBranchConstructor();\n if (!noFreeze) {\n // Abstract long types can't be frozen at this stage.\n Object.freeze(this);\n }\n}", "function TestObjectReset(obj, index) {\n obj.x = undefined;\n obj.y = undefined;\n\n // We store object index in pool on the object itself,\n // so we can use this index to free object from the pool.\n // However, doing this adds an extra reference on the object\n // which you might want to eliminate when dealing with very large pools of small objects\n obj.poolIndex = index;\n }", "function doop(o, seen) {\n let clone;\n let descriptor;\n let props;\n let i;\n let l;\n\n if (!seen) {\n seen = setDefined ? new Set() : [];\n }\n\n if (o instanceof Object && o.constructor !== Function) {\n if ( hasItem(seen, o) ) {\n clone = '<CircularRef>';\n }\n else {\n addItem(seen, o);\n\n if ( Array.isArray(o) ) {\n clone = [];\n for (i = 0, l = o.length; i < l; i++) {\n clone[i] = (o[i] instanceof Object) ? doop(o[i], seen) : o[i];\n }\n }\n else {\n clone = Object.create( Object.getPrototypeOf(o) );\n props = Object.keys(o);\n for (i = 0, l = props.length; i < l; i++) {\n descriptor = Object.getOwnPropertyDescriptor(o, props[i]);\n if (descriptor.value) {\n descriptor.value = doop(descriptor.value, seen);\n }\n\n Object.defineProperty(clone, props[i], descriptor);\n }\n }\n }\n\n return clone;\n }\n\n return o;\n}", "function local_change_type(input_object, new_type)\n {\n if(input_object instanceof new_type)\n return input_object;\n\n var new_object = new new_type();\n new_object.id_block = input_object.id_block;\n new_object.len_block = input_object.len_block;\n new_object.warnings = input_object.warnings;\n new_object.value_before_decode = util_copybuf(input_object.value_before_decode);\n\n return new_object;\n }", "function clone(object) { return JSON.parse(JSON.stringify(object))}", "set normal(value) {}", "set normal(value) {}", "function _setCoerce(obj) {\n return _array.call(this, Array.from(obj));\n}", "function deepObjectAssign() {\n var merged = deepObjectAssignNonentry.apply(void 0, arguments);\n stripDelete(merged);\n return merged;\n}", "function prepare$primitive (primitive, where) {\n try {\n return { ptv: primitive }\n } catch (e) {\n let e2 = new (e.constructor)(e.message + ' for ' + where)\n throw e2\n }\n}", "function deepClone(obj) {\n switch (typeof obj) {\n case 'object':\n return JSON.parse(JSON.stringify(obj)); //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case 'undefined':\n return null; //this is how JSON.stringify behaves for array items\n default:\n return obj; //no need to clone primitives\n }\n }", "function initialize(object) {\n this._object = Object.isHash(object) ? object.toObject() : Object.clone(object);\n }", "function initialize(object) {\n this._object = Object.isHash(object) ? object.toObject() : Object.clone(object);\n }", "function checkObject(obj){\n obj.checked = true;\n}", "function cloneObj(objectToBeCloned, visited = new Set()) {\n if (!(objectToBeCloned instanceof Object)) {\n return objectToBeCloned;\n }\n\n let objectClone;\n\n try {\n if (objectToBeCloned && objectToBeCloned[ITERABLE_KEY]) {\n objectToBeCloned = objectToBeCloned.toJS();\n }\n\n const Constructor = objectToBeCloned.constructor;\n\n switch (Constructor) {\n case RegExp:\n objectClone = new Constructor(objectToBeCloned);\n break;\n case Date:\n objectClone = new Constructor(objectToBeCloned.getTime());\n break;\n case Function:\n objectClone = {\n __metal_devtools_read_only: true\n };\n\n if (objectToBeCloned.name) {\n objectClone.value = `${objectToBeCloned.name}()`;\n } else if (objectToBeCloned.__jsxDOMWrapper) {\n objectClone.value = '<JSXElement />';\n } else {\n objectClone.value = 'function()';\n }\n break;\n default:\n try {\n objectClone = new Constructor();\n } catch (err) {\n objectClone = Constructor.name;\n }\n }\n } catch (err) {\n console.log(\n '%c metal-devtools extension: (`clone`)\\n',\n 'background: rgb(136, 18, 128); color: #DDD',\n err\n );\n console.log(\n '%c Args:',\n 'background: rgb(136, 18, 128); color: #DDD',\n objectToBeCloned\n );\n }\n\n if (objectClone instanceof Object) {\n visited.add(objectToBeCloned);\n\n for (const key in objectToBeCloned) {\n if (Object.prototype.hasOwnProperty.call(objectToBeCloned, key)) {\n const prop = objectToBeCloned[key];\n\n if (typeof prop !== undefined) {\n objectClone[key] = visited.has(prop)\n ? '[Circular]'\n : cloneObj(prop, visited);\n }\n }\n }\n\n visited.delete(objectToBeCloned);\n }\n\n return objectClone;\n}", "function _cloneObject(object) {\n\t if (object == null || typeof (object) != 'object' || typeof (object.nodeType) != 'undefined') {\n\t return object;\n\t }\n\t var temp = {};\n\t for (var key in object) {\n\t temp[key] = _cloneObject(object[key]);\n\t }\n\t return temp;\n\t }", "_leave_kids_to_gramps(me, child) {\n if (child == null) {\n me = null;\n } else {\n child.parent = me.parent;\n Object.assign(me, child);\n }\n }", "crack(v) {\n\t\t\n\t\tif (v.type != 1) return false\n\t\t\n\t\tthis.retype(v, 0)\n\t\t\n\t\tfor( var i = 0; i < 8; i++ ) {\n\t\t\tv.childs[i] = this.create( this.childPos(i, v), 1, v.lvl-1, v )\n\t\t}\n\t}", "reset(level = 1) {\n if ( level === 1 ) {\n trace(INFO_STORE, \"resetting\", this.name, \"with\", this._clones.length, \"clones\")\n }\n\n // info(INFO_STORE, \"RESET \", level, \":\", this.name, \" -> Found\", this._clones.length, \"clones\")\n this.definedProps = {}\n if ( level > 3 ) {\n warn(WARNING_RESET_MAX_DEPTH, \"RESET - Stop at recursion level 3\", this._clones)\n return\n }\n this._clones.forEach(clone => {\n clone.reset( level + 1 );\n })\n }", "function isPrimitiveLike (o) {\n if (o === null || (typeof o === 'object' && typeof o.toJSON !== 'undefined') ||\n typeof o === 'string' || typeof o === 'boolean' || typeof o === 'number') {\n return true\n }\n\n if (!Array.isArray(o)) {\n return false\n } else {\n let keys = Object.keys(o)\n if (keys.length !== o.length) { \n return false /* sparse array or named props */\n }\n }\n\n for (let i = 0; i < o.length; i++) {\n if (!isPrimitiveLike(o[i])) {\n return false\n }\n }\n\n return true\n}", "static initialize(obj) { \n obj['left'] = left;\n obj['right'] = right;\n obj['operator'] = operator;\n }", "flatClone(noodle, flatList = noodle.object.flatList(obj), newList = new Array(flatList.length)) { //Kinda stupid to check lists for each recursion?\n for (var i in flatList) {\n var obj = flatList[i];\n if (typeof obj == 'object') {\n //Go through obj to find its properties in flatList and clone them to newList\n for (var j in obj) {\n var ind = flatList.indexOf(obj[i]);//Find obj[i] in flatList\n if (ind != -1) {\n if (newList[i] == undefined) {//If this object hasn't been found before\n newList[i] = shallowClone(); //TODO\n }\n }\n }\n }\n return $.extend(null, obj);\n }\n }", "set referenceObject(obj) {\n this._referenceObject = obj;\n }", "function _iSClone(input, mMap, options) {\n\n if (input === null) {\n return null;\n }\n\n if (Object(input) === input) {\n return _handleObjectClone(input, mMap, options);\n }\n\n // If the value is a primitive, simply return it.\n return input;\n }", "function convertCircRefsRecursively(oldObj, currObj, newObj, replacement = 'Circular Ref') {\n each(currObj, (val, prop) => {\n \n if (isObject(val) || isArray(val)) {\n\n // detect a circular reference\n if (val === oldObj) {\n newObj[prop] = replacement;\n } \n // otherwise initialize the current object\n else {\n if(isArray(val)) {\n newObj[prop] = [];\n } else {\n newObj[prop] = {};\n }\n convertCircRefsRecursively(oldObj, val, newObj[prop], replacement);\n }\n } else {\n newObj[prop] = val;\n }\n });\n}", "function fixedProp(obj, name, value) {\n\t Object.defineProperty(obj, name, {\n\t configurable: true,\n\t enumerable: false,\n\t value: value,\n\t writable: false\n\t });\n\t}", "objd(obj) {\n\n return toObject(obj);\n }", "function redacted (object, publishable) {\n const clone = JSON.parse(JSON.stringify(object))\n Object.keys(clone).forEach(key => {\n if (!publishable.includes(key)) delete clone[key]\n })\n return clone\n}", "function remove(obj, path) {\n if (obj.toJSON) {\n // We need to get the JSON form of the object before recursing.\n // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#toJSON()_behavior\n obj = obj.toJSON();\n }\n if (Array.isArray(obj)) {\n var is_cloned = false;\n for (var i = 0; i < obj.length; i++) {\n var value = obj[i];\n if (value) {\n if (value instanceof ArrayBuffer || ArrayBuffer.isView(value)) {\n if (!is_cloned) {\n obj = obj.slice();\n is_cloned = true;\n }\n buffers.push(ArrayBuffer.isView(value) ? value.buffer : value);\n buffer_paths.push(path.concat([i]));\n // easier to just keep the array, but clear the entry, otherwise we have to think\n // about array length, much easier this way\n obj[i] = null;\n }\n else {\n var new_value = remove(value, path.concat([i]));\n // only assigned when the value changes, we may serialize objects that don't support assignment\n if (new_value !== value) {\n if (!is_cloned) {\n obj = obj.slice();\n is_cloned = true;\n }\n obj[i] = new_value;\n }\n }\n }\n }\n }\n else if (isPlainObject(obj)) {\n for (var key in obj) {\n var is_cloned = false;\n if (obj.hasOwnProperty(key)) {\n var value = obj[key];\n if (value) {\n if (value instanceof ArrayBuffer || ArrayBuffer.isView(value)) {\n if (!is_cloned) {\n obj = __assign({}, obj);\n is_cloned = true;\n }\n buffers.push(ArrayBuffer.isView(value) ? value.buffer : value);\n buffer_paths.push(path.concat([key]));\n delete obj[key]; // for objects/dicts we just delete them\n }\n else {\n var new_value = remove(value, path.concat([key]));\n // only assigned when the value changes, we may serialize objects that don't support assignment\n if (new_value !== value) {\n if (!is_cloned) {\n obj = __assign({}, obj);\n is_cloned = true;\n }\n obj[key] = new_value;\n }\n }\n }\n }\n }\n }\n return obj;\n }", "function fastpathSet(obj, name) {\n if (name === 'toString') { fail(\"internal: Can't fastpath .toString\"); }\n if (isFrozen(obj)) {\n fail(\"Can't set .\", name, ' on frozen (', debugReference(obj), ')');\n }\n if (typeOf(obj) === 'function') {\n fail(\"Can't make .\", name, \n ' writable on a function (', debugReference(obj), ')');\n }\n fastpathEnum(obj, name);\n fastpathRead(obj, name);\n if (obj[name + '_canCall___']) {\n obj[name + '_canCall___'] = false;\n }\n if (obj[name + '_grantCall___']) {\n obj[name + '_grantCall___'] = false;\n }\n obj.SLOWFREEZE___ = obj;\n obj[name + '_canSet___'] = obj;\n }", "_unwrap(value, asClone = true) {\n if (!this.options.useClones) {\n asClone = false;\n }\n if (value.v != null) {\n if (asClone) {\n return clone(value.v);\n } else {\n return value.v;\n }\n }\n return null;\n }", "function _updateSelectedObject() {\n var data = $('.listTree').data('listTree');\n\n // Filter the context to the selected parents.\n var selected = _.filter($.extend(true, {}, data.context), function(parent) {\n return $('.listTree > ul > li > span > input[value=\"' + parent.key + '\"]').prop('checked')\n });\n \n // For each parent in the working context...\n _.each(selected, function(parent) {\n\n // Filter the children to the selected children.\n parent.values = _.filter(parent.values, function(child) {\n return $('.listTree > ul > li > ul > li > span > input[value=\"' + child.key + '\"]').prop('checked');\n });\n });\n\n // Update the plugin's selected object.\n $('.listTree').data('listTree', {\n \"target\": data.target,\n \"context\": data.context,\n \"options\": data.options,\n \"selected\": selected\n });\n }", "function PrimitiveType(noFreeze) {\n Type$2.call(this);\n this._branchConstructor = this._createBranchConstructor();\n if (!noFreeze) {\n // Abstract long types can't be frozen at this stage.\n Object.freeze(this);\n }\n}", "set serializedObject(value) {}", "function primitiveEqualsInteger(obj, integer) {\n return obj.primitive && obj.primitive.numerator === integer && obj.primitive.denominator === 1\n}", "function coercePrimitiveToObject(obj) {\n if (isPrimitive(obj)) {\n obj = Object(obj);\n }\n // istanbul ignore next\n if (NO_KEYS_IN_STRING_OBJECTS && isString(obj)) {\n forceStringCoercion(obj);\n }\n return obj;\n }", "function wrap (obj, onMutate, path = []) {\n function recordMutation (op, childPath, value) {\n let fullPath = path.concat(childPath)\n let oldValue\n let existed = false\n try {\n [ oldValue, existed ] = access(obj, childPath)\n } catch (err) {}\n let mutation = {\n op,\n path: fullPath,\n oldValue: baseObject(oldValue),\n newValue: value,\n existed\n }\n onMutate(mutation)\n // TODO: replace mutations for overriden paths\n }\n\n // TODO: wrap array methods to record array-specific mutations,\n // otherwise ops like splices and shifts will create N mutations\n\n function put (obj, key, value, path = []) {\n if (!isObject(value)) {\n // if we are overriding an existing object,\n // record deletion\n if (isObject(obj[key])) {\n // recursively delete object props\n del(obj, key)\n }\n\n // record parent object update\n let parent = baseObject(obj)\n parent[key] = baseObject(value)\n recordMutation('put', path, parent)\n return\n }\n\n // if we are overriding an existing non-object,\n // record update of parent base object\n if (key in obj && !isObject(obj[key])) {\n let base = baseObject(obj)\n delete base[key]\n recordMutation('put', path, base)\n }\n\n // if parent is array, ensure length gets updated\n if (Array.isArray(obj)) {\n let parent = baseObject(obj)\n recordMutation('put', path, parent)\n }\n\n let base = baseObject(value)\n recordMutation('put', path.concat(key), base)\n\n for (let childKey in value) {\n let child = value[childKey]\n\n // if any of our non-object children override an\n // existing object, then record deletion\n if (!isObject(child)) {\n if (!isObject(obj[key])) continue\n if (!isObject(obj[key][childKey])) continue\n del(obj[key], childKey, path.concat(key))\n continue\n }\n\n // recursively record puts for objects\n put(value, childKey, child, path.concat(key))\n }\n }\n\n function del (obj, key, path = []) {\n let value = obj[key]\n\n if (!isObject(obj[key])) {\n // record parent object update\n let parent = baseObject(obj)\n delete parent[key]\n recordMutation('put', path, parent)\n return\n }\n\n // recursively record deletions for objects\n for (let childKey in value) {\n let child = value[childKey]\n if (!isObject(child)) continue\n del(value, childKey, path.concat(key))\n }\n\n recordMutation('del', path.concat(key))\n }\n\n let wrapped = new Proxy(obj, {\n // recursively wrap child objects when accessed\n get (obj, key) {\n let value = obj[key]\n\n // functions should be bound to parent\n if (typeof value === 'function') {\n return value.bind(wrapped)\n }\n\n // don't recurse if not object\n if (!isObject(value)) {\n return value\n }\n\n // convert array bases to actual array\n if ('__MERK_ARRAY__' in value) {\n let base = value\n value = new Array(value.length)\n Object.assign(value, base)\n delete value.__MERK_ARRAY__\n }\n\n // if value is object, recursively wrap\n let childPath = path.concat(key)\n return wrap(value, onMutate, childPath)\n },\n\n // record mutations\n set (obj, key, value) {\n put(obj, key, value)\n obj[key] = value\n return true\n },\n\n // record deletions as mutations too\n deleteProperty (obj, key) {\n if (!(key in obj)) return true\n del(obj, key)\n delete obj[key]\n return true\n },\n\n // ovverride ownKeys to exclude symbol properties\n ownKeys () {\n return Object.getOwnPropertyNames(obj)\n }\n })\n return wrapped\n}", "function wrongDeepCopy(obj) {\n return obj\n}", "get Primitives() {\n return Primitives;\n }", "static cloneDeep(obj) {\r\n // list of fields we will skip during cloneDeep (nested objects, other internal)\r\n const skipFields = ['_isNested', 'el', 'grid', 'subGrid', 'engine'];\r\n // return JSON.parse(JSON.stringify(obj)); // doesn't work with date format ?\r\n const ret = Utils.clone(obj);\r\n for (const key in ret) {\r\n // NOTE: we don't support function/circular dependencies so skip those properties for now...\r\n if (ret.hasOwnProperty(key) && typeof (ret[key]) === 'object' && key.substring(0, 2) !== '__' && !skipFields.find(k => k === key)) {\r\n ret[key] = Utils.cloneDeep(obj[key]);\r\n }\r\n }\r\n return ret;\r\n }", "function primitiveEqualsInteger(obj, integer) {\n return obj.meta.primitive && obj.meta.primitive.numerator === integer && obj.meta.primitive.denominator === 1\n}", "AddObject(object)\n {\n if(this.root == undefined)\n {\n this.root = new Node(object);\n }\n else\n {\n this.p = root;\n while(this.p != undefined)\n {\n if(this.p.object.drawOrder <= object.drawOrder)\n {\n this.p = this.p.rigth;\n }\n else\n {\n this.p = this.p.left;\n }\n }\n this.p = new Node(object);\n }\n }" ]
[ "0.6690821", "0.6626453", "0.6613599", "0.6613599", "0.63387674", "0.5628509", "0.54233634", "0.54124993", "0.53967017", "0.53695726", "0.5347259", "0.5282712", "0.5180013", "0.5173394", "0.5148008", "0.5135972", "0.51214164", "0.51214164", "0.51150763", "0.5105766", "0.50838906", "0.50802946", "0.50305027", "0.50223804", "0.5014593", "0.5009406", "0.49888662", "0.49882594", "0.49507645", "0.4937489", "0.49297863", "0.49275067", "0.49142364", "0.4899302", "0.48978642", "0.48948672", "0.48930258", "0.4889762", "0.4889762", "0.4886482", "0.48832896", "0.4877819", "0.48766136", "0.4872674", "0.48685187", "0.48638347", "0.4856518", "0.48459738", "0.4845838", "0.48446465", "0.48408043", "0.4831986", "0.48297507", "0.48279026", "0.4816325", "0.4816325", "0.48080245", "0.4784868", "0.47837391", "0.4776616", "0.47737643", "0.47737643", "0.47716153", "0.47684968", "0.47684324", "0.47677562", "0.47662967", "0.4765881", "0.47637936", "0.47620663", "0.47607896", "0.47548577", "0.47471568", "0.4746614", "0.47399133", "0.47358373", "0.47343573", "0.4731738", "0.47212714", "0.47207174", "0.47175744", "0.47175553", "0.47144672", "0.4714461", "0.47128433", "0.47127005", "0.47108766", "0.4706036", "0.47049335", "0.4701465", "0.4698154" ]
0.63652956
13
This is a dummy function to check if the function name has been altered by minification. If the function has been minified and NODE_ENV !== 'production', warn the user.
function isCrushed() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uglify(name) {\n console.log(\"Hello \" + name);\n}", "function keepNonMinified(file) {\n\tvar keep = true;\n\tif(file.path.match('.js$')) {\n\t\tvar minPath = file.path.replace('.js', '.min.js');\n\t\tkeep = !exists(minPath);\n\t}\n\treturn keep;\n}", "function markFuncFreeze(fun, opt_name) {\n // inline: enforceType(fun, 'function', opt_name);\n if (typeOf(fun) !== 'function') {\n fail('expected function instead of ', typeOf(fun),\n ': ', (opt_name || fun));\n }\n\n // inline: if (isCtor(fun)) {\n if (fun.CONSTRUCTOR___) {\n fail(\"Constructors can't be simple functions: \", fun);\n }\n // inline: if (isXo4aFunc(fun)) {\n if (fun.XO4A___) {\n fail(\"Exophoric functions can't be simple functions: \", fun);\n }\n fun.FUNC___ = opt_name ? String(opt_name) : true;\n return primFreeze(fun);\n }", "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) { type = 'warn'; }\n if (Object(__WEBPACK_IMPORTED_MODULE_0__environment__[\"b\" /* isProduction */])()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__environment__[\"c\" /* isTest */])()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) { type = 'warn'; }\n if (Object(__WEBPACK_IMPORTED_MODULE_0__environment__[\"b\" /* isProduction */])()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__environment__[\"c\" /* isTest */])()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "function isUserFunction(source) {\n return (typeof source === 'function' && source !== exports.NOOP);\n}", "function isUserFunction(source) {\n return (typeof source === 'function' && source !== exports.NOOP);\n}", "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) { type = 'warn'; }\n if (Object(__WEBPACK_IMPORTED_MODULE_0__environment__[\"d\" /* isProduction */])()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__environment__[\"e\" /* isTest */])()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "function warn(message) {\n if (_warningCallback && \"dev\" !== 'production') {\n _warningCallback(message);\n }\n else if (console && console.warn) {\n console.warn(message);\n }\n}", "function cleanFunctionName(functionName) {\n var ignoredPrefix = 'non-virtual thunk to ';\n if (functionName.startsWith(ignoredPrefix)) {\n return functionName.substr(ignoredPrefix.length);\n }\n return functionName;\n}", "minify() {\n\n }", "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) { type = 'warn'; }\n if (Object(_environment__WEBPACK_IMPORTED_MODULE_0__[\"isProduction\"])()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!Object(_environment__WEBPACK_IMPORTED_MODULE_0__[\"isTest\"])()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) { type = 'warn'; }\n if (Object(_environment__WEBPACK_IMPORTED_MODULE_0__[\"isProduction\"])()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!Object(_environment__WEBPACK_IMPORTED_MODULE_0__[\"isTest\"])()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) { type = 'warn'; }\n if (Object(_environment__WEBPACK_IMPORTED_MODULE_0__[\"isProduction\"])()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!Object(_environment__WEBPACK_IMPORTED_MODULE_0__[\"isTest\"])()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) { type = 'warn'; }\n if (Object(_environment__WEBPACK_IMPORTED_MODULE_0__[\"isProduction\"])()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!Object(_environment__WEBPACK_IMPORTED_MODULE_0__[\"isTest\"])()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) { type = 'warn'; }\n if (Object(_environment__WEBPACK_IMPORTED_MODULE_0__[\"isProduction\"])()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!Object(_environment__WEBPACK_IMPORTED_MODULE_0__[\"isTest\"])()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "isFileCompressed(file) {\n var dir = path.dirname(file);\n var basename = path.basename(file);\n\n if(this.isScript(basename) || this.isCss(basename) || this.isLess(basename)) {\n if(basename == 'script.js') {\n var compressedName = dir + '/script.min.js';\n } else if(basename == 'styles.css') {\n var compressedName = dir + '/styles.min.css';\n } else if(basename == 'style.css') {\n var compressedName = dir + '/style.min.css';\n } else if(this.isLess(basename)) {\n var compressedName = '../www/local/templates/bootstrap3/styles.css';\n }\n // var compressedName = (basename == 'script.js') ? dir + '/script.min.js' : dir + '/style.min.css';\n\n return this.isDateActual(file, compressedName);\n } else {\n return false;\n }\n }", "function isFallbackFunction(f) {\n return !f.name\n}", "function functionWithoutJSDocWarningsBecauseTheSectionWasCompletelyExcluded() {\n console.log('ASHLDKFJHASKFJSDHFKJSDHFKLSDJHFLJKSDHFLKSDJFHKSDLJFHLSDKJF')\n return true\n}", "isPackedFunc(func) {\n // eslint-disable-next-line no-prototype-builtins\n return typeof func == \"function\" && func.hasOwnProperty(\"_tvmPackedCell\");\n }", "function warn(message) {\n if (_warningCallback && \"development\" !== 'production') {\n _warningCallback(message);\n }\n else if (console && console.warn) {\n console.warn(message);\n }\n}", "function checkFunction(fn) {\n return typeof fn === 'function';\n }", "function istraced (namespace) {\n /* istanbul ignore next: tested in a child processs */\n if (process.traceDeprecation) {\n // --trace-deprecation support\n return true\n }\n\n var str = Object({\"NODE_ENV\":\"production\"}).TRACE_DEPRECATION || ''\n\n // namespace traced\n return containsNamespace(str, namespace)\n}", "function istraced (namespace) {\n /* istanbul ignore next: tested in a child processs */\n if (process.traceDeprecation) {\n // --trace-deprecation support\n return true\n }\n\n var str = Object({\"NODE_ENV\":\"production\"}).TRACE_DEPRECATION || ''\n\n // namespace traced\n return containsNamespace(str, namespace)\n}", "function istraced (namespace) {\n /* istanbul ignore next: tested in a child processs */\n if (process.traceDeprecation) {\n // --trace-deprecation support\n return true\n }\n\n var str = Object({\"NODE_ENV\":\"production\"}).TRACE_DEPRECATION || ''\n\n // namespace traced\n return containsNamespace(str, namespace)\n}", "function isignored (namespace) {\n /* istanbul ignore next: tested in a child processs */\n if (process.noDeprecation) {\n // --no-deprecation support\n return true\n }\n\n var str = Object({\"NODE_ENV\":\"production\"}).NO_DEPRECATION || ''\n\n // namespace ignored\n return containsNamespace(str, namespace)\n}", "function isignored (namespace) {\n /* istanbul ignore next: tested in a child processs */\n if (process.noDeprecation) {\n // --no-deprecation support\n return true\n }\n\n var str = Object({\"NODE_ENV\":\"production\"}).NO_DEPRECATION || ''\n\n // namespace ignored\n return containsNamespace(str, namespace)\n}", "function isignored (namespace) {\n /* istanbul ignore next: tested in a child processs */\n if (process.noDeprecation) {\n // --no-deprecation support\n return true\n }\n\n var str = Object({\"NODE_ENV\":\"production\"}).NO_DEPRECATION || ''\n\n // namespace ignored\n return containsNamespace(str, namespace)\n}", "function isProduction() {\n return argv.production\n}", "function isDev() {\n return (process.env.NODE_ENV !== 'production')\n}", "function isDev(fn) {\n if (devMode) {\n return fn;\n } else {\n return passthrough();\n }\n}", "function onValidateGLFunc( functionName, functionArgs ) {\n let functionString;\n if ( log.priority >= 4 ) {\n functionString = getFunctionString( functionName, functionArgs );\n log.info( 4, functionString );\n }\n\n if ( log.break ) {\n functionString = functionString || getFunctionString( functionName, functionArgs );\n const isBreakpoint = log.break &&\n log.break.every( breakOn => functionString.indexOf( breakOn ) !== -1 );\n if ( isBreakpoint ) {\n debugger; // eslint-disable-line\n }\n }\n\n for ( const arg of functionArgs ) {\n if ( arg === undefined ) {\n functionString = functionString || getFunctionString( functionName, functionArgs );\n if ( log.throw ) {\n throw new Error( `Undefined argument: ${functionString}` );\n } else {\n log.error( `Undefined argument: ${functionString}` );\n debugger; // eslint-disable-line\n }\n }\n }\n}", "function monitorCodeUse(eventName, data) {\n (\"production\" !== \"development\" ? invariant(\n eventName && !/[^a-z0-9_]/.test(eventName),\n 'You must provide an eventName using only the characters [a-z0-9_]'\n ) : invariant(eventName && !/[^a-z0-9_]/.test(eventName)));\n}", "function monitorCodeUse(eventName, data) {\n (\"production\" !== \"development\" ? invariant(\n eventName && !/[^a-z0-9_]/.test(eventName),\n 'You must provide an eventName using only the characters [a-z0-9_]'\n ) : invariant(eventName && !/[^a-z0-9_]/.test(eventName)));\n}", "function monitorCodeUse(eventName, data) {\n (\"production\" !== \"development\" ? invariant(\n eventName && !/[^a-z0-9_]/.test(eventName),\n 'You must provide an eventName using only the characters [a-z0-9_]'\n ) : invariant(eventName && !/[^a-z0-9_]/.test(eventName)));\n}", "function monitorCodeUse(eventName, data) {\n (\"production\" !== \"development\" ? invariant(\n eventName && !/[^a-z0-9_]/.test(eventName),\n 'You must provide an eventName using only the characters [a-z0-9_]'\n ) : invariant(eventName && !/[^a-z0-9_]/.test(eventName)));\n}", "function monitorCodeUse(eventName, data) {\n (\"production\" !== \"development\" ? invariant(\n eventName && !/[^a-z0-9_]/.test(eventName),\n 'You must provide an eventName using only the characters [a-z0-9_]'\n ) : invariant(eventName && !/[^a-z0-9_]/.test(eventName)));\n}", "function monitorCodeUse(eventName, data) {\n (\"production\" !== \"development\" ? invariant(\n eventName && !/[^a-z0-9_]/.test(eventName),\n 'You must provide an eventName using only the characters [a-z0-9_]'\n ) : invariant(eventName && !/[^a-z0-9_]/.test(eventName)));\n}", "function can_mangle(name) {\n if (unmangleable.indexOf(name) >= 0) return false;\n if (reserved.indexOf(name) >= 0) return false;\n if (options.only_cache) {\n return cache.props.has(name);\n }\n if (/^-?[0-9]+(\\.[0-9]+)?(e[+-][0-9]+)?$/.test(name)) return false;\n return true;\n }", "function onValidateGLFunc(functionName, functionArgs) {\n let functionString;\n if (log.priority >= 4) {\n functionString = getFunctionString(functionName, functionArgs);\n log.log(4, functionString)();\n }\n\n if (log.break) {\n functionString = functionString || getFunctionString(functionName, functionArgs);\n const isBreakpoint =\n log.break && log.break.every(breakOn => functionString.indexOf(breakOn) !== -1);\n if (isBreakpoint) {\n debugger; // eslint-disable-line\n }\n }\n\n for (const arg of functionArgs) {\n if (arg === undefined) {\n functionString = functionString || getFunctionString(functionName, functionArgs);\n if (log.throw) {\n throw new Error(`Undefined argument: ${functionString}`);\n } else {\n log.error(`Undefined argument: ${functionString}`)();\n log.error(`Undefined argument: ${functionString}`)();\n debugger; // eslint-disable-line\n }\n }\n }\n}", "function untestableFilter(mockName) {\n var cond =\n !(\n mockName === 'font-wishlist' ||\n mockName.indexOf('mapbox_') !== -1\n );\n\n if(!cond) console.log(' -', mockName);\n\n return cond;\n}", "function isProductionBuild() {\n return process.env.NODE_ENV === 'production';\n}", "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) { type = 'warn'; }\n if (isProduction()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!isTest()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "function function_exists(function_name)\n{\n if (typeof function_name == 'string')\n return (typeof window[function_name] == 'function');\n return (function_name instanceof Function);\n}", "function warn(message) {\n if (_warningCallback && process.env.NODE_ENV !== 'production') {\n _warningCallback(message);\n }\n else if (console && console.warn) {\n console.warn(message);\n }\n}", "function monitorCodeUse(eventName, data) {\n\t (\"production\" !== process.env.NODE_ENV ? invariant(\n\t eventName && !/[^a-z0-9_]/.test(eventName),\n\t 'You must provide an eventName using only the characters [a-z0-9_]'\n\t ) : invariant(eventName && !/[^a-z0-9_]/.test(eventName)));\n\t}", "function monitorCodeUse(eventName, data) {\n\t (\"production\" !== process.env.NODE_ENV ? invariant(\n\t eventName && !/[^a-z0-9_]/.test(eventName),\n\t 'You must provide an eventName using only the characters [a-z0-9_]'\n\t ) : invariant(eventName && !/[^a-z0-9_]/.test(eventName)));\n\t}", "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) {\n type = 'warn';\n }\n if ((0, _environment.isProduction)()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!(0, _environment.isTest)()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) {\n type = 'warn';\n }\n if ((0, _environment.isProduction)()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!(0, _environment.isTest)()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "function isProdMode() {\n return process.env.NODE_ENV == 'production';\n}", "function funcName(func) {\n return func.name || \"{anonymous}\"\n }", "function checkIfFunction(func) {\n return typeof func === \"function\";\n}", "function getFunctionName( func ){\n\n\ttry {\n\t\tfunc = func.substr('function '.length);\n\t \tfunc = func.substr(0, func.indexOf('('));\n\n\t\tif( func == \"\" ) func = \"ANONYMOUS_FUNC\";\n\t\tif( func.indexOf( \"=>\" ) >= 0 ) func = \"ANONYMOUS_FUNC\";\n\n\t\treturn func;\n\t} catch( err ){\n\t\tconsole.log( \"\\x1b[31m%s\\x1b[0m\", \"[summer-mvc core]\", \"[logger.js]\", err );\n\t\tthrow err;\n\t}\n}", "function monitorCodeUse(eventName, data) {\n (\"production\" !== process.env.NODE_ENV ? invariant(\n eventName && !/[^a-z0-9_]/.test(eventName),\n 'You must provide an eventName using only the characters [a-z0-9_]'\n ) : invariant(eventName && !/[^a-z0-9_]/.test(eventName)));\n}", "function monitorCodeUse(eventName, data) {\n (\"production\" !== process.env.NODE_ENV ? invariant(\n eventName && !/[^a-z0-9_]/.test(eventName),\n 'You must provide an eventName using only the characters [a-z0-9_]'\n ) : invariant(eventName && !/[^a-z0-9_]/.test(eventName)));\n}", "function monitorCodeUse(eventName, data) {\n (\"production\" !== process.env.NODE_ENV ? invariant(\n eventName && !/[^a-z0-9_]/.test(eventName),\n 'You must provide an eventName using only the characters [a-z0-9_]'\n ) : invariant(eventName && !/[^a-z0-9_]/.test(eventName)));\n}", "function monitorCodeUse(eventName, data) {\n (\"production\" !== process.env.NODE_ENV ? invariant(\n eventName && !/[^a-z0-9_]/.test(eventName),\n 'You must provide an eventName using only the characters [a-z0-9_]'\n ) : invariant(eventName && !/[^a-z0-9_]/.test(eventName)));\n}", "function monitorCodeUse(eventName, data) {\n (\"production\" !== process.env.NODE_ENV ? invariant(\n eventName && !/[^a-z0-9_]/.test(eventName),\n 'You must provide an eventName using only the characters [a-z0-9_]'\n ) : invariant(eventName && !/[^a-z0-9_]/.test(eventName)));\n}", "function monitorCodeUse(eventName, data) {\n (\"production\" !== process.env.NODE_ENV ? invariant(\n eventName && !/[^a-z0-9_]/.test(eventName),\n 'You must provide an eventName using only the characters [a-z0-9_]'\n ) : invariant(eventName && !/[^a-z0-9_]/.test(eventName)));\n}", "function monitorCodeUse(eventName, data) {\n (\"production\" !== process.env.NODE_ENV ? invariant(\n eventName && !/[^a-z0-9_]/.test(eventName),\n 'You must provide an eventName using only the characters [a-z0-9_]'\n ) : invariant(eventName && !/[^a-z0-9_]/.test(eventName)));\n}", "function monitorCodeUse(eventName, data) {\n (\"production\" !== process.env.NODE_ENV ? invariant(\n eventName && !/[^a-z0-9_]/.test(eventName),\n 'You must provide an eventName using only the characters [a-z0-9_]'\n ) : invariant(eventName && !/[^a-z0-9_]/.test(eventName)));\n}", "function checkFunctions(func1, func2) {\n if (func1.toString() !== func2.toString()) return false;\n return true;\n}", "function monitorCodeUse(eventName, data) {\n (\"production\" !== \"production\" ? invariant(\n eventName && !/[^a-z0-9_]/.test(eventName),\n 'You must provide an eventName using only the characters [a-z0-9_]'\n ) : invariant(eventName && !/[^a-z0-9_]/.test(eventName)));\n}", "function unusedFragMessage(fragName) {\n return 'Fragment \"' + fragName + '\" is never used.';\n}", "function showSpecialWarning() {\r\n return true;\r\n}", "function has_bugs(buggy_code) {\n if (buggy_code) {\n return 'sad days'\n } else {\n return 'it\\'s a good day'\n }\n }", "function function_exists(function_name)\n{\n\tif (typeof function_name == 'string')\n\t\treturn (typeof window[function_name] == 'function');\n\treturn (function_name instanceof Function);\n}", "function StupidBug() {}", "function functionTest(){\n 'use strict';\n console.log(this===window);\n}", "function unusedFragMessage(fragName) {\n return \"Fragment \\\"\".concat(fragName, \"\\\" is never used.\");\n}", "function isDeployment() {\n return !isDev()\n}", "warn() {}", "function getMinimizerConfig() {\n return global.FOO_PROD\n ? [\n new UglifyJsPlugin({\n uglifyOptions: {\n parse: {\n html5_comments: false\n },\n comments: false,\n compress: {\n warnings: false,\n drop_console: true,\n drop_debugger: true\n }\n },\n extractComments: true\n })\n ]\n : [];\n}", "function DEBUG2() {\n if (d) {\n console.warn.apply(console, arguments)\n }\n}", "function checkInstrumented() {\n if (proto['__gl_wrapped__']) {\n return false;\n }\n Object.defineProperty(proto, '__gl_wrapped__', {\n 'configurable': true,\n 'enumerable': false,\n 'value': true\n });\n contextRestoreFns.push(function() {\n delete proto['__gl_wrapped__'];\n });\n return true;\n }", "function existFunction(strNameFunction)\n{\n return (!empty(window[strNameFunction])) ? isFunction(window[strNameFunction]) : false;\n}", "function someFunc() {}", "minifyOneFile () {\n throw new Error('CachingMinifier subclass should implement minifyOneFile!');\n }", "function myReusableFunction(){\n console.log(\"Heyya World\");\n}", "function isHotswappableLambdaFunctionChange(logicalId, change, assetParamsWithEnv) {\n var _a, _b;\n const lambdaCodeChange = isLambdaFunctionCodeOnlyChange(change, assetParamsWithEnv);\n if (typeof lambdaCodeChange === 'string') {\n return lambdaCodeChange;\n }\n else {\n // verify that the Asset changed - otherwise,\n // it's a Code property-only change,\n // but not to an asset change\n // (for example, going from Code.fromAsset() to Code.fromInline())\n if (!common_1.assetMetadataChanged(change)) {\n return common_1.ChangeHotswapImpact.REQUIRES_FULL_DEPLOYMENT;\n }\n let functionPhysicalName;\n try {\n functionPhysicalName = common_1.stringifyPotentialCfnExpression((_b = (_a = change.newValue) === null || _a === void 0 ? void 0 : _a.Properties) === null || _b === void 0 ? void 0 : _b.FunctionName, assetParamsWithEnv);\n }\n catch (e) {\n // It's possible we can't evaluate the function's name -\n // for example, it can use a Ref to a different resource,\n // which we wouldn't have in `assetParamsWithEnv`.\n // That's fine though - ignore any errors,\n // and treat this case the same way as if the name wasn't provided at all,\n // which means it will be looked up using the listStackResources() call\n // by the later phase (which actually does the Lambda function update)\n functionPhysicalName = undefined;\n }\n return new LambdaFunctionHotswapOperation({\n logicalId,\n physicalName: functionPhysicalName,\n code: lambdaCodeChange,\n });\n }\n}", "function staticallyAnalyze(fn) {\n const report = {\n isAsync: false,\n hasInjectionParam: false,\n injections: [/* alias1, alias2, ... */],\n wantsContainer: false,\n wantedBindingMethods: [],\n // fn, // The function itself\n };\n\n // NOTE Here we say this is a proper function to Esprima\n // since it throws error if the function string like;\n // `boot() { ... }`\n let bootFnStr = fn.toString();\n if (/^(\\w+)\\(([\\w,\\s{}:\\'\\\"]*)\\)\\s{0,1}\\{(?!\\w+)/.test(bootFnStr)) {\n bootFnStr = `function ${bootFnStr}`;\n }\n let pb0 = (esprima.parseScript(bootFnStr)).body[0];\n if (pb0.type !== 'FunctionDeclaration' && pb0.expression) {\n pb0 = pb0.expression;\n }\n\n report.isAsync = pb0.async;\n\n // TODO Loop here at most 2 times (hence the note above)\n // Therefore we can enter the if statement's body below (~:335)\n const maxArgumentCountToProcess = (pb0.params.length < 2 ? pb0.params.length : 2);\n let i = 0;\n while (i < maxArgumentCountToProcess) {\n if (pb0.params[i].type === 'ObjectPattern') {\n // First argument is defined as `{ ... }`\n\n // Extract property names\n //\n const propertyNames = pb0.params[i].properties.map((property) => {\n // TODO Figure out the checks below is really necessary - if not simplify this arrow function\n if (property.computed) {\n throw new Error(`Computed property names (${property.key.name}) are not supported.`);\n }\n if (property.method) {\n throw new Error(`Methods (${property.key.name}) are not supported.`);\n }\n\n return (property.key.name || property.key.value);\n });\n\n // FIXME [MANUALNAME_INJECTABLE]: Manual update required here to sustain consistency\n // See https://stackoverflow.com/a/1885569/250453\n const containerLikeIntersection = [\n 'bind',\n 'singleton',\n 'instance',\n 'make',\n 'callInKernelContext',\n 'paths',\n 'on',\n 'once',\n 'off',\n 'emit',\n // Add Mirket methods that can be injected to the `boot()` of a provider\n ].filter(value => propertyNames.indexOf(value) !== -1);\n\n // NOTE Maybe here we can validate each type of argument's number in the list,\n // e.g. if argument list is like this; `({ binding1 }, container, { instance })\n // do NOT send the container as the 2nd or 3rd argument.\n if (containerLikeIntersection.length > 0) {\n // NOTE Just one container-related method name (e.g. 'bind', 'singleton', 'instance')\n // is enough to say that it want the container.\n report.wantsContainer = true;\n report.wantedBindingMethods.push(...containerLikeIntersection);\n\n // TODO Figure out what to do with others?\n } else {\n report.hasInjectionParam = true;\n report.injections.push(...propertyNames);\n }\n }\n\n i += 1;\n }\n\n return report;\n}", "function isValidExtensionFunction(fn) {\n const reflectionResult = functionReflector.forFunction(fn);\n\n return reflectionResult.params.length === 0\n || (reflectionResult.params[0].type === `DESTRUCTURING`\n && reflectionResult.params[0].value.type === `object`);\n}", "function functionExists(function_name)\n\t{\n\t\t// https://kvz.io/\n\t\t// + original by: Kevin van Zonneveld (https://kvz.io/)\n\t\t// + improved by: Steve Clay\n\t\t// + improved by: Legaev Andrey\n\t\t// * example 1: function_exists('isFinite');\n\t\t// * returns 1: true\n\t\tif (typeof function_name == 'string')\n\t\t{\n\t\t\treturn (typeof window[function_name] == 'function');\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn (function_name instanceof Function);\n\t\t}\n\t}", "function funcname(f) {\n const s = f.toString().match(/function (\\w*)/)[1];\n if ((s === null) || (s.length === 0)){ return \"~anonymous~\";}\n return s;\n}", "function strictly() {\n 'use strict';\n\n}", "function test(fn) {\n return Object.defineProperty(fn, \"name\", {\n enumerable: false,\n configurable: true,\n value: \"@\" + fn.name,\n writable: false\n });\n}", "diagnosticDetectFunctionCollisions(file) {\n for (let func of file.callables) {\n const funcName = func.getName(Parser_1.ParseMode.BrighterScript);\n const lowerFuncName = funcName === null || funcName === void 0 ? void 0 : funcName.toLowerCase();\n if (lowerFuncName) {\n //find function declarations with the same name as a stdlib function\n if (globalCallables_1.globalCallableMap.has(lowerFuncName)) {\n this.diagnostics.push(Object.assign(Object.assign({}, DiagnosticMessages_1.DiagnosticMessages.scopeFunctionShadowedByBuiltInFunction()), { range: func.nameRange, file: file }));\n }\n //find any functions that have the same name as a class\n if (this.hasClass(lowerFuncName)) {\n this.diagnostics.push(Object.assign(Object.assign({}, DiagnosticMessages_1.DiagnosticMessages.functionCannotHaveSameNameAsClass(funcName)), { range: func.nameRange, file: file }));\n }\n }\n }\n }", "function warnUser() {\n console.log(\"This is my warning message\");\n}", "function warnUser() {\n console.log(\"This is my warning message\");\n}", "function _checkForUnused() {\n // function params are handled specially\n // assume that parameters are the only thing declared in the param scope\n if (_current[\"(type)\"] === \"functionparams\") {\n _checkParams();\n return;\n }\n var curentLabels = _current[\"(labels)\"];\n for (var labelName in curentLabels) {\n if (curentLabels[labelName][\"(type)\"] !== \"exception\" &&\n curentLabels[labelName][\"(unused)\"]) {\n _warnUnused(labelName, curentLabels[labelName][\"(token)\"], \"var\");\n }\n }\n }", "function formatProdErrorMessage(code){var url='https://reactjs.org/docs/error-decoder.html?invariant='+code;for(var i=1;i<arguments.length;i++){url+='&args[]='+encodeURIComponent(arguments[i]);}return \"Minified React error #\"+code+\"; visit \"+url+\" for the full message or \"+'use the non-minified dev environment for full errors and additional '+'helpful warnings.';}// TODO: this is special because it gets imported during build.", "function f() {\n \"Make sure `this` is unusable in this standalone function.\";\n}", "function check_for_anonymous_functions(){\n\t\n\t// For completing the starting block\n\tfunc_name = '';\n\tfunc_stack = [];\n\n\tfor (var i = 0; i < program_stack.length; i++) {\n\t\tif(program_stack[i] == 'invoke-fun-pre_'){\n\t\t\t\n\t\t\t//If the program starts with a self-invokating function then add \"anonymous\" keyword which will help in further processing\n\t\t\tif(i == 0){\n\t\t\t\tfunc_stack.push(\"anonymous\");\n\t\t\t\tprogram_stack[i] = program_stack[i] + \"anonymous\";\n\t\t\t\tfunction_list.push(\"anonymous\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// For anonymous functions without names assign them the names to which these functions are assigned.\n\t\t\tfunc_name = program_stack[i-1].split('_').splice(-1)[0];\n\t\t\tprogram_stack[i] = program_stack[i] + func_name;\n\t\t\tfunction_list.push(func_name);\n\t\t\tfunc_stack.push(func_name);\t\t\n\t\t}\n\n\t\t//Completing the program stack block ending with appropriate keywords for anonymous functions.\n\t\tif(program_stack[i] == 'invoke-fun_'){\n\t\t\tprogram_stack[i] = program_stack[i] + func_stack.pop();\n\t\t}\n\t};\t\t\n\n}", "function ourReusableFunction() {\r\n console.log(\"Hi World\");\r\n}", "function linting() {\r\n return lintExtension;\r\n}", "function isignored (namespace) {\n /* istanbul ignore next: tested in a child processs */\n if (process.noDeprecation) {\n // --no-deprecation support\n return true\n }\n\n var str = process.env.NO_DEPRECATION || ''\n\n // namespace ignored\n return containsNamespace(str, namespace)\n}", "function isignored (namespace) {\n /* istanbul ignore next: tested in a child processs */\n if (process.noDeprecation) {\n // --no-deprecation support\n return true\n }\n\n var str = process.env.NO_DEPRECATION || ''\n\n // namespace ignored\n return containsNamespace(str, namespace)\n}", "function isignored (namespace) {\n /* istanbul ignore next: tested in a child processs */\n if (process.noDeprecation) {\n // --no-deprecation support\n return true\n }\n\n var str = process.env.NO_DEPRECATION || ''\n\n // namespace ignored\n return containsNamespace(str, namespace)\n}", "function isignored (namespace) {\n /* istanbul ignore next: tested in a child processs */\n if (process.noDeprecation) {\n // --no-deprecation support\n return true\n }\n\n var str = process.env.NO_DEPRECATION || ''\n\n // namespace ignored\n return containsNamespace(str, namespace)\n}", "function isignored (namespace) {\n /* istanbul ignore next: tested in a child processs */\n if (process.noDeprecation) {\n // --no-deprecation support\n return true\n }\n\n var str = process.env.NO_DEPRECATION || ''\n\n // namespace ignored\n return containsNamespace(str, namespace)\n}", "function isignored (namespace) {\n /* istanbul ignore next: tested in a child processs */\n if (process.noDeprecation) {\n // --no-deprecation support\n return true\n }\n\n var str = process.env.NO_DEPRECATION || ''\n\n // namespace ignored\n return containsNamespace(str, namespace)\n}" ]
[ "0.60268617", "0.57781506", "0.5717464", "0.5680803", "0.5680803", "0.5637184", "0.5637184", "0.5621175", "0.5575853", "0.5548215", "0.5529817", "0.5520376", "0.5520376", "0.5520376", "0.5520376", "0.5520376", "0.55096394", "0.5493174", "0.5485926", "0.54793435", "0.54786927", "0.54401183", "0.54227", "0.54227", "0.54227", "0.5414127", "0.5414127", "0.5414127", "0.53968436", "0.5376752", "0.5376632", "0.53273934", "0.5326889", "0.5326889", "0.5326889", "0.5326889", "0.5326889", "0.5326889", "0.53243434", "0.5322638", "0.531715", "0.5302702", "0.52991223", "0.52988863", "0.5290804", "0.5279601", "0.5279601", "0.5241657", "0.5241657", "0.521551", "0.5193671", "0.51907665", "0.5185999", "0.5183109", "0.5183109", "0.5183109", "0.5183109", "0.5183109", "0.5183109", "0.5183109", "0.5183109", "0.51826715", "0.5176911", "0.5171037", "0.5166267", "0.5164265", "0.51503253", "0.51451653", "0.5139893", "0.5139231", "0.5124995", "0.5124036", "0.51104504", "0.50928473", "0.50918055", "0.5091217", "0.5087397", "0.50846875", "0.50793535", "0.5075602", "0.5071486", "0.50705713", "0.50696325", "0.50650805", "0.50633305", "0.5060916", "0.5049969", "0.5042255", "0.5042255", "0.5037137", "0.50354725", "0.5014749", "0.5013603", "0.5011182", "0.50060725", "0.49873212", "0.49873212", "0.49873212", "0.49873212", "0.49873212", "0.49873212" ]
0.0
-1
It should to be noted that this function isn't equivalent to `texttransform: capitalize`. A strict capitalization should uppercase the first letter of each word a the sentence. We only handle the first word.
function capitalize(string) { if (false) { throw new Error('Material-UI: capitalize(string) expects a string argument.'); } return string.charAt(0).toUpperCase() + string.slice(1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sentenceCapitalizer1(text) {\n text = text.toLowerCase();\n let output = \"\";\n text.split(\" \").forEach( sentence => {\n output += sentence.slice(0, 1).toUpperCase();\n output += sentence.slice(1, sentence.length)+\" \";\n } );\n return output.trim();\n}", "function capitalizeAll (sentence) {\n let sentenceSplit = sentence.toLowerCase().split(' ');\n for (var i=0; i < sentenceSplit.length; i++) {\n sentenceSplit[i] = sentenceSplit[i][0].toUpperCase() + sentenceSplit[i].slice(1);\n }\n return sentenceSplit.join(' ');\n}", "function capitalize(sentence) {\n // Get the individual words\n let words = sentence.split(' ');\n\n // Capitalize the first character in each word\n words = words.map(word => word[0].toUpperCase() + word.slice(1));\n\n return words.join(' ');\n}", "function sentenceCapitalizer(text) {\n let words = text.toLowerCase().split(' ');\n let capitalized = words.map( word => {\n return word[0].toUpperCase() + word.slice(1);\n });\n\n return capitalized.join(' ');\n}", "static capitalize(sentence){\n let a= sentence.toUpperCase().charAt(0);\n return a+sentence.substr(1);\n }", "function capitalize( s ) {\n // GOTCHA: Assumes it's all-one-word.\n return s[0].toUpperCase() + s.substring(1).toLowerCase();\n}", "function capitalize(str) {\n str = str.toLowerCase();\n return finalSentence = str.replace(/(^\\w{1})|(\\s+\\w{1})/g, letter => letter.toUpperCase());\n}", "function ucfirst(str,force){\n str=force ? str.toLowerCase() : str;\n return str.replace(/(\\b)([a-zA-Z])/,\n function(firstLetter){\n return firstLetter.toUpperCase();\n });\n }", "function firstToUpper(text) { // 160\n // 161\n return text.charAt(0).toUpperCase() + text.substr(1); // 162\n // 163\n }", "function uncapitalize(text) {\n if (!text || typeof text !== \"string\") {\n return '';\n }\n return text.charAt(0).toLowerCase() + text.substr(1);\n }", "function firstWordCapitalize(word){\n let firstCharcter = word[0].toUpperCase();\n return firstCharcter + word.slice(1);\n \n}", "function capitalizeAll (sentence) {\n\n var sentenceArray = sentence.split(' ')\n\tvar capitalizedArray = []\n\n sentenceArray.forEach( (word, i) => {\n\t\tcapitalizedArray[i] = word.charAt(0).toUpperCase() + word.substring(1)\n }) \n\n return capitalizedArray.join(' ')\n\n}", "function capitalizeFirstLetter(text) {\n if (typeof text !== 'string') {\n return '';\n }\n return text.charAt(0).toUpperCase() + text.slice(1);\n }", "function capitalize(str) {}", "capitalizeFirstLetter(word) {\n return (word.charAt(0).toUpperCase() + word.substring(1));\n }", "function capitalize(s){\n\t\t\treturn s[0].toUpperCase() + s.slice(1);\n\t\t}", "function capitalize() {\n utilitymanager_1.um.utilityManager({\n utilType: utilitymanager_1.um.TIXUtilityType.utInTransform,\n sp: utilitymanager_1.um.TIXSelPolicy.Word,\n pat: /\\b(_*\\w)/g, repl: function (_match, p1) { return p1.toUpperCase(); },\n });\n }", "function capitalize(s) {\n return s && s[0].toUpperCase() + s.slice(1);\n }", "function capitalizeAllWords(string){\nvar subStrings = string.split(\" \");\nvar upperString = \"\";\nvar finishedString = \"\";\n for(var i = 0; i < subStrings.length; i++){\n if(subStrings[i]) {\n upperString = subStrings[i][0].toUpperCase() + subStrings[i].slice(1) + \" \";\n finishedString += upperString;\n }\n } return finishedString.trim()\n}", "function capitalizeWord(string) {\n //I-string of one word\n //O- return the word with first letter in caps\n //C-\n //E-\n let array = string.split(\"\")\n array[0] = array[0].toUpperCase()\n string = array.join(\"\")\n return string\n}", "function capitalizeAllWords(string) {\n var splitStr = string.toLowerCase().split(' ');\n \nfor (var i = 0; i < splitStr.length; i++){\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].slice(1);\n}\nreturn splitStr.join(' ');\n}", "function capitalize(s) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n }", "function firstToUpper(text) {\n\n return text.charAt(0).toUpperCase() + text.substr(1);\n\n }", "function capitalize(text){\n // in: \"some_string\"\n // out: \"Some_string\"\n return text.charAt(0).toUpperCase() + text.slice(1);\n}", "function firstLetterCapital (word) {\n var wordArray = word.split(' ');\n var newWordArray = [];\n for (var i = 0; i < wordArray.length; i++) {\n newWordArray.push(wordArray[i].charAt(0).toUpperCase() + wordArray[i].slice(1));\n }\n return newWordArray.join(' ');\n}", "function capitalize(s) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n }", "function camelCase(str, firstCapital) {\n if (firstCapital === void 0) { firstCapital = false; }\n return str.replace(/^([A-Z])|[\\s-_](\\w)/g, function (match, p1, p2, offset) {\n if (firstCapital === true && offset === 0)\n return p1;\n if (p2)\n return p2.toUpperCase();\n return p1.toLowerCase();\n });\n}", "function capitalize(s) {\r\n return s.charAt(0).toUpperCase() + s.slice(1)\r\n}", "function upperCaseFirst(s) {\r\n return s ? s.replace(/\\w\\S*/g, function (txt) {\r\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\r\n }) : '';\r\n}", "function firstLetterCapitalized (word){//function that capitalizes first letter of one word\n var letterOne = word.substring(0,1)//finds first letter\n var capitalizedLetter = letterOne.toUpperCase()//to upper case\n return capitalizedLetter + word.substring(1)//concatenates capitalized first letter and rest of word\n}", "function sc_string_capitalize(s) {\n return s.replace(/\\w+/g, function (w) {\n\t return w.charAt(0).toUpperCase() + w.substr(1).toLowerCase();\n });\n}", "function capitalize(s){\n return s[0].toUpperCase() + s.slice(1);\n}", "function capitalizeFirst(input) {\n return input\n .split(\" \")\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \");\n}", "function capitalize(s) {\n\t\t\treturn s.toLowerCase().replace( /\\b./g, function(a){ return a.toUpperCase(); } );\n\t\t}", "function capitalizeWord(word){\n return word[0].toUpperCase() + word.substr(1);\n}", "function titleCase(str) {\r\n var words = str.toLowerCase().split(' ');\r\n var charToCapitalize;\r\n\r\n for (var i = 0; i < words.length; i++) {\r\n charToCapitalize = words[i].charAt(0);\r\n // words[i] = words[i].replace(charToCapitalize, charToCapitalize.toUpperCase()); // works only if first letter is not present elsewhere in word\r\n words[i] = words[i].charAt(0).toUpperCase().concat(words[i].substr(1));\r\n }\r\n\r\n return words.join(' ');\r\n}", "function capitalizeWord(string){\n var firstLetter = string.charAt(0); // takes first letter\n var goodString = firstLetter.toUpperCase() + string.slice(1); //capitalize and reattach\n return goodString;\n}", "function capitalize_Words(str) {\n return str.replace(/\\w\\S*/g, function (txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); });\n}", "function capitalizeWords(sentence) {\n var sentenceArr = sentence.split(' ');\n var result = [];\n sentenceArr.forEach(function(word) {\n result.push(word[0].toUpperCase() + word.slice(1));\n })\n return result.join(' ');\n}", "function ucfirst(strText)\n{\n// return ((!strText) ? '' : strText.substr(0, 1).toUpperCase() + strText.substr(1).toLowerCase());\n return ((!strText) ? '' : strText.substr(0, 1).toUpperCase() + strText.substr(1));\n}", "function capitalizeFirst(s) {\n\n return s.substr(0, 1).toUpperCase() + s.substr(1);\n\n}", "function firstChar(sentence) {\n\tconst capitalize = sentence.charAt(0).toUpperCase() + sentence.slice(1);\n\treturn capitalize;\n}", "function sentenceCase(word) {\n return `${word[0].toUpperCase()}${word.substring(1)}`;\n}", "function sentenceCase(word) {\n return `${word[0].toUpperCase()}${word.substring(1)}`;\n}", "function capitalize(s) {\n return s.charAt(0).toUpperCase() + s.slice(1)\n}", "function capitalize(s) {\n return s.charAt(0).toUpperCase() + s.slice(1)\n}", "function ucwords(str,force){\n str=force ? str.toLowerCase() : str;\n return str.replace(/(^([a-zA-Z\\p{M}]))|([ -][a-zA-Z\\p{M}])/g,\n function(firstLetter){\n return firstLetter.toUpperCase();\n });\n}", "function firstToUpper(text) { // 143\n // 144\n return text.charAt(0).toUpperCase() + text.substr(1); // 145\n // 146\n }", "function capitalize(word) { // capitalizes word\n return word[0].toUpperCase() + word.slice(1).toLowerCase();\n}", "function sentence(str) {\n return str.replace(/^\\S/, function(t) { return t.toUpperCase() });\n}", "function capitalizeWord(word) {\n return word[0].toUpperCase() + word.substr(1);\n}", "titleCase(string) {\n var sentence = string.toLowerCase().split(\" \");\n for(var i = 0; i< sentence.length; i++){\n sentence[i] = sentence[i][0].toUpperCase() + sentence[i].slice(1);\n }\n \n return sentence.join(\" \");\n }", "function capitalizeWord(string) {\n return string[0].toUpperCase() + string.substring(1);\n}", "function capitalizeTitle(str) {\n let ar = str.split(\" \");\n const wordExceptions = [\"the\", \"in\", \"as\", \"per\", \"a\", \"of\", \"an\", \"for\", \"nor\", \"or\", \"yet\", \"so\", \"at\", \"from\", \"on\", \"to\", \"with\", \"without\"]\n ar.forEach((word, i) => {\n if (i == 0 || !wordExceptions.includes(word))\n ar[i] = word.charAt(0).toUpperCase() + word.substring(1);\n });\n return ar.join(\" \");\n}", "function capitalizeAll(sentence){\n // since the string is what we need to convert, we use an array.\n var sentenceArray = sentence.split(\" \");\n\n for (var i = 0; i < sentenceArray.length; i++) {\n\n var wordArray = sentenceArray[i].split(\"\");\n\n var capitalizedLetter = wordArray[0].toUpperCase();\n\n wordArray[0] = capitalizedLetter;\n\n var joinedWord = wordArray.join(\"\");\n\n sentenceArray[i] = joinedWord;\n\n }\n var joinedSentence = sentenceArray.join(\" \")\n return joinedSentence;\n}", "function capitalizeWord (string) {\n var firstLetter = string[0];\n var restOfWord = string.substring(1); \n return firstLetter.toUpperCase() + restOfWord;\n}", "function firstLetter(sentence) {\n let text = sentence.split(' ');\n for (let i = 0; i < text.length; i++) {\n text[i] = text[i].charAt(0).toUpperCase() + text[i].substr(1);\n //console.log(text[i].charAt(0));\n }\n return text.join(' ');\n}", "makeCapital(word) {\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n }", "function cap_first(s) {\n return s[0].toUpperCase() + s.substring(1); \n}", "function capitalizeAllWords(string) {\n //split string into array of string words\n var splitStr = string.split(\" \");\n //loop through array\n for(var i = 0; i < splitStr.length; i++){\n //if there is a value at element then do a thing\n if(splitStr[i]){\n //access word in word array,uppercase first char, then slice the rest back on\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].slice(1);\n }\n string = splitStr.join(\" \");\n }\n return string;\n}", "function capitalizeWord(string) {\n return string.replace(string[0], string[0].toUpperCase()); //return string but replace the string[0] with a capital letter\n}", "function allCapsTitleTrimmed(originalText) {\n var modifiedText = originalText.trim().toUpperCase(); \n return modifiedText;\n \n}", "static capitalize(string){\n let array = string.split(\"\")\n array[0] = string[0].toUpperCase()\n return array.join(\"\")\n }", "function capitalizeWord(word) {\n return word[0].toUpperCase() + word.slice(1);\n}", "function capitalize(inputString){\r\n\t\t\t\tif(inputString == null){\r\n\t\t\t\t\treturn \"There is no text\";\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\treturn inputString.charAt(0).toUpperCase() + inputString.slice(1);\r\n\t\t\t\t}\r\n\t\t\t}", "function xCapitalize(str)\r\n{\r\n var i, c, wd, s='', cap = true;\r\n \r\n for (i = 0; i < str.length; ++i) {\r\n c = str.charAt(i);\r\n wd = isWordDelim(c);\r\n if (wd) {\r\n cap = true;\r\n } \r\n if (cap && !wd) {\r\n c = c.toUpperCase();\r\n cap = false;\r\n }\r\n s += c;\r\n }\r\n return s;\r\n\r\n function isWordDelim(c)\r\n {\r\n // add other word delimiters as needed\r\n // (for example '-' and other punctuation)\r\n return c == ' ' || c == '\\n' || c == '\\t';\r\n }\r\n}", "function capsSentence(text) {\n let wordsArray = text.toLowerCase().split(\" \");\n\n let capsArray = wordsArray.map((word) => {\n return word.replace(word[0], word[0].toUppercase());\n //We replace the first letter of each word (word[0]) with an uppercase version of the same letter using word.[0].toUppercase as the second parameter of the .replace() method.\n });\n\n return capsArray.join(\" \");\n}", "function capSentence(text) {\n let wordsArray = text.toLowerCase().split(\" \");\n let capsArray = wordsArray.map((word) => {\n //We use .map() function to loop through every word in the array and execute the same function as before to create capsArray.\n return word[o].toUpperCase() + word.slice(1);\n });\n\n return capsArray.join(\" \");\n}", "function everyWordCapitalized(aPhrase) {\n var becomeAnArray = aPhrase.split(\" \");\n \n for (var i=0; i<becomeAnArray.length; i++){\n var firstChar = becomeAnArray[i].charAt(0);\n var rest = becomeAnArray[i].substring(1);\n \n \n \n firstChar = firstChar.toUpperCase();\n rest = rest.toLowerCase();\n becomeAnArray[i] = firstChar + rest;\n \n }\n \n return becomeAnArray.join(\" \");\n}", "function capitalizeAllWords(words){\n return words.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n}", "function capitalize(word) {\n return word.charAt(0).toUpperCase() + word.slice(1);\n}", "function capitalizeWord(string) {\n \n // Should take a string of one word, and return the word with its first letter capitalized\n return string[0].toUpperCase() + string.substring(1, string.length);\n \n}", "static capitalize(word){\n let arr;\n arr = word.split(\"\")\n arr[0] = arr[0].toUpperCase()\n return arr.join(\"\")\n }", "function capitalize(word) {\n return word[0].toUpperCase() + word.slice(1).toLowerCase();\n }", "function capitalize2(str) {\n let result = str[0].toUpperCase();\n // let letters = str.split(' ');\n for (let i = 1; i < str.length; i++) {\n if (str[i - 1] === '') {\n result += str[i].toUpperCase();\n } else {\n result += str[i];\n }\n }\n return result;\n}", "function capSentence(text) {\n let wordsArray = text.toLowerCase().split(\" \");\n //We use toLowercase() to convert the entire sentence in lowercase. We chain it with .split() to divide the lowercase sentence into an array of words.\n let capsArray = [];\n //The array is stored is capsArray.\n\n wordsArray.forEach((word) => {\n capsArray.push(word[0].toUpperCase() + word.slice(1));\n //We iterate through every word in the array, and we take the first letter with slice(1) and turn it to uppercase with toUpperCase().\n });\n\n return capsArray.join(\" \");\n //We combine the transformed first letter (New string from slice()) and the sliced lowercase section with the method join() and push it into our capsArray.\n}", "function capitalizeWord(string) {\n return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();\n }", "function titleCase(str) {\nreturn str.replace(/\\w\\S*/g, function(txt) { // Checks for a character then zero or more non-white space\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); // replaces the first char with a CAP letter\n}", "function capitalize(word) {\n\treturn word[0].toUpperCase() + word.slice(1).toLowerCase();\n}", "function Capitaliser(input) {\n const eachWord = input.split(\" \");\n for (let index = 0; index < eachWord.length; index++) {\n eachWord[index] = eachWord[index][0].toUpperCase() + eachWord[index].substr(1);\n }\n return eachWord.join(\" \");\n}", "function capitalizeWord(string) {\n return string[0].toUpperCase() + string.slice(1);\n}", "capitalize(word){\n let char = word.charAt(0).toUpperCase();\n let remainder = word.slice(1);\n return char + remainder;\n }", "function capitalizeAllWords(string) {\n var split = string.split(\" \"); //splits string up\n for (var i = 0; i < split.length; i++) { //loops over array of strings\n split[i] = split[i][0].toUpperCase() + split[i].slice(1); //uppercases first chas on string and slices the extra letter\n }\n var finalStr = split.join(' '); // joins split string into one string\n return finalStr; //return final string\n}", "function CapitalizeWord(str)\n {\n return str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n }", "function capitalise(word) {\n var lowerCase = word.toLowerCase();\n return lowerCase.charAt(0).toUpperCase() + lowerCase.slice(1).trim();\n}", "function wordToUpper(strSentence) {\r\n return strSentence.toLowerCase().replace(/\\b[a-z]/g, convertToUpper);\r\n\r\n function convertToUpper() { \r\n\t\treturn arguments[0].toUpperCase(); \r\n\t} \r\n}", "function titleCase(str) {\nreturn str.replace(/\\w\\S*/g, function(txt) { // Checks for a character then zero or more non-white space\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); // Replaces the first char with a CAP letter\n}", "function capitalize( str , echo){\n var words = str.toLowerCase().split(\" \");\n for ( var i = 0; i < words.length; i++ ) {\n var j = words[i].charAt(0).toUpperCase();\n words[i] = j + words[i].substr(1);\n }\n if(typeof echo =='undefined')\n return words.join(\" \");\n else\n return str;\n}", "function titleCase(text) {\n if(text) {\n let output = \"\";\n let stringArray = text.split(\" \");\n for(let i = 0; i < stringArray.length; i ++) {\n for(let j = 0; j < stringArray[i].length; j ++) {\n let chr = stringArray[i][j];\n if(j === 0) {\n output += chr.toUpperCase();\n } else {\n output += chr.toLowerCase();\n }\n }\n if(i < stringArray.length - 1) {\n output += \" \";\n }\n }\n return output;\n } else {\n return text;\n }\n}", "function capitalizeWords(str) {\n\tif (str.length === 0) {\n\t\treturn str;\n\t}\n\n\treturn str\n\t\t.split(\" \")\n\t\t.map((word) => capitalizeFirstLetter(word))\n\t\t.join(\" \");\n}", "function capitalize(string) {\n return `${string[0].toUpperCase()}${string.slice(1)}`;\n} //so we return the first character captitalized, and the rest of the string starting from the first index", "function capitalize(input) {\n return input.replace(input.charAt(0), input.charAt(0).toUpperCase());\n}", "function capitalize(str) {\n str = str.trim().toLowerCase(); // remove extra whitespace and change all letters to lower case\n var words = str.split(' ') // split string into array of individual words\n str = ''; // clear string variable since all the words are saved in an array\n // this loop takes each word in the array and capitalizes the first letter then adds each word to the new string with a space following \n for (i = 0; i < words.length; i++) {\n var foo = words[i];\n foo = foo.charAt(0).toUpperCase() + foo.slice(1);\n str += foo + \" \";\n }\n return str.trim(); // return the new string with the last space removed\n}", "function capitalize(str) {\n const firstLow = firstCharacter(str);\n const rest = str.slice(1);\n const firstUp = firstLow.toUpperCase(str);\n return firstUp + rest;\n}", "function toTitleCase(x) {\n var smalls = [];\n var articles = [\"A\", \"An\", \"The\"].forEach(function(d){ smalls.push(d); })\n var conjunctions = [\"And\", \"But\", \"Or\", \"Nor\", \"So\"].forEach(function(d){ smalls.push(d); })\n var prepositions = [\"As\", \"At\", \"By\", \"Into\", \"It\", \"In\", \"For\", \"From\", \"Of\", \"Onto\", \"On\", \"Out\", \"Per\", \"To\", \"Up\", \"Upon\", \"With\"].forEach(function(d){ smalls.push(d); });\n \n x = x.split(\"\").reverse().join(\"\") + \" \"\n\n x = x.replace(/['\"]?[a-z]['\"]?(?= )/g, function(match){return match.toUpperCase();})\n\n x = x.split(\"\").slice(0, -1).reverse().join(\"\")\n\n x = x.replace(/ .*?(?= )/g, function(match){\n if(smalls.indexOf(match.substr(1)) !== -1)\n return match.toLowerCase()\n return match\n })\n\n x = x.replace(/: .*?(?= )/g, function(match){return match.toUpperCase()})\n\n //smalls at the start of sentences shouldbe capitals. Also includes when the sentence ends with an abbreviation.\n x = x.replace(/(([^\\.]\\w\\. )|(\\.[\\w]*?\\.\\. )).*?(?=[ \\.])/g, function(match) {\n var word = match.split(\" \")[1]\n var letters = word.split(\"\");\n\n letters[0] = letters[0].toUpperCase();\n word = letters.join(\"\");\n\n if(smalls.indexOf(word) !== -1) {\n return match.split(\" \")[0] + \" \" + word;\n }\n\n return match\n })\n \n return x\n }", "function ucFirstAllWords(str) {\n var word = str.split(\" \");\n for (var i = 0; i < word.length; i++) {\n var j = word[i].charAt(0).toUpperCase();\n word[i] = j + word[i].substr(1);\n }\n return word.join(\" \");\n}", "static capitalize(string){\n let firstLetter = string.slice(0,1).toUpperCase()\n return firstLetter + string.slice(1)\n }", "static capitalize(str){\n return str[0].toUpperCase() + str.slice(1)\n }", "function capFirstWord(string){\n return string[0].toUpperCase + string.slice(1).toLowerCase()\n}", "function capitalizeAll (str) {\n var upperCaseArr = []\n var lowerCaseArr = str.split(' ')\n for (var i = 0; i < lowerCaseArr.length; i++) {\n var firstLetter = lowerCaseArr[i][0].toUpperCase()\n var restOfSentence = lowerCaseArr[i].slice(1, lowerCaseArr[i].length)\n upperCaseArr[i] = firstLetter + restOfSentence\n }\n return upperCaseArr.join(' ')\n}", "function upperFirst(str) {\n let splitStr = str.toLowerCase().split(' ');\n for (let i = 0; i < splitStr.length; i++) {\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1); \n }\n return splitStr.join(' '); \n }" ]
[ "0.7846306", "0.7635373", "0.76215124", "0.76206636", "0.76174986", "0.76139426", "0.76054466", "0.7586552", "0.7550366", "0.7518982", "0.7518821", "0.75142384", "0.7513061", "0.7500775", "0.74998087", "0.74790484", "0.74651855", "0.746171", "0.74413735", "0.7440085", "0.74389017", "0.74226403", "0.7388036", "0.73837894", "0.7379224", "0.7374533", "0.7363772", "0.7357456", "0.7353339", "0.73491716", "0.7346609", "0.73421955", "0.7326537", "0.7321302", "0.7319681", "0.7318381", "0.7316654", "0.7313652", "0.73066765", "0.729469", "0.7294003", "0.72828746", "0.7280706", "0.7280706", "0.7279433", "0.7279433", "0.72719187", "0.7264426", "0.7263119", "0.7262151", "0.7258648", "0.7255266", "0.72375304", "0.72357416", "0.7235715", "0.7235194", "0.72328323", "0.72311205", "0.72301435", "0.72239864", "0.7221063", "0.72194797", "0.72185147", "0.72179234", "0.72150093", "0.7208705", "0.720326", "0.719389", "0.71881646", "0.71823484", "0.71821827", "0.7178519", "0.7175648", "0.71720386", "0.7168321", "0.7167663", "0.7167006", "0.71649355", "0.7161468", "0.7154124", "0.7150584", "0.71474046", "0.71454763", "0.7144534", "0.7143701", "0.7143309", "0.7143308", "0.7140803", "0.7132629", "0.71309227", "0.71255255", "0.71170527", "0.7116909", "0.71140593", "0.71100897", "0.71093565", "0.7109186", "0.71086663", "0.7105968", "0.71030194", "0.71018195" ]
0.0
-1
Event `rendered` is triggered when zr rendered. It is useful for realtime snapshot (reflect animation). Event `finished` is triggered when: (1) zrender rendering finished. (2) initial animation finished. (3) progressive rendering finished. (4) no pending action. (5) no delayed setOption needs to be processed.
function bindRenderedEvent(zr, ecIns) { zr.on('rendered', function () { ecIns.trigger('rendered'); // The `finished` event should not be triggered repeatly, // so it should only be triggered when rendering indeed happend // in zrender. (Consider the case that dipatchAction is keep // triggering when mouse move). if ( // Although zr is dirty if initial animation is not finished // and this checking is called on frame, we also check // animation finished for robustness. zr.animation.isFinished() && !ecIns[OPTION_UPDATED] && !ecIns._scheduler.unfinished && !ecIns._pendingActions.length) { ecIns.trigger('finished'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function completeRender() {\n var afterRender = options.afterRender;\n\n if (afterRender) {\n afterRender.call(root, root);\n }\n\n // Always emit an afterRender event.\n root.trigger(\"afterRender\", root);\n }", "function completeRender() {\n var afterRender = options.afterRender;\n\n if (afterRender) {\n afterRender.call(root, root);\n }\n\n // Always emit an afterRender event.\n root.trigger(\"afterRender\", root);\n }", "IsFinishedRendering() {}", "function viewRenderComplete() {\n $container.trigger(topologyConstants.events.viewRenderComplete, {}); // Private Event\n }", "handleRendered_() {\n\t\tthis.isRendered_ = true;\n\t}", "function _renderComplete( videoElement ) {\n videoElement.addClass( 'rendered' );\n fxcm.limelight.setThumbnailSize( videoElement );\n\n // description handler\n checkForCaption(videoElement);\n\n }", "onRender(scene, time) {}", "render(...args) {\n if (this._render) {\n this.__notify(EV.BEFORE_RENDER);\n this._render(...args);\n this.__notify(EV.RENDERED);\n }\n\n this.rendered = true;\n }", "afterRender() { }", "afterRender() { }", "function completeRender() {\n var console = window.console;\n var afterRender = root.afterRender;\n\n if (afterRender) {\n afterRender.call(root, root);\n }\n\n // Always emit an afterRender event.\n root.trigger(\"afterRender\", root);\n\n // If there are multiple top level elements and `el: false` is used,\n // display a warning message and a stack trace.\n if (manager.noel && root.$el.length > 1) {\n // Do not display a warning while testing or if warning suppression\n // is enabled.\n if (_.isFunction(console.warn) && !root.suppressWarnings) {\n console.warn(\"`el: false` with multiple top level elements is \" +\n \"not supported.\");\n\n // Provide a stack trace if available to aid with debugging.\n if (_.isFunction(console.trace)) {\n console.trace();\n }\n }\n }\n }", "done() {\n this.calc();\n this.stop();\n\n this.el.fire('drawdone');\n }", "function completeRender() {\n\t\t\t\t\t\tvar console = window.console;\n\t\t\t\t\t\tvar afterRender = root.afterRender;\n\n\t\t\t\t\t\tif (afterRender) {\n\t\t\t\t\t\t\tafterRender.call(root, root);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Always emit an afterRender event.\n\t\t\t\t\t\t */\n\t\t\t\t\t\troot.trigger(\"afterRender\", root);\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * If there are multiple top level elements and `el: false` is used,\n\t\t\t\t\t\t * display a warning message and a stack trace.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (manager.noel && root.$el.length > 1) {\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Do not display a warning while testing or if warning suppression\n\t\t\t\t\t\t\t * is enabled.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif (_.isFunction(console.warn) && !root.suppressWarnings) {\n\t\t\t\t\t\t\t\tconsole.warn(\"`el: false` with multiple top level elements is \" +\n\t\t\t\t\t\t\t\t\t\t\"not supported.\");\n\n\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t * Provide a stack trace if available to aid with debugging.\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\tif (_.isFunction(console.trace)) {\n\t\t\t\t\t\t\t\t\tconsole.trace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "_onFinishedEvent() {\n this._finished += 1;\n\n if (this._finished === this._babylonNumAnimations) {\n this._looped = 0;\n this._finished = 0;\n\n // Pause the animations\n this._babylonAnimatables.forEach(animatable => {\n animatable.speedRatio = 0;\n });\n\n this._promises.play.resolve();\n\n // Stop evaluating interpolators if they have already completed\n if (!this.weightPending && !this.timeScalePending) {\n this._paused = true;\n }\n }\n }", "function render() {\n\n isRendered = true;\n\n renderSource();\n\n }", "didRender() {\n console.log('didRender ejecutado!');\n }", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "_onEnd() {\n this._duringDisplayAnim = false;\n // - need to re render at the end of the display animation\n this._setAnimParams();\n }", "static finishedRenderingComponent() {\n\t\trenderingComponents_.pop();\n\t}", "onAfterRendering() {}", "function handleRender() {\n\t view._isRendered = true;\n\t triggerDOMRefresh();\n\t }", "render() {\n\n // Calculate delta\n if (!this.lastFrameTime) this.lastFrameTime = Date.now()\n this.delta = Math.min(1, (Date.now() - this.lastFrameTime) / 1000)\n this.lastFrameTime = Date.now()\n\n // Check if should be rendering\n if (!this.isRendering)\n return\n\n // Request another frame\n requestAnimationFrame(this.render)\n\n }", "function postInitialization() {\n console.info(finished);\n}", "function render() {\n\n\t\t\tisRendered = true;\n\n\t\t\trenderSource();\n\n\t\t}", "complete() {\n if (this.element.renderTransform) {\n this.refreshTransforms();\n this.element.renderTransform.reset();\n }\n }", "postrender() {\n this.gl.flush();\n }", "function render() {\n\tvar delta = clock.getDelta();\n\tcameraControls.update(delta);\n\tTWEEN.update();\n\trenderer.render(scene, camera);\n\tif(hasFinishedInit == true)\n\t{\n\t\tmirror.visible = false;\n\t\tmirrorCamera.updateCubeMap( renderer, scene );\n\t\tif(topDownPOV == false)\n\t\t{\n\t\t\tmirror.visible = true;\n\t\t}\n\t}\n}", "onBeforeRendering() {}", "_finished( ) { \n\n\t\tif( this.verbose ) { this.log( \"All stages finished.\" ); }\n\n\t\tif( this.rollback ) {\n\t\t\tif( this.verbose ) { this.log( \"Processing failed.\" ); }\n\t\t\tthis.callback.failure( \"failed because of stage \\\"\" + this.failed + \"\\\"\" );\n\t\t} else {\n\t\t\tif( this.verbose ) { this.log( \"Processing succeeded.\" ); }\n\t\t\tthis.callback.success( this.results ); \n\t\t}\n\t\t\n\t}", "function finish() {\n// if (--finished == 0) {\n if (!isFinished) {\n isFinished = true;\n Physics.there.style(self.from.getContainerBodyId(), {\n opacity: 0\n });\n\n self.dfd.resolve();\n }\n }", "onRender()/*: void*/ {\n this.render();\n }", "function onRenderEnd(callback) {\n\t return _baseStreams2.default.onValue(this.devStreams.renderEndStream, _lib2.default.baconTryD(callback));\n\t}", "render (timestamp = window.performance.now()) {\n const progress = this._prevTimestamp ? timestamp - this._prevTimestamp : 0\n this.camera.update()\n const volcanoesTransition = this.volcanoes.update(progress)\n const earthquakesTransition = this.earthquakes.update(progress)\n const eruptionsTransition = this.eruptions.update(progress)\n const transitionInProgress = volcanoesTransition || earthquakesTransition || eruptionsTransition\n renderer.render(this.scene, this.camera.camera)\n // Reset timestamp if transition has just ended, so when it starts next time, `progress` value starts from 0 again.\n this._prevTimestamp = transitionInProgress ? timestamp : null\n return transitionInProgress\n }", "function RenderEvent() {}", "function render(layerName, type, duration, finishedCB) {\n\tconst layer = new Vivus('map-container', {\n\t\tfile: 'maps/' + layerName + '.svg',\n\t\ttype: type, //\"scenario-sync\",\n\t\tstart: \"autostart\",\n\t\tduration: duration,\n\t\tdashGap: 10,\n\t\treverseStack: true,\n\t\tforceRender: false\n\t}, finishedCB);\n}", "function renderFinalResult() {\n //console.log('Final result is being rendered');\n $('.result').html(generateFinalResult());\n}", "willRender() {\n console.log('willRender ejecutado!');\n }", "function onFinish() {\n console.log('finished!');\n}", "_didRender(props) {\n\t\tthis.hexAnimation = new NeonHexAnimation(this.shadowRoot.querySelector('canvas').getContext('2d'), props);\n\t\tthis.hexAnimation.init();\n\t}", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "function render() {\n\trequestAnimationFrame(render);\n\n\tstats.update();\n\t//scene.getCameraControls().update();\n\tscene.animate(GUIcontrols);\n\n\trenderer.render(scene, scene.getCamera(scene.r2d2.fp));\n}", "function ifComplete() {\r\n\t\t\t\t\tif (isFinished == false) {\r\n\t\t\t\t\t\tisFinished = true;\r\n\r\n\t\t\t\t\t\t// show the flag animation when a car reaches the finish line\r\n\t\t\t\t\t\tfinishedImage.attr('src', 'Assets/img/finish.gif');\r\n\r\n\t\t\t\t\t\t// add a background shadow effect while the flag animation is on\r\n\t\t\t\t\t\t$('#raceTrack').addClass('shadow');\r\n\r\n\t\t\t\t\t\t// timeout function for removal of flag animation and enable the buttons\r\n\t\t\t\t\t\tsetTimeout(function () {\r\n\r\n\t\t\t\t\t\t\t// remove flag animation and background shadow\r\n\t\t\t\t\t\t\tfinishedImage.attr('src', '');\r\n\t\t\t\t\t\t\t$('#raceTrack').removeClass('shadow');\r\n\r\n\t\t\t\t\t\t\t// set buttons to enable when the animation and race finish\r\n\t\t\t\t\t\t\traceBtn.prop(\"disabled\", false);\r\n\t\t\t\t\t\t\trestartBtn.prop(\"disabled\", false);\r\n\t\t\t\t\t\t}, 3500);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfinishedIn = 'second';\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "render(deltaTime=0.01) {\n this.controls.update()\n for (let renderer of this.renderers) renderer.render(deltaTime)\n this.composer.render(deltaTime)\n requestAnimationFrame(() => this.render(this.clock.getDelta())) }", "function render() {\n\t if(stopped || scene.contextLost) {\n\t return\n\t }\n\t requestAnimationFrame(render)\n\t redraw()\n\t }", "function render() {\n\t if(stopped || scene.contextLost) {\n\t return\n\t }\n\t requestAnimationFrame(render)\n\t redraw()\n\t }", "rendererReady() {\n const message = new Message(Message.rendererReadyTitle, 'void').toString();\n this.ipc.send('update-message', message);\n }", "function render()\n\t{\n\t\t// only render\n\t\tif(renderer) {\n\t\t\trenderer.render(scene, camera);\n\t\t}\n\t\t\n\t\t// set up the next frame\n\t\tif(running) {\n\t\t\tupdate();\n\t\t}\n\t}", "onRender() {\n if ( !this.mRunning )\n return;\n\n if ( SPE_USES_PREVIEW_IMAGE ) {\n document.querySelector( '.spline-preview-image-container' ).style.display = 'none';\n\n SPE_USES_PREVIEW_IMAGE = false;\n }\n\n if ( this.mPlayHandler && !this.mPlayHandler.isEnable ) {\n this.mPlayHandler.activate();\n }\n\n if ( this.mOrbitControls ) {\n this.mOrbitControls.update();\n }\n if ( this.mScene && this.mMainCamera ) {\n this.mRenderer.autoClear = true;\n this.mRenderer.render( this.mScene, this.mMainCamera );\n }\n }", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_587( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function render () {\n requestAnimationFrame( render );\n renderer.render(scene, scene.getActiveCamera());\n if(!scene.endedGame)\n scene.animate(GUIcontrols);\n}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_412( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function done(context, template) {\n // Store the rendered template someplace so it can be re-assignable.\n var rendered;\n\n // Trigger this once the render method has completed.\n manager.callback = function(rendered) {\n // Clean up asynchronous manager properties.\n delete manager.isAsync;\n delete manager.callback;\n\n root._applyTemplate(rendered, manager, def);\n };\n\n // Ensure the cache is up-to-date.\n LayoutManager.cache(url, template);\n\n // Render the View into the el property.\n if (template) {\n rendered = root.renderTemplate.call(root, template, context);\n }\n\n // If the function was synchronous, continue execution.\n if (!manager.isAsync) {\n root._applyTemplate(rendered, manager, def);\n }\n }", "function _triggerAfterRender() {\n _trigger(docma.Event.Render, [docma.currentRoute]);\n if (_initialLoad) {\n _trigger(docma.Event.Ready);\n _initialLoad = false;\n }\n }", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_577( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_475( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_452( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "onRender () {\n\n }", "function render() {\n\t\tcontrols.update(clock.getDelta());\n\t\trenderer.render( scene, camera );\n\t}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_330( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_520( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_457( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function render()\n {\n renderer.render(scene, camera);\n }", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_488( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "render() {\n\t\trenderer.render(scene, camera);\n\t}", "render() {\n\t\trenderer.render(scene, camera);\n\t}", "transitionCompleted() {\n // implement if needed\n }", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_332( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_395( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_429( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function onViewRendered(domEl) {\n setDOMElement(domEl);\n // from the ViewMixinEventDelegator\n if (this.delegateEvents) {\n this.delegateEvents();\n }\n\n if (this.viewDidMount) {\n this.viewDidMount();\n }\n }", "function render() {\n stats.update();\n requestAnimationFrame(render);\n renderer.render(scene, camera);\n}", "render() {\n\t\tif (!this.component_.element) {\n\t\t\tthis.component_.element = document.createElement('div');\n\t\t}\n\t\tthis.emit('rendered', !this.isRendered_);\n\t}", "function render() {\n renderer.render(scene, camera);\n requestAnimationFrame(render);\n cameraControls.update();\n stats.update();\n }", "function render() {\n if(stopped || scene.contextLost) {\n return\n }\n requestAnimationFrame(render)\n redraw()\n }", "function render() {\n placeSelector();\n renderer.render(scene, camera);\n}", "render() {\n // TODO should also return when no need to update.\n if (!this.coordinates.isInitialized()) {\n return;\n }\n\n // Return if the car mesh is not loaded yet, or the ground is not\n // loaded yet.\n if (!this.adc.mesh || !this.ground.mesh) {\n return;\n }\n\n // Upon the first time in render() it sees car mesh loaded,\n // added it to the scene.\n if (!this.adcMeshAddedToScene) {\n this.adcMeshAddedToScene = true;\n this.scene.add(this.adc.mesh);\n }\n\n // Upon the first time in render() it sees ground mesh loaded,\n // added it to the scene.\n if (!this.ground.initialized) {\n this.ground.initialize(this.coordinates);\n this.scene.add(this.ground.mesh);\n }\n\n this.adjustCameraWithTarget(this.adc.mesh);\n this.renderer.render(this.scene, this.camera);\n }", "OnAnimationEnd() {\n // If the animation is complete (and not stopped), then rerender to restore any flourishes hidden during animation.\n if (!this.AnimationStopped) {\n this._container.removeChildren();\n\n // Finally, re-layout and render the component\n var availSpace = new Rectangle(0, 0, this.Width, this.Height);\n this.Layout(availSpace);\n this.Render(this._container, availSpace);\n\n // Reselect the nodes using the selection handler's state\n var selectedNodes = this._selectionHandler ? this._selectionHandler.getSelection() : [];\n for (var i = 0; i < selectedNodes.length; i++) selectedNodes[i].setSelected(true);\n }\n\n // : Force full angle extent in case the display animation didn't complete\n if (this._angleExtent < 2 * Math.PI) this._animateAngleExtent(2 * Math.PI);\n\n // Delegate to the superclass to clear common things\n super.OnAnimationEnd();\n }", "function render() {\n \trequestAnimationFrame( render );\n control.update(0.5);\n \trenderer.render( scene, camera );\n }", "function render() {\n \trequestAnimationFrame( render );\n control.update(0.5);\n \trenderer.render( scene, camera );\n }", "function finishedRenderingComponent_() {\n\trenderingComponents_.pop();\n\tif (renderingComponents_.length === 0) {\n\t\t(0, _unused.disposeUnused)();\n\t}\n}", "function doSomethingAfterRendering(){\n displayLoading() // 로딩화면 보여주기\n fetchServer(); // 서버에서 데이터 가져오기\n }", "function _render(scene) {\n renderer.update(scene);\n }", "function render() {\n\t\t\trequestAnimationFrame( render );\n\n\t\t\t\t// Render scene\n\t\t\t\trenderer.render( scene, camera);\n\t\t\t\tcontrols.update();\n\t\t}", "function afterRenderActions(){\r\n var section = $(SECTION_ACTIVE_SEL)[0];\r\n\r\n addClass(section, COMPLETELY);\r\n\r\n lazyLoad(section);\r\n playMedia(section);\r\n\r\n if(options.scrollOverflow){\r\n options.scrollOverflowHandler.afterLoad();\r\n }\r\n\r\n if(isDestinyTheStartingSection() && isFunction(options.afterLoad) ){\r\n fireCallback('afterLoad', {\r\n activeSection: null,\r\n element: section,\r\n direction: null,\r\n\r\n //for backwards compatibility callback (to be removed in a future!)\r\n anchorLink: section.getAttribute('data-anchor'),\r\n sectionIndex: index(section, SECTION_SEL)\r\n });\r\n }\r\n\r\n if(isFunction(options.afterRender)){\r\n fireCallback('afterRender');\r\n }\r\n }", "function renderCall() {\n // Repaint?\n if (needs_repaint === true) {\n needs_repaint = false;\n\n ctx.clearRect(0, 0, canvas_el.width, canvas_el.height);\n\n renderTimeXAxis();\n renderElementsMargin();\n\n renderRows();\n\n renderCurrentTimePoint();\n\n }\n }", "onBeforeRender () {\n\n }", "function afterRenderActions() {\n var section = $(SECTION_ACTIVE_SEL)[0];\n addClass(section, COMPLETELY);\n lazyLoad(section);\n lazyLoadOthers();\n playMedia(section);\n\n if (options.scrollOverflow) {\n options.scrollOverflowHandler.afterLoad();\n }\n\n if (isDestinyTheStartingSection() && isFunction(options.afterLoad)) {\n fireCallback('afterLoad', {\n activeSection: section,\n element: section,\n direction: null,\n //for backwards compatibility callback (to be removed in a future!)\n anchorLink: section.getAttribute('data-anchor'),\n sectionIndex: index(section, SECTION_SEL)\n });\n }\n\n if (isFunction(options.afterRender)) {\n fireCallback('afterRender');\n }\n }", "function afterRenderActions(){\r\n var section = $(SECTION_ACTIVE_SEL)[0];\r\n\r\n addClass(section, COMPLETELY);\r\n\r\n lazyLoad(section);\r\n lazyLoadOthers();\r\n playMedia(section);\r\n\r\n if(options.scrollOverflow){\r\n options.scrollOverflowHandler.afterLoad();\r\n }\r\n\r\n if(isDestinyTheStartingSection() && isFunction(options.afterLoad) ){\r\n fireCallback('afterLoad', {\r\n activeSection: section,\r\n element: section,\r\n direction: null,\r\n\r\n //for backwards compatibility callback (to be removed in a future!)\r\n anchorLink: section.getAttribute('data-anchor'),\r\n sectionIndex: index(section, SECTION_SEL)\r\n });\r\n }\r\n\r\n if(isFunction(options.afterRender)){\r\n fireCallback('afterRender');\r\n }\r\n }", "function afterRenderActions(){\n var section = $(SECTION_ACTIVE_SEL)[0];\n\n addClass(section, COMPLETELY);\n\n lazyLoad(section);\n lazyLoadOthers();\n playMedia(section);\n\n if(options.scrollOverflow){\n options.scrollOverflowHandler.afterLoad();\n }\n\n if(isDestinyTheStartingSection() && isFunction(options.afterLoad) ){\n fireCallback('afterLoad', {\n activeSection: section,\n element: section,\n direction: null,\n\n //for backwards compatibility callback (to be removed in a future!)\n anchorLink: section.getAttribute('data-anchor'),\n sectionIndex: index(section, SECTION_SEL)\n });\n }\n\n if(isFunction(options.afterRender)){\n fireCallback('afterRender');\n }\n }", "function afterRenderActions(){\n var section = $(SECTION_ACTIVE_SEL)[0];\n\n addClass(section, COMPLETELY);\n\n lazyLoad(section);\n lazyLoadOthers();\n playMedia(section);\n\n if(options.scrollOverflow){\n options.scrollOverflowHandler.afterLoad();\n }\n\n if(isDestinyTheStartingSection() && isFunction(options.afterLoad) ){\n fireCallback('afterLoad', {\n activeSection: section,\n element: section,\n direction: null,\n\n //for backwards compatibility callback (to be removed in a future!)\n anchorLink: section.getAttribute('data-anchor'),\n sectionIndex: index(section, SECTION_SEL)\n });\n }\n\n if(isFunction(options.afterRender)){\n fireCallback('afterRender');\n }\n }", "function afterRenderActions(){\n var section = $(SECTION_ACTIVE_SEL)[0];\n\n addClass(section, COMPLETELY);\n\n lazyLoad(section);\n lazyLoadOthers();\n playMedia(section);\n\n if(options.scrollOverflow){\n options.scrollOverflowHandler.afterLoad();\n }\n\n if(isDestinyTheStartingSection() && isFunction(options.afterLoad) ){\n fireCallback('afterLoad', {\n activeSection: section,\n element: section,\n direction: null,\n\n //for backwards compatibility callback (to be removed in a future!)\n anchorLink: section.getAttribute('data-anchor'),\n sectionIndex: index(section, SECTION_SEL)\n });\n }\n\n if(isFunction(options.afterRender)){\n fireCallback('afterRender');\n }\n }", "function render() {\n // Check for canvas resize\n if (checkCanvasAndViewportResize(gl) || needToRender) {\n needToRender = false;\n draw(gl, resolutionUniformLocation, colorLocation);\n }\n requestAnimationFrame(render);\n }", "_firstRendered() { }" ]
[ "0.6279269", "0.6279269", "0.61146736", "0.5770001", "0.5723044", "0.56036395", "0.55704445", "0.5520249", "0.5420462", "0.5420462", "0.53874916", "0.53564095", "0.53542143", "0.5350398", "0.5307551", "0.52943355", "0.52539366", "0.52539366", "0.52206737", "0.5207219", "0.5200485", "0.5183362", "0.5173106", "0.5170969", "0.51434386", "0.51121974", "0.5110912", "0.5100041", "0.50916326", "0.5062529", "0.5055644", "0.5026986", "0.5005214", "0.4999474", "0.4996642", "0.49723333", "0.49700615", "0.49405485", "0.49353504", "0.49137223", "0.4913", "0.4913", "0.4913", "0.4909702", "0.49093616", "0.4900862", "0.48903397", "0.48903397", "0.48895806", "0.48812315", "0.4875165", "0.48737752", "0.48617953", "0.48602146", "0.48571688", "0.48564363", "0.48499173", "0.48484224", "0.48444363", "0.48379722", "0.48331866", "0.48290107", "0.48261124", "0.48213932", "0.48207504", "0.48193285", "0.48159158", "0.48159158", "0.48156804", "0.48153192", "0.48115993", "0.4806347", "0.48055577", "0.4801117", "0.47999066", "0.47946295", "0.4790517", "0.4788355", "0.4784794", "0.47839287", "0.4777709", "0.4777709", "0.47673318", "0.47654969", "0.4757483", "0.47560754", "0.47503242", "0.47469965", "0.4744821", "0.4735093", "0.47263855", "0.4724758", "0.4724758", "0.4724758", "0.4721446", "0.47067648" ]
0.71377945
4
Render each chart and component
function renderSeries(ecIns, ecModel, api, payload, dirtyMap) { // Render all charts var scheduler = ecIns._scheduler; var unfinished; ecModel.eachSeries(function (seriesModel) { var chartView = ecIns._chartsMap[seriesModel.__viewId]; chartView.__alive = true; var renderTask = chartView.renderTask; scheduler.updatePayload(renderTask, payload); if (dirtyMap && dirtyMap.get(seriesModel.uid)) { renderTask.dirty(); } unfinished |= renderTask.perform(scheduler.getPerformArgs(renderTask)); chartView.group.silent = !!seriesModel.get('silent'); updateZ(seriesModel, chartView); updateBlend(seriesModel, chartView); }); scheduler.unfinished |= unfinished; // If use hover layer updateHoverLayerStatus(ecIns._zr, ecModel); // Add aria aria(ecIns._zr.dom, ecModel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "renderComponents() {\n this.algedonodeActivators.forEach(aa => {\n aa.render(this.renderer)\n })\n this.dials.forEach(d => {\n d.render(this.renderer)\n })\n this.strips.forEach(s => {\n s.render(this.renderer)\n })\n this.rows.forEach(r => {\n r.forEach(c => {\n c.render(this.renderer)\n })\n })\n this.lights.forEach(lightPair => {\n lightPair.forEach(light => light.render(this.renderer))\n })\n }", "function renderAll() {\n chart.each((method, index, arr) => {\n render(method, index, arr);\n });\n drawAllValueNumbers();\n }", "_renderChartsCanvas() {\n let json = this.get('getJsonCharts')();\n let canvas = this.get('_chartsCanvas');\n this.get('_chartsRenderer').renderOnChartsCanvas({\n canvas: canvas,\n json: json\n });\n }", "render() {\n const total = this.values.reduce((a, b) => a + b, 0);\n\n const rest = 100 - total;\n const dataset = rest > 0 ? [...this.values, rest] : this.values;\n\n this._renderSvg();\n this._renderGroups(dataset, rest);\n this._renderRects(dataset);\n this._renderMarkers();\n }", "function render() {\n // Render pie chart.\n if (angular.isDefined(vm.dataset)) {\n renderChart(vm.dataset.summary, $scope.meters.listAll);\n }\n }", "function render() {\n renderPlots1D();\n renderPlots2D();\n}", "init () {\n this.renderPieCharts(40,100,300,300);\n }", "function renderAll() {\n\t\tchart.each(render);\n\t\ttimeline1.updateData(bornDate.top(99999));\n\t}", "render() {\n\t\t\t\treturn Chart;\n\t\t\t}", "render() {\n\t\t\t\treturn Chart;\n\t\t\t}", "function ChartsContainer() {\n return (\n <div className=\"row\">\n <AreaChart />\n <PieChart />\n </div>\n );\n}", "render() {\n\t\t\t\trendered = true\n\n\t\t\t\tif (data.location != 'blank'){\n\n\t\t\t\t\t// add div for chart\n\t\t\t\t\tconst $container = $sel.append('div')\n\t\t\t\t\t\t.attr('class', 'container')\n\t\t\t\t\t\t.style('height', `${containerHeight}px`)\n\n\t\t\t\t\t// add containers for imports and exports\n\t\t\t\t\tconst $imports = $container.append('div')\n\t\t\t\t\t\t.attr('class', 'container-imports')\n\n\t\t\t\t\tconst $exports = $container.append('div')\n\t\t\t\t\t\t.attr('class', 'container-exports')\n\n\t\t\t\t\t// add state name\n\t\t\t\t\tconst $nameDiv = $sel.append('div').attr('class', 'name-div')\n\t\t\t\t\t$nameDiv.append('span').text(data.abbreviation).attr('class', 'name name-upper')\n\n\t\t\t\t\taddDogBlocks({$imports, $exports, factor})\n\n\t\t\t\t\t// if the data exists for that state, add dogs\n\t\t\t\t\t// if (data.count){\n \t\t\t// \t\t$imports.selectAll('.import dog')\n \t\t\t// \t\t\t.data(d3.range(data.count.imported / factor))\n \t\t\t// \t\t\t.join(enter => {\n \t\t\t// \t\t\t\tenter.append('div')\n \t\t\t// \t\t\t\t\t.attr('class', 'import')\n \t\t\t// \t\t\t})\n\t\t\t\t\t//\n\t\t\t\t\t// \t$exports.selectAll('.export dog')\n\t\t\t\t\t// \t\t.data(d3.range(data.count.exported / factor))\n\t\t\t\t\t// \t\t.join(enter => {\n\t\t\t\t\t// \t\t\tenter.append('div')\n\t\t\t\t\t// \t\t\t\t.attr('class', 'export')\n\t\t\t\t\t// \t\t})\n\t\t\t\t\t// }\n\n\n\t\t\t\t}\n\n\t\t\t\treturn Chart;\n\t\t\t}", "function renderAll() {\n chart.each(render);\n list.each(render);\n d3.select('#active').text(formatNumber(all.value()));\n }", "_initializeComponent() {\n //Heade\n this.elements.header = document.createElement(\"div\");\n this.elements.title = document.createElement(\"span\");\n this.elements.range = document.createElement(\"span\");\n\n this.elements.header.className = \"chart-header\";\n this.elements.title.className = \"chart-title\";\n this.elements.range.className = \"chart-range\";\n\n this.elements.header.appendChild(this.elements.title);\n this.elements.header.appendChild(this.elements.range);\n\n //Tooltip\n this.elements.tooltip = document.createElement(\"div\");\n this.elements.date = document.createElement(\"span\");\n this.elements.values = document.createElement(\"div\");\n\n this.elements.tooltip.className = \"chart-tooltip\";\n this.elements.date.className = \"chart-tooltip-date\";\n this.elements.values.className = \"chart-tooltip-values\";\n\n this.elements.tooltip.appendChild(this.elements.date);\n this.elements.tooltip.appendChild(this.elements.values);\n\n //Render\n this.elements.render = document.createElement(\"div\");\n this.elements.chart = document.createElement(\"canvas\");\n this.elements.layout = document.createElement(\"canvas\");\n\n this.elements.render.className = \"chart-render\";\n this.elements.chart.className = \"chart-render-chart\";\n this.elements.layout.className = \"chart-render-layout\";\n\n this.elements.render.appendChild(this.elements.chart);\n this.elements.render.appendChild(this.elements.layout);\n\n //Preview\n this.elements.control = document.createElement(\"div\");\n this.elements.preview = document.createElement(\"canvas\");\n this.elements.select = document.createElement(\"div\");\n this.elements.draggerLeft = document.createElement(\"div\");\n this.elements.draggerRight = document.createElement(\"div\");\n this.elements.coverLeft = document.createElement(\"div\");\n this.elements.coverRight = document.createElement(\"div\");\n\n this.elements.control.className = \"chart-control\";\n this.elements.preview.className = \"chart-preview\";\n this.elements.select.className = \"chart-select\";\n this.elements.draggerLeft.className = \"chart-dragger chart-dragger-left\";\n this.elements.draggerRight.className = \"chart-dragger chart-dragger-right\";\n this.elements.coverLeft.className = \"chart-cover chart-cover-left\";\n this.elements.coverRight.className = \"chart-cover chart-cover-right\";\n\n this.elements.control.appendChild(this.elements.preview);\n this.elements.control.appendChild(this.elements.coverLeft);\n this.elements.control.appendChild(this.elements.select);\n this.elements.select.appendChild(this.elements.draggerLeft);\n this.elements.select.appendChild(this.elements.draggerRight);\n this.elements.control.appendChild(this.elements.coverRight);\n\n //Graph buttons container\n this.elements.graphs = document.createElement(\"div\");\n\n this.elements.graphs.className = \"chart-graphs\";\n\n //Main container\n this.elements.container.className += \" chart-container\";\n\n this.elements.container.appendChild(this.elements.header);\n this.elements.container.appendChild(this.elements.tooltip);\n this.elements.container.appendChild(this.elements.render);\n this.elements.container.appendChild(this.elements.control);\n this.elements.container.appendChild(this.elements.graphs);\n }", "function renderAll() {\n chart.each(render);\n d3.select(\"#active\").text(formatNumber(all.value()));\n }", "function render() {\n if (window._env === 'development') console.debug('RENDER');\n initDynamicSentence();\n initMapChart();\n initHighcharts();\n initBubbleChart();\n initSankeyChart();\n initBubbleChart();\n initTableBody();\n }", "render() {\n DvtChartEventUtils.addPlotAreaDnDBackground(this.chart, this, this._frame, true);\n\n if (!this.contains(this._shapesContainer)) {\n if (!this._shapesContainer) {\n this._shapesContainer = new dvt.Container(this.getCtx());\n }\n this.addChild(this._shapesContainer);\n }\n\n // Set each slice's angle start and angle extent\n // The order in which these slices are rendered is determined in the later call to orderSlicesForRendering\n DvtChartPie._layoutSlices(this._slices, this._anchorOffset);\n\n // create the physical surface objects and labels\n var pieCircumference = 2 * Math.PI * this.getRadiusX();\n var prevEndCoord = 0;\n var thinSlices = {};\n var hasLargeSeriesCount = this.chart.getOptionsCache().getFromCache('hasLargeSeriesCount');\n for (var i = 0; i < this._slices.length; i++) {\n // Skip rendering some of the thin slices for charts with large series counts\n if (hasLargeSeriesCount) {\n var angleExtent = this._slices[i].getAngleExtent();\n var sliceArc = (angleExtent / 360) * pieCircumference;\n var endCoord = ((this._slices[i].getAngleStart() + angleExtent) / 360) * pieCircumference;\n if (\n sliceArc < this._MIN_ARC_LENGTH &&\n Math.abs(prevEndCoord - endCoord) < this._MIN_ARC_LENGTH\n ) {\n thinSlices[this._slices[i].getSeriesIndex()] = true;\n continue; // skip pre render\n } else prevEndCoord = endCoord;\n }\n this._slices[i].preRender();\n }\n\n // we order the slices for rendering, such that\n // the \"front-most\" slice, the one closest to the user\n // is redered last. each slice is then responsible\n // for properly ordering each of its surfaces before\n // the surfaces are rendered.\n var zOrderedSlices = DvtChartPie._orderSlicesForRendering(this._slices);\n\n if (!this._duringDisplayAnim) {\n DvtChartPieLabelUtils.createPieCenter(this);\n DvtChartPieLabelUtils.layoutLabelsAndFeelers(this);\n }\n\n // now that everything has been laid out, tell the slices to\n // render their surfaces\n for (var i = 0; i < zOrderedSlices.length; i++) {\n if (!thinSlices[zOrderedSlices[i].getSeriesIndex()])\n zOrderedSlices[i].render(this._duringDisplayAnim);\n }\n\n // perform initial selection\n this.setInitialSelection();\n\n // Initial Highlighting\n this.highlight(DvtChartDataUtils.getHighlightedCategories(this.chart));\n }", "function renderAll() {\n chart.each(render);\n updateMarkers();\n redrawMap();\n // list.each(render);\n d3.select(\"#active\").text(formatNumber(all.value()));\n }", "render() {\n this.renderCells();\n this.paintCells();\n this.setFigures();\n }", "render () {\n\t\t\t\t//Clear the entire canvas every render\n\t\tthis\n\t\t\t\t\t\t.context\n\t\t\t\t\t\t.clearRect( 0, 0, this.width, this.height );\n\n\t\t\t\t//Trigger the render function on every child element\n\t\tfor ( let i = 0; i < this.circleContainers.length; i++ ) {\n\t\t\tthis\n\t\t\t\t\t\t\t\t.circleContainers[i]\n\t\t\t\t\t\t\t\t.render();\n\t\t}\n\t}", "function render() {\n\n var\n //scaleOverflowLabel = i18n( 'FormEditorMojit.el_properties_panel.LBL_EE_SCALEOVERFLOW' ),\n //maxLengthLabel = i18n( 'FormEditorMojit.el_properties_panel.LBL_EE_MAXLEN' ),\n panelNode = Y.Node.create( '<div></div>' );\n\n async.series( [ loadPanelHtml, cacheJQuery, loadMedDataTypes, setupAxisTypes ], onAllDone );\n\n function loadPanelHtml( itcb ) {\n // clear any existing content\n jq.me.html( '' );\n isRendered = false;\n\n // load the panel template\n YUI.dcJadeRepository.loadNodeFromTemplate(\n 'editor_chartmd',\n 'FormEditorMojit',\n {},\n panelNode,\n onPanelHtmlLoaded\n );\n\n // add panel template to page\n function onPanelHtmlLoaded( err ) {\n if ( err ) { return itcb( err ); }\n Y.one( '#' + domId ).append( panelNode );\n itcb( null );\n }\n }\n\n function cacheJQuery( itcb ) {\n var\n k;\n\n for ( k in BIND_ELEMENTS ) {\n if ( BIND_ELEMENTS.hasOwnProperty( k ) ) {\n jq[ k ] = $( '#' + k );\n }\n }\n\n jq.btnSelectChartImage = $( '#btnSelectChartImage' );\n\n itcb( null );\n }\n\n function loadMedDataTypes( itcb ) {\n Y.doccirrus.jsonrpc.api.meddata\n .getAllMeddataTypes()\n .then( onTypesLoaded )\n .fail( itcb );\n\n function onTypesLoaded( allMeddataTypes ) {\n var html, k;\n\n allMeddataTypes = allMeddataTypes.data ? allMeddataTypes.data : allMeddataTypes;\n\n for ( k in allMeddataTypes ) {\n if ( allMeddataTypes.hasOwnProperty( k ) ) {\n html = '<option value=\"' + k + '\">' + allMeddataTypes[k] + '</option>';\n jq.selChartMdY.append( html );\n }\n }\n\n itcb( null );\n }\n }\n\n function setupAxisTypes( itcb ) {\n var html, i;\n\n for ( i = 0; i < AXIS_MEDDATA_TYPES.length; i++ ) {\n html = '' +\n '<option value=\"' + AXIS_MEDDATA_TYPES[i] + '\">' +\n i18n( 'v_meddata-schema.medDataTypes.' + AXIS_MEDDATA_TYPES[i] ) +\n '</option>';\n\n jq.selChartMdX.append( html );\n }\n\n itcb( null );\n }\n\n function onAllDone( err ) {\n if ( err ) {\n Y.log( 'Problem initializing chart editor: ' + JSON.stringify( err ), 'warn', NAME );\n return;\n }\n\n function EditChartMDVM() {\n var\n self = this;\n\n self.btnChooseImageI18n = i18n('FormEditorMojit.ctrl.BTN_CHOOSE_IMAGE');\n\n }\n\n ko.applyBindings( new EditChartMDVM(), document.querySelector( '#divElementEditPanelChartMD' ) );\n isRendered = true;\n updateFromElement();\n subscribeToControls();\n }\n\n }", "render () {\n\t\tfor ( let i = 0; i < this.numberOfCircles; i++ ) {\n\t\t\tthis\n\t\t\t\t\t\t\t\t.circles[i]\n\t\t\t\t\t\t\t\t.render( this.context );\n\t\t}\n\t}", "renderElements(data, xScale, renderGroups) {\n\n let { lineG, circleG,/* arrowG,*/ tagG } = renderGroups;\n\n lineG.selectAll('rect').remove();\n circleG.selectAll('circle').remove();\n tagG.selectAll('polyline').remove();\n tagG.selectAll('text').remove();\n\n\n this.renderLines(data, xScale, lineG);\n this.renderCircles(data, xScale, circleG);\n this.renderTags(data, xScale, tagG);\n //if(!data.realEndDate) this.renderArrows(data, xScale,arrowG);\n\n }", "function doRender(ecModel,payload){var api=this._api; // Render all components\n each(this._componentsViews,function(componentView){var componentModel=componentView.__model;componentView.render(componentModel,ecModel,api,payload);updateZ(componentModel,componentView);},this);each(this._chartsViews,function(chart){chart.__alive = false;},this); // Render all charts\n ecModel.eachSeries(function(seriesModel,idx){var chartView=this._chartsMap[seriesModel.__viewId];chartView.__alive = true;chartView.render(seriesModel,ecModel,api,payload);chartView.group.silent = !!seriesModel.get('silent');updateZ(seriesModel,chartView);},this); // Remove groups of unrendered charts\n each(this._chartsViews,function(chart){if(!chart.__alive){chart.remove(ecModel,api);}},this);}", "render() {\n\n return(<div>\n<br />\n<Container>\n <div>\n\n <h2>Top 10 Players</h2>\n\n <BarChart1 data={this.props.chartData1} />\n\n </div>\n\n <div>\n <h2>Top 5 Teams With Most Goals</h2>\n\n <BarChart2 data={this.props.chartData2} />\n </div>\n\n</Container>\n\n\n </div>)\n }", "render() {\n this.renderComponents() // dial + outputs, algedonode, brass pads, strips, lights\n this.renderLabels()\n }", "function doRender(ecModel, payload) {\n var api = this._api;\n // Render all components\n each(this._componentsViews, function (componentView) {\n var componentModel = componentView.__model;\n componentView.render(componentModel, ecModel, api, payload);\n\n updateZ(componentModel, componentView);\n }, this);\n\n each(this._chartsViews, function (chart) {\n chart.__alive = false;\n }, this);\n\n // Render all charts\n ecModel.eachSeries(function (seriesModel, idx) {\n var chartView = this._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n chartView.render(seriesModel, ecModel, api, payload);\n\n chartView.group.silent = !!seriesModel.get('silent');\n\n updateZ(seriesModel, chartView);\n\n updateProgressiveAndBlend(seriesModel, chartView);\n\n }, this);\n\n // If use hover layer\n updateHoverLayerStatus(this._zr, ecModel);\n\n // Remove groups of unrendered charts\n each(this._chartsViews, function (chart) {\n if (!chart.__alive) {\n chart.remove(ecModel, api);\n }\n }, this);\n }", "function doRender(ecModel, payload) {\n var api = this._api;\n // Render all components\n each(this._componentsViews, function (componentView) {\n var componentModel = componentView.__model;\n componentView.render(componentModel, ecModel, api, payload);\n\n updateZ(componentModel, componentView);\n }, this);\n\n each(this._chartsViews, function (chart) {\n chart.__alive = false;\n }, this);\n\n // Render all charts\n ecModel.eachSeries(function (seriesModel, idx) {\n var chartView = this._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n chartView.render(seriesModel, ecModel, api, payload);\n\n chartView.group.silent = !!seriesModel.get('silent');\n\n updateZ(seriesModel, chartView);\n\n updateProgressiveAndBlend(seriesModel, chartView);\n\n }, this);\n\n // If use hover layer\n updateHoverLayerStatus(this._zr, ecModel);\n\n // Remove groups of unrendered charts\n each(this._chartsViews, function (chart) {\n if (!chart.__alive) {\n chart.remove(ecModel, api);\n }\n }, this);\n }", "function chartRenderCharts() {\r\n if(!document.getElementById(\"apex_line2_chart\")) return ;\r\n\r\n // create charts for chart page\r\n if (!chartLaptime) {\r\n chartLaptime = new CustomApexChart(\"#apex_line2_chart\", \"line\");\r\n chartLaptime.setOptions({\r\n 'title' : 'laptime(seconds)/lap',\r\n 'height' : 396,\r\n 'xAxisTitle' : 'LAP',\r\n 'yAxisTitle' : 'Laptime',\r\n });\r\n chartLaptime.render();\r\n }\r\n if (!chartSector1) {\r\n chartSector1 = new CustomApexChart(\"#basic-column-sector1\", \"bar\");\r\n chartSector1.setOptions({\r\n 'height' : 385,\r\n 'xAxisTitle' : 'LAP',\r\n 'yAxisTitle' : 'sector1',\r\n });\r\n chartSector1.render();\r\n }\r\n if (!chartSector2) {\r\n chartSector2 = new CustomApexChart(\"#basic-column-sector2\", \"bar\");\r\n chartSector2.setOptions({\r\n 'height' : 385,\r\n 'xAxisTitle' : 'LAP',\r\n 'yAxisTitle' : 'sector2',\r\n });\r\n chartSector2.render();\r\n }\r\n if (!chartSector3) {\r\n chartSector3 = new CustomApexChart(\"#basic-column-sector3\", \"bar\");\r\n chartSector3.setOptions({\r\n 'height' : 385,\r\n 'xAxisTitle' : 'LAP',\r\n 'yAxisTitle' : 'sector3',\r\n });\r\n chartSector3.render();\r\n }\r\n\r\n chartPageCheckDrivers();\r\n\r\n getCheckedChartDrivers();\r\n\r\n var currentSeries = {};\r\n\r\n checkedChartDrivers.forEach(driverId => {\r\n // chart series name\r\n currentSeries[driverId] = \"\";\r\n if ($(\"#customCheck\"+driverId).length) currentSeries[driverId] = $(\"#customCheck\"+driverId).attr('data-title');\r\n\r\n // chart series data\r\n });\r\n\r\n getDatasCharts(function() {\r\n if (!gameChartsLapsValues || !gameChartsLapsValues.length) return;\r\n console.log(\"[chartRenderCharts] after getDatasCharts\", gameChartsLapsValues, currentSeries, gameChartsData, gameChartsSector1Data, gameChartsSector2Data, gameChartsSector3Data);\r\n\r\n if (chartLaptime) {\r\n chartLaptime.setSeries(currentSeries);\r\n chartLaptime.setXAxis(gameChartsLapsValues);\r\n chartLaptime.setData(gameChartsData);\r\n\r\n if(sliderLaptime){\r\n let tempMin = CustomApexChart.calcYAxisMin(chartLaptime.yValueMin);\r\n let tempMax = CustomApexChart.calcYAxisMax(chartLaptime.yValueMax);\r\n sliderLaptime.update({\r\n from: tempMin,\r\n to: tempMax,\r\n min: tempMin,\r\n max: tempMax\r\n });\r\n }\r\n }\r\n if (chartSector1) {\r\n chartSector1.setSeries(currentSeries);\r\n chartSector1.setXAxis(gameChartsLapsValues);\r\n chartSector1.setData(gameChartsSector1Data);\r\n\r\n if(sliderSector1){\r\n let tempMin = CustomApexChart.calcYAxisMin(chartSector1.yValueMin);\r\n let tempMax = CustomApexChart.calcYAxisMax(chartSector1.yValueMax);\r\n sliderSector1.update({\r\n from: tempMin,\r\n to: tempMax,\r\n min: tempMin,\r\n max: tempMax\r\n });\r\n }\r\n }\r\n if (chartSector2) {\r\n chartSector2.setSeries(currentSeries);\r\n chartSector2.setXAxis(gameChartsLapsValues);\r\n chartSector2.setData(gameChartsSector1Data);\r\n\r\n if(sliderSector2){\r\n let tempMin = CustomApexChart.calcYAxisMin(chartSector2.yValueMin);\r\n let tempMax = CustomApexChart.calcYAxisMax(chartSector2.yValueMax);\r\n sliderSector2.update({\r\n from: tempMin,\r\n to: tempMax,\r\n min: tempMin,\r\n max: tempMax\r\n });\r\n }\r\n }\r\n if (chartSector3) {\r\n chartSector3.setSeries(currentSeries);\r\n chartSector3.setXAxis(gameChartsLapsValues);\r\n chartSector3.setData(gameChartsSector1Data);\r\n\r\n if(sliderSector3){\r\n let tempMin = CustomApexChart.calcYAxisMin(chartSector3.yValueMin);\r\n let tempMax = CustomApexChart.calcYAxisMax(chartSector3.yValueMax);\r\n sliderSector3.update({\r\n from: tempMin,\r\n to: tempMax,\r\n min: tempMin,\r\n max: tempMax\r\n });\r\n }\r\n }\r\n });\r\n\r\n }", "render() {\n this.activeObjects.forEach(function(object) {\n object.render();\n });\n }", "render(){\n\n if (this.props.location === \"bar\"){\n return (\n <div className=\"chart\">\n <div className=\"item\">\n <Bar\n data={this.state.chartData}\n options={{\n title:{\n display:this.props.displayTitle,\n fontSize:25\n },\n legend:{\n display:this.props.displayLegend,\n position:this.props.legendPosition\n },\n scales: {\n yAxes: [{\n scaleLabel: {\n display: false,\n labelString: \"\"\n }\n }],\n xAxes: [{\n scaleLabel: {\n display: false,\n labelString: \"\"\n }\n }] \n }\n }}\n />\n </div>\n </div>\n )\n }\n\n if (this.props.location === \"line\"){\n return (\n <div className=\"chart\">\n <div className=\"item\">\n <Line\n data={this.state.chartData}\n options={{\n title:{\n display:this.props.displayTitle,\n fontSize:25\n },\n legend:{\n display:this.props.displayLegend,\n position:this.props.legendPosition\n },\n scales: {\n yAxes: [{\n scaleLabel: {\n display: false,\n labelString: \"\"\n }\n }],\n xAxes: [{\n scaleLabel: {\n display: false,\n labelString: \"\"\n }\n }] \n }\n }}\n />\n </div>\n </div>\n )\n }\n\n if (this.props.location === \"pie\"){\n return (\n <div className=\"chart\">\n <div className=\"item\">\n <Pie\n data={this.state.chartData}\n options={{\n title:{\n display:this.props.displayTitle,\n fontSize:25\n },\n legend:{\n display:this.props.displayLegend,\n position:this.props.legendPosition\n },\n backgroundColor:this.props.backgroundColor\n }}\n />\n </div>\n </div>\n )\n }\n }", "function renderEverything() {\n renderIngredients();\n renderButtons();\n renderPrice();\n}", "function render() {\n renderCards();\n renderValue();\n}", "render() {\n this.widgets.forEach((widget) => {\n widget.render();\n });\n }", "function render() { \t\n\t// renderMenu(); // dropdown menu to let user switch between years manually\n\trenderDatatext();\n\tif (state.world && state.countries.length > 0) renderMap();\n\trenderKey(); // map legend\n\trenderMapyear();\n\trenderLinechart(\".chart-1\", config.countryGroups.heighincome, \"normal\"); // where to place, what data to use\n\trenderLinechart(\".chart-2\", config.countryGroups.brics, \"normal\");\n\trenderLinechart(\".chart-3\", config.countryGroups.arab, \"large\");\n\trenderLinechart(\".chart-4\", config.countryGroups.mostrising, \"normal\");\n\trenderLinechart(\".chart-5\", config.countryGroups.northamerica, \"normal\");\n\trenderLinechart(\".chart-6\", config.countryGroups.warridden, \"normal\");\n\trenderLinechart(\".chart-7\", config.countryGroups.soviet, \"normal\");\n\trenderLinechart(\".chart-8\", config.countryGroups.mensworld,\"normal\");\n\trenderLinechart(\".chart-9\", state.userselected,\"normal\");\n\trenderUserinput();\n}", "function doRender(ecModel, payload) {\n var api = this._api;\n // Render all components\n each(this._componentsViews, function (componentView) {\n var componentModel = componentView.__model;\n componentView.render(componentModel, ecModel, api, payload);\n\n updateZ(componentModel, componentView);\n }, this);\n\n each(this._chartsViews, function (chart) {\n chart.__alive = false;\n }, this);\n\n // Render all charts\n ecModel.eachSeries(function (seriesModel, idx) {\n var chartView = this._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n chartView.render(seriesModel, ecModel, api, payload);\n\n chartView.group.silent = !!seriesModel.get('silent');\n\n updateZ(seriesModel, chartView);\n\n updateProgressiveAndBlend(seriesModel, chartView);\n }, this);\n\n // If use hover layer\n updateHoverLayerStatus(this._zr, ecModel);\n\n // Remove groups of unrendered charts\n each(this._chartsViews, function (chart) {\n if (!chart.__alive) {\n chart.remove(ecModel, api);\n }\n }, this);\n}", "render() {\n\t\tthis.a1.render(this.context);\n\t\tthis.b1.render(this.context);\n\t\tthis.c1.render(this.context);\n\t\tthis.c2.render(this.context);\n\t\tthis.d1.render(this.context);\n\t\tthis.e1.render(this.context);\n\t\tthis.f1.render(this.context);\n\t\tthis.g1.render(this.context);\n\t\tthis.a1s.render(this.context);\n\t\tthis.c1s.render(this.context);\n\t\tthis.d1s.render(this.context);\n\t\tthis.f1s.render(this.context);\n\t\tthis.g1s.render(this.context);\n\n\t}", "function doRender(ecModel, payload) {\n var api = this._api; // Render all components\n\n each(this._componentsViews, function (componentView) {\n var componentModel = componentView.__model;\n componentView.render(componentModel, ecModel, api, payload);\n updateZ(componentModel, componentView);\n }, this);\n each(this._chartsViews, function (chart) {\n chart.__alive = false;\n }, this); // Render all charts\n\n ecModel.eachSeries(function (seriesModel, idx) {\n var chartView = this._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n chartView.render(seriesModel, ecModel, api, payload);\n chartView.group.silent = !!seriesModel.get('silent');\n updateZ(seriesModel, chartView);\n updateProgressiveAndBlend(seriesModel, chartView);\n }, this); // If use hover layer\n\n updateHoverLayerStatus(this._zr, ecModel); // Remove groups of unrendered charts\n\n each(this._chartsViews, function (chart) {\n if (!chart.__alive) {\n chart.remove(ecModel, api);\n }\n }, this);\n}", "function doRender(ecModel, payload) {\n var api = this._api; // Render all components\n\n each(this._componentsViews, function (componentView) {\n var componentModel = componentView.__model;\n componentView.render(componentModel, ecModel, api, payload);\n updateZ(componentModel, componentView);\n }, this);\n each(this._chartsViews, function (chart) {\n chart.__alive = false;\n }, this); // Render all charts\n\n ecModel.eachSeries(function (seriesModel, idx) {\n var chartView = this._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n chartView.render(seriesModel, ecModel, api, payload);\n chartView.group.silent = !!seriesModel.get('silent');\n updateZ(seriesModel, chartView);\n updateProgressiveAndBlend(seriesModel, chartView);\n }, this); // If use hover layer\n\n updateHoverLayerStatus(this._zr, ecModel); // Remove groups of unrendered charts\n\n each(this._chartsViews, function (chart) {\n if (!chart.__alive) {\n chart.remove(ecModel, api);\n }\n }, this);\n}", "function doRender(ecModel, payload) {\n var api = this._api; // Render all components\n\n each(this._componentsViews, function (componentView) {\n var componentModel = componentView.__model;\n componentView.render(componentModel, ecModel, api, payload);\n updateZ(componentModel, componentView);\n }, this);\n each(this._chartsViews, function (chart) {\n chart.__alive = false;\n }, this); // Render all charts\n\n ecModel.eachSeries(function (seriesModel, idx) {\n var chartView = this._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n chartView.render(seriesModel, ecModel, api, payload);\n chartView.group.silent = !!seriesModel.get('silent');\n updateZ(seriesModel, chartView);\n updateProgressiveAndBlend(seriesModel, chartView);\n }, this); // If use hover layer\n\n updateHoverLayerStatus(this._zr, ecModel); // Remove groups of unrendered charts\n\n each(this._chartsViews, function (chart) {\n if (!chart.__alive) {\n chart.remove(ecModel, api);\n }\n }, this);\n}", "function render_panel() {\n if (shouldAbortRender()) {\n //return;\n }\n \n \n // this.seriesList = [];\n // this.data = [];\n\n var stack = panel.stack ? true : null;\n\n // Populate element\n var options = {\n hooks: {\n draw: [drawHook],\n processOffset: [processOffsetHook],\n },\n legend: { show: false },\n series: {\n stackpercent: panel.stack ? panel.percentage : false,\n stack: panel.percentage ? null : stack,\n bars: {\n show: true,\n fill: 0.9,\n barWidth: 1,\n zero: false,\n lineWidth: 0,\n align: 'center'\n },\n shadowSize: 0\n },\n yaxes: [],\n xaxis: {},\n grid: {\n minBorderMargin: 0,\n markings: [],\n backgroundColor: null,\n borderWidth: 0,\n hoverable: true,\n color: '#c8c8c8',\n margin: { left: 0, right: 0 },\n },\n selection: {\n mode: \"x\",\n color: '#666'\n },\n crosshair: {\n mode: panel.tooltip.shared || dashboard.sharedCrosshair ? \"x\" : null\n }\n };\n\n // var scopedVars = ctrl.panel.scopedVars;\n //// var bucketSize = !panel.bucketSize && panel.bucketSize !== 0 ? null : parseFloat(ctrl.templateSrv.replaceWithText(panel.bucketSize.toString(), scopedVars));\n // var minValue = !panel.minValue && panel.minValue !== 0 ? null : parseFloat(ctrl.templateSrv.replaceWithText(panel.minValue.toString(), scopedVars));\n // var maxValue = !panel.maxValue && panel.maxValue !== 0 ? null : parseFloat(ctrl.templateSrv.replaceWithText(panel.maxValue.toString(), scopedVars));\nif(!isPng){\n\n for (var i = 0; i < data.length; i++) {\n var series = data[i];\n series.data = getFFT(series);\n \n options.series.bars.barWidth = ((series.data[series.data.length-1][0] + series.data[0][0])/series.data.length);//(elem.width()/series.data.length);\n\n // if hidden remove points and disable stack\n if (ctrl.hiddenSeries[series.alias]) {\n series.data = [];\n series.stack = false;\n }\n }\n\n // if (data.length && data[0].stats.timeStep) {\n //data[0].stats.timeStep / 1.5;\n // }\n} else {\n \n addAnnotations(options); \n}\n \n // panel.yaxes[1].show = true;\n configureAxisOptions(data, options);\n // addHistogramAxis(options);\n // options.selection = {};\n\n sortedSeries = _.sortBy(data, function(series) { return series.zindex; });\n\n function callPlot(incrementRenderCounter) {\n try {\n $.plot(elem, sortedSeries, options);\n } catch (e) {\n console.log('flotcharts error', e);\n }\n\n if (incrementRenderCounter) {\n ctrl.renderingCompleted();\n }\n }\n \n scope.isPng = isPng;\n \n \n scope.zoomPlot = function(start, end) {\n \n options.xaxis.min = start;\n options.xaxis.max = end;\n\n callPlot(true);\n };\n \n scope.zoomOut = function() {\n if(isPng){\n // this.ctrl.events.emit('zoom-out');\n this.ctrl.publishAppEvent('zoom-out',2);\n } else {\n options.xaxis.min = null;\n options.xaxis.max = null;\n callPlot(true);\n }\n \n };\n \n\n if (shouldDelayDraw(panel)) {\n // temp fix for legends on the side, need to render twice to get dimensions right\n callPlot(false);\n setTimeout(function() { callPlot(true); }, 50);\n legendSideLastValue = panel.legend.rightSide;\n }\n else {\n callPlot(true);\n }\n }", "function doRender(ecModel, payload) {\n\t var api = this._api;\n\t // Render all components\n\t each(this._componentsViews, function (componentView) {\n\t var componentModel = componentView.__model;\n\t componentView.render(componentModel, ecModel, api, payload);\n\n\t updateZ(componentModel, componentView);\n\t }, this);\n\n\t each(this._chartsViews, function (chart) {\n\t chart.__alive = false;\n\t }, this);\n\n\t // Render all charts\n\t ecModel.eachSeries(function (seriesModel, idx) {\n\t var chartView = this._chartsMap[seriesModel.__viewId];\n\t chartView.__alive = true;\n\t chartView.render(seriesModel, ecModel, api, payload);\n\n\t chartView.group.silent = !!seriesModel.get('silent');\n\n\t updateZ(seriesModel, chartView);\n\n\t updateProgressiveAndBlend(seriesModel, chartView);\n\t }, this);\n\n\t // If use hover layer\n\t updateHoverLayerStatus(this._zr, ecModel);\n\n\t // Remove groups of unrendered charts\n\t each(this._chartsViews, function (chart) {\n\t if (!chart.__alive) {\n\t chart.remove(ecModel, api);\n\t }\n\t }, this);\n\t}", "render() {\n let me = $(this);\n let parentModule = me.closest('flx-module');\n let wcModule = parentModule[0];\n let rendered = '';\n if (this.data.length > 0) {\n if (this.tHeader && this.tHeader !== '') {\n let render = flexygo.utils.parser.recursiveCompile(this.data[0], this.tHeader, this);\n rendered += render;\n }\n let uniqueId = flexygo.utils.uniqueId();\n rendered += `<div class=\"zoomElements\">\n <i class=\"flx-icon icon-zoomout icon-zoom-115 zoom-ic minusZoom\"></i>\n <input class=\"sliderZoom\" min=\"0.1\" max= \"2\" value= \"1\" step= \"0.05\" type= \"range\"></input>\n <i class=\"flx-icon icon-zoom-1 icon-zoom-115 zoom-ic plusZoom\" ></i>\n <i class=\"flx-icon icon-focus icon-zoom-115 zoom-ic fitZoom\"></i>\n </div>\n <div class=\"flx-orgchart margintoporgchart\" id=\"` + uniqueId + `\"></div>`;\n if (this.tFooter && this.tFooter !== '') {\n let render = flexygo.utils.parser.recursiveCompile(this.data[0], this.tFooter, this);\n rendered += render;\n }\n me.html(rendered);\n //zoom\n let slider = me.find(\".sliderZoom\");\n slider.on(\"change\", function () {\n me.find(\".flx-orgchart\").css({ \"zoom\": $(this).val() });\n });\n me.find(\".plusZoom\").on(\"click\", function () {\n slider.val(parseFloat(slider.val()) + parseFloat(slider.attr('step')));\n slider.change();\n });\n me.find(\".minusZoom\").on(\"click\", function () {\n slider.val(parseFloat(slider.val()) - parseFloat(slider.attr('step')));\n slider.change();\n });\n me.find(\".fitZoom\").on(\"click\", function () {\n if (parseFloat(me.find(\"svg\").attr(\"width\")) != 0) {\n slider.val($('.cntBody').width() / parseFloat(me.find(\"svg\").attr(\"width\")));\n slider.change();\n }\n });\n let initialNode = new flexygo.api.orgchart.Node();\n initialNode.children = new Array();\n if (this.tBody && this.tBody !== '') {\n for (let i = 0; i < this.data.length; i++) {\n if (flexygo.utils.isBlank(this.data[i].Parent)) {\n let node = new flexygo.api.orgchart.Node();\n node.id = this.data[i].Id;\n node.innerHTML = flexygo.utils.parser.recursiveCompile(this.data[i], this.tBody, this);\n node.children = this.getChildren(this.data[i].Id);\n node.stackChildren = this.stackChildren;\n initialNode.children.push(node);\n }\n }\n }\n this.options.chart.container = \"#\" + uniqueId;\n this.options.chart.callback = {\n onTreeLoaded: () => { this.stopLoading(); this.setInitialZoom(); this.dragScroll(); }\n };\n this.options.nodeStructure = initialNode;\n this.tree = new Treant(this.options);\n }\n if (parentModule && wcModule) {\n wcModule.moduleLoaded(this);\n }\n }", "function renderEverything() {\n renderPepperonni()\n renderMushrooms()\n renderGreenPeppers()\n renderWhiteSauce()\n renderGlutenFreeCrust()\n\n renderButtons()\n renderPrice()\n}", "function renderEverything() {\n renderPepperonni()\n renderMushrooms()\n renderGreenPeppers()\n renderWhiteSauce()\n renderGlutenFreeCrust()\n\n renderButtons()\n renderPrice()\n}", "charts() {\n const l = this.data[this.vue.person]\n .event\n .map(i => i.data.physical.sign)\n const measurements = {}\n for (let event = 0; event < l.length; ++event) {\n for (let item of l[event]) {\n const ident = item.ident.toLowerCase()\n measurements[ident] = measurements[ident] || []\n item = Object.assign({event}, item)\n measurements[ident].push(item)\n }\n }\n\n const run = () => {\n for (let key in measurements) {\n // console.log(key)\n // Patch to combine blood pressure\n if (key === 'bps' || key === 'bpd') {\n console.log(\"In here\")\n console.log(key)\n } else {\n // console.log(\"Trying to render \" + key)\n const m = measurements[key].filter(i => i.event <= this.vue.event)\n const name = `#charts-${key}`\n const cats = m.map(i => this.vue.p.event[i.event].title)\n const cols = [key].concat(m.map(i => parseInt(i.value)))\n const unit = m[0].units.replace(\"&deg;C\", \"Celcius\")\n // Change to Line Graphs\n bb.generate({\n bindto: name,\n axis: {\n x: { \n type: \"category\",\n categories: cats,\n tick : { width : 50 },\n height : 50\n },\n y: { tick: { format: i => `${i} ${unit}` } }\n },\n data: {\n columns: [ cols ],\n types: { [key]: \"spline\", },\n colors: { [key] : \"red\", },\n },\n grid: {\n x: {\n show: true\n },\n y: {\n show: true\n }\n },\n legend : { show: false }\n })\n }\n }\n // Make one blood pressure chart\n var columns = []\n var cats = []\n var unit = []\n for (let key in measurements) {\n if (key === 'bps' || key === 'bpd') {\n const m = measurements[key].filter(i => i.event <= this.vue.event)\n unit = m[0].units\n console.log(m)\n cats = m.map(i => this.vue.p.event[i.event].title)\n const cols = [key].concat(m.map(i => parseInt(i.value)))\n columns.push(cols)\n\n }\n }\n const name = '#charts-bps'\n console.log(cats)\n console.log(columns)\n bb.generate({\n bindto: name,\n axis: {\n x: { \n type: \"category\",\n categories: cats,\n tick : { width : 50 },\n height : 50\n },\n y: { tick: { format: i => `${i} ${unit}` } }\n },\n data: {\n columns: columns,\n types: { 'bps': \"spline\", \n 'bpd': \"spline\"},\n colors: { 'bps' : \"red\", \n 'bpd' : \"blue\"},\n },\n grid: {\n x: {\n show: true\n },\n y: {\n show: true\n }\n },\n legend : { show: false }\n })\n var x = document.getElementsByClassName(\"chart\");\n x[0].innerHTML = \"Blood Pressure\";\n var element = x[1]\n element.parentNode.removeChild(element)\n }\n\n setTimeout(run, 0)\n return Object\n .keys(measurements)\n .map(i => [i, measurements[i]])\n }", "function render() { \n\n $body.append(templates['container']({'id':_uid}))\n $j('#' + _uid).append(templates['heading-no-links']({'title':'Countdown Promotion'}));\n $j('#' + _uid).append(templates['countdown-promo']({'id':_uid}));\n \n chtLeaderboard = new CHART.CountdownLeaderboard(_uid + '-charts-promo-leaderboard', _models.promo.getData('all'), _models.promo.getTargetSeries(20000));\n tblLeaderboard = new TABLE.CountdownLeaderboard(_uid + '-tables-promo-leaderboard', _models.promo.groupByOwner('all', 20000), _models.promo.getTotal('all', 180000)); \n chtLastWeek = new CHART.CountdownLeaderboard(_uid + '-charts-promo-lastweek', _models.promo.getData('lastweek'), _models.promo.getTargetSeries(1540));\n tblLastWeek = new TABLE.CountdownLeaderboard(_uid + '-tables-promo-lastweek', _models.promo.groupByOwner('lastweek', 1540), _models.promo.getTotal('lastweek', 13860)); \n chtWeeklySales = new CHART.CountdownWeeklySales(_uid + '-charts-promo-weeklysales', _models.promo.getData('all'));\n\n }", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n\n renderButtons();\n renderPrice();\n}", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n\n renderButtons();\n renderPrice();\n}", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n\n renderButtons();\n renderPrice();\n}", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n\n renderButtons();\n renderPrice();\n}", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n\n renderButtons();\n renderPrice();\n}", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n\n renderButtons();\n renderPrice();\n}", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n\n renderButtons();\n renderPrice();\n}", "render() {\n // background box.\n this.renderBackground();\n this.renderName();\n this.renderTimeLine();\n this.renderWave();\n }", "function drawCharts() {\n drawPieChart()\n drawAxisTickColors()\n}", "render() {\n\t\treturn (\n\t\t\t<div style={{width: '180px', height: '180px'}}>\n\t\t\t\t<EasiCircleChart value={80.} animationTime={500}\n\t\t\t\t\tmax={100}\n\t\t\t\t\tcolors={['#00D561', '#FFD71E', '#FFA86D', '#F6502F']} title=\"使用率(%)\"/>\n\t\t\t\t<DashboardCircleChart value={340} animationTime={500}\n\t\t\t\t\tmax={500}\n\t\t\t\t\tisScaleVisible={true}\n\t\t\t\t\ttitle=\"重度污染\"\n\t\t\t\t\tcolors={['#00D561', '#FFD71E', '#ffaf52', '#fb9a29', '#F6502F']}/>\n\t\t\t</div>\n\t\t);\n\t}", "render() {\n return (\n <div className=\"ScatterplotGraph\">\n <div className=\"wrapper\">\n <Card>\n <CardBody>\n <div id=\"chart\" />\n </CardBody>\n </Card>\n </div>\n </div>\n );\n }", "draw() {\n const selector = this.selector;\n let gradient;\n if (this.angles.length !== 1) {\n gradient = this.angles.reduce(\n (acc, curr, index) =>\n acc +\n `${this.getColor(index)} ${curr}deg, ${this.getColor(\n index + 1\n )} ${curr}deg, `,\n ''\n );\n let tempGradient = gradient.split(', ');\n tempGradient = tempGradient.slice(0, tempGradient.length - 2);\n gradient = tempGradient.join(', ');\n }\n else {\n gradient = `${this.getColor(0)} 0deg, ${this.getColor(0)} 360deg`;\n }\n\n const chart = document.createElement('DIV');\n const title = document.createElement('H2');\n const chartGraph = document.createElement('DIV');\n const chartData = document.createElement('DIV');\n const chartPercents = document.createElement('P');\n\n chart.setAttribute('class', 'chart');\n title.setAttribute('class', 'chart__title');\n title.textContent = this.title;\n chartGraph.setAttribute('class', `chart__graph chart__${this.chartType}`);\n chartGraph.style.backgroundImage = `conic-gradient(${gradient})`;\n chartData.setAttribute('class', 'chart__data');\n chartPercents.setAttribute('class', 'chart__percents');\n\n this.percents.forEach((percent, index) => {\n const chartPercent = document.createElement('SPAN');\n const chartPiece = document.createElement('I');\n chartPercent.textContent = `${percent}%`;\n chartPercent.setAttribute('class', 'chart__percent');\n chartPiece.setAttribute('class', 'chart__piece');\n chartPiece.style.backgroundColor = this.getColor(index);\n chartPercent.appendChild(chartPiece);\n chartPercents.appendChild(chartPercent);\n });\n chartData.appendChild(chartPercents);\n\n this.data.forEach((data, index) => {\n const chartDataRow = document.createElement('P');\n const chartDataName = document.createElement('SPAN');\n const chartDataValue = document.createElement('SPAN');\n const chartPiece = document.createElement('I');\n chartDataRow.setAttribute('class', 'chart__dataRow');\n chartDataName.setAttribute('class', 'chart__dataName');\n chartDataValue.setAttribute('class', 'chart__dataValue');\n chartDataName.textContent = Object.keys(data)[0];\n chartDataValue.textContent = Object.values(data)[0];\n chartPiece.setAttribute('class', 'chart__piece');\n chartPiece.style.backgroundColor = this.getColor(index);\n chartDataValue.appendChild(chartPiece);\n chartDataRow.appendChild(chartDataName);\n chartDataRow.appendChild(chartDataValue);\n chartData.appendChild(chartDataRow);\n });\n\n chart.appendChild(title);\n chart.appendChild(chartGraph);\n chart.appendChild(chartData);\n chart.dataset.chartId = this.id;\n\n const existId = document.querySelector(`[data-chart-id=\"${this.id}\"]`);\n if(existId){\n existId.parentNode.replaceChild(chart, existId);\n }\n else\n { \n document.querySelector(selector).appendChild(chart);\n }\n }", "renderMetasystemVisibleComponents() {\n this.dials.forEach(d => {\n d.render(this.renderer)\n })\n this.strips.forEach(s => {\n s.render(this.renderer)\n })\n this.lights.forEach(lightPair => {\n lightPair.forEach(light => light.renderAsMetaSystem(this.renderer))\n })\n }", "render() {\n this.getColorsFromCSS();\n this.drawLines();\n }", "generateChartsHTML() {\n\n\t\tlet plantingDate = new Date();\n\t\tlet harvestDate = new Date();\n\t\tlet harvestDateMin = new Date();\n\t\tlet harvestDateMax = new Date();\n\t\tlet rangeSelectorMin = new Date();\n\t\tlet rangeSelectorMax = new Date();\n\t\tlet ccChartDataArray = {}; // Associative array to store chart data\n\t\tlet biomassDates = [];\n\t\tlet biomassValues = [];\n\t\tlet cnDates = [];\n\t\tlet cnValues = [];\n\t\tlet cnMax = 60;\n\n\t\tlet cnRows = [];\n\t\tlet biomassRows = [];\n\n\t\tif (this.props.hasOwnProperty(\"userInputJson\") && this.props[\"userInputJson\"] !== null && this.props[\"userInputJson\"] !== undefined) {\n\n\t\t\tlet plantingYear = this.props[\"userInputJson\"][\"year_planting\"];\n\t\t\tlet harvestYear = plantingYear + 1;\n\t\t\tlet plantingDOY = this.props[\"userInputJson\"][\"doy_planting\"];\n\t\t\tlet harvestDOY = this.props[\"userInputJson\"][\"doy_harvest\"] - config.coverCropTerminationOffsetDays;\n\t\t\tplantingDate = new Date(plantingYear, 0, plantingDOY);\n\t\t\tharvestDate = new Date(harvestYear, 0, harvestDOY);\n\n\t\t\tharvestDateMin = new Date(harvestYear, 0, harvestDOY - (windowDurationDays/2));\n\t\t\tharvestDateMax = new Date(harvestYear, 0, harvestDOY + (windowDurationDays/2));\n\t\t\trangeSelectorMin = new Date(plantingYear, 0, plantingDOY - 1);\n\t\t\trangeSelectorMax = new Date(harvestYear, 0, harvestDOY + windowDurationDays);\n\t\t}\n\n\t\tccChartDataArray = this.state.ccDataArray;// generate charts for with cover crop case\n\t\tfor (let key in ccChartDataArray) {\n\t\t\tif(key.toString() === \"C:N ratio\"){\n\t\t\t\tif(ccChartDataArray[key].chartData !== undefined && ccChartDataArray[key].chartData.datasets.length) {\n\t\t\t\t\tcnRows = ccChartDataArray[key].chartData.datasets[0].data;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(key.toString() === \"TWAD\"){\n\t\t\t\tif(ccChartDataArray[key].chartData !== undefined && ccChartDataArray[key].chartData.datasets.length) {\n\t\t\t\t\tbiomassRows = ccChartDataArray[key].chartData.datasets[0].data;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet prevCnDate = null;\n\n\t\tcnRows.forEach(function(element) {\n\t\t\tlet dt = element.x;\n\n\t\t\t// Adds 0s for missing date to make graph cleaner\n\t\t\tif(prevCnDate != null){\n\t\t\t\tlet dayDiff = calculateDayDifference(prevCnDate, dt);\n\t\t\t\twhile(dayDiff > 1){\n\t\t\t\t\tlet newDate = addDays(prevCnDate, 1);\n\t\t\t\t\tcnDates.push(newDate);\n\t\t\t\t\tcnValues.push(null);\n\t\t\t\t\tdayDiff--;\n\t\t\t\t\tprevCnDate = newDate;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcnDates.push(dt);\n\t\t\tcnValues.push(element.y);\n\t\t\tprevCnDate = element.x;\n\t\t});\n\n\t\tcnMax = Math.max(...cnValues);\n\t\tif(cnMax < 21){\n\t\t\tcnMax = 26;\n\t\t}\n\n\t\tlet prevBiomassDate = null;\n\t\tbiomassRows.forEach(function(element) {\n\t\t\tlet dt = element.x;\n\n\t\t\t// Adds 0s for missing date to make graph cleaner\n\t\t\tif(prevBiomassDate != null){\n\t\t\t\tlet dayDiff = calculateDayDifference(prevBiomassDate, dt);\n\t\t\t\twhile(dayDiff > 1){\n\t\t\t\t\tlet newDate = addDays(prevBiomassDate, 1);\n\t\t\t\t\tbiomassDates.push(newDate);\n\t\t\t\t\tbiomassValues.push(null);\n\t\t\t\t\tdayDiff--;\n\t\t\t\t\tprevBiomassDate = newDate;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbiomassDates.push(dt);\n\t\t\tbiomassValues.push(element.y);\n\t\t\tprevBiomassDate = element.x;\n\t\t});\n\n\n\t\tlet resultHtml = [];\n\t\tlet selectorOptions = {\n\t\t\tx: 0.01,\n\t\t\ty: 1.15,\n\t\t\tbuttons: [\n\t\t\t// \t{\n\t\t\t// \tstep: \"month\",\n\t\t\t// \tstepmode: \"backward\",\n\t\t\t// \tcount: 1,\n\t\t\t// \tlabel: \"1m\"\n\t\t\t// }, {\n\t\t\t// \tstep: \"month\",\n\t\t\t// \tstepmode: \"backward\",\n\t\t\t// \tcount: 6,\n\t\t\t// \tlabel: \"6m\"\n\t\t\t// }, {\n\t\t\t// \tstep: \"year\",\n\t\t\t// \tstepmode: \"todate\",\n\t\t\t// \tcount: 1,\n\t\t\t// \tlabel: \"YTD\"\n\t\t\t// }, {\n\t\t\t// \tstep: \"year\",\n\t\t\t// \tstepmode: \"backward\",\n\t\t\t// \tcount: 1,\n\t\t\t// \tlabel: \"1y\"\n\t\t\t// },\n\t\t\t\t{\n\t\t\t\tstep: \"all\",\n\t\t\t\tlabel: \"show all\"\n\t\t\t}],\n\n\t\t};\n\n\t\tlet biomass = {\n\t\t\tx: biomassDates, //[\"2019-01-01\", \"2019-03-01\", \"2019-06-01\", \"2019-09-03\"],\n\t\t\ty: biomassValues, //[0, 15, 19, 21],\n\t\t\tname: \"Plant Biomass\",\n\t\t\ttype: \"scatter\",\n\t\t\tmode: \"lines\",\n\t\t\tconnectgaps: false,\n\t\t\tline: {color: \"DeepSkyBlue\"}\n\t\t};\n\n\t\tlet cn = {\n\t\t\tx: cnDates, //[\"2019-01-01\", \"2019-03-01\", \"2019-06-01\", \"2019-09-03\"],\n\t\t\ty: cnValues, //[0, 3, 10, 13],\n\t\t\tname: \"C:N\",\n\t\t\tyaxis: \"y2\",\n\t\t\ttype: \"scatter\",\n\t\t\tmode: \"lines\", //lines+marks\n\t\t\tconnectgaps: false,\n\t\t\tline: {color: \"Orange\"}\n\t\t};\n\n\t\tlet data = [biomass, cn];\n\n\t\tlet highlightShapes = [\n\t\t\t{\n\t\t\t\ttype: \"rect\",\n\t\t\t\txref: \"x\",\n\t\t\t\tyref:\"paper\",\n\t\t\t\tx0: harvestDateMin,\n\t\t\t\ty0: 0,\n\t\t\t\tx1: harvestDateMax,\n\t\t\t\ty1: 1,\n\t\t\t\tfillcolor: \"rgb(204, 255, 235)\", //\"LightYellow\",\n\t\t\t\topacity: 0.5,\n\t\t\t\tlayer: \"below\",\n\t\t\t\tline: {width: 1, dash: \"dot\"}\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: \"line\",\n\t\t\t\txref: \"x\",\n\t\t\t\tyref:\"paper\",\n\t\t\t\tx0: plantingDate,\n\t\t\t\ty0: 0,\n\t\t\t\tx1: plantingDate,\n\t\t\t\ty1: 1.1,\n\t\t\t\tline: {width: 2}\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: \"line\",\n\t\t\t\txref: \"x\",\n\t\t\t\tyref:\"paper\",\n\t\t\t\tx0: harvestDate,\n\t\t\t\ty0: 0,\n\t\t\t\tx1: harvestDate,\n\t\t\t\ty1: 1.1,\n\t\t\t\tline: {width: 2}\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: \"rect\",\n\t\t\t\txref: \"paper\",\n\t\t\t\tyref:\"y2\",\n\t\t\t\tx0: 0,\n\t\t\t\ty0: 0,\n\t\t\t\tx1: 1,\n\t\t\t\ty1: 20,\n\t\t\t\tfillcolor: \"rgb(240, 240, 194)\",\n\t\t\t\topacity: 0.3,\n\t\t\t\tlayer: \"below\",\n\t\t\t\tline: {width: 0.1}\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: \"rect\",\n\t\t\t\txref: \"paper\",\n\t\t\t\tyref:\"y2\",\n\t\t\t\tx0: 0,\n\t\t\t\ty0: 20,\n\t\t\t\tx1: 1,\n\t\t\t\ty1: cnMax,\n\t\t\t\tfillcolor: \"rgb(240, 220, 220)\",\n\t\t\t\topacity: 0.3,\n\t\t\t\tlayer: \"below\",\n\t\t\t\tline: {width: 0.1}\n\t\t\t},\n\t\t];\n\n\t\tlet annotations = [\n\t\t\t{\n\t\t\t\tx: plantingDate,\n\t\t\t\ty: 1.06,\n\t\t\t\txref: \"x\",\n\t\t\t\tyref: \"paper\",\n\t\t\t\ttext: \" IN \",\n\t\t\t\tborderpad: 4,\n\t\t\t\tbgcolor: \"SlateGray\",\n\t\t\t\tshowarrow: false,\n\t\t\t\tfont: {\n\t\t\t\t\tsize: 14,\n\t\t\t\t\tcolor: \"White\"\n\t\t\t\t},\n\t\t\t\topacity: 0.8,\n\t\t\t\t// arrowhead: 3,\n\t\t\t\t// ax: -30,\n\t\t\t\t// ay: -40,\n\t\t\t\t//yanchor: \"top\",\n\t\t\t\txshift: -20\n\t\t\t},\n\t\t\t{\n\t\t\t\tx: harvestDate,\n\t\t\t\ty: 1.06,\n\t\t\t\txref: \"x\",\n\t\t\t\tyref: \"paper\",\n\t\t\t\ttext: \"OUT\",\n\t\t\t\tshowarrow: false,\n\t\t\t\tborderpad: 4,\n\t\t\t\tbgcolor: \"SlateGray\",\n\t\t\t\tfont: {\n\t\t\t\t\tsize: 14,\n\t\t\t\t\tcolor: \"White\"\n\t\t\t\t},\n\t\t\t\topacity: 0.8,\n\t\t\t\t// arrowhead: 3,\n\t\t\t\t// ax: -30,\n\t\t\t\t// ay: -40,\n\t\t\t\t//yanchor: \"top\",\n\t\t\t\txshift: -22\n\n\t\t\t},\n\t\t\t// {\n\t\t\t// \ttext: \"Immobilization Begins<sup>*</sup>\",\n\t\t\t// \tshowarrow: true,\n\t\t\t// \tx: 0.5,\n\t\t\t// \ty: 20.25,\n\t\t\t// \tvalign: \"top\",\n\t\t\t// \txref:\"paper\",\n\t\t\t// \tyref: \"y2\",\n\t\t\t// \t// borderwidth: 1,\n\t\t\t// \t// bordercolor: \"black\",\n\t\t\t// \t// hovertext: \"Termination of CR with a C:N ratio ranging from 0-20 has the potential to result in soil N mineralization <br>\" +\n\t\t\t// \t// \t\"Termination of CR with a C:N ratio ranging >20 has the potential to result in soil N immobilization\",\n\t\t\t// }\n\t\t];\n\n\t\tlet layout = {\n\t\t\ttitle: \"Cover Crop Growth & C:N Prediction\",\n\t\t\twidth: 930,\n\t\t\theight: 600,\n\t\t\t// responsive: true,\n\t\t\txaxis: {\n\t\t\t\trangeselector: selectorOptions,\n\t\t\t\trangeslider: {borderwidth: 1},\n\t\t\t\trange: [rangeSelectorMin, rangeSelectorMax],\n\t\t\t\tshowline: true,\n\t\t\t\tlinecolor: \"LightGray\",\n\t\t\t\tzeroline: true,\n\t\t\t\tticks: \"outside\"\n\t\t\t},\n\t\t\tyaxis: {\n\t\t\t\ttitle: {\n\t\t\t\t\ttext: \"Plant Biomass (lb/acre)\",\n\t\t\t\t\tfont: {\n\t\t\t\t\t\tcolor: \"DeepSkyBlue\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\ttickfont: {color: \"DeepSkyBlue\"},\n\t\t\t\tshowgrid: false,\n\t\t\t\tshowline: true,\n\t\t\t\tlinecolor: \"LightGray\",\n\t\t\t\tticks: \"outside\"\n\t\t\t\t// range: [0,5000],\n\t\t\t\t// rangemode: \"tozero\"\n\t\t\t},\n\t\t\tyaxis2: {\n\t\t\t\ttitle: {\n\t\t\t\t\ttext: \"C:N\",\n\t\t\t\t\tfont: {\n\t\t\t\t\t\tcolor: \"Orange\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\ttickfont: {color: \"Orange\"},\n\t\t\t\toverlaying: \"y\",\n\t\t\t\tside: \"right\",\n\t\t\t\tshowgrid: false,\n\t\t\t\tshowline: true,\n\t\t\t\tlinecolor: \"LightGray\",\n\t\t\t\tticks: \"outside\"\n\t\t\t},\n\t\t\tshapes: highlightShapes,\n\t\t\tannotations: annotations,\n\t\t\tlegend: {x:0.88, y: 1.40, borderwidth: 0.5}\n\t\t};\n\n\n\t\tresultHtml.push(\n\t\t\t\t\t<div >\n\t\t\t\t\t\t<Plot\n\t\t\t\t\t\t\tdata={data}\n\t\t\t\t\t\t\tlayout={layout}\n\t\t\t\t\t\t\tconfig={{\n\t\t\t\t\t\t\t\t\"displayModeBar\": false\n\t\t\t\t\t\t\t}}\n\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>);\n\n\t\treturn resultHtml;\n\t}", "function applyChart() {\n\tresetSpace();\n\tvar filteredConditiontionsMap = fetchAllFilteredConditions();\n\tvar map = BeforeProcessFiltering(filteredConditiontionsMap);\n\tvar chartsSelected = fetchChartSelections();\n\tvar labels = [];\n\tvar vals = [];\n\tfor (let label of map.keys()){\n\t\tlabels.push(label);\n\t\tvals.push(map.get(label));\n\t}\n\t\n\tfor(var i =0;i<chartsSelected.length;i++){\n\t\tdocument.getElementById('parentChart').style.display = \"block\";\n\t\tlet cs = new ChartMain();\n\t\tvar chart = null;\n\t\tlet isBackgroundColorRequired = true;\n\t\tif(chartsSelected[i] == \"Bar Chart\"){\n\t\t\tmakeCanvasElement(\"barchartcanvas\");\n\n\t\t\tlet barChartDecorator = new BarChartDecorator();\n\t\t\tchart = cs.orderChart(\"bar\");\n\t\t\tchart.setLabelAndData(labels,vals);\n\t\t\tbarChartDecorator.applyBackgroundColor(chart);\n\t\t\tbarChartDecorator.applyBorderColor(chart);\n\t\t} else if(chartsSelected[i] == \"Line Chart\"){\n\t\t\tlet lineChartDecorator = new LineChartDecorator();\n\t\t\tmakeCanvasElement(\"linechartcanvas\");\n\n\t\t\tchart = cs.orderChart(\"line\");\n\t\t\tchart.setLabelAndData(labels,vals);\n\t\t\tlineChartDecorator.applyBorderColor(chart);\n\n\t\t} else if(chartsSelected[i] == \"Pie Chart\"){\n\t\t\tlet pieChartDecorator = new PieChartDecorator();\n\t\t\tmakeCanvasElement(\"piechartcanvas\");\n\t\t\tchart = cs.orderChart(\"pie\");\n\t\t\tchart.setLabelAndData(labels,vals); \n\t\t\tpieChartDecorator.applyBackgroundColor(chart);\n\t\t\tpieChartDecorator.applyBorderColor(chart);\t\t\t\n\t\t}else if(chartsSelected[i] == \"Doughnut Chart\"){\n\t\t\tlet doughnutChartDecorator = new DoughnutChartDecorator();\n\t\t\tmakeCanvasElement(\"doughnutchartcanvas\");\n\t\t\tchart = cs.orderChart(\"doughnut\");\n\t\t\tchart.setLabelAndData(labels,vals); \n\t\t\tdoughnutChartDecorator.applyBackgroundColor(chart);\n\t\t\tdoughnutChartDecorator.applyBorderColor(chart);\n\t\t}\n\t\t\n\t\t \n\t\tchart.plot();\n\t}\n}", "componentDidMount() {\n // Extend Highcharts with modules\n if (this.state.modules) {\n this.state.modules.forEach(function (module) {\n module(Highcharts);\n });\n }\n // Set container which the chart should render to.\n this.state.charts.forEach(function (chart, index) {\n chart.ref = new Highcharts.chart(\n chart.container, \n chart.options\n );\n });\n }", "renderCharts(chart, name, x) {\n\t\tlet color;\n\t\tif(x <= 25) color = '#48E229';\n\t\telse if(x > 25 && x <= 45) color = '#F6EB43';\n\t\telse if(x > 45 && x <= 75) color = '#ffc107';\n\t\telse color = '#dc3545';\n\t\tchart.innerHTML += `<div class=\"row p-3\">\n\t\t\t\t<div class=\"col-2\"><h5>${name}</h5></div>\n\t\t\t\t<div class=\"col-10\"><div style=\"padding: 5px; background-color: ${color}; \n\t\t\t\ttext-align: center; width: 0\"><span style=\"color: white;\"></span></div></div>\n\t\t\t\t</div>`;\n\t\tlet width = 0;\n\t\tconst timer = setInterval(() => {\n\t\t\twidth++;\n\t\t\tchart.children[this.br].children[1].children[0].style.width = `${width * 5}px`;\n\t\t\tchart.children[this.br].children[1].children[0].children[0].innerText = width;\n\t\t\tif(width >= x) {\n\t\t\t\tthis.br++;\n\t\t\t\tclearInterval(timer);\n\t\t\t}\n\t\t}, 30);\n\t}", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n renderButtons();\n renderPrice();\n renderReceipt()\n}", "render() {\n this.clearCanvas();\n this.sortEntities();\n this.updateScrollToFollow();\n for (let entity of this.entities) {\n if (!entity.visible)\n break;\n if (entity.shouldBeCulled(this.scrollX, this.scrollY))\n continue;\n entity.render(this.context, this.scrollX, this.scrollY);\n }\n // Dibujamos el overlay\n this.context.fillStyle = \"rgba(\" + this.overlayColor.r + \", \" + this.overlayColor.g + \", \" + this.overlayColor.b + \", \" + this.overlayColor.a + \")\";\n this.context.fillRect(0, 0, this.canvas.width, this.canvas.height);\n this.context.fillStyle = \"#000000\";\n // Render del fotograma listo, disparamos el evento\n this.onFrameUpdate.dispatch();\n }", "function Data(){\n return(\n <section className=\"WhatsHealthySection\">\n <div className=\"first\">\n <div className=\"dc-all\">\n <div className=\"MainContent\">\n <div className=\"ChartContainer\">\n <WhatsHealthyChart/>\n </div> \n <div className=\"TextArea\" id=\"Preparation\">\n <h3 className=\"DataTitle\">What Constitutes a Healthy Meal?</h3> \n </div> \n <p className=\"dc-subHead\">Data taken from NHS England's recommended intake per 100g</p>\n </div>\n </div>\n </div>\n <section className=\"od-all\">\n <div className=\"ContentControl\">\n <div className=\"ChartContainer\">\n <FourAverageCharts/>\n </div>\n </div>\n </section>\n <section className=\"AverageToHealth\">\n <div className=\"ah-content\">\n <div className=\"ah-subHead-Layout\">\n <h3 className=\"ah-title\">Are They Healthy?</h3>\n <p className=\"ah-subHead\">Legend: <br/><p id='Healthy'>Healthy, </p><p id='Moderate'>Moderate, </p><p id='Unhealthy'>Unhealthy, </p><p id='Tesco'>Tesco, </p><p id=\"Morrisons\">Morrisons, </p><p id=\"Sainsburys\">Sainsburys, </p><p id=\"Waitrose\">Waitrose</p></p>\n </div>\n <span className=\"ChartContainerComp\">\n <AreAveragesHealthy/>\n </span>\n </div>\n </section>\n <section className=\"hee\">\n <div className=\"he-content\">\n <div className=\"heInnerContent\">\n <div className=\"TitleAndSub\">\n <h3 className=\"he-title\">View The Data</h3>\n <p className=\"he-subHead\" id=\"supermarket-in-view\">All collected supermarket data</p>\n </div>\n <div className=\"allProductGraph\">\n <AllDataChart/>\n </div>\n </div>\n </div>\n </section>\n </section>\n );\n}", "function renderChart() {\n\n if($scope.currentChartModel==null) {\n $scope.app.getObject($element.find('div'), $scope.currentChart).then(function(model) {\n $scope.currentChartModel = model;\n });\n }\n else {\n $scope.currentChartModel.enigmaModel.endSelections(true)\n .then(destroyObject)\n .then(\n function() {\n $scope.app.getObject($element.find('div'), $scope.currentChart)\n .then(function(model) {\n $scope.currentChartModel = model;\n });\n });\n }\n\n }", "draw() {\n this._updateWidthHeight();\n\n this.initSvg();\n // bar char\n if (this.keysBar) {\n this.aggregateLabelsByKeys(this.selection, this.keysBar);\n }\n\n if (this.keysX && this.keysY) {\n this.aggregateValuesByKeys(this.selection, this.keysX, this.keysY);\n }\n\n this.barChart.draw();\n // scatterplot\n // this.scatter.draw();\n }", "function renderAll() {\n renderPatty();\n renderCheese();\n renderTomatoes();\n renderOnions();\n renderLettuce();\n // renderButtons();\n // renderIngredientsBoard();\n renderPrice();\n}", "function draw() {\n\t\t\tdrawGrid();\n\t\t\tdrawLabels();\n\t\t\tfor(var i = 0; i < series.length; i++){\n\t\t\t\tdrawSeries(series[i]);\n\t\t\t}\n\t\t}", "function renderData(container, processed_data) {\n \n // Different Container Div States and how to function in each state.\n //\n // 1. Neither height nor width is specified for the containing dv.\n //\n // In this state the widget should be defined by the sum of all its\n // children. Hence, intelligent defaults will be used and it will\n // be rendered.\n //\n // 2. Both height and width are specified.\n //\n // In this state the widget size is defined explicitly, hence the\n // widget will be the size explicity defined and the contents will be\n // horizontally and vertically scaled to fit N sub groups where N is\n // the number of subgroups provided..\n //\n // 3. Only width is specified\n \n // Diffrent Container Div States\n //\n // 1. The client application didn't specify a width or height, so they\n // are expecting the width and height of that div to be defined by the\n // combination of its children and its parent.\n //\n // 2. The client application does specify a width and height, so they\n // are expecting the div to only take up the provided width and height\n // in area.\n // 1. Make everything fit into the specified height and width of the div.\n //\n // 2. \n \n \n // var i;\n var html = \"\";\n // var max_bar_width = 125;\n \n // function calcBarLength(perc, max_bar_width) {\n // var r;\n // r = Math.floor((perc/100) * max_bar_width);\n // if (r == 0) {\n // r = 1;\n // }\n // return r;\n // }\n\n //container.addClass(\"ui-widget\");\n //container.addClass(\"ui-comphist-widget\");\n\n // Obtain the height of the container div and set the font-size to that\n // height in pixels so that I can then make all of the fonts and child\n // elements sized relative to that size.\n var container_width_in_px = container.height();\n //container.css('font-size', container_width_in_px + 'px');\n\n html += '<div class=\"ui-comphist-widget\" style=\"font-size: ' + container_width_in_px + 'px;\">';\n // Create the comparitive histogram header \n html += ' <div class=\"ui-comphist-header\">';\n html += ' <span class=\"ui-comphist-pop-size\">' + processed_data.population_count + '</span>';\n html += ' <span class=\"ui-comphist-pop-label\">' + processed_data.population_label + '</span>';\n html += ' </div>';\n \n html += ' <div class=\"ui-comphist-spacer\">';\n html += ' </div>';\n\n html += ' <div class=\"ui-comphist-pseudotable\">';\n // // Create primary group one bars column.\n html += ' <div class=\"ui-comphist-bars-col\">';\n html += ' <div class=\"ui-comphist-label-row ui-comphist-left-row\">';\n html += ' <div class=\"ui-comphist-group-label ui-comphist-left-label\">' + processed_data.group_1_label + '</div>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n html += ' <div class=\"ui-comphist-sum-row\">';\n if (processed_data.group_1_perc == 0) {\n html += ' <div class=\"ui-comphist-sum-bar ui-comphist-left\" style=\"width: 1%;\">';\n } else {\n html += ' <div class=\"ui-comphist-sum-bar ui-comphist-left\" style=\"width: ' + processed_data.group_1_perc + '%;\">';\n }\n html += ' </div>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n for (i = 0; i < processed_data.subgroups.length; i++) {\n html += ' <div class=\"ui-comphist-subgroup-row\">';\n if (processed_data.subgroups[i].group_1_perc == 0) {\n html += ' <div class=\"ui-comphist-bar ui-comphist-left\" style=\"width: 1%;\">';\n } else {\n html += ' <div class=\"ui-comphist-bar ui-comphist-left\" style=\"width: ' + processed_data.subgroups[i].group_1_perc + '%;\">';\n }\n html += ' </div>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n }\n html += ' </div>'; // close group one bars column\n // \n // // Create primary group two bars column.\n html += ' <div class=\"ui-comphist-bars-col\">';\n html += ' <div class=\"ui-comphist-label-row\">';\n html += ' <div class=\"ui-comphist-group-label ui-comphist-right-label\">' + processed_data.group_2_label + '</div>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n html += ' <div class=\"ui-comphist-sum-row\">';\n if (processed_data.group_2_perc == 0) { \n html += ' <div class=\"ui-comphist-sum-bar ui-comphist-right\" style=\"width: 1%;\">';\n } else {\n html += ' <div class=\"ui-comphist-sum-bar ui-comphist-right\" style=\"width: ' + processed_data.group_2_perc + '%;\">';\n }\n html += ' </div>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n for (i = 0; i < processed_data.subgroups.length; i++) {\n html += ' <div class=\"ui-comphist-subgroup-row\">';\n if (processed_data.subgroups[i].group_2_perc == 0) {\n html += ' <div class=\"ui-comphist-bar ui-comphist-right\" style=\"width: 1%;\">';\n } else {\n html += ' <div class=\"ui-comphist-bar ui-comphist-right\" style=\"width: ' + processed_data.subgroups[i].group_2_perc + '%;\">';\n }\n html += ' </div>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n } \n html += ' </div>'; // close group two bars column\n\n // Create the subgroup labels bar\n html += ' <div class=\"ui-comphist-subgroup-label-col\">';\n html += ' <div class=\"ui-comphist-label-row\">';\n html += ' </div>';\n html += ' <div class=\"ui-comphist-sum-row\">';\n html += ' </div>';\n for (i = 0; i < processed_data.subgroups.length; i++) {\n html += ' <div class=\"ui-comphist-subgroup-row\">';\n html += ' <span class=\"ui-comphist-subgroup-label ui-comphist-right\">' + processed_data.subgroups[i].label + '</span>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n }\n html += ' </div>'\n\n // Create the group one stats column\n html += ' <div class=\"ui-comphist-subgroup-col\">';\n html += ' <div class=\"ui-comphist-label-row ui-comphist-left-row\">';\n html += ' <div class=\"ui-comphist-group-label ui-comphist-left-label\">' + processed_data.group_1_label + '</div>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n html += ' <div class=\"ui-comphist-sum-row ui-comphist-row-left\">';\n html += ' <span class=\"ui-comphist-sum-val ui-comphist-left\">' + processed_data.group_1_perc + '%</span>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n for (i = 0; i < processed_data.subgroups.length; i++) {\n html += ' <div class=\"ui-comphist-subgroup-row ui-comphist-row-left\">';\n html += ' <span class=\"ui-comphist-subgroup-val ui-comphist-left\">' + processed_data.subgroups[i].group_1_perc + '%</span>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n }\n html += ' </div>';\n // \n // // Create the group two stats column\n html += ' <div class=\"ui-comphist-subgroup-col\">';\n html += ' <div class=\"ui-comphist-label-row\">';\n html += ' <div class=\"ui-comphist-group-label ui-comphist-right-label\">' + processed_data.group_2_label + '</div>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n html += ' <div class=\"ui-comphist-sum-row\">';\n html += ' <span class=\"ui-comphist-sum-val ui-comphist-right\">' + processed_data.group_2_perc + '%</span>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n for (i = 0; i < processed_data.subgroups.length; i++) {\n html += ' <div class=\"ui-comphist-subgroup-row\">';\n html += ' <span class=\"ui-comphist-subgroup-val ui-comphist-right\">' + processed_data.subgroups[i].group_2_perc + '%</span>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n }\n html += ' </div>';\n // \n // // Create the subgroup totals column\n html += ' <div class=\"ui-comphist-totals-col\">';\n html += ' <div class=\"ui-comphist-label-row\">';\n html += ' </div>';\n html += ' <div class=\"ui-comphist-sum-row\">';\n html += ' </div>';\n for (i = 0; i < processed_data.subgroups.length; i++) {\n html += ' <div class=\"ui-comphist-subgroup-row\">';\n html += ' <span class=\"ui-comphist-subgroup-tot-val ui-comphist-right\">' + processed_data.subgroups[i].tot_perc + '%</span>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n }\n html += ' </div>';\n \n html += \" </div>\"; // close the ui-comphist-pseudotable\n html += \"</div>\"; // close the ui-comphist-widget\n \n container.html(html);\n \n container.mouseover(function (event) {\n var curo = $(event.target);\n if (curo.hasClass(\"ui-comphist-bar\") || curo.hasClass(\"ui-comphist-sum-bar\")) {\n container.trigger(\"barover\", [curo.css(\"width\"), curo.position()]);\n }\n });\n container.mouseout(function (event) {\n var curo = $(event.target);\n if (curo.hasClass(\"ui-comphist-bar\") || curo.hasClass(\"ui-comphist-sum-bar\")) {\n container.trigger(\"barout\", [curo.css(\"width\"), curo.position()]);\n }\n });\n }", "init() {\n\n\n\t\t\t\tChart.resize();\n\t\t\t\tChart.render();\n\t\t\t}", "function renderSeries(ecIns, ecModel, api, payload, dirtyMap) {\n // Render all charts\n var scheduler = ecIns._scheduler;\n var unfinished;\n ecModel.eachSeries(function (seriesModel) {\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n var renderTask = chartView.renderTask;\n scheduler.updatePayload(renderTask, payload);\n\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\n renderTask.dirty();\n }\n\n unfinished |= renderTask.perform(scheduler.getPerformArgs(renderTask));\n chartView.group.silent = !!seriesModel.get('silent');\n updateZ(seriesModel, chartView);\n updateBlend(seriesModel, chartView);\n });\n scheduler.unfinished |= unfinished; // If use hover layer\n\n updateHoverLayerStatus(ecIns, ecModel); // Add aria\n\n aria(ecIns._zr.dom, ecModel);\n}", "function renderSeries(ecIns, ecModel, api, payload, dirtyMap) {\n // Render all charts\n var scheduler = ecIns._scheduler;\n var unfinished;\n ecModel.eachSeries(function (seriesModel) {\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n var renderTask = chartView.renderTask;\n scheduler.updatePayload(renderTask, payload);\n\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\n renderTask.dirty();\n }\n\n unfinished |= renderTask.perform(scheduler.getPerformArgs(renderTask));\n chartView.group.silent = !!seriesModel.get('silent');\n updateZ(seriesModel, chartView);\n updateBlend(seriesModel, chartView);\n });\n scheduler.unfinished |= unfinished; // If use hover layer\n\n updateHoverLayerStatus(ecIns, ecModel); // Add aria\n\n aria(ecIns._zr.dom, ecModel);\n}", "renderChartType(dataset){\n\n if(this.state.chartType == \"line\"){\n return(\n <Line\n data={dataset}\n\n />\n );\n }\n else if(this.state.chartType == \"bar\"){\n return(\n <Bar\n data={dataset}\n\n />\n );\n }\n else if(this.state.chartType == \"polar\"){\n return(\n <Polar\n data={dataset}\n\n />\n );\n }\n else if(this.state.chartType == \"radar\"){\n return(\n <Radar\n data={dataset}\n\n />\n );\n }\n else if(this.state.chartType == \"doughnut\"){\n return(\n <Doughnut\n data={dataset}\n\n />\n );\n }\n else if(this.state.chartType == \"scatter\"){\n return(\n <Scatter\n data={dataset}\n\n />\n );\n }\n else if(this.state.chartType == \"bubble\"){\n return(\n <Bubble\n data={dataset}\n\n />\n );\n }\n else if(this.state.chartType == \"pie\"){\n return(\n <Pie\n data={dataset}\n\n />\n );\n }\n }", "function buildCharts() {\n const charts = document.getElementsByClassName( 'simple-chart-target' );\n for ( let i = 0; i < charts.length; i++ ) {\n buildChart( charts[i] );\n }\n}", "renderElements()\n {\n \tlet self = this;\n \t\n \t// TODO: Handle no section?\n \tif( !self.activeSection ) return;\n \t\n \tif( self.renderingElements ) \n \t{\n \t\treturn;\n \t}\n \t\n \tself.renderingElements = true;\n \t\n \tif( !self.currentPage )\n \t{\n \t\tself.currentPage = 0;\n \t}\n \t\n \tself.canvasContent.innerHTML = '';\n \t\n\t self.canvasHeader.innerHTML = self.course.Name + \n\t \t' <span class=\"IconSmall fa-chevron-right\"></span> ' + \n\t \tself.getCurrentSection().Name + \n\t \t' <span class=\"IconSmall fa-chevron-right\"></span> ' + \n\t \tself.getCurrentPage().Name;\n \t\n \tlet act = false;\n \tfor( let a in self.sections )\n \t\tif( a == self.activeSection )\n \t\t\tact = self.sections[ a ];\n \t\n \tlet csId = self.#courseSessionId;\n \t\n \tif( act && act.pages && act.pages[self.currentPage] )\n \t{\n \t\t// Ref the page\n \t\tlet page = act.pages[self.currentPage];\n\t\t\t// Load all elements for the page\n\t\t\tlet m = new Module( 'system' );\n\t\t\tm.onExecuted = function( e, d )\n\t\t\t{\n\t\t\t\tif( e != 'ok' ) \n\t\t\t\t{\n\t\t\t\t\tself.renderingElements = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlet els = JSON.parse( d );\n\t\t\t\tfor( let a = 0; a < els.length; a++ )\n\t\t\t\t{\n\t\t\t\t\t// Convert from BASE64\n\t\t\t\t\tif( els[a].Properties.substr && els[a].Properties.substr( 0, 7 ) == 'BASE64:' )\n\t\t\t\t\t{\n\t\t\t\t\t\tels[a].Properties = Base64.decode( els[a].Properties.substr( 7, els[a].Properties.length - 7 ) );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tlet ele = self.createElement( els[a].ElementType, els[a] );\n\t\t\t\t\tself.addToCanvas( ele );\n\t\t\t\t\tif( ele.init )\n\t\t\t\t\t\tele.init();\n\t\t\t\t}\n\t\t\t\tFUI.initialize();\n\t\t\t\tself.renderingElements = false;\n\t\t\t\t\n\t\t\t\t// Update page status (tick off the box)\n\t\t\t\tlet p = new Module( 'system' );\n\t\t\t\tp.onExecuted = function( pc, pd )\n\t\t\t\t{\n\t\t\t\t\t// nothing\n\t\t\t\t\tconsole.log( 'What result of page status: ', pc, pd );\n\t\t\t\t}\n\t\t\t\tp.execute( 'appmodule', {\n\t\t\t\t\tappName: 'Courses',\n\t\t\t\t\tcommand: 'setpagestatus',\n\t\t\t\t\tpageId: page.ID,\n\t\t\t\t\tcourseSessionId: csId\n\t\t\t\t} );\n\t\t\t\t\n\t\t\t\tself.redrawNavPanel();\n\t\t\t\n\t\t\t\t// Check which state the buttons are in\n\t\t\t\tself.checkNavButtons();\n\t\t\t}\n\t\t\t\n\t\t\tm.execute( 'appmodule', {\n\t\t\t\tappName: 'Courses',\n\t\t\t\tcommand: 'loadpageelements',\n\t\t\t\tpageId: page.ID\n\t\t\t} );\n\t\t}\n\t\telse\n\t\t{\n\t\t\tself.renderingElements = false;\n\t\t}\n }", "mounted() {\n renderChart(this.matchedRhythms, this.$refs.rhythmChart);\n renderChart(this.matchedContourGraph, this.$refs.contourChart);\n renderChart(this.matchedLineLengths, this.$refs.lengthChart);\n renderChart(this.matchedNotes, this.$refs.noteChart);\n renderChart(this.avgQuartersByPos, this.$refs.quartersChart);\n renderChart(this.avgNotesByPos, this.$refs.notesByPosChart);\n renderChart(this.rhymingTones, this.$refs.rhymingChart);\n renderChart(this.finalTones, this.$refs.finalChart);\n renderChart(this.finalNotes, this.$refs.finalNotesChart);\n renderChart(this.allTones, this.$refs.allTonesChart);\n }", "render() {\n return (\n <div class=\"container\" >\n <h2 class=\"text-center\" id=\"title\">{this.props.title}\n <small class=\"small\"> {\"(\"+this.props.patient[0].edad+ \"years)\"}</small> </h2>\n <ul class=\"list-inline small text-center\">\n <li class=\"list-inline-item\">{this.props.patient[0].cellphone}</li>\n <li class=\"list-inline-item\">|</li>\n <li class=\"list-inline-item\">{this.props.patient[0].email}</li>\n </ul>\n <hr></hr> \n <h3 className=\"mt-5\">History</h3>\n <Line data={this.dataLine} options={{ responsive: true }} />\n <hr></hr>\n <h2 class=\"text-center\" id=\"title\">VOLUMEN </h2>\n <p class=\"text-center small\">Volume history per {\"day\"}</p>\n <Line data={this.volDataLine} options={{ responsive: true }} />\n <hr></hr>\n <h2 class=\"text-center\" id=\"title\">COLOR </h2>\n <p class=\"text-center small\">Color history per {\"day\"}</p>\n <Pie data={this.dataPie} options={{ responsive: true }} />\n </div>\n );\n }", "function renderDomain () {\n renderSites();\n renderEvents();\n renderNarratives();\n }", "function renderClassChart() {\n\tclassHoverRect();\n\tincrementProgress();\n}", "function renderAll() {\n renderPatty();\n renderCheese();\n renderTomatoes();\n renderOnions();\n renderLettuce();\n renderButtons();\n renderIngredientsBoard();\n renderPrice();\n}", "function renderEverything() {\n renderPepperonni() ;\n renderMushrooms() ;\n renderGreenPeppers() ;\n renderWhiteSauce() ;\n renderGlutenFreeCrust() ;\n // renderButtons() -- not done, integrated this into the render of each ingredient ;\n renderPrice() ;\n}", "function renderChildComponents(hostLView, components) {\n for (var i = 0; i < components.length; i++) {\n renderComponent(hostLView, components[i]);\n }\n }", "renderMultGraph() {\n let send_data = [];\n for (let i = 0; i < this.props.data.length; i++) {\n if (this.state.clicked[i.toString()]) {\n send_data.push(this.props.data[i])\n }\n }\n fetch(\"/render-graph\", {\n method: \"POST\",\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({'data': send_data})\n }).then((res) => {\n res\n .json()\n .then((j) => {\n //$(\"#bokeh-plot\").html(j['div']);\n this.setState({bokeh_plot_id: j['id']})\n $(\"#for-script\").html(j['script'])\n })\n })\n }", "function drawCharts() {\n // Get total used in this year\n $.getJSON('get_dashboard_values', function (result) {\n createSpiderChart(result['registers']);\n var year_per = (Math.floor(result.total_used.year.value__sum)/15512066)*100;\n var month_per = (Math.floor(result.total_used.month.value__sum)/1292672)*100;\n\n var gauge1 = loadLiquidFillGauge(\"circle-1\", year_per);\n var gauge1 = loadLiquidFillGauge(\"circle-2\", month_per);\n });\n // Get raw debits\n $.getJSON('api/v1/CouncilmanDebits/?format=json&limit=99999999', function (result) {\n createHorizontalBarChart(sumDebitsByCNPJ(result['objects']));\n createTreeMapChart(sumDebitsByCostObject(result['objects']));\n createBarChart(sumDebitsByCouncilman(result['objects']));\n createDataTable(result['objects']);\n });\n}", "function makeCharts() {\n issueChart();\n countChart();\n averageChart();\n}", "render() {\n this._renderFiltersOptions(this._filtersItems);\n this._renderCards(this._recipesList);\n\n this._addSearchBarEvents();\n this._addOpenFiltersEvents();\n this._addCloseAllFiltersEvent();\n this._addResizeOpenedFilterListsEvent();\n this._addUpButtonEvent();\n }", "function render()\n {\n if (me.triggerEvent('renderBefore', data) === false)\n return;\n\n // remove all child nodes\n container.html('');\n\n // render child nodes\n for (var i=0; i < data.length; i++) {\n data[i].level = 0;\n render_node(data[i], container);\n }\n\n me.triggerEvent('renderAfter', container);\n }", "render () {\r\n return (\r\n <div>\r\n\r\n <Header \r\n onLoading={this.loading} \r\n onLoadingFinish={this.loadingFinish}\r\n onSave={this.onSave}\r\n loading={this.state.loading}\r\n napchart={this.state.napchart}\r\n addOns={this.state.addOns}\r\n changeAddOn={this.changeAddOn}\r\n url={this.state.url}\r\n chartid={this.state.chartid}\r\n title={this.state.title}\r\n description={this.state.description} \r\n />\r\n \r\n <div className={classNames('grid', {loading: this.state.loading})}>\r\n <div className='column left'>\r\n <ColorHub napchart={this.state.napchart} />\r\n <Lanes\r\n napchart={this.state.napchart}\r\n clickLane={this.setNumberOfLanes}\r\n />\r\n <Shapes napchart={this.state.napchart}/>\r\n <MetaInfo\r\n title={this.state.title}\r\n description={this.state.description} \r\n changeTitle={this.changeTitle}\r\n changeDescription={this.changeDescription}\r\n />\r\n </div>\r\n \r\n <div className={classNames('mainChartArea')}>\r\n <Chart \r\n napchart={this.state.napchart}\r\n onUpdate={this.somethingUpdate}\r\n setGlobalNapchart={this.setGlobalNapchart} \r\n onLoading={this.loading} onLoadingFinish={this.loadingFinish}\r\n />\r\n </div>\r\n\r\n \r\n\r\n <InfoColumn\r\n napchart={this.state.napchart}\r\n addOns={this.state.addOns} />\r\n </div>\r\n\r\n \r\n\r\n </div>\r\n )\r\n }", "function createContentForGraphs () {\n resetGraphValuesBeforeRendering();\n //first graph template\n var entireTemplateForGraphs = ``;\n AppData.listOfGraphsData.forEach(function (arrayItem, index, arrayObject) {\n var arrayItemWithDataSeriesAdded = returnDataSeriesForArrayItem(arrayItem); \n var tempGraphTemplate = \n `<div class=\"col-12 col-lg-6 mb-1\">\n <div class=\"card\"><div class=\"card-body\">` + returnGraphPlaceholder(arrayItemWithDataSeriesAdded) + `</div></div>\n </div>`;\n entireTemplateForGraphs = entireTemplateForGraphs + tempGraphTemplate;\n });\n /* since we created placeholder containers (returnGraphPlaceholder), we will start checking when those elements are added to DOM\n we want to attach Graphs when those elements are added to DOM\n */\n startCheckingForAddedGraphsPlaceholders();\n return entireTemplateForGraphs;\n }", "renderAllViewComponents() {\n this._views.forEach((view) => {\n if (view && view.dataContext) {\n this.renderViewModel(view.dataContext);\n }\n });\n }", "render(container) {\n this.renderer.render(container);\n }", "render() {\n $vizCont.selectAll('.letter-details')\n .data(data, d => {\n return d.letter\n })\n .join(\n enter => {\n $letterDet = enter.append('div')\n .attr('class', d => `letter-details letter-details-${d.letter}`)\n\n $leftCont = $letterDet.append('div')\n .attr('class', 'left-container')\n\n $leftBar = $leftCont.append('div')\n .attr('class', 'left-bar')\n .style('width', d => {\n if (d.dif < 0) return `${scaleX(Math.abs(d.dif))}px`\n else return '0px'\n })\n\n $letterDet.append('p')\n .attr('class', 'letter')\n .text(d => d.letter)\n\n $rightCont = $letterDet.append('div')\n .attr('class', 'right-container')\n\n $rightBar = $rightCont.append('div')\n .attr('class', 'right-bar')\n .style('width', d => {\n if (d.dif > 0) return `${scaleX(d.dif)}px`\n else return '0px'\n })\n },\n update => {\n update.select('.left-bar')\n .transition()\n .duration(500)\n .style('width', d => {\n if (d.dif < 0) return `${scaleX(Math.abs(d.dif))}px`\n else return '0px'\n })\n\n update.select('.right-bar')\n .transition()\n .duration(500)\n .style('width', d => {\n if (d.dif > 0) return `${scaleX(d.dif)}px`\n else return '0px'\n })\n\n }\n )\n\n\t\t\t\treturn Chart;\n\t\t\t}", "render() {\n var content = '<div>data not provided</div><hr/>'; // default view for data-less component\n const isDataAvailable = (this.data.length >= 1);\n\n // build html code from templates and row data\n if (isDataAvailable) {\n const keys = Object.keys(this.data[0]);\n const STYLES = this.tpls.styles;\n const HEAD = keys.map(n => this.placehold(this.tpls.headCell, {\n TEXT: n,\n CLASSES: n===this.sortBy ? `sort${this.sortDir < 0 ? ' rev':''}`:'',\n })).join('');\n const DATA = this.data.map(r => this.placehold(this.tpls.dataRow, {\n ROWDATA: keys.map( n => this.placehold(this.tpls.dataCell, {\n CELLDATA: r[n]\n }) ).join('')\n }) ).join('');\n const TABLE = this.placehold(this.tpls.table, {\n DATA,\n HEAD,\n });\n content = this.placehold(this.tpls.component, {\n TABLE,\n STYLES,\n });\n }\n\n this.shadow.innerHTML = content;\n\n // add click columns (header cells) click handlers to sort rows\n if (isDataAvailable) {\n const keys = Object.keys(this.data[0]);\n keys.map(n => {\n var handledElement = this.shadow.querySelector(this.placehold(this.tpls.handledSelector, {FIELDSELECTOR: n}));\n handledElement.addEventListener(\"click\", () => {\n if (n === this.sortBy) {\n this.sortDir = -this.sortDir;\n } else {\n this.sortBy = n;\n this.sortDir = 1;\n }\n this.sortData();\n this.render();\n });\n });\n }\n }", "render() {\n return (\n <div className=\"px-3\">\n <hr />\n Visualization method{this.createVisualizationSelector()}\n <hr />\n </div>\n );\n }" ]
[ "0.7473573", "0.7403123", "0.69380677", "0.6869042", "0.684144", "0.67867094", "0.67843324", "0.6767544", "0.6739161", "0.6739161", "0.6714284", "0.6659189", "0.6650795", "0.6618465", "0.6532486", "0.6525728", "0.6523463", "0.64996064", "0.64785266", "0.6468907", "0.6445784", "0.643623", "0.6431963", "0.6419455", "0.6398322", "0.63910985", "0.63797545", "0.63797545", "0.63606834", "0.6350324", "0.6343838", "0.63433814", "0.63354605", "0.63313323", "0.62905025", "0.6287226", "0.6265267", "0.62599295", "0.62599295", "0.62599295", "0.62479484", "0.6235327", "0.6230423", "0.62261635", "0.62261635", "0.6217491", "0.62122273", "0.6203894", "0.6203894", "0.6203894", "0.6203894", "0.6203894", "0.6203894", "0.6203894", "0.6195889", "0.61831737", "0.61445075", "0.6141928", "0.61180216", "0.61162627", "0.60957366", "0.6091592", "0.6069404", "0.6062397", "0.6052719", "0.6042709", "0.6041374", "0.6030457", "0.60282385", "0.6028002", "0.60262704", "0.6018285", "0.6013586", "0.60135704", "0.60128623", "0.60128623", "0.6005324", "0.59990525", "0.5988051", "0.59800035", "0.5976322", "0.5973266", "0.59729445", "0.5970021", "0.5952663", "0.59511155", "0.5938092", "0.5937177", "0.5933647", "0.5932394", "0.59294355", "0.5915783", "0.59106094", "0.591036", "0.59034985", "0.58989054", "0.58933127", "0.5868184" ]
0.60248715
72
Extend shape with parameters
function extendShape(opts) { return Path.extend(opts); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extendShape(opts) {\n\t return Path.extend(opts);\n\t }", "function extendShape(opts) {\n return zrender_lib_graphic_Path__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"b\"].extend(opts);\n}", "function baseParams_2_extendedParams()\n {\n rg.b.value = 1- rg.a.value;\n setRgPoint( 'H', [ rg.A.pos[0] + rg.a.value, rg.O.pos[1] ] );\n }", "function ShapeParameter(obj) {\n scope.AbstractParameter.call(this, obj);\n if (obj) {\n if (obj.rejectDetectionSensitivity) {\n this.rejectDetectionSensitivity = obj.rejectDetectionSensitivity;\n }\n if (obj.doBeautification) {\n this.doBeautification = obj.doBeautification;\n }\n if (obj.userResources) {\n this.userResources = obj.userResources;\n }\n }\n }", "constructor(shape, material, size) {\n Object.assign(this, { shape, material, size });\n }", "function Shape2(){}", "function Shape4(){}", "function Shape() {}", "function Proxy(shape) {\n\n //The parent shape.\n this.shape = shape;\n\n //The axis-aligned bounding box.\n this.aabb = shape.aabb;\n}", "function Shape(){}", "function Shape(){}", "function Shape(h,w,type){\n this.h = h;\n this.w = w;\n this.type = type;\n}", "function SuperShape() {\n /** @type {Boolean} Indicates validity of the shape */\n this.valid = false;\n /** @type {Array} The array of points defining the shape */\n this.pts = [];\n /** @type {String} Indicates the type of the shape, e.g. \"rect\" */\n this.type = 'none';\n}", "function Shape3(){}", "function translateShape(shape, x, y) {\n 'use strict';\n\n shape.x += x;\n shape.y += y;\n}", "makeShape(){\n rect(this.x, this.y, this.w, this.w);\n }", "function shapeFactory(){\r\n}", "function Shape5(){}", "setMainPolygon (w,h) { this.polygons[0] = new Polygon( ...Utils.atoc([0,0, w,0, w,h, 0,h]) ); }", "function Shape () {\n}", "function PolarEquation(shape) {\n\n}", "function Shape() {\n\n}", "insertShape(shape) {\n shape.blocks.forEach(block => this.insertBlock(block));\n }", "function initArbitraryShape(phi1, phi2, sep_x, sep_y, x, y, innerArrow = true) {\r\n var Curve = []\r\n var xTemp = [], yTemp = [];\r\n //when combine the four parts, let innerArrow = false so the inner arrows can be hidden\r\n var innerColor = magenta;\r\n if(!innerArrow){\r\n innerColor = orange;\r\n }\r\n //add the side with straight lines\r\n var side ={\r\n type: \"scatter\",\r\n mode: \"lines\",\r\n x: [sep_x, sep_x, x+sep_x],\r\n y: [y+sep_y, sep_y, sep_y],\r\n line: {color: innerColor, width: 1},\r\n fill: 'toself',\r\n fillcolor: orange,\r\n opacity: 0.9\r\n };\r\n Curve.push(side)\r\n\r\n //add the curly side\r\n var Phi = numeric.linspace(phi1,phi2,20)\r\n for (var i=0; i<20; ++i){\r\n var radius = 1 - 0.7*(Math.cos(Phi[i]-Math.PI*0.25)*Math.sin(Phi[i]-Math.PI*0.25));\r\n xTemp.push(2*radius*Math.cos(Phi[i])+sep_x);\r\n yTemp.push(2*radius*Math.sin(Phi[i])+sep_y);\r\n var curve ={\r\n type: \"scatter\",\r\n mode: \"lines\",\r\n x: xTemp,\r\n y: yTemp,\r\n line: {color: black, width: 4},\r\n fill: 'toself',\r\n fillcolor: orange,\r\n opacity: 0.9\r\n }\r\n\r\n }\r\n Curve.push(curve)\r\n\r\n //add arrows on each side use if blocks to identify which 1/4 of the arbitrary shape is being drawn\r\n var half_x = (2*sep_x + x)*0.5\r\n var half_y = (2*sep_y + y)*0.5\r\n if (sep_x*sep_y>0){\r\n var grid1 = new Line2d([[sep_x,sep_y],[half_x, sep_y]])\r\n if (sep_x>0){\r\n var y1 = y + 1 + sep_y;\r\n }else if (sep_x<0){\r\n var y1 = y - 1 + sep_y;\r\n }\r\n var grid2 = new Line2d([[sep_x, y1],[sep_x, half_y]])\r\n var arr = new Line2d([[sep_x+x, sep_y],[xTemp[10],yTemp[10]]])\r\n }else if(sep_x*sep_y<0){\r\n var grid1 = new Line2d([[x+sep_x,sep_y],[half_x, sep_y]])\r\n if (sep_y>0){\r\n var y1 = y - 1 + sep_y;\r\n }else if (sep_y<0){\r\n var y1 = y + 1 + sep_y;\r\n }\r\n var grid2 = new Line2d([[sep_x, -y1],[sep_x, half_y]])\r\n var arr = new Line2d([[sep_x, sep_y+y],[xTemp[10],yTemp[10]]])\r\n }\r\n Curve.push(arr.arrowHead(black,3))\r\n if (innerArrow){\r\n Curve.push(grid1.arrowHead(magenta,2));\r\n Curve.push(grid2.arrowHead(magenta,2));\r\n } else {\r\n Curve.push(grid1.arrowHead(magenta,0));\r\n Curve.push(grid2.arrowHead(magenta,0));\r\n }\r\n\r\n\r\n return Curve\r\n}", "function Shape(type, x, y, w, h, fill_color, strk_color=null, strk_weight=null, blend=null) {\n\tthis.type = type;\n\tthis.x = Math.floor(x);\n\tthis.y = Math.floor(y);\n\tthis.w = Math.floor(w);\n\tthis.h = Math.floor(h);\n\tthis.fill_color = fill_color;\n\tthis.strk_color = strk_color;\n\tthis.strk_weight = Math.floor(strk_weight);\n\tthis.blend = blend;\n\tthis.vx = 0;\n\tthis.vy = 0\n}", "function SVGShape() {}", "function Pencil(position, color, size) {\n Shape.call(this, position, color, size);\n this.pathArray = [];\n this.color = color;\n this.width = size ;\n}", "updateShape(incRadius, incIntensity) {\n // decrease the intensity\n this.intensity -= incIntensity;\n\n // increase the radius\n this.radius += incRadius;\n }", "drawShape(...shapes) {\n shapes = shapes.map((s) => {\n if (s instanceof Shape) return s;\n return new Shape(this.POLYGON, undefined, s);\n });\n this.currentShape = shapes[0].copy();\n for (let i = 1; i < shapes.length; i++) {\n this.currentShape.merge(shapes[i]);\n }\n this.end();\n }", "function Shape() {\n // \n}", "function ShapeConfig() {\n\n // position of the shape in parent's coordinate system.\n this.relativePosition = new _Vec.Vec3();\n // rotation matrix of the shape in parent's coordinate system.\n this.relativeRotation = new _Mat.Mat33();\n // coefficient of friction of the shape.\n this.friction = 0.2; // 0.4\n // coefficient of restitution of the shape.\n this.restitution = 0.2;\n // density of the shape.\n this.density = 1;\n // bits of the collision groups to which the shape belongs.\n this.belongsTo = 1;\n // bits of the collision groups with which the shape collides.\n this.collidesWith = 0xffffffff;\n}", "grow(){\n this.size.x += 5;\n this.size.y += 5;\n }", "function init(x, y, width, height, data) {\n return COG.extend({\n x: x,\n y: y,\n width: width,\n height: height\n }, data);\n }", "set shape(val) {\n if (hasStringPropertyChangedAndNotNil(val, this._shape)) {\n const oldVal = this._shape;\n this._shape = val;\n this.requestUpdate('shape', oldVal);\n }\n }", "function ShapeFactory() {\n var _this = _super.call(this) || this;\n _this.DEFAULT_RADIUS = 40;\n _this.DEFAULT_WIDTH = 60;\n _this.DEFAULT_HEIGHT = 60;\n return _this;\n }", "set(size, angle) {\n this.gl.uniform1f(this.uniformLocations.uPointSize, size);\n this.gl.uniform1f(this.uniformLocations.uAngle, angle);\n \n return this;\n }", "function shape(){\n constructor(){\n this.height='13CM';\n this.length='12CM';\n this.area='256CM2';\n } \n shape.getteArea.function()={\n return area;\n }\n \n}", "editShape () {\n this.shapeStyle = EDIT_SHAPE_STYLE\n this.edit = true\n this.freeDraw._updateModel('edit', this.id)\n this.freeDraw._refreshShapesInCanvas()\n this._backupData()\n return this\n }", "setShape() {\n this.vectors = p5VectorsToVec2(this.pixelVectorPositions);\n this.fixDef.shape = new b2PolygonShape();\n this.fixDef.shape.SetAsArray(this.vectors, this.pixelVectorPositions.length);\n }", "function set_shape_attribute(name, event, regexp){\n var target = cross_target(event);\n var valid = validate(target, regexp);\n if (valid){\n g['shape'][name] = target.value;\n g['shape_generator'].default_values[name] = target.value;\n // The two inputs 'open_stroke' and 'closed_stroke' must hold\n // the same value, because they both refer to the same\n // variable, the stroke width\n if (name === 'stroke-width')\n getInput('open_stroke').value = getInput('closed_stroke').value = target.value;\n }\n}", "function Ellipse2D(settings){var _this=this;// Avoid checking every time if the object exists\nif(settings==null){settings={};}_this=_super.call(this,settings)||this;if(settings.size!=null){_this.size=settings.size;}else if(settings.width||settings.height){var size=new BABYLON.Size(settings.width,settings.height);_this.size=size;}var sub=settings.subdivisions==null?64:settings.subdivisions;_this.subdivisions=sub;return _this;}", "function Shape(config) {\n\n this.type = _constants.SHAPE_NULL;\n\n // global identification of the shape should be unique to the shape.\n this.id = ShapeIdCount();\n\n // previous shape in parent rigid body. Used for fast interations.\n this.prev = null;\n\n // next shape in parent rigid body. Used for fast interations.\n this.next = null;\n\n // proxy of the shape used for broad-phase collision detection.\n this.proxy = null;\n\n // parent rigid body of the shape.\n this.parent = null;\n\n // linked list of the contacts with the shape.\n this.contactLink = null;\n\n // number of the contacts with the shape.\n this.numContacts = 0;\n\n // center of gravity of the shape in world coordinate system.\n this.position = new _Vec.Vec3();\n\n // rotation matrix of the shape in world coordinate system.\n this.rotation = new _Mat.Mat33();\n\n // position of the shape in parent's coordinate system.\n this.relativePosition = new _Vec.Vec3().copy(config.relativePosition);\n\n // rotation matrix of the shape in parent's coordinate system.\n this.relativeRotation = new _Mat.Mat33().copy(config.relativeRotation);\n\n // axis-aligned bounding box of the shape.\n this.aabb = new _AABB.AABB();\n\n // density of the shape.\n this.density = config.density;\n\n // coefficient of friction of the shape.\n this.friction = config.friction;\n\n // coefficient of restitution of the shape.\n this.restitution = config.restitution;\n\n // bits of the collision groups to which the shape belongs.\n this.belongsTo = config.belongsTo;\n\n // bits of the collision groups with which the shape collides.\n this.collidesWith = config.collidesWith;\n}", "constructor(shape) {\n this.id = shape.id;\n this.type = shape.type;\n this.path = [];\n for (let i = 0; i < shape.path.length; i++) {\n this.path[i] = []\n for (let j = 0; j < 2; j++) {\n this.path[i][j] = shape.path[i][j];\n }\n }\n }", "function fnewShape(i,h,d){\r\n\tthis.shapes.push(new objeto(i,h,d));\r\n}", "function generate_rectangle(shape, center) {\n // console.log(shape)\n x_adjust = shape.dimensions['w']/2;\n y_adjust = shape.dimensions['h']/2;\n\n // Adjust nodes to be defined from center of shape\n for (i of shape.nodes) {\n i['x'] += center.x\n i['y'] += center.y\n }\n\n var vertices = [\n {x: (center.x - x_adjust), y: (center.y - y_adjust)},\n {x: (center.x + x_adjust), y: (center.y - y_adjust)},\n {x: (center.x + x_adjust), y: (center.y + y_adjust)},\n {x: (center.x - x_adjust), y: (center.y + y_adjust)}\n ]\n\n new_shape = {\n vertices: vertices,\n nodes: shape.nodes,\n pinned: shape.pinned,\n center: center\n };\n\n return new_shape;\n}", "function LineShape(x, y, length, isHorizontal)\r\n{\r\n this.X = x; this.Y = y; this.Length = length; this.IsHorizontal = isHorizontal; \r\n}", "function updateShape(point) {\n model.context.clearRect(0, 0, model.cnv.width, model.cnv.height);\n model.cnv.width = model.cnv.width;\n\n var width = model.width;\n var height = model.height;\n\n model.context.setTransform(1, 0, 0, 1, 0, 0);\n\n let dx = point.xAxis + 0.5 * width;\n let dy = point.yAxis + 0.5 * height;\n model.context.translate(dx, dy);\n\tmodel.context.rotate(0.7931);\n // model.context.fillStyle = model.bgColor;\n // model.context.fillRect(-0.5 * width, -0.5 * height, width, height);\n model.context.drawImage(this.csImage, -0.5 * width, -0.5 * height, width, height);\n}", "updateConnectorShapePath(connectorShape, x1, x2, y1, y2) {\n connectorShape.x1 = x1;\n connectorShape.x2 = x2;\n connectorShape.y1 = y1;\n connectorShape.y2 = y2;\n }", "setShape(t){\n this.shape = t;\n console.log(this.shape);\n }", "setExtent() {\n\n var tl = this.props.map.containerPointToLatLng(this.tl);\n var br = this.props.map.containerPointToLatLng(this.br);\n\n tl = this.projection([tl.lng, tl.lat]);\n br = this.projection([br.lng, br.lat]);\n\n this.extent.attr({\n x: tl[0],\n y: tl[1],\n height: br[1]-tl[1],\n width: br[0]-tl[0],\n });\n\n }", "function Shape(x, y, w, h, fill) {\n // This is a very simple and unsafe constructor. All we're doing is checking if the values exist.\n // \"x || 0\" just means \"if there is a value for x, use that. Otherwise use 0.\"\n // But we aren't checking anything else! We could put \"Lalala\" for the value of x\n this.x = x || 0;\n this.y = y || 0;\n this.w = w || 1;\n this.h = h || 1;\n this.fill = fill || '#AAAAAA';\n this.canEdit = true;\n }", "setAttributes(geometry, translations, values, originalValues) {\n geometry.addAttribute('translation', translations)\n geometry.addAttribute('size', values)\n geometry.addAttribute('originalsize', originalValues)\n }", "function NoteShape()\n\t{\n\t\tmxCylinder.call(this);\n\t}", "function BoxShape() {\n mxCylinder.call(this);\n}", "function xy_2_xy8shape( item, xName, x, yName, y )\n {\n item.x = x;\n item.y = y;\n item.dom.setAttributeNS( null, xName, x );\n item.dom.setAttributeNS( null, yName, y );\n }", "function InConstructionShape() {\n\tvar shape = this.shape;\n\tshape.addPoint(new Point2D(85, 0));\n\tshape.addPoint(new Point2D(101, 27));\n\tshape.addPoint(new Point2D(101, 37));\n\tshape.addPoint(new Point2D(139, 62));\n\tshape.addPoint(new Point2D(70, 107));\n\tshape.addPoint(new Point2D(0, 62));\n\tshape.addPoint(new Point2D(38, 37));\n\tshape.addPoint(new Point2D(38, 35));\n\tshape.addPoint(new Point2D(68, 15));\n\tshape.addPoint(new Point2D(68, 8));\n\n\tthis.image.src = \"canvas/images/Costruzione.png\";\n}", "function ModelShape(id,shape,shapeUV,posFunction,vtxFunction){this.shapeID=id;this._shape=shape;this._shapeUV=shapeUV;this._positionFunction=posFunction;this._vertexFunction=vtxFunction;}", "_initShape () {\n // Set default style for shaape\n if (!this.handlePointStyle) {\n this.handlePointStyle = HANDLE_POINT_STYLE\n }\n if (!this.shapeStyle) {\n this.shapeStyle = EDIT_SHAPE_STYLE\n }\n }", "function ExtendPolylineTo(wrapper, id, x, y) {\n var circle = document.getElementById(\"circ\" + id);\n if (circle != null)\n circle.parentNode.removeChild(circle);\n\n var polyline = document.getElementById(\"pl\" + id);\n if (polyline != null) {\n var pt = svgTarget.createSVGPoint();\n pt.x = x;\n pt.y = y;\n polyline.points.appendItem(pt);\n }\n }", "function Xb(a){this.radius=a}", "function addStroke(shape,strokeWidthValue){\n var stroke = shape.content.addProperty(\"ADBE Vector Graphic - Stroke\");\n var strokeWidth = stroke.property(\"ADBE Vector Stroke Width\");\n strokeWidth.setValue(strokeWidthValue);}", "clone(x) {\n const y = ENGINE.runKernel(_kernel_names__WEBPACK_IMPORTED_MODULE_3__[\"Identity\"], { x });\n const inputs = { x };\n const grad = (dy) => ({\n x: () => {\n const dtype = 'float32';\n const gradInputs = { x: dy };\n const attrs = { dtype };\n return ENGINE.runKernel(_kernel_names__WEBPACK_IMPORTED_MODULE_3__[\"Cast\"], gradInputs, \n // tslint:disable-next-line: no-unnecessary-type-assertion\n attrs);\n }\n });\n const saved = [];\n this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {});\n return y;\n }", "function ScaleShape (pan_width_px, pan_height_px, pan_dy_px, base_width_px, base_width_top_px, base_height_px, savedObject){\n\t\tthis.initialize (pan_width_px, pan_height_px, pan_dy_px, base_width_px, base_width_top_px, base_height_px, savedObject);\n\t}", "function Shape() {\n this.x = 0;\n this.y = 0;\n}", "function Shape(color) { // Parent function\n this.color = color; // Initialize\n}", "function shapeSettings(){\n rectMode(CENTER);\n noStroke();\n waveWidth = width;\n increment = (TWO_PI / period) * xSpacing;\n periodYValues = new Array( floor(waveWidth / xSpacing) );\n}", "function extend(name, schema) {\n // makes sure new rules are properly formatted.\n guardExtend(name, schema);\n // Full schema object.\n if (typeof schema === 'object') {\n RuleContainer.extend(name, schema);\n return;\n }\n RuleContainer.extend(name, {\n validate: schema\n });\n }", "setShape(shape) {\n if (shape === 'X') { return 'O'; }\n return 'X';\n }", "constructor(x,y,w,h)\n {\n super();\n this.x=x;\n this.y=y;\n this.w=w;\n this.h=h;\n }", "function extend() {\n var args = Array.prototype.slice.call(arguments, 0);\n return _extend.apply(null, [{}].concat(args));\n }", "setSize() {\n this.size.D1 = this.shape.D1*this.unit.X;\n this.size.D2 = this.shape.D2*this.unit.Y;\n }", "function setUpEditPanel(shape) {\n //var propertiesPanel = canvas.edit; //access the edit div\n var propertiesPanel = document.getElementById(\"edit\");\n propertiesPanel.innerHTML = \"\";\n if (shape == null) {\n //do nothing\n }\n else {\n switch (shape.oType) {\n case 'Group':\n //do nothing. We do not want to offer this to groups\n break;\n case 'Container':\n Builder.constructPropertiesPanel(propertiesPanel, shape);\n break;\n case 'CanvasProps':\n Builder.constructCanvasPropertiesPanel(propertiesPanel, shape);\n break;\n default: //both Figure and Connector\n Builder.constructPropertiesPanel(propertiesPanel, shape);\n }\n }\n}", "initFromPolyline (polyline) {\n Object.assign(this, polyline)\n this.__type = 'polygon'\n }", "grow(factor) {\n this.radius = this.radius * factor\n }", "function extend(name, schema) {\n // makes sure new rules are properly formatted.\n guardExtend(name, schema);\n // Full schema object.\n if (typeof schema === 'object') {\n RuleContainer.extend(name, schema);\n return;\n }\n RuleContainer.extend(name, {\n validate: schema\n });\n}", "function extend(name, schema) {\n // makes sure new rules are properly formatted.\n guardExtend(name, schema);\n // Full schema object.\n if (typeof schema === 'object') {\n RuleContainer.extend(name, schema);\n return;\n }\n RuleContainer.extend(name, {\n validate: schema\n });\n}", "function squeezeInputInfo(inInfo, squeezedShape) {\n // Deep copy.\n var newInputInfo = JSON.parse(JSON.stringify(inInfo));\n newInputInfo.shapeInfo.logicalShape = squeezedShape;\n return newInputInfo;\n}", "constructor() {\n this.x = random(width);\n this.y = random(-2000, -10);\n this.dx = random(-10, 10);\n this.dy = random(5, 6);\n this.size = random(20, 40);\n this.color = color(random(200, 255));\n this.touchingGround = false;\n this.shape = \"*\";\n //Very similar to raindrop\n }", "drawVariables(x, y , w, h) {\n this.x = x;\n this.y = y;\n this.w = w;\n this.h = h;\n }", "function setBoundsDottedNE(width, height) {\n\t\tthis.width = eval(width);\n\t\tthis.height = eval(height);\n\t}", "extend(config) {\n }", "function extendBounds(position) {\n latlngBounds.extend(position);\n }", "function basicShape(x,y) \n {\n\t\n pulley_front_shape1=new Shape()\n .moveTo( x, y )\n .cubicCurveTo( -shift + x, y, -shift + x, height+y, x, height+y )\n .close();\n\n box_front_shape=new Shape()\n .moveTo( x-t, y-e -t )\n .lineTo( x+t, y+e - t)\n .lineTo( x+t, y+ height+e + t)\n .lineTo( x-t, y+ height-e + t)\n .close();\n\n }", "function set_brush_paddle_size(size) {\n self.paddleSize = size;\n return this\n }", "function increaseSize() {\n\tif (selectedShape) {\n\t\tselectedShape.resize(5);\n\t\tdrawShapes();\n\t}\n}", "function squeezeInputInfo(inInfo, squeezedShape) {\n // Deep copy.\n const newInputInfo = JSON.parse(JSON.stringify(inInfo));\n newInputInfo.shapeInfo.logicalShape = squeezedShape;\n return newInputInfo;\n}", "Blend() {}", "function init_model_parameters()\n {\n //:primary params\n var a = toreg( 'a' )( 'value', sconf.a )( 'value' );\n toreg( 'alpha' )( 'value', sconf.alpha );\n toreg( 'beta' )( 'value', sconf.beta );\n toreg( 'gamma' )( 'value', sconf.gamma );\n toreg( 'O' )( 'pos', [0,0] );\n toreg( 'H' )( 'pos', [0,0] );\n\n //dependent parameters\n toreg( 'nB' )( 'value', [ 1, 0 ] );\n toreg( 'nA' )( 'value', [ -1, 0 ] );\n\n //variable parameter\n toreg( 'g' )( 'value', sconf.initial_g );\n\n //decorations:\n toreg( 'gN' )( 'value', sconf.initial_gN );\n\n setRgPoint( 'A', [ -rg.a.value, 0 ] )\n setRgPoint( 'B', [ 1-rg.a.value, 0 ] )\n\n toreg( 'b' );\n baseParams_2_extendedParams();\n //dev tool:\n //ellipsePar_create8paint( 1.50 )\n }", "static regular_polygon(x, y, r, n, rot=0) {\n\t\tlet pos = createVector(x, y);\n\t\tlet vert = [];\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tlet ang = i * TWO_PI / n + rot;\n\t\t\tlet vec = p5.Vector.fromAngle(ang).mult(r);\n\t\t\tvert.push(p5.Vector.add(vec, pos));\n\t\t}\n\t\treturn new Shape(vert);\n\t}", "function Shape(shapeObj) {\n this.x = shapeObj.x || 0; // Rect setup\n this.y = shapeObj.y || 0;\n this.w = shapeObj.w || 1;\n this.h = shapeObj.h || 1;\n this.color = shapeObj.color || '#000';\n }", "function ShapeProto(color, shape, element) {\n\tthis.color = color;\n\tthis.shape = shape;\n}", "shapeFill(node) {\n const theShape = {\n tag: 'path',\n children: [],\n props: {\n 'data-type': node.type,\n 'data-key': node.key,\n d: node.toPathString(),\n transform: transform(node),\n fill: node.fill,\n },\n };\n\n return theShape;\n }" ]
[ "0.7005202", "0.6436609", "0.60699636", "0.56709445", "0.5648829", "0.55835265", "0.5462741", "0.5448022", "0.54328185", "0.5429609", "0.5429609", "0.52849346", "0.5266649", "0.5246164", "0.5209159", "0.5109845", "0.5107622", "0.5099576", "0.5089148", "0.5088283", "0.50840217", "0.5072727", "0.50254333", "0.4979807", "0.49642617", "0.49047452", "0.48817718", "0.48806122", "0.48782954", "0.48461467", "0.48439416", "0.48294574", "0.48291668", "0.48074546", "0.48009828", "0.4797563", "0.47970393", "0.47892186", "0.47787434", "0.4768716", "0.47446024", "0.47021207", "0.4683175", "0.46819296", "0.46800554", "0.46748254", "0.4666872", "0.46652797", "0.46593952", "0.4651859", "0.464672", "0.46403837", "0.46396494", "0.46282652", "0.46217263", "0.46194002", "0.46192467", "0.46154687", "0.4614972", "0.46148384", "0.46017393", "0.46004376", "0.4599042", "0.45962378", "0.45890275", "0.4576666", "0.45764667", "0.45756945", "0.4574093", "0.4571961", "0.4570804", "0.45707542", "0.45694607", "0.45617357", "0.45611328", "0.45611328", "0.45547536", "0.4553084", "0.45523417", "0.45499888", "0.4549072", "0.45461708", "0.45287803", "0.45121282", "0.45105717", "0.45069063", "0.45056987", "0.45051098", "0.45049474", "0.45027557", "0.4502149", "0.45001966" ]
0.6893373
9
Give some default value to the input `textStyle` object, based on the current settings in this `textStyle` object. The Scenario: when text position is `inside` and `textFill` is not specified, we show text border by default for better view. But it should be considered that text position might be changed when hovering or being emphasis, where the `insideRollback` is used to restore the style. Usage (& NOTICE): When a style object (eithor plain object or instance of `zrender/src/graphic/Style`) is about to be modified on its text related properties, `rollbackDefaultTextStyle` should be called before the modification and `applyDefaultTextStyle` should be called after that. (For the case that all of the text related properties is reset, like `setTextStyleCommon` does, `rollbackDefaultTextStyle` is not needed to be called).
function applyDefaultTextStyle(textStyle) { var opt = textStyle.insideRollbackOpt; // Only `insideRollbackOpt` created (in `setTextStyleCommon`), // applyDefaultTextStyle works. if (!opt || textStyle.textFill != null) { return; } var useInsideStyle = opt.useInsideStyle; var textPosition = textStyle.insideRawTextPosition; var insideRollback; var autoColor = opt.autoColor; if (useInsideStyle !== false && (useInsideStyle === true || opt.isRectText && textPosition // textPosition can be [10, 30] && typeof textPosition === 'string' && textPosition.indexOf('inside') >= 0)) { insideRollback = { textFill: null, textStroke: textStyle.textStroke, textStrokeWidth: textStyle.textStrokeWidth }; textStyle.textFill = '#fff'; // Consider text with #fff overflow its container. if (textStyle.textStroke == null) { textStyle.textStroke = autoColor; textStyle.textStrokeWidth == null && (textStyle.textStrokeWidth = 2); } } else if (autoColor != null) { insideRollback = { textFill: null }; textStyle.textFill = autoColor; } // Always set `insideRollback`, for clearing previous. if (insideRollback) { textStyle.insideRollback = insideRollback; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function applyDefaultTextStyle(textStyle) {\n var textPosition = textStyle.textPosition;\n var opt = textStyle.insideRollbackOpt;\n var insideRollback;\n\n if (opt && textStyle.textFill == null) {\n var autoColor = opt.autoColor;\n var isRectText = opt.isRectText;\n var useInsideStyle = opt.useInsideStyle;\n var useInsideStyleCache = useInsideStyle !== false && (useInsideStyle === true || isRectText && textPosition // textPosition can be [10, 30]\n && typeof textPosition === 'string' && textPosition.indexOf('inside') >= 0);\n var useAutoColorCache = !useInsideStyleCache && autoColor != null; // All of the props declared in `CACHED_LABEL_STYLE_PROPERTIES` are to be cached.\n\n if (useInsideStyleCache || useAutoColorCache) {\n insideRollback = {\n textFill: textStyle.textFill,\n textStroke: textStyle.textStroke,\n textStrokeWidth: textStyle.textStrokeWidth\n };\n }\n\n if (useInsideStyleCache) {\n textStyle.textFill = '#fff'; // Consider text with #fff overflow its container.\n\n if (textStyle.textStroke == null) {\n textStyle.textStroke = autoColor;\n textStyle.textStrokeWidth == null && (textStyle.textStrokeWidth = 2);\n }\n }\n\n if (useAutoColorCache) {\n textStyle.textFill = autoColor;\n }\n } // Always set `insideRollback`, so that the previous one can be cleared.\n\n\n textStyle.insideRollback = insideRollback;\n}", "function applyDefaultTextStyle(textStyle) {\n var textPosition = textStyle.textPosition;\n var opt = textStyle.insideRollbackOpt;\n var insideRollback;\n\n if (opt && textStyle.textFill == null) {\n var autoColor = opt.autoColor;\n var isRectText = opt.isRectText;\n var useInsideStyle = opt.useInsideStyle;\n var useInsideStyleCache = useInsideStyle !== false && (useInsideStyle === true || isRectText && textPosition // textPosition can be [10, 30]\n && typeof textPosition === 'string' && textPosition.indexOf('inside') >= 0);\n var useAutoColorCache = !useInsideStyleCache && autoColor != null; // All of the props declared in `CACHED_LABEL_STYLE_PROPERTIES` are to be cached.\n\n if (useInsideStyleCache || useAutoColorCache) {\n insideRollback = {\n textFill: textStyle.textFill,\n textStroke: textStyle.textStroke,\n textStrokeWidth: textStyle.textStrokeWidth\n };\n }\n\n if (useInsideStyleCache) {\n textStyle.textFill = '#fff'; // Consider text with #fff overflow its container.\n\n if (textStyle.textStroke == null) {\n textStyle.textStroke = autoColor;\n textStyle.textStrokeWidth == null && (textStyle.textStrokeWidth = 2);\n }\n }\n\n if (useAutoColorCache) {\n textStyle.textFill = autoColor;\n }\n } // Always set `insideRollback`, so that the previous one can be cleared.\n\n\n textStyle.insideRollback = insideRollback;\n}", "function createTextStyle(textStyleModel, specifiedTextStyle, // Fixed style in the code. Can't be set by model.\nopt, isNotNormal, isAttached // If text is attached on an element. If so, auto color will handling in zrender.\n) {\n var textStyle = {};\n setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached);\n specifiedTextStyle && Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_1__[/* extend */ \"m\"])(textStyle, specifiedTextStyle); // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false);\n\n return textStyle;\n}", "function createTextStyle(textStyleModel, specifiedTextStyle, // Fixed style in the code. Can't be set by model.\n\t opt, isNotNormal, isAttached // If text is attached on an element. If so, auto color will handling in zrender.\n\t ) {\n\t var textStyle = {};\n\t setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached);\n\t specifiedTextStyle && extend(textStyle, specifiedTextStyle); // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false);\n\t\n\t return textStyle;\n\t }", "function setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached) {\n\t // Consider there will be abnormal when merge hover style to normal style if given default value.\n\t opt = opt || EMPTY_OBJ;\n\t var ecModel = textStyleModel.ecModel;\n\t var globalTextStyle = ecModel && ecModel.option.textStyle; // Consider case:\n\t // {\n\t // data: [{\n\t // value: 12,\n\t // label: {\n\t // rich: {\n\t // // no 'a' here but using parent 'a'.\n\t // }\n\t // }\n\t // }],\n\t // rich: {\n\t // a: { ... }\n\t // }\n\t // }\n\t\n\t var richItemNames = getRichItemNames(textStyleModel);\n\t var richResult;\n\t\n\t if (richItemNames) {\n\t richResult = {};\n\t\n\t for (var name_1 in richItemNames) {\n\t if (richItemNames.hasOwnProperty(name_1)) {\n\t // Cascade is supported in rich.\n\t var richTextStyle = textStyleModel.getModel(['rich', name_1]); // In rich, never `disableBox`.\n\t // FIXME: consider `label: {formatter: '{a|xx}', color: 'blue', rich: {a: {}}}`,\n\t // the default color `'blue'` will not be adopted if no color declared in `rich`.\n\t // That might confuses users. So probably we should put `textStyleModel` as the\n\t // root ancestor of the `richTextStyle`. But that would be a break change.\n\t\n\t setTokenTextStyle(richResult[name_1] = {}, richTextStyle, globalTextStyle, opt, isNotNormal, isAttached, false, true);\n\t }\n\t }\n\t }\n\t\n\t if (richResult) {\n\t textStyle.rich = richResult;\n\t }\n\t\n\t var overflow = textStyleModel.get('overflow');\n\t\n\t if (overflow) {\n\t textStyle.overflow = overflow;\n\t }\n\t\n\t var margin = textStyleModel.get('minMargin');\n\t\n\t if (margin != null) {\n\t textStyle.margin = margin;\n\t }\n\t\n\t setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, true, false);\n\t } // Consider case:", "function setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached) {\n // Consider there will be abnormal when merge hover style to normal style if given default value.\n opt = opt || EMPTY_OBJ;\n var ecModel = textStyleModel.ecModel;\n var globalTextStyle = ecModel && ecModel.option.textStyle; // Consider case:\n // {\n // data: [{\n // value: 12,\n // label: {\n // rich: {\n // // no 'a' here but using parent 'a'.\n // }\n // }\n // }],\n // rich: {\n // a: { ... }\n // }\n // }\n\n var richItemNames = getRichItemNames(textStyleModel);\n var richResult;\n\n if (richItemNames) {\n richResult = {};\n\n for (var name_1 in richItemNames) {\n if (richItemNames.hasOwnProperty(name_1)) {\n // Cascade is supported in rich.\n var richTextStyle = textStyleModel.getModel(['rich', name_1]); // In rich, never `disableBox`.\n // FIXME: consider `label: {formatter: '{a|xx}', color: 'blue', rich: {a: {}}}`,\n // the default color `'blue'` will not be adopted if no color declared in `rich`.\n // That might confuses users. So probably we should put `textStyleModel` as the\n // root ancestor of the `richTextStyle`. But that would be a break change.\n\n setTokenTextStyle(richResult[name_1] = {}, richTextStyle, globalTextStyle, opt, isNotNormal, isAttached, false, true);\n }\n }\n }\n\n if (richResult) {\n textStyle.rich = richResult;\n }\n\n var overflow = textStyleModel.get('overflow');\n\n if (overflow) {\n textStyle.overflow = overflow;\n }\n\n var margin = textStyleModel.get('minMargin');\n\n if (margin != null) {\n textStyle.margin = margin;\n }\n\n setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, true, false);\n} // Consider case:", "set defaultStyle(style) {\n this._defaultStyle = style;\n }", "function textStyle() {\n return { font: \"9pt Segoe UI,sans-serif\", stroke: \"white\" };\n }", "function textStyle(text) {\n return new ol.style.Text({\n 'font': '12px Calibri,sans-serif',\n 'text': text,\n 'fill': new ol.style.Fill({\n 'color': '#000'\n }),\n 'stroke': new ol.style.Stroke({\n 'color': '#fff',\n 'width': 3\n })\n });\n }", "function textStyle() {\n return { font: \"9pt Segoe UI,sans-serif\", stroke: \"white\" };\n }", "function noopFormatter(style, defaults, palette) {\n return style;\n}", "getDefaultStyle(name) {\n return this.mDefaultStyle;\n }", "function getTooltipTextStyle(textStyle, renderMode) {\n\t var nameFontColor = textStyle.color || '#6e7079';\n\t var nameFontSize = textStyle.fontSize || 12;\n\t var nameFontWeight = textStyle.fontWeight || '400';\n\t var valueFontColor = textStyle.color || '#464646';\n\t var valueFontSize = textStyle.fontSize || 14;\n\t var valueFontWeight = textStyle.fontWeight || '900';\n\t\n\t if (renderMode === 'html') {\n\t // `textStyle` is probably from user input, should be encoded to reduce security risk.\n\t return {\n\t // eslint-disable-next-line max-len\n\t nameStyle: \"font-size:\" + encodeHTML(nameFontSize + '') + \"px;color:\" + encodeHTML(nameFontColor) + \";font-weight:\" + encodeHTML(nameFontWeight + ''),\n\t // eslint-disable-next-line max-len\n\t valueStyle: \"font-size:\" + encodeHTML(valueFontSize + '') + \"px;color:\" + encodeHTML(valueFontColor) + \";font-weight:\" + encodeHTML(valueFontWeight + '')\n\t };\n\t } else {\n\t return {\n\t nameStyle: {\n\t fontSize: nameFontSize,\n\t fill: nameFontColor,\n\t fontWeight: nameFontWeight\n\t },\n\t valueStyle: {\n\t fontSize: valueFontSize,\n\t fill: valueFontColor,\n\t fontWeight: valueFontWeight\n\t }\n\t };\n\t }\n\t } // See `TooltipMarkupLayoutIntent['innerGapLevel']`.", "get textStyle() {\n if (this.i.o == null) {\n return null;\n }\n return this.i.o.fontString;\n }", "set fontStyle(value) {}", "function style(style, text)\n\t{\n\t\tvar newText = addMeta('color', toCss(style.color), text);\n\t\tvar props = newText._0;\n\n\t\tif (style.typeface.ctor !== '[]')\n\t\t{\n\t\t\tprops['font-family'] = toTypefaces(style.typeface);\n\t\t}\n\t\tif (style.height.ctor !== \"Nothing\")\n\t\t{\n\t\t\tprops['font-size'] = style.height._0 + 'px';\n\t\t}\n\t\tif (style.bold)\n\t\t{\n\t\t\tprops['font-weight'] = 'bold';\n\t\t}\n\t\tif (style.italic)\n\t\t{\n\t\t\tprops['font-style'] = 'italic';\n\t\t}\n\t\tif (style.line.ctor !== 'Nothing')\n\t\t{\n\t\t\tprops['text-decoration'] = toLine(style.line._0);\n\t\t}\n\t\treturn newText;\n\t}", "function getTooltipTextStyle(textStyle, renderMode) {\n var nameFontColor = textStyle.color || '#6e7079';\n var nameFontSize = textStyle.fontSize || 12;\n var nameFontWeight = textStyle.fontWeight || '400';\n var valueFontColor = textStyle.color || '#464646';\n var valueFontSize = textStyle.fontSize || 14;\n var valueFontWeight = textStyle.fontWeight || '900';\n\n if (renderMode === 'html') {\n // `textStyle` is probably from user input, should be encoded to reduce security risk.\n return {\n // eslint-disable-next-line max-len\n nameStyle: \"font-size:\" + Object(_util_format__WEBPACK_IMPORTED_MODULE_0__[/* encodeHTML */ \"c\"])(nameFontSize + '') + \"px;color:\" + Object(_util_format__WEBPACK_IMPORTED_MODULE_0__[/* encodeHTML */ \"c\"])(nameFontColor) + \";font-weight:\" + Object(_util_format__WEBPACK_IMPORTED_MODULE_0__[/* encodeHTML */ \"c\"])(nameFontWeight + ''),\n // eslint-disable-next-line max-len\n valueStyle: \"font-size:\" + Object(_util_format__WEBPACK_IMPORTED_MODULE_0__[/* encodeHTML */ \"c\"])(valueFontSize + '') + \"px;color:\" + Object(_util_format__WEBPACK_IMPORTED_MODULE_0__[/* encodeHTML */ \"c\"])(valueFontColor) + \";font-weight:\" + Object(_util_format__WEBPACK_IMPORTED_MODULE_0__[/* encodeHTML */ \"c\"])(valueFontWeight + '')\n };\n } else {\n return {\n nameStyle: {\n fontSize: nameFontSize,\n fill: nameFontColor,\n fontWeight: nameFontWeight\n },\n valueStyle: {\n fontSize: valueFontSize,\n fill: valueFontColor,\n fontWeight: valueFontWeight\n }\n };\n }\n} // See `TooltipMarkupLayoutIntent['innerGapLevel']`.", "function style(style, text)\n\t{\n\t\tvar newText = addMeta('color', toCss(style.color), text);\n\t\tvar props = newText._0;\n\n\t\tif (style.typeface.ctor !== '[]')\n\t\t{\n\t\t\tprops['font-family'] = toTypefaces(style.typeface);\n\t\t}\n\t\tif (style.height.ctor !== 'Nothing')\n\t\t{\n\t\t\tprops['font-size'] = style.height._0 + 'px';\n\t\t}\n\t\tif (style.bold)\n\t\t{\n\t\t\tprops['font-weight'] = 'bold';\n\t\t}\n\t\tif (style.italic)\n\t\t{\n\t\t\tprops['font-style'] = 'italic';\n\t\t}\n\t\tif (style.line.ctor !== 'Nothing')\n\t\t{\n\t\t\tprops['text-decoration'] = toLine(style.line._0);\n\t\t}\n\t\treturn newText;\n\t}", "function makeTextStyleLayer(ref) {\n var style = ref.style;\n var styleIndex = ref.styleIndex;\n var draw = ref.draw;\n var xyz = ref.xyz;\n var xyzLayerIndex = ref.xyzLayerIndex;\n var tgOptions = ref.tgOptions;\n\n var tgTextDrawGroupName = (style.type) + \"_\" + styleIndex + \"_text\";\n draw[tgTextDrawGroupName] = {\n interactive: true,\n collide: true, // always collide text labels (no real downside)\n priority: getLabelPriority(xyz.layers, xyzLayerIndex, tgOptions),\n style: 'XYZ_text',\n text_source: (\"function() { var properties = feature; return \" + (style.textRef) + \"; }\"),\n font: {\n fill: style.fill,\n stroke: {\n color: style.stroke,\n width: ((style.strokeWidth) + \"px\")\n }\n },\n offset: getOffset(style),\n anchor: 'center',\n // repeat_distance: '1000px',\n blend_order: getBlendOrder(style, xyz.layers, xyzLayerIndex)\n };\n\n // parse XYZ font field\n var font = parser(style.font);\n if (font['font-family'].length > 0) {\n draw[tgTextDrawGroupName].font.family = font['font-family'][0]; // use first family in list\n }\n\n draw[tgTextDrawGroupName].font.size = font['font-size'] || '12px';\n\n if (font['font-style']) {\n draw[tgTextDrawGroupName].font.style = font['font-style'];\n }\n\n if (font['font-weight']) {\n draw[tgTextDrawGroupName].font.weight = font['font-weight'];\n }\n }", "function defaultStyles() {\n return {\n cellPadding: 5,\n fontSize: 10,\n font: \"helvetica\", // helvetica, times, courier\n lineColor: 200,\n lineWidth: 0.1,\n fontStyle: 'normal', // normal, bold, italic, bolditalic\n overflow: 'ellipsize', // visible, hidden, ellipsize or linebreak\n fillColor: 255,\n textColor: 20,\n halign: 'left', // left, center, right\n valign: 'top', // top, middle, bottom\n fillStyle: 'F', // 'S', 'F' or 'DF' (stroke, fill or fill then stroke)\n rowHeight: 20,\n columnWidth: 'auto'\n };\n }", "function defaultStyles() {\n return {\n font: \"helvetica\",\n fontStyle: 'normal',\n overflow: 'linebreak',\n fillColor: false,\n textColor: 20,\n halign: 'left',\n valign: 'top',\n fontSize: 10,\n cellPadding: 5 / state_1.default().scaleFactor(),\n lineColor: 200,\n lineWidth: 0 / state_1.default().scaleFactor(),\n cellWidth: 'auto',\n minCellHeight: 0\n };\n}", "function defaultStyles() {\n return {\n font: \"helvetica\",\n fontStyle: 'normal',\n overflow: 'linebreak',\n fillColor: false,\n textColor: 20,\n halign: 'left',\n valign: 'top',\n fontSize: 10,\n cellPadding: 5 / state_1.default().scaleFactor(),\n lineColor: 200,\n lineWidth: 0 / state_1.default().scaleFactor(),\n cellWidth: 'auto',\n minCellHeight: 0\n };\n}", "function defaultStyles() {\n return {\n font: 'helvetica',\n fontStyle: 'normal',\n overflow: 'linebreak',\n fillColor: false,\n textColor: 20,\n halign: 'left',\n valign: 'top',\n fontSize: 10,\n cellPadding: 5 / state_1.default().scaleFactor(),\n lineColor: 200,\n lineWidth: 0 / state_1.default().scaleFactor(),\n cellWidth: 'auto',\n minCellHeight: 0,\n };\n}", "function Style() {\n var style = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, Style);\n\n if (!style.sketchObject) {\n // eslint-disable-next-line no-param-reassign\n style = Object.assign({}, DEFAULT_STYLE, style); // eslint-disable-next-line no-param-reassign\n\n style.sketchObject = MSDefaultStyle.defaultStyle();\n }\n\n return _possibleConstructorReturn(this, _getPrototypeOf(Style).call(this, style));\n }", "function defaultStyles() {\n var scaleFactor = Config.scaleFactor();\n return {\n font: \"helvetica\",\n lineColor: 200,\n fontStyle: 'normal',\n overflow: 'ellipsize',\n fillColor: false,\n textColor: 20,\n halign: 'left',\n valign: 'top',\n fontSize: 10,\n cellPadding: 5 / scaleFactor,\n lineWidth: 0 / scaleFactor,\n columnWidth: 'auto'\n };\n}", "function textStyle(text) {\n text.attr(\"aria-hidden\", d.aH).attr(\"dir\", rtl ? \"rtl\" : \"ltr\").attr(\"fill\", d.fC).attr(\"stroke\", d.fStroke).attr(\"stroke-width\", d.fSW).attr(\"text-anchor\", d.tA).attr(\"font-family\", d.fF).style(\"font-family\", d.fF).attr(\"font-size\", \"\".concat(d.fS, \"px\")).style(\"font-size\", \"\".concat(d.fS, \"px\")).attr(\"font-weight\", d.fW).style(\"font-weight\", d.fW).attr(\"x\", \"\".concat(d.tA === \"middle\" ? d.w / 2 : rtl ? d.tA === \"start\" ? d.w : 0 : d.tA === \"end\" ? d.w : 2 * Math.sin(Math.PI * d.r / 180), \"px\")).attr(\"y\", function (t, i) {\n return d.r === 0 || d.vA === \"top\" ? \"\".concat((i + 1) * d.lH - (d.lH - d.fS), \"px\") : d.vA === \"middle\" ? \"\".concat((d.h + d.fS) / 2 - (d.lH - d.fS) + (i - d.lines.length / 2 + 0.5) * d.lH, \"px\") : \"\".concat(d.h - 2 * (d.lH - d.fS) - (d.lines.length - (i + 1)) * d.lH + 2 * Math.cos(Math.PI * d.r / 180), \"px\");\n });\n }", "function styleText(txtColour, txtFont, txtAlign, txtBaseline) {\n canvasContext.fillStyle = txtColour;\n canvasContext.font = txtFont;\n canvasContext.textAlign = txtAlign;\n canvasContext.textBaseline = txtBaseline;\n}", "reset() {\n UtilsSettings_1.UtilsSettings.deepCopyProperties(this, TextSettings_1.TextSettings.defaultStyle, TextSettings_1.TextSettings.defaultStyle);\n }", "function getTextBoxStyle({\n padY,\n padX,\n borderColor,\n borderWidth,\n bgColor,\n textColor,\n ...opts\n}) {\n const layer = getBaseVectorLayer();\n\n const backgroundStroke = new Stroke({\n color: borderColor,\n width: borderWidth\n });\n const backgroundFill = new Fill({ color: bgColor });\n const fill = new Fill({ color: textColor });\n\n const textStyle = new Text({\n padding: [padY, padX, padY, padX],\n backgroundFill,\n backgroundStroke,\n fill,\n ...opts\n });\n const style = new Style({\n text: textStyle\n });\n\n layer.setStyle(feature => {\n if (feature.get(\"text_content\")) {\n textStyle.setText(feature.get(\"text_content\"));\n } else {\n textStyle.setText(`?${feature.ol_uid}`);\n }\n\n return [style];\n });\n\n return layer;\n}", "function apply(context, styleId) {\n var style = styles[styleId] ? styles[styleId] : styles.basic,\n previousStyle;\n \n // if we have a context and context canvas, then update the previous style info\n if (context && context.canvas) {\n previousStyle = previousStyles[context.canvas.id];\n previousStyles[context.canvas.id] = styleId;\n } // if\n\n // apply the style\n style.applyToContext(context);\n\n // return the previously selected style\n return previousStyle;\n }", "applyStyle(style, clearDirectFormatting) {\n clearDirectFormatting = isNullOrUndefined(clearDirectFormatting) ? false : clearDirectFormatting;\n if (clearDirectFormatting) {\n this.initComplexHistory('ApplyStyle');\n this.clearFormatting();\n }\n let styleObj = this.viewer.styles.findByName(style);\n if (styleObj !== undefined) {\n this.onApplyParagraphFormat('styleName', styleObj, false, true);\n }\n else {\n // tslint:disable-next-line:max-line-length\n this.viewer.owner.parser.parseStyle(JSON.parse(this.getCompleteStyles()), JSON.parse(this.viewer.preDefinedStyles.get(style)), this.viewer.styles);\n this.applyStyle(style);\n }\n if (this.editorHistory && this.editorHistory.currentHistoryInfo && this.editorHistory.currentHistoryInfo.action === 'ApplyStyle') {\n this.editorHistory.updateComplexHistory();\n }\n }", "function default_1(text, x, y, styles, doc) {\n styles = styles || {};\n var FONT_ROW_RATIO = 1.15;\n if (typeof x !== 'number' || typeof y !== 'number') {\n console.error('The x and y parameters are required. Missing for text: ', text);\n }\n var k = doc.internal.scaleFactor;\n var fontSize = doc.internal.getFontSize() / k;\n var splitRegex = /\\r\\n|\\r|\\n/g;\n var splitText = '';\n var lineCount = 1;\n if (styles.valign === 'middle' ||\n styles.valign === 'bottom' ||\n styles.halign === 'center' ||\n styles.halign === 'right') {\n splitText = typeof text === 'string' ? text.split(splitRegex) : text;\n lineCount = splitText.length || 1;\n }\n // Align the top\n y += fontSize * (2 - FONT_ROW_RATIO);\n if (styles.valign === 'middle')\n y -= (lineCount / 2) * fontSize * FONT_ROW_RATIO;\n else if (styles.valign === 'bottom')\n y -= lineCount * fontSize * FONT_ROW_RATIO;\n if (styles.halign === 'center' || styles.halign === 'right') {\n var alignSize = fontSize;\n if (styles.halign === 'center')\n alignSize *= 0.5;\n if (splitText && lineCount >= 1) {\n for (var iLine = 0; iLine < splitText.length; iLine++) {\n doc.text(splitText[iLine], x - doc.getStringUnitWidth(splitText[iLine]) * alignSize, y);\n y += fontSize * FONT_ROW_RATIO;\n }\n return doc;\n }\n x -= doc.getStringUnitWidth(text) * alignSize;\n }\n if (styles.halign === 'justify') {\n doc.text(text, x, y, {\n maxWidth: styles.maxWidth || 100,\n align: 'justify',\n });\n }\n else {\n doc.text(text, x, y);\n }\n return doc;\n}", "function default_1(text, x, y, styles, doc) {\n styles = styles || {};\n var FONT_ROW_RATIO = 1.15;\n var k = doc.internal.scaleFactor;\n var fontSize = doc.internal.getFontSize() / k;\n var splitRegex = /\\r\\n|\\r|\\n/g;\n var splitText = '';\n var lineCount = 1;\n if (styles.valign === 'middle' ||\n styles.valign === 'bottom' ||\n styles.halign === 'center' ||\n styles.halign === 'right') {\n splitText = typeof text === 'string' ? text.split(splitRegex) : text;\n lineCount = splitText.length || 1;\n }\n // Align the top\n y += fontSize * (2 - FONT_ROW_RATIO);\n if (styles.valign === 'middle')\n y -= (lineCount / 2) * fontSize * FONT_ROW_RATIO;\n else if (styles.valign === 'bottom')\n y -= lineCount * fontSize * FONT_ROW_RATIO;\n if (styles.halign === 'center' || styles.halign === 'right') {\n var alignSize = fontSize;\n if (styles.halign === 'center')\n alignSize *= 0.5;\n if (splitText && lineCount >= 1) {\n for (var iLine = 0; iLine < splitText.length; iLine++) {\n doc.text(splitText[iLine], x - doc.getStringUnitWidth(splitText[iLine]) * alignSize, y);\n y += fontSize * FONT_ROW_RATIO;\n }\n return doc;\n }\n x -= doc.getStringUnitWidth(text) * alignSize;\n }\n if (styles.halign === 'justify') {\n doc.text(text, x, y, {\n maxWidth: styles.maxWidth || 100,\n align: 'justify',\n });\n }\n else {\n doc.text(text, x, y);\n }\n return doc;\n}", "function default_1(text, x, y, styles, doc) {\n styles = styles || {};\n var FONT_ROW_RATIO = 1.15;\n var k = doc.internal.scaleFactor;\n var fontSize = doc.internal.getFontSize() / k;\n var splitRegex = /\\r\\n|\\r|\\n/g;\n var splitText = '';\n var lineCount = 1;\n if (styles.valign === 'middle' ||\n styles.valign === 'bottom' ||\n styles.halign === 'center' ||\n styles.halign === 'right') {\n splitText = typeof text === 'string' ? text.split(splitRegex) : text;\n lineCount = splitText.length || 1;\n }\n // Align the top\n y += fontSize * (2 - FONT_ROW_RATIO);\n if (styles.valign === 'middle')\n y -= (lineCount / 2) * fontSize * FONT_ROW_RATIO;\n else if (styles.valign === 'bottom')\n y -= lineCount * fontSize * FONT_ROW_RATIO;\n if (styles.halign === 'center' || styles.halign === 'right') {\n var alignSize = fontSize;\n if (styles.halign === 'center')\n alignSize *= 0.5;\n if (splitText && lineCount >= 1) {\n for (var iLine = 0; iLine < splitText.length; iLine++) {\n doc.text(splitText[iLine], x - doc.getStringUnitWidth(splitText[iLine]) * alignSize, y);\n y += fontSize * FONT_ROW_RATIO;\n }\n return doc;\n }\n x -= doc.getStringUnitWidth(text) * alignSize;\n }\n if (styles.halign === 'justify') {\n doc.text(text, x, y, {\n maxWidth: styles.maxWidth || 100,\n align: 'justify',\n });\n }\n else {\n doc.text(text, x, y);\n }\n return doc;\n}", "function default_1(text, x, y, styles, doc) {\n styles = styles || {};\n var FONT_ROW_RATIO = 1.15;\n var k = doc.internal.scaleFactor;\n var fontSize = doc.internal.getFontSize() / k;\n var splitRegex = /\\r\\n|\\r|\\n/g;\n var splitText = '';\n var lineCount = 1;\n if (styles.valign === 'middle' ||\n styles.valign === 'bottom' ||\n styles.halign === 'center' ||\n styles.halign === 'right') {\n splitText = typeof text === 'string' ? text.split(splitRegex) : text;\n lineCount = splitText.length || 1;\n }\n // Align the top\n y += fontSize * (2 - FONT_ROW_RATIO);\n if (styles.valign === 'middle')\n y -= (lineCount / 2) * fontSize * FONT_ROW_RATIO;\n else if (styles.valign === 'bottom')\n y -= lineCount * fontSize * FONT_ROW_RATIO;\n if (styles.halign === 'center' || styles.halign === 'right') {\n var alignSize = fontSize;\n if (styles.halign === 'center')\n alignSize *= 0.5;\n if (splitText && lineCount >= 1) {\n for (var iLine = 0; iLine < splitText.length; iLine++) {\n doc.text(splitText[iLine], x - doc.getStringUnitWidth(splitText[iLine]) * alignSize, y);\n y += fontSize * FONT_ROW_RATIO;\n }\n return doc;\n }\n x -= doc.getStringUnitWidth(text) * alignSize;\n }\n if (styles.halign === 'justify') {\n doc.text(text, x, y, {\n maxWidth: styles.maxWidth || 100,\n align: 'justify',\n });\n }\n else {\n doc.text(text, x, y);\n }\n return doc;\n}", "function _setTextColors() {\n if (!styles.shepherdThemeTextPrimary) {\n styles.shepherdThemeTextPrimary = transparentize(0.25, readableColor(styles.shepherdThemePrimary));\n }\n\n if (!styles.shepherdThemeTextSecondary) {\n styles.shepherdThemeTextSecondary = transparentize(0.25, readableColor(styles.shepherdThemeSecondary));\n }\n\n if (!styles.shepherdThemeTextHeader) {\n styles.shepherdThemeTextHeader = transparentize(0.25, readableColor(styles.shepherdHeaderBackground));\n }\n\n if (!styles.shepherdThemeTextColor) {\n styles.shepherdThemeTextColor = transparentize(0.25, readableColor(styles.shepherdTextBackground));\n }\n}", "function createTTAddDefaultStyle() {\n cb.addCSS(`div.cb_createTT {\n font-family: Arial, Helvetica, sans-serif;\n font-size: 11px; /* 0.85em; */\n font-weight: bold;\n background-color: black;\n color: #fff;\n text-align: center;\n padding: 4px 8px; /* 0.2em 0.4em; */\n border-radius: 6px;\n /* always on top */\n z-index: 999999;\n }`);\n }", "function RenderStyle() {\n this.line_color = 'black';\n this.line_width = 0;\n this.fill_color = 'transparent';\n this.text_color = 'black';\n this.text_size = '12';\n}", "function setTextColors (cssRules, prop) {\n let cssStyleRule;\n let style;\n\n if ((prop != undefined) && (prop != null)) {\n\tsidebarTextColor = prop;\n\n\tcssStyleRule = getStyleRule(cssRules, \"html, body\");\n\tstyle = cssStyleRule.style; // A CSSStyleDeclaration object\n\tstyle.setProperty(\"color\", prop);\n\n\tcssStyleRule = getStyleRule(cssRules, \".favseparator\");\n\tstyle = cssStyleRule.style; // A CSSStyleDeclaration object\n\tstyle.setProperty(\"border-bottom-color\", prop);\n\n\t// Force a visible text color when highlighting a cell (= default FF value in nm/default theme mode)\n\tcssStyleRule = getStyleRule(cssRules, \".selbrow\");\n\tstyle = cssStyleRule.style; // A CSSStyleDeclaration object\n\tstyle.setProperty(\"color\", HighlightTextColor);\n\n\tcssStyleRule = getStyleRule(cssRules, \".brow:hover, .selbrow:hover, .rselbrow:hover\");\n\tstyle = cssStyleRule.style; // A CSSStyleDeclaration object\n\tstyle.setProperty(\"color\", HighlightTextColor);\n\n\tcssStyleRule = getStyleRule(cssRules, \".brow:focus, .selbrow:focus, .rselbrow:focus\");\n\tstyle = cssStyleRule.style; // A CSSStyleDeclaration object\n\tstyle.setProperty(\"color\", HighlightTextColor);\n }\n else {\n\tsidebarTextColor = undefined;\n\n\tcssStyleRule = getStyleRule(cssRules, \"html, body\");\n\tstyle = cssStyleRule.style; // A CSSStyleDeclaration object\n\tstyle.removeProperty(\"color\");\n\n\tcssStyleRule = getStyleRule(cssRules, \".favseparator\");\n\tstyle = cssStyleRule.style; // A CSSStyleDeclaration object\n\tstyle.setProperty(\"border-bottom-color\", HighlightTextColor);\n\n\t// Force a visible text color when highlighting a cell (= default FF value in nm/default theme mode)\n\tcssStyleRule = getStyleRule(cssRules, \".selbrow\");\n\tstyle = cssStyleRule.style; // A CSSStyleDeclaration object\n\tstyle.removeProperty(\"color\");\n\n\tcssStyleRule = getStyleRule(cssRules, \".brow:hover, .selbrow:hover, .rselbrow:hover\");\n\tstyle = cssStyleRule.style; // A CSSStyleDeclaration object\n\tstyle.removeProperty(\"color\");\n\n\tcssStyleRule = getStyleRule(cssRules, \".brow:focus, .selbrow:focus, .rselbrow:focus\");\n\tstyle = cssStyleRule.style; // A CSSStyleDeclaration object\n\tstyle.removeProperty(\"color\");\n }\n}", "function applyTextStyle(container, styler, from, to) {\n if (from === void 0) { from = new Position_1.default(container, 0 /* Begin */).normalize(); }\n if (to === void 0) { to = new Position_1.default(container, -1 /* End */).normalize(); }\n var formatNodes = [];\n while (from && to && to.isAfter(from)) {\n var formatNode = from.node;\n var parentTag = getTagOfNode_1.default(formatNode.parentNode);\n // The code below modifies DOM. Need to get the next sibling first otherwise you won't be able to reliably get a good next sibling node\n var nextNode = getLeafSibling_1.getNextLeafSibling(container, formatNode);\n if (formatNode.nodeType == 3 /* Text */ && ['TR', 'TABLE'].indexOf(parentTag) < 0) {\n if (formatNode == to.node && !to.isAtEnd) {\n formatNode = splitTextNode_1.default(formatNode, to.offset, true /*returnFirstPart*/);\n }\n if (from.offset > 0) {\n formatNode = splitTextNode_1.default(formatNode, from.offset, false /*returnFirstPart*/);\n }\n formatNodes.push(formatNode);\n }\n from = nextNode && new Position_1.default(nextNode, 0 /* Begin */);\n }\n if (formatNodes.length > 0) {\n if (formatNodes.every(function (node) { return node.parentNode == formatNodes[0].parentNode; })) {\n var newNode_1 = formatNodes.shift();\n formatNodes.forEach(function (node) {\n newNode_1.nodeValue += node.nodeValue;\n node.parentNode.removeChild(node);\n });\n formatNodes = [newNode_1];\n }\n formatNodes.forEach(function (node) {\n // When apply style within style tags like B/I/U/..., we split the tag and apply outside them\n // So that the inner style tag such as U, STRIKE can inherit the style we added\n while (getTagOfNode_1.default(node) != 'SPAN' &&\n STYLETAGS.indexOf(getTagOfNode_1.default(node.parentNode)) >= 0) {\n callStylerWithInnerNode(node, styler);\n node = splitParentNode_1.splitBalancedNodeRange(node);\n }\n if (getTagOfNode_1.default(node) != 'SPAN') {\n callStylerWithInnerNode(node, styler);\n node = wrap_1.default(node, 'SPAN');\n }\n styler(node);\n });\n }\n}", "_setSelectedMarkerStyleDefaultSettings() {\n let previouslySelectedMarkerStyle = this.get('_previouslySelectedMarkerStyle');\n let selectedMarkerStyle = this.get('styleSettings.type');\n if (Ember.isBlank(selectedMarkerStyle) || previouslySelectedMarkerStyle === selectedMarkerStyle) {\n return;\n }\n\n this.set('styleSettings', this.get('_markersStylesRenderer').getDefaultStyleSettings(selectedMarkerStyle));\n this.set('_previouslySelectedMarkerStyle', selectedMarkerStyle);\n\n this.send('onStyleSettingsChange');\n }", "function Text(x, y, text, fillStyle, strokeStyle) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (text === void 0) { text = ''; }\n if (fillStyle === void 0) { fillStyle = color_9.default.black; }\n if (strokeStyle === void 0) { strokeStyle = color_9.default.white; }\n var _this = _super.call(this, x, y, fillStyle, strokeStyle) || this;\n /**\n * The actual string value that is rendered.\n */\n _this.text = '';\n /**\n * The font used to render the text.\n */\n _this.font = '16px Monospace';\n /**\n * Text align.\n */\n _this.textAlign = exports.TextAlign.Start;\n /**\n * Text base line.\n */\n _this.textBaseLine = exports.TextBaseLine.Alphabetic;\n /**\n * Text direction.\n */\n _this.textDirection = exports.TextDirection.Inherit;\n _this.text = text;\n return _this;\n }", "function addStylePropertyMarkup(styles, text) {\n if (styles && (styles.COLOR || styles.BGCOLOR || styles.FONTSIZE || styles.FONTFAMILY)) {\n var styleString = 'style=\"';\n if (styles.COLOR) {\n styleString += 'color: ' + styles.COLOR + ';';\n }\n if (styles.BGCOLOR) {\n styleString += 'background-color: ' + styles.BGCOLOR + ';';\n }\n if (styles.FONTSIZE) {\n styleString += 'font-size: ' + styles.FONTSIZE + (/^\\d+$/.test(styles.FONTSIZE) ? 'px' : '') + ';';\n }\n if (styles.FONTFAMILY) {\n styleString += 'font-family: ' + styles.FONTFAMILY + ';';\n }\n styleString += '\"';\n return '<span ' + styleString + '>' + text + '</span>';\n }\n return text;\n}", "function defaultStyles(scaleFactor) {\n return {\n font: 'helvetica',\n fontStyle: 'normal',\n overflow: 'linebreak',\n fillColor: false,\n textColor: 20,\n halign: 'left',\n valign: 'top',\n fontSize: 10,\n cellPadding: 5 / scaleFactor,\n lineColor: 200,\n lineWidth: 0,\n cellWidth: 'auto',\n minCellHeight: 0,\n minCellWidth: 0,\n };\n}", "function defaultStyles(scaleFactor) {\n return {\n font: 'helvetica',\n fontStyle: 'normal',\n overflow: 'linebreak',\n fillColor: false,\n textColor: 20,\n halign: 'left',\n valign: 'top',\n fontSize: 10,\n cellPadding: 5 / scaleFactor,\n lineColor: 200,\n lineWidth: 0,\n cellWidth: 'auto',\n minCellHeight: 0,\n minCellWidth: 0,\n };\n}", "function defaultStyles(scaleFactor) {\n return {\n font: 'helvetica',\n fontStyle: 'normal',\n overflow: 'linebreak',\n fillColor: false,\n textColor: 20,\n halign: 'left',\n valign: 'top',\n fontSize: 10,\n cellPadding: 5 / scaleFactor,\n lineColor: 200,\n lineWidth: 0,\n cellWidth: 'auto',\n minCellHeight: 0,\n minCellWidth: 0,\n };\n}", "noTextStroke() {\n this.textStroke = false;\n this.strokeWeight = false;\n }", "function getDefaultStyle() {\n return \"\" +\n \".material-background-nav-bar { \" +\n \" background-color : \" + appPrimaryColor + \" !important; \" +\n \" border-style : none;\" +\n \"}\" +\n \".md-primary-color {\" +\n \" color : \" + appPrimaryColor + \" !important;\" +\n \"}\";\n }// End create custom defaultStyle", "function formatReset() {\n DocumentApp.getActiveDocument().getBody().editAsText().setBold(false).setUnderline(false);\n}", "get styleStaticText() { return Object.assign({}, this.style.common); }", "function defaultFormatter(text){\n return text;\n}", "function getInitialStyleStringValue(context) {\n var initialStyleValues = context[3 /* InitialStyleValuesPosition */];\n var styleString = initialStyleValues[1 /* CachedStringValuePosition */];\n if (styleString === null) {\n styleString = '';\n for (var i = 2 /* KeyValueStartPosition */; i < initialStyleValues.length; i += 3 /* Size */) {\n var value = initialStyleValues[i + 1];\n if (value !== null) {\n styleString += (styleString.length ? ';' : '') + (initialStyleValues[i] + \":\" + value);\n }\n }\n initialStyleValues[1 /* CachedStringValuePosition */] = styleString;\n }\n return styleString;\n}", "static setDefaultThemeStyle(style) {\n defaultTheme = new Theme(style);\n }", "function text(text, fontStyle) {\n $._text(text, fontStyle);\n}", "function copyArrays(textStyle) {\n // These color fields were arrays, but will set to WASM pointers before we pass this\n // object over the WASM interface.\n textStyle['_colorPtr'] = copyColorToWasm(textStyle['color']);\n textStyle['_foregroundColorPtr'] = nullptr; // nullptr is 0, from helper.js\n textStyle['_backgroundColorPtr'] = nullptr;\n textStyle['_decorationColorPtr'] = nullptr;\n if (textStyle['foregroundColor']) {\n textStyle['_foregroundColorPtr'] = copyColorToWasm(textStyle['foregroundColor'], scratchForegroundColorPtr);\n }\n if (textStyle['backgroundColor']) {\n textStyle['_backgroundColorPtr'] = copyColorToWasm(textStyle['backgroundColor'], scratchBackgroundColorPtr);\n }\n if (textStyle['decorationColor']) {\n textStyle['_decorationColorPtr'] = copyColorToWasm(textStyle['decorationColor'], scratchDecorationColorPtr);\n }\n\n if (Array.isArray(textStyle['fontFamilies']) && textStyle['fontFamilies'].length) {\n textStyle['_fontFamiliesPtr'] = naiveCopyStrArray(textStyle['fontFamilies']);\n textStyle['_fontFamiliesLen'] = textStyle['fontFamilies'].length;\n } else {\n textStyle['_fontFamiliesPtr'] = nullptr;\n textStyle['_fontFamiliesLen'] = 0;\n Debug('no font families provided, text may draw wrong or not at all');\n }\n\n if (textStyle['locale']) {\n var str = textStyle['locale'];\n textStyle['_localePtr'] = cacheOrCopyString(str);\n textStyle['_localeLen'] = lengthBytesUTF8(str) + 1; // add 1 for the null terminator.\n } else {\n textStyle['_localePtr'] = nullptr;\n textStyle['_localeLen'] = 0;\n }\n\n if (Array.isArray(textStyle['shadows']) && textStyle['shadows'].length) {\n var shadows = textStyle['shadows'];\n var shadowColors = shadows.map(function (s) { return s['color'] || CanvasKit.BLACK; });\n var shadowBlurRadii = shadows.map(function (s) { return s['blurRadius'] || 0.0; });\n textStyle['_shadowLen'] = shadows.length;\n // 2 floats per point, 4 bytes per float\n var ptr = CanvasKit._malloc(shadows.length * 2 * 4);\n var adjustedPtr = ptr / 4; // 4 bytes per float\n for (var i = 0; i < shadows.length; i++) {\n var offset = shadows[i]['offset'] || [0, 0];\n CanvasKit.HEAPF32[adjustedPtr] = offset[0];\n CanvasKit.HEAPF32[adjustedPtr + 1] = offset[1];\n adjustedPtr += 2;\n }\n textStyle['_shadowColorsPtr'] = copyFlexibleColorArray(shadowColors).colorPtr;\n textStyle['_shadowOffsetsPtr'] = ptr;\n textStyle['_shadowBlurRadiiPtr'] = copy1dArray(shadowBlurRadii, 'HEAPF32');\n } else {\n textStyle['_shadowLen'] = 0;\n textStyle['_shadowColorsPtr'] = nullptr;\n textStyle['_shadowOffsetsPtr'] = nullptr;\n textStyle['_shadowBlurRadiiPtr'] = nullptr;\n }\n\n if (Array.isArray(textStyle['fontFeatures']) && textStyle['fontFeatures'].length) {\n var fontFeatures = textStyle['fontFeatures'];\n var fontFeatureNames = fontFeatures.map(function (s) { return s['name']; });\n var fontFeatureValues = fontFeatures.map(function (s) { return s['value']; });\n textStyle['_fontFeatureLen'] = fontFeatures.length;\n textStyle['_fontFeatureNamesPtr'] = naiveCopyStrArray(fontFeatureNames);\n textStyle['_fontFeatureValuesPtr'] = copy1dArray(fontFeatureValues, 'HEAPU32');\n } else {\n textStyle['_fontFeatureLen'] = 0;\n textStyle['_fontFeatureNamesPtr'] = nullptr;\n textStyle['_fontFeatureValuesPtr'] = nullptr;\n }\n\n if (Array.isArray(textStyle['fontVariations']) && textStyle['fontVariations'].length) {\n var fontVariations = textStyle['fontVariations'];\n var fontVariationAxes = fontVariations.map(function (s) { return s['axis']; });\n var fontVariationValues = fontVariations.map(function (s) { return s['value']; });\n textStyle['_fontVariationLen'] = fontVariations.length;\n textStyle['_fontVariationAxesPtr'] = naiveCopyStrArray(fontVariationAxes);\n textStyle['_fontVariationValuesPtr'] = copy1dArray(fontVariationValues, 'HEAPF32');\n } else {\n textStyle['_fontVariationLen'] = 0;\n textStyle['_fontVariationAxesPtr'] = nullptr;\n textStyle['_fontVariationValuesPtr'] = nullptr;\n }\n }", "get fontStyle() {}", "function fontColorOverride(cell) {\n\n var cellObj = $(cell);\n var hex = cellObj.attr(\"fill\");\n\n var colorIsLight = function (r, g, b) {\n // Counting the perceptive luminance\n // human eye favors green color...\n var a = 1 - (0.299 * r + 0.587 * g + 0.114 * b) / 255;\n return (a < 0.5);\n }\n\n\n function hexToRgb(hex) {\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n hex = hex.replace(shorthandRegex, function (m, r, g, b) {\n return r + r + g + g + b + b;\n });\n\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16)\n } : null;\n }\n\n if (hexToRgb(hex)) {\n var textColor = colorIsLight(hexToRgb(hex).r, hexToRgb(hex).g, hexToRgb(hex).b) ? '#000000' : '#ffffff';\n cellObj.next('text').attr('fill', textColor);\n }\n\n }", "function setDefaultStyle(opts) {\r\n if (cssStyles&&cssStyles[opts.cssClass]&&cssStyles[opts.cssClass][opts.style_name]) {\r\n opts.style_value = cssStyles[opts.cssClass][opts.style_name];\r\n $.each(opts.target, function(index, value) {\r\n setTargetStyle(opts.style_name, opts.style_value, value, opts.cssClass);\r\n });\r\n }\r\n}", "static restore(data) {\n let fontStyle = new FontStyle(data.fontDescription);\n\n fontStyle.setSpread(data.spread);\n fontStyle.setFontSize(data.fontSize);\n fontStyle.setLetterSpacing(data.letterSpacing);\n\n return fontStyle;\n }", "function renderPlainText(hostEl, ctx, text, style, rect, prevEl) {\n 'use strict';\n\n var needDrawBg = needDrawBackground(style);\n var prevStyle;\n var checkCache = false;\n var cachedByMe = ctx.__attrCachedBy === ContextCachedBy.PLAIN_TEXT; // Only take and check cache for `Text` el, but not RectText.\n\n if (prevEl !== WILL_BE_RESTORED) {\n if (prevEl) {\n prevStyle = prevEl.style;\n checkCache = !needDrawBg && cachedByMe && prevStyle;\n } // Prevent from using cache in `Style::bind`, because of the case:\n // ctx property is modified by other properties than `Style::bind`\n // used, and Style::bind is called next.\n\n\n ctx.__attrCachedBy = needDrawBg ? ContextCachedBy.NONE : ContextCachedBy.PLAIN_TEXT;\n } // Since this will be restored, prevent from using these props to check cache in the next\n // entering of this method. But do not need to clear other cache like `Style::bind`.\n else if (cachedByMe) {\n ctx.__attrCachedBy = ContextCachedBy.NONE;\n }\n\n var styleFont = style.font || DEFAULT_FONT; // PENDING\n // Only `Text` el set `font` and keep it (`RectText` will restore). So theoretically\n // we can make font cache on ctx, which can cache for text el that are discontinuous.\n // But layer save/restore needed to be considered.\n // if (styleFont !== ctx.__fontCache) {\n // ctx.font = styleFont;\n // if (prevEl !== WILL_BE_RESTORED) {\n // ctx.__fontCache = styleFont;\n // }\n // }\n\n if (!checkCache || styleFont !== (prevStyle.font || DEFAULT_FONT)) {\n ctx.font = styleFont;\n } // Use the final font from context-2d, because the final\n // font might not be the style.font when it is illegal.\n // But get `ctx.font` might be time consuming.\n\n\n var computedFont = hostEl.__computedFont;\n\n if (hostEl.__styleFont !== styleFont) {\n hostEl.__styleFont = styleFont;\n computedFont = hostEl.__computedFont = ctx.font;\n }\n\n var textPadding = style.textPadding;\n var textLineHeight = style.textLineHeight;\n var contentBlock = hostEl.__textCotentBlock;\n\n if (!contentBlock || hostEl.__dirtyText) {\n contentBlock = hostEl.__textCotentBlock = textContain.parsePlainText(text, computedFont, textPadding, textLineHeight, style.truncate);\n }\n\n var outerHeight = contentBlock.outerHeight;\n var textLines = contentBlock.lines;\n var lineHeight = contentBlock.lineHeight;\n var boxPos = getBoxPosition(_tmpBoxPositionResult, hostEl, style, rect);\n var baseX = boxPos.baseX;\n var baseY = boxPos.baseY;\n var textAlign = boxPos.textAlign || 'left';\n var textVerticalAlign = boxPos.textVerticalAlign; // Origin of textRotation should be the base point of text drawing.\n\n applyTextRotation(ctx, style, rect, baseX, baseY);\n var boxY = textContain.adjustTextY(baseY, outerHeight, textVerticalAlign);\n var textX = baseX;\n var textY = boxY;\n\n if (needDrawBg || textPadding) {\n // Consider performance, do not call getTextWidth util necessary.\n var textWidth = textContain.getWidth(text, computedFont);\n var outerWidth = textWidth;\n textPadding && (outerWidth += textPadding[1] + textPadding[3]);\n var boxX = textContain.adjustTextX(baseX, outerWidth, textAlign);\n needDrawBg && drawBackground(hostEl, ctx, style, boxX, boxY, outerWidth, outerHeight);\n\n if (textPadding) {\n textX = getTextXForPadding(baseX, textAlign, textPadding);\n textY += textPadding[0];\n }\n } // Always set textAlign and textBase line, because it is difficute to calculate\n // textAlign from prevEl, and we dont sure whether textAlign will be reset if\n // font set happened.\n\n\n ctx.textAlign = textAlign; // Force baseline to be \"middle\". Otherwise, if using \"top\", the\n // text will offset downward a little bit in font \"Microsoft YaHei\".\n\n ctx.textBaseline = 'middle'; // Set text opacity\n\n ctx.globalAlpha = style.opacity || 1; // Always set shadowBlur and shadowOffset to avoid leak from displayable.\n\n for (var i = 0; i < SHADOW_STYLE_COMMON_PROPS.length; i++) {\n var propItem = SHADOW_STYLE_COMMON_PROPS[i];\n var styleProp = propItem[0];\n var ctxProp = propItem[1];\n var val = style[styleProp];\n\n if (!checkCache || val !== prevStyle[styleProp]) {\n ctx[ctxProp] = fixShadow(ctx, ctxProp, val || propItem[2]);\n }\n } // `textBaseline` is set as 'middle'.\n\n\n textY += lineHeight / 2;\n var textStrokeWidth = style.textStrokeWidth;\n var textStrokeWidthPrev = checkCache ? prevStyle.textStrokeWidth : null;\n var strokeWidthChanged = !checkCache || textStrokeWidth !== textStrokeWidthPrev;\n var strokeChanged = !checkCache || strokeWidthChanged || style.textStroke !== prevStyle.textStroke;\n var textStroke = getStroke(style.textStroke, textStrokeWidth);\n var textFill = getFill(style.textFill);\n\n if (textStroke) {\n if (strokeWidthChanged) {\n ctx.lineWidth = textStrokeWidth;\n }\n\n if (strokeChanged) {\n ctx.strokeStyle = textStroke;\n }\n }\n\n if (textFill) {\n if (!checkCache || style.textFill !== prevStyle.textFill) {\n ctx.fillStyle = textFill;\n }\n } // Optimize simply, in most cases only one line exists.\n\n\n if (textLines.length === 1) {\n // Fill after stroke so the outline will not cover the main part.\n textStroke && ctx.strokeText(textLines[0], textX, textY);\n textFill && ctx.fillText(textLines[0], textX, textY);\n } else {\n for (var i = 0; i < textLines.length; i++) {\n // Fill after stroke so the outline will not cover the main part.\n textStroke && ctx.strokeText(textLines[i], textX, textY);\n textFill && ctx.fillText(textLines[i], textX, textY);\n textY += lineHeight;\n }\n }\n}", "function renderPlainText(hostEl, ctx, text, style, rect, prevEl) {\n 'use strict';\n\n var needDrawBg = needDrawBackground(style);\n var prevStyle;\n var checkCache = false;\n var cachedByMe = ctx.__attrCachedBy === ContextCachedBy.PLAIN_TEXT; // Only take and check cache for `Text` el, but not RectText.\n\n if (prevEl !== WILL_BE_RESTORED) {\n if (prevEl) {\n prevStyle = prevEl.style;\n checkCache = !needDrawBg && cachedByMe && prevStyle;\n } // Prevent from using cache in `Style::bind`, because of the case:\n // ctx property is modified by other properties than `Style::bind`\n // used, and Style::bind is called next.\n\n\n ctx.__attrCachedBy = needDrawBg ? ContextCachedBy.NONE : ContextCachedBy.PLAIN_TEXT;\n } // Since this will be restored, prevent from using these props to check cache in the next\n // entering of this method. But do not need to clear other cache like `Style::bind`.\n else if (cachedByMe) {\n ctx.__attrCachedBy = ContextCachedBy.NONE;\n }\n\n var styleFont = style.font || DEFAULT_FONT; // PENDING\n // Only `Text` el set `font` and keep it (`RectText` will restore). So theoretically\n // we can make font cache on ctx, which can cache for text el that are discontinuous.\n // But layer save/restore needed to be considered.\n // if (styleFont !== ctx.__fontCache) {\n // ctx.font = styleFont;\n // if (prevEl !== WILL_BE_RESTORED) {\n // ctx.__fontCache = styleFont;\n // }\n // }\n\n if (!checkCache || styleFont !== (prevStyle.font || DEFAULT_FONT)) {\n ctx.font = styleFont;\n } // Use the final font from context-2d, because the final\n // font might not be the style.font when it is illegal.\n // But get `ctx.font` might be time consuming.\n\n\n var computedFont = hostEl.__computedFont;\n\n if (hostEl.__styleFont !== styleFont) {\n hostEl.__styleFont = styleFont;\n computedFont = hostEl.__computedFont = ctx.font;\n }\n\n var textPadding = style.textPadding;\n var textLineHeight = style.textLineHeight;\n var contentBlock = hostEl.__textCotentBlock;\n\n if (!contentBlock || hostEl.__dirtyText) {\n contentBlock = hostEl.__textCotentBlock = textContain.parsePlainText(text, computedFont, textPadding, textLineHeight, style.truncate);\n }\n\n var outerHeight = contentBlock.outerHeight;\n var textLines = contentBlock.lines;\n var lineHeight = contentBlock.lineHeight;\n var boxPos = getBoxPosition(outerHeight, style, rect);\n var baseX = boxPos.baseX;\n var baseY = boxPos.baseY;\n var textAlign = boxPos.textAlign || 'left';\n var textVerticalAlign = boxPos.textVerticalAlign; // Origin of textRotation should be the base point of text drawing.\n\n applyTextRotation(ctx, style, rect, baseX, baseY);\n var boxY = textContain.adjustTextY(baseY, outerHeight, textVerticalAlign);\n var textX = baseX;\n var textY = boxY;\n\n if (needDrawBg || textPadding) {\n // Consider performance, do not call getTextWidth util necessary.\n var textWidth = textContain.getWidth(text, computedFont);\n var outerWidth = textWidth;\n textPadding && (outerWidth += textPadding[1] + textPadding[3]);\n var boxX = textContain.adjustTextX(baseX, outerWidth, textAlign);\n needDrawBg && drawBackground(hostEl, ctx, style, boxX, boxY, outerWidth, outerHeight);\n\n if (textPadding) {\n textX = getTextXForPadding(baseX, textAlign, textPadding);\n textY += textPadding[0];\n }\n } // Always set textAlign and textBase line, because it is difficute to calculate\n // textAlign from prevEl, and we dont sure whether textAlign will be reset if\n // font set happened.\n\n\n ctx.textAlign = textAlign; // Force baseline to be \"middle\". Otherwise, if using \"top\", the\n // text will offset downward a little bit in font \"Microsoft YaHei\".\n\n ctx.textBaseline = 'middle'; // Set text opacity\n\n ctx.globalAlpha = style.opacity || 1; // Always set shadowBlur and shadowOffset to avoid leak from displayable.\n\n for (var i = 0; i < SHADOW_STYLE_COMMON_PROPS.length; i++) {\n var propItem = SHADOW_STYLE_COMMON_PROPS[i];\n var styleProp = propItem[0];\n var ctxProp = propItem[1];\n var val = style[styleProp];\n\n if (!checkCache || val !== prevStyle[styleProp]) {\n ctx[ctxProp] = fixShadow(ctx, ctxProp, val || propItem[2]);\n }\n } // `textBaseline` is set as 'middle'.\n\n\n textY += lineHeight / 2;\n var textStrokeWidth = style.textStrokeWidth;\n var textStrokeWidthPrev = checkCache ? prevStyle.textStrokeWidth : null;\n var strokeWidthChanged = !checkCache || textStrokeWidth !== textStrokeWidthPrev;\n var strokeChanged = !checkCache || strokeWidthChanged || style.textStroke !== prevStyle.textStroke;\n var textStroke = getStroke(style.textStroke, textStrokeWidth);\n var textFill = getFill(style.textFill);\n\n if (textStroke) {\n if (strokeWidthChanged) {\n ctx.lineWidth = textStrokeWidth;\n }\n\n if (strokeChanged) {\n ctx.strokeStyle = textStroke;\n }\n }\n\n if (textFill) {\n if (!checkCache || style.textFill !== prevStyle.textFill) {\n ctx.fillStyle = textFill;\n }\n } // Optimize simply, in most cases only one line exists.\n\n\n if (textLines.length === 1) {\n // Fill after stroke so the outline will not cover the main part.\n textStroke && ctx.strokeText(textLines[0], textX, textY);\n textFill && ctx.fillText(textLines[0], textX, textY);\n } else {\n for (var i = 0; i < textLines.length; i++) {\n // Fill after stroke so the outline will not cover the main part.\n textStroke && ctx.strokeText(textLines[i], textX, textY);\n textFill && ctx.fillText(textLines[i], textX, textY);\n textY += lineHeight;\n }\n }\n}", "function renderPlainText(hostEl, ctx, text, style, rect, prevEl) {\n 'use strict';\n\n var needDrawBg = needDrawBackground(style);\n var prevStyle;\n var checkCache = false;\n var cachedByMe = ctx.__attrCachedBy === ContextCachedBy.PLAIN_TEXT; // Only take and check cache for `Text` el, but not RectText.\n\n if (prevEl !== WILL_BE_RESTORED) {\n if (prevEl) {\n prevStyle = prevEl.style;\n checkCache = !needDrawBg && cachedByMe && prevStyle;\n } // Prevent from using cache in `Style::bind`, because of the case:\n // ctx property is modified by other properties than `Style::bind`\n // used, and Style::bind is called next.\n\n\n ctx.__attrCachedBy = needDrawBg ? ContextCachedBy.NONE : ContextCachedBy.PLAIN_TEXT;\n } // Since this will be restored, prevent from using these props to check cache in the next\n // entering of this method. But do not need to clear other cache like `Style::bind`.\n else if (cachedByMe) {\n ctx.__attrCachedBy = ContextCachedBy.NONE;\n }\n\n var styleFont = style.font || DEFAULT_FONT; // PENDING\n // Only `Text` el set `font` and keep it (`RectText` will restore). So theoretically\n // we can make font cache on ctx, which can cache for text el that are discontinuous.\n // But layer save/restore needed to be considered.\n // if (styleFont !== ctx.__fontCache) {\n // ctx.font = styleFont;\n // if (prevEl !== WILL_BE_RESTORED) {\n // ctx.__fontCache = styleFont;\n // }\n // }\n\n if (!checkCache || styleFont !== (prevStyle.font || DEFAULT_FONT)) {\n ctx.font = styleFont;\n } // Use the final font from context-2d, because the final\n // font might not be the style.font when it is illegal.\n // But get `ctx.font` might be time consuming.\n\n\n var computedFont = hostEl.__computedFont;\n\n if (hostEl.__styleFont !== styleFont) {\n hostEl.__styleFont = styleFont;\n computedFont = hostEl.__computedFont = ctx.font;\n }\n\n var textPadding = style.textPadding;\n var textLineHeight = style.textLineHeight;\n var contentBlock = hostEl.__textCotentBlock;\n\n if (!contentBlock || hostEl.__dirtyText) {\n contentBlock = hostEl.__textCotentBlock = textContain.parsePlainText(text, computedFont, textPadding, textLineHeight, style.truncate);\n }\n\n var outerHeight = contentBlock.outerHeight;\n var textLines = contentBlock.lines;\n var lineHeight = contentBlock.lineHeight;\n var boxPos = getBoxPosition(outerHeight, style, rect);\n var baseX = boxPos.baseX;\n var baseY = boxPos.baseY;\n var textAlign = boxPos.textAlign || 'left';\n var textVerticalAlign = boxPos.textVerticalAlign; // Origin of textRotation should be the base point of text drawing.\n\n applyTextRotation(ctx, style, rect, baseX, baseY);\n var boxY = textContain.adjustTextY(baseY, outerHeight, textVerticalAlign);\n var textX = baseX;\n var textY = boxY;\n\n if (needDrawBg || textPadding) {\n // Consider performance, do not call getTextWidth util necessary.\n var textWidth = textContain.getWidth(text, computedFont);\n var outerWidth = textWidth;\n textPadding && (outerWidth += textPadding[1] + textPadding[3]);\n var boxX = textContain.adjustTextX(baseX, outerWidth, textAlign);\n needDrawBg && drawBackground(hostEl, ctx, style, boxX, boxY, outerWidth, outerHeight);\n\n if (textPadding) {\n textX = getTextXForPadding(baseX, textAlign, textPadding);\n textY += textPadding[0];\n }\n } // Always set textAlign and textBase line, because it is difficute to calculate\n // textAlign from prevEl, and we dont sure whether textAlign will be reset if\n // font set happened.\n\n\n ctx.textAlign = textAlign; // Force baseline to be \"middle\". Otherwise, if using \"top\", the\n // text will offset downward a little bit in font \"Microsoft YaHei\".\n\n ctx.textBaseline = 'middle'; // Set text opacity\n\n ctx.globalAlpha = style.opacity || 1; // Always set shadowBlur and shadowOffset to avoid leak from displayable.\n\n for (var i = 0; i < SHADOW_STYLE_COMMON_PROPS.length; i++) {\n var propItem = SHADOW_STYLE_COMMON_PROPS[i];\n var styleProp = propItem[0];\n var ctxProp = propItem[1];\n var val = style[styleProp];\n\n if (!checkCache || val !== prevStyle[styleProp]) {\n ctx[ctxProp] = fixShadow(ctx, ctxProp, val || propItem[2]);\n }\n } // `textBaseline` is set as 'middle'.\n\n\n textY += lineHeight / 2;\n var textStrokeWidth = style.textStrokeWidth;\n var textStrokeWidthPrev = checkCache ? prevStyle.textStrokeWidth : null;\n var strokeWidthChanged = !checkCache || textStrokeWidth !== textStrokeWidthPrev;\n var strokeChanged = !checkCache || strokeWidthChanged || style.textStroke !== prevStyle.textStroke;\n var textStroke = getStroke(style.textStroke, textStrokeWidth);\n var textFill = getFill(style.textFill);\n\n if (textStroke) {\n if (strokeWidthChanged) {\n ctx.lineWidth = textStrokeWidth;\n }\n\n if (strokeChanged) {\n ctx.strokeStyle = textStroke;\n }\n }\n\n if (textFill) {\n if (!checkCache || style.textFill !== prevStyle.textFill) {\n ctx.fillStyle = textFill;\n }\n } // Optimize simply, in most cases only one line exists.\n\n\n if (textLines.length === 1) {\n // Fill after stroke so the outline will not cover the main part.\n textStroke && ctx.strokeText(textLines[0], textX, textY);\n textFill && ctx.fillText(textLines[0], textX, textY);\n } else {\n for (var i = 0; i < textLines.length; i++) {\n // Fill after stroke so the outline will not cover the main part.\n textStroke && ctx.strokeText(textLines[i], textX, textY);\n textFill && ctx.fillText(textLines[i], textX, textY);\n textY += lineHeight;\n }\n }\n}", "function renderPlainText(hostEl, ctx, text, style, rect, prevEl) {\n 'use strict';\n\n var needDrawBg = needDrawBackground(style);\n var prevStyle;\n var checkCache = false;\n var cachedByMe = ctx.__attrCachedBy === ContextCachedBy.PLAIN_TEXT; // Only take and check cache for `Text` el, but not RectText.\n\n if (prevEl !== WILL_BE_RESTORED) {\n if (prevEl) {\n prevStyle = prevEl.style;\n checkCache = !needDrawBg && cachedByMe && prevStyle;\n } // Prevent from using cache in `Style::bind`, because of the case:\n // ctx property is modified by other properties than `Style::bind`\n // used, and Style::bind is called next.\n\n\n ctx.__attrCachedBy = needDrawBg ? ContextCachedBy.NONE : ContextCachedBy.PLAIN_TEXT;\n } // Since this will be restored, prevent from using these props to check cache in the next\n // entering of this method. But do not need to clear other cache like `Style::bind`.\n else if (cachedByMe) {\n ctx.__attrCachedBy = ContextCachedBy.NONE;\n }\n\n var styleFont = style.font || DEFAULT_FONT; // PENDING\n // Only `Text` el set `font` and keep it (`RectText` will restore). So theoretically\n // we can make font cache on ctx, which can cache for text el that are discontinuous.\n // But layer save/restore needed to be considered.\n // if (styleFont !== ctx.__fontCache) {\n // ctx.font = styleFont;\n // if (prevEl !== WILL_BE_RESTORED) {\n // ctx.__fontCache = styleFont;\n // }\n // }\n\n if (!checkCache || styleFont !== (prevStyle.font || DEFAULT_FONT)) {\n ctx.font = styleFont;\n } // Use the final font from context-2d, because the final\n // font might not be the style.font when it is illegal.\n // But get `ctx.font` might be time consuming.\n\n\n var computedFont = hostEl.__computedFont;\n\n if (hostEl.__styleFont !== styleFont) {\n hostEl.__styleFont = styleFont;\n computedFont = hostEl.__computedFont = ctx.font;\n }\n\n var textPadding = style.textPadding;\n var textLineHeight = style.textLineHeight;\n var contentBlock = hostEl.__textCotentBlock;\n\n if (!contentBlock || hostEl.__dirtyText) {\n contentBlock = hostEl.__textCotentBlock = textContain.parsePlainText(text, computedFont, textPadding, textLineHeight, style.truncate);\n }\n\n var outerHeight = contentBlock.outerHeight;\n var textLines = contentBlock.lines;\n var lineHeight = contentBlock.lineHeight;\n var boxPos = getBoxPosition(_tmpBoxPositionResult, hostEl, style, rect);\n var baseX = boxPos.baseX;\n var baseY = boxPos.baseY;\n var textAlign = boxPos.textAlign || 'left';\n var textVerticalAlign = boxPos.textVerticalAlign; // Origin of textRotation should be the base point of text drawing.\n\n applyTextRotation(ctx, style, rect, baseX, baseY);\n var boxY = textContain.adjustTextY(baseY, outerHeight, textVerticalAlign);\n var textX = baseX;\n var textY = boxY;\n\n if (needDrawBg || textPadding) {\n // Consider performance, do not call getTextWidth util necessary.\n var textWidth = textContain.getWidth(text, computedFont);\n var outerWidth = textWidth;\n textPadding && (outerWidth += textPadding[1] + textPadding[3]);\n var boxX = textContain.adjustTextX(baseX, outerWidth, textAlign);\n needDrawBg && drawBackground(hostEl, ctx, style, boxX, boxY, outerWidth, outerHeight);\n\n if (textPadding) {\n textX = getTextXForPadding(baseX, textAlign, textPadding);\n textY += textPadding[0];\n }\n } // Always set textAlign and textBase line, because it is difficute to calculate\n // textAlign from prevEl, and we dont sure whether textAlign will be reset if\n // font set happened.\n\n\n ctx.textAlign = textAlign; // Force baseline to be \"middle\". Otherwise, if using \"top\", the\n // text will offset downward a little bit in font \"Microsoft YaHei\".\n\n ctx.textBaseline = 'middle'; // Set text opacity\n\n ctx.globalAlpha = style.opacity || 1; // Always set shadowBlur and shadowOffset to avoid leak from displayable.\n\n for (var i = 0; i < SHADOW_STYLE_COMMON_PROPS.length; i++) {\n var propItem = SHADOW_STYLE_COMMON_PROPS[i];\n var styleProp = propItem[0];\n var ctxProp = propItem[1];\n var val = style[styleProp];\n\n if (!checkCache || val !== prevStyle[styleProp]) {\n ctx[ctxProp] = fixShadow(ctx, ctxProp, val || propItem[2]);\n }\n } // `textBaseline` is set as 'middle'.\n\n\n textY += lineHeight / 2;\n var textStrokeWidth = style.textStrokeWidth;\n var textStrokeWidthPrev = checkCache ? prevStyle.textStrokeWidth : null;\n var strokeWidthChanged = !checkCache || textStrokeWidth !== textStrokeWidthPrev;\n var strokeChanged = !checkCache || strokeWidthChanged || style.textStroke !== prevStyle.textStroke;\n var textStroke = getStroke(style.textStroke, textStrokeWidth);\n var textFill = getFill(style.textFill);\n\n if (textStroke) {\n if (strokeWidthChanged) {\n ctx.lineWidth = textStrokeWidth;\n }\n\n if (strokeChanged) {\n ctx.strokeStyle = textStroke;\n }\n }\n\n if (textFill) {\n if (!checkCache || style.textFill !== prevStyle.textFill) {\n ctx.fillStyle = textFill;\n }\n } // Optimize simply, in most cases only one line exists.\n\n\n if (textLines.length === 1) {\n // Fill after stroke so the outline will not cover the main part.\n textStroke && ctx.strokeText(textLines[0], textX, textY);\n textFill && ctx.fillText(textLines[0], textX, textY);\n } else {\n for (var i = 0; i < textLines.length; i++) {\n // Fill after stroke so the outline will not cover the main part.\n textStroke && ctx.strokeText(textLines[i], textX, textY);\n textFill && ctx.fillText(textLines[i], textX, textY);\n textY += lineHeight;\n }\n }\n}", "function setNormalText() {\n // Set color\n interBtn.style.background = '#6A1B9A';\n interBtn.style.color = 'white';\n\n // Reset others color\n beginBtn.style.background = 'white';\n beginBtn.style.color = '#6A1B9A';\n masterBtn.style.background = 'white';\n masterBtn.style.color = '#6A1B9A';\n\n normalText = getNormalText();\n txt.textContent = normalText;\n return normalText;\n}", "static updateStyleFromProperties(oldStyle, properties) {\n const {\n font,\n color,\n icon,\n iconSize,\n text,\n textColor,\n textSize,\n textRotation,\n } = properties;\n\n // Update Fill style if it existed.\n const fillStyle = oldStyle.getFill();\n if (fillStyle && color) {\n fillStyle.setColor(color.fill.concat(fillStyle.getColor()[3]));\n }\n\n // Update Stroke style if it existed\n const strokeStyle = oldStyle.getStroke();\n if (strokeStyle && color) {\n strokeStyle.setColor(color.fill.concat(strokeStyle.getColor()[3]));\n }\n\n // Update Text style if it existed;\n const textStyle = oldStyle.getText() ? oldStyle.getText().clone() : null;\n if (textStyle) {\n textStyle.setText(text);\n\n if (textSize) {\n textStyle.setScale(textSize.scale);\n }\n\n if (font) {\n textStyle.setFont(font);\n }\n\n if (textColor) {\n const olColor = textColor.fill.concat([1]);\n const textFill = textStyle.getFill();\n textFill.setColor(olColor);\n textStyle.setFill(textFill);\n }\n\n textStyle.setRotation(textRotation);\n }\n\n // Update Icon style if it existed.\n let iconStyle = oldStyle.getImage();\n if (iconStyle instanceof Icon && icon) {\n iconStyle = new Icon({\n src: icon.url,\n scale: iconSize.scale,\n anchor: icon.anchor,\n });\n\n // We load the icon manually to be sure the size of the image's size is set asap.\n // Useful when you use a layer's styleFunction that makes some canvas operations.\n iconStyle.load();\n }\n\n return new Style({\n fill: fillStyle,\n stroke: strokeStyle,\n text: textStyle,\n image: iconStyle,\n zIndex: oldStyle.getZIndex(),\n });\n }", "function applyThematicStyle() {\n //console.log(\"applyThematicStyle: initiated\");\n \n mapLoadMask.hide();\n \n // Create StyleMap-Object for the thematic layer\n thematicStyleMap = new OpenLayers.StyleMap({\n 'default': getThematicStyle(\"Staaten thematisch\")\n });\n staaten.addOptions({\n styleMap: thematicStyleMap\n });\n // Redraw staaten layer\n staaten.redraw();\n //console.log(\"applyThematicStyle: Layer wurde neu gezeichnet\");\n\n // Update vectorLegend\n vectorLegend.legendTitle = getActiveLegendTitle();\n vectorLegend.setRules();\n vectorLegend.update();\n \n }", "setTextTrackStyle(textTrackStyle) {\n return Native.setTextTrackStyle(textTrackStyle);\n }", "function UpdateText(ref, newText){\n // Default vals\n noStroke(0); fill(255); textSize(20); textAlign(LEFT);\n \n switch(ref){\n case (0): { text(newText, 500, 25); break;}\n case (2): { text(newText, 200, 25); break;}\n case (3): {textAlign(CENTER); text(newText, width/2, 640); break;}\n }\n\n }", "setTextStroke(color, weight) {\n this.textStroke = color;\n this.strokeWeight = weight;\n }", "function selected2style(styleCommand) {\n if (!toolbar.data(\"sourceOpened\")) {\n\n // if selected to changing the font-size value\n if (styleCommand == \"fSize\")\n styleField = fsizebar;\n\n // if selected to changing the text-color value\n else if (styleCommand == \"colors\")\n styleField = cpalette;\n\n // display the style-field\n styleFieldSwitch(styleField, true);\n\n // the event of click to style button\n styleField.find(\"a\").unbind(\"click\").click(function () {\n var styleValue = $(this).attr(vars.css + \"-styleval\"); // the property of style value to be added\n\n // if selected to changing the font-size value\n if (styleCommand == \"fSize\") {\n styleType = \"font-size\";\n styleValue = styleValue + vars.funit; // combine the value with size unit\n }\n // if selected to changing the text-color value\n else if (styleCommand == \"colors\") {\n styleType = \"color\";\n styleValue = \"rgb(\" + styleValue + \")\"; // combine color value with rgb\n }\n\n var prevStyles = refuseStyle(styleType); // affect styles to child tags (and extract to the new style attributes)\n\n // change to selected text\n replaceSelection(\"span\", \"style\", styleType + \":\" + styleValue + \";\" + prevStyles);\n\n // hide all style-fields\n styleFieldSwitch(\"\", false);\n\n // remove title bubbles\n $('.' + vars.css + '_title').remove();\n\n // export contents of the text to the sources\n editor.trigger(\"change\");\n });\n\n }\n else\n // hide the style-field\n styleFieldSwitch(styleField, false);\n\n // hide the link-form-field\n linkAreaSwitch(false);\n }", "getStyle() {\n const DEFAULTS = RectObject.defaultProps.style;\n return Object.assign({}, DEFAULTS, this.props.style || {});\n }", "function LK_applyNormalStyle(elem) {\n elem.style.fontWeight = 'normal';\n elem.style.backgroundColor = 'white';\n}", "function Styles() {\n\n var defaultTraits = {\n\n 'no-fill': {\n fill: 'none'\n },\n 'no-border': {\n strokeOpacity: 0.0\n },\n 'no-events': {\n pointerEvents: 'none'\n }\n };\n\n var self = this;\n\n /**\n * Builds a style definition from a className, a list of traits and an object of additional attributes.\n *\n * @param {string} className\n * @param {Array<string>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n this.cls = function(className, traits, additionalAttrs) {\n var attrs = this.style(traits, additionalAttrs);\n\n return assign$1(attrs, { 'class': className });\n };\n\n /**\n * Builds a style definition from a list of traits and an object of additional attributes.\n *\n * @param {Array<string>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n this.style = function(traits, additionalAttrs) {\n\n if (!isArray$2(traits) && !additionalAttrs) {\n additionalAttrs = traits;\n traits = [];\n }\n\n var attrs = reduce(traits, function(attrs, t) {\n return assign$1(attrs, defaultTraits[t] || {});\n }, {});\n\n return additionalAttrs ? assign$1(attrs, additionalAttrs) : attrs;\n };\n\n this.computeStyle = function(custom, traits, defaultStyles) {\n if (!isArray$2(traits)) {\n defaultStyles = traits;\n traits = [];\n }\n\n return self.style(traits || [], assign$1({}, defaultStyles, custom || {}));\n };\n}", "getStyle() {\n const style = {};\n if (this.blockDef.bold) {\n style.fontWeight = \"bold\";\n }\n if (this.blockDef.italic) {\n style.fontStyle = \"italic\";\n }\n if (this.blockDef.underline) {\n style.textDecoration = \"underline\";\n }\n if (this.blockDef.align) {\n style.textAlign = this.blockDef.align;\n }\n // Multiline is only when not markdown\n if (this.blockDef.multiline && !this.blockDef.markdown) {\n style.whiteSpace = \"pre-line\";\n }\n return style;\n }", "function getDefaultValue(style, direction) {\r\n if (style === 'width') {\r\n return direction === 'horizontal' ? DEFAULT_WIDTH : '100%';\r\n }\r\n else {\r\n return direction === 'vertical' ? DEFAULT_HEIGHT : '100%';\r\n }\r\n}", "function Styles() {\n\n var defaultTraits = {\n\n 'no-fill': {\n fill: 'none'\n },\n 'no-border': {\n strokeOpacity: 0.0\n },\n 'no-events': {\n pointerEvents: 'none'\n }\n };\n\n var self = this;\n\n /**\n * Builds a style definition from a className, a list of traits and an object of additional attributes.\n *\n * @param {String} className\n * @param {Array<String>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n this.cls = function(className, traits, additionalAttrs) {\n var attrs = this.style(traits, additionalAttrs);\n\n return assign(attrs, { 'class': className });\n };\n\n /**\n * Builds a style definition from a list of traits and an object of additional attributes.\n *\n * @param {Array<String>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n this.style = function(traits, additionalAttrs) {\n\n if (!isArray(traits) && !additionalAttrs) {\n additionalAttrs = traits;\n traits = [];\n }\n\n var attrs = reduce(traits, function(attrs, t) {\n return assign(attrs, defaultTraits[t] || {});\n }, {});\n\n return additionalAttrs ? assign(attrs, additionalAttrs) : attrs;\n };\n\n this.computeStyle = function(custom, traits, defaultStyles) {\n if (!isArray(traits)) {\n defaultStyles = traits;\n traits = [];\n }\n\n return self.style(traits || [], assign(defaultStyles, custom || {}));\n };\n}", "function applyTextPlacement(textCanvas, placement) {\n // Setup TextCanvas layout settings of the new placement as it is required for further\n // TextBufferObject creation and measurements in addText().\n textCanvas.textLayoutStyle.horizontalAlignment = harp_text_canvas_1.hAlignFromPlacement(placement.h);\n textCanvas.textLayoutStyle.verticalAlignment = harp_text_canvas_1.vAlignFromPlacement(placement.v);\n}", "function setTextStyle(feature, resolution)\n {\n return new ol.style.Text({\n text:feature.get('name'),\n font: CONF_label_font,\n fill: new ol.style.Fill({color: CONF_label_color}),\n offsetX: CONF_label_offsetX,\n offsetY: CONF_label_offsetY\n });\n }", "createStyle(styleString) {\n this.createStyleIn(styleString);\n }", "function refuseStyle(refStyle) {\n var selectedTag = getSelectedNode(); // the selected node\n\n // if the selected node have attribute of \"style\" and it have unwanted style\n if (selectedTag && selectedTag.is(\"[style]\") && selectedTag.css(refStyle) != \"\") {\n var refValue = selectedTag.css(refStyle); // first get key of unwanted style\n\n selectedTag.css(refStyle, \"\"); // clear unwanted style\n\n var cleanStyle = selectedTag.attr(\"style\"); // cleaned style\n\n selectedTag.css(refStyle, refValue); // add unwanted style to the selected node again\n\n return cleanStyle; // print cleaned style\n }\n else\n return \"\";\n }", "function initialTractStyle(data) {\n\t\tvar id, _tid, _rid, d, estOrMar;\n\t\t_tid = cleanTID(data.properties.TID);\n\t\t_rid = data.properties.RID;\n\t\t//if (MAP_DEBUG) console.log(\" -> initialTractStyle() -> _tid = \", _tid, \" // _rid = \", _rid, \" // data = \", data);\n\n\t\t/*\n\t\t\t\tif (tractOrRegion == \"t\")\n\t\t\t\t\tid = _tid;\n\t\t\t\telse if (tractOrRegion == \"r\")\n\t\t\t\t\tid = _rid;\n\t\t*/\n\n\t\t// set default style\n\t\tvar defaultStyle = {\n\t\t\tfillColor: \"#000000\",\n\t\t\tweight: 1,\n\t\t\topacity: 0.5,\n\t\t\tcolor: 'white',\n\t\t\tfillOpacity: 0.7\n\t\t};\n\t\t// if we are showing estimate updateScale\n\t\tif (estimateOrMargin == \"e\") {\n\t\t\t// set color scale\n\t\t\tColor.updateScale();\n\t\t}\n\n\t\t// make sure _tid exists\n\t\tif (prop(currentScenario) && currentScenario[_tid]) {\n\t\t\t//if (MAP_DEBUG) console.log(\" -> initialTractStyle() -> setting style based on data\");\n\n\t\t\tlet val = 0;\n\n\t\t\t// determine whether to store tract / region AND estimate / margin\n\t\t\tif (estimateOrMargin == \"e\") {\n\t\t\t\tval = currentScenario[_tid][tractOrRegion + \"Est\"];\n\t\t\t\t//if (MAP_DEBUG) console.log(\" -> Mns.initialTractStyle() -> E\", \", val = \" + val, \", fillColor = \" + Color.getScale(val));\n\t\t\t\tdefaultStyle.fillColor = Color.getScale(val);\n\t\t\t} else if (estimateOrMargin == \"m\") {\n\t\t\t\tval = currentScenario[_tid][tractOrRegion + \"CV\"];\n\t\t\t\t//if (MAP_DEBUG) console.log(\" -> Mns.initialTractStyle() -> M\");\n\t\t\t\t// color by CV, but display MOE\n\t\t\t\tdefaultStyle.fillColor = Color.cvColorScale(val);\n\t\t\t}\n\n\t\t\t/*\n\t\t\t\t\t\t// use TID (without \"g\") or RID as a reference with currentScenario to get estimate\n\t\t\t\t\t\tif (tractOrRegion == \"t\")\n\t\t\t\t\t\t\td = currentScenario[_tid].tEst;\n\t\t\t\t\t\telse if (tractOrRegion == \"r\")\n\t\t\t\t\t\t\td = currentScenario[_tid].rEst;\n\n\t\t\t\t\t\t// update style color\n\t\t\t\t\t\tdefaultStyle.fillColor = blues(d);\n\t\t\t*/\n\t\t} // if no TID, currentScenario, or data found\n\t\telse {\n\t\t\tif (MAP_DEBUG) console.log(\" -> Mns.initialTractStyle() -> NO DATA, RETURNING DEFAULT STYLE\");\n\t\t\t// else just make default style transparent\n\t\t\tdefaultStyle.fillColor = \"#00000000\";\n\t\t}\n\t\t// return style object\n\t\treturn defaultStyle;\n\t}", "componentWillMount() {\n Text.defaultProps.style = {\n fontFamily: 'Roboto',\n color: '#444',\n };\n }", "getDefaultStyles() {\n const styles = [\n {\n key: 'mainTitle',\n style: { progress: 0 },\n },\n {\n key: 'subTitle',\n style: { progress: 0 },\n data: { precededBy: 'mainTitle' },\n },\n {\n key: 'divider',\n style: { progress: 0 },\n data: { precededBy: 'subTitle' },\n },\n {\n key: 'summary',\n style: { progress: 0 },\n data: { precededBy: 'divider', triggeredAt: 0.55 },\n },\n ];\n\n // Setup the icon styles using a loop, since they're all super similar.\n for (var i = 1; i <= 7; i++) {\n styles.push({\n key: 'icon' + i,\n style: { progress: 0 },\n data: { precededBy: 'divider', triggeredAt: (0.14 * i - 0.05) },\n });\n }\n\n return styles;\n }", "function configureStyles(){\n\t var _ = nvd3Utils.deepExtend(defaultStyles(), scope.options['styles'] || {});\n\n\t if (scope._config.extended) scope.options['styles'] = _;\n\n\t angular.forEach(_.classes, function(value, key){\n\t value ? element.addClass(key) : element.removeClass(key);\n\t });\n\n\t element.removeAttr('style').css(_.css);\n\t }", "function getDefaultValue(style, direction) {\n if (style === 'width') {\n return direction === 'horizontal' ? DEFAULT_WIDTH : '100%';\n }\n else {\n return direction === 'vertical' ? DEFAULT_HEIGHT : '100%';\n }\n}", "function getDefaultValue(style, direction) {\n if (style === 'width') {\n return direction === 'horizontal' ? DEFAULT_WIDTH : '100%';\n }\n else {\n return direction === 'vertical' ? DEFAULT_HEIGHT : '100%';\n }\n}", "function getDefaultValue(style, direction) {\n if (style === 'width') {\n return direction === 'horizontal' ? DEFAULT_WIDTH : '100%';\n }\n else {\n return direction === 'vertical' ? DEFAULT_HEIGHT : '100%';\n }\n}", "isCustomStyleApplied(editorState: EditorState) {\n const { selection, doc } = editorState;\n const { from, to } = selection;\n let customStyleName = RESERVED_STYLE_NONE;\n doc.nodesBetween(from, to, (node, pos) => {\n if (node.attrs.styleName) {\n customStyleName = node.attrs.styleName;\n }\n });\n return customStyleName;\n }", "reset() {\n Utils.deepCopyProperties(this, defaultStyle, defaultStyle);\n }", "function default_txt_c( col )\n\n // Set or return default text colour\n //\n // col: Default colour\n{\n if ( typeof col === \"undefined\" ) {\t// No new value provided?\n return dflt_txt_col;\t\t// Return value\n } else {\n dflt_txt_col = col;\t\t\t// Set value\n }\n}\t\t\t\t\t// End function default_txt_c", "function configureStyles(){\n var _ = nvd3Utils.deepExtend(defaultStyles(), scope.options['styles'] || {});\n\n if (scope._config.extended) scope.options['styles'] = _;\n\n angular.forEach(_.classes, function(value, key){\n value ? element.addClass(key) : element.removeClass(key);\n });\n\n element.removeAttr('style').css(_.css);\n }", "function configureStyles(){\n var _ = nvd3Utils.deepExtend(defaultStyles(), scope.options['styles'] || {});\n\n if (scope._config.extended) scope.options['styles'] = _;\n\n angular.forEach(_.classes, function(value, key){\n value ? element.addClass(key) : element.removeClass(key);\n });\n\n element.removeAttr('style').css(_.css);\n }", "function getDefaultFontSettings() {\n return {font: \"verdana\", size: 1};\n}", "function changeText_Back() {\n var sen = document.getElementById(\"changeMe\");\n sen.style.fontStyle = \"\";\n sen.style.fontWeight = \"\";\n sen.style.color = \"\";\n var sen2 = document.getElementById(\"changeMe2\");\n sen2.style.fontStyle = \"\";\n sen2.style.fontWeight = \"\";\n sen2.style.color = \"\";\n}", "function _updateDefaultFromTheme(componentContext) {\n var themeDefault = ThemeUtils.parseJSONFromFontFamily('oj-form-layout-option-defaults') || {}; // componentContext.props.labelEdge = themeDefault;\n\n if (componentContext) {\n if (!componentContext.props.labelEdge) {\n element.labelEdge = themeDefault.labelEdge;\n }\n\n if (!componentContext.props.colspanWrap) {\n element.colspanWrap = themeDefault.colspanWrap;\n }\n\n if (!componentContext.props.direction) {\n element.direction = themeDefault.direction;\n }\n } else {\n if (!element.labelEdge) {\n element.labelEdge = themeDefault.labelEdge;\n }\n\n if (!element.colspanWrap) {\n element.colspanWrap = themeDefault.colspanWrap;\n }\n\n if (!element.direction) {\n element.direction = themeDefault.direction;\n }\n }\n }", "getMessageStyle() {\n\t\treturn {\n\t\t\tfontSize: 20,\n\t\t\tcolor: this.state.color,\n\t\t\talignSelf: 'center'\n\t\t};\n\t}", "function setLabelLineStyle(targetEl, statesModels, defaultStyle) {\n var labelLine = targetEl.getTextGuideLine();\n var label = targetEl.getTextContent();\n\n if (!label) {\n // Not show label line if there is no label.\n if (labelLine) {\n targetEl.removeTextGuideLine();\n }\n\n return;\n }\n\n var normalModel = statesModels.normal;\n var showNormal = normalModel.get('show');\n var labelIgnoreNormal = label.ignore;\n\n for (var i = 0; i < _util_states__WEBPACK_IMPORTED_MODULE_9__[/* DISPLAY_STATES */ \"a\"].length; i++) {\n var stateName = _util_states__WEBPACK_IMPORTED_MODULE_9__[/* DISPLAY_STATES */ \"a\"][i];\n var stateModel = statesModels[stateName];\n var isNormal = stateName === 'normal';\n\n if (stateModel) {\n var stateShow = stateModel.get('show');\n var isLabelIgnored = isNormal ? labelIgnoreNormal : Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_6__[/* retrieve2 */ \"P\"])(label.states[stateName] && label.states[stateName].ignore, labelIgnoreNormal);\n\n if (isLabelIgnored // Not show when label is not shown in this state.\n || !Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_6__[/* retrieve2 */ \"P\"])(stateShow, showNormal) // Use normal state by default if not set.\n ) {\n var stateObj = isNormal ? labelLine : labelLine && labelLine.states.normal;\n\n if (stateObj) {\n stateObj.ignore = true;\n }\n\n continue;\n } // Create labelLine if not exists\n\n\n if (!labelLine) {\n labelLine = new _util_graphic__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"]();\n targetEl.setTextGuideLine(labelLine); // Reset state of normal because it's new created.\n // NOTE: NORMAL should always been the first!\n\n if (!isNormal && (labelIgnoreNormal || !showNormal)) {\n setLabelLineState(labelLine, true, 'normal', statesModels.normal);\n } // Use same state proxy.\n\n\n if (targetEl.stateProxy) {\n labelLine.stateProxy = targetEl.stateProxy;\n }\n }\n\n setLabelLineState(labelLine, false, stateName, stateModel);\n }\n }\n\n if (labelLine) {\n Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_6__[/* defaults */ \"j\"])(labelLine.style, defaultStyle); // Not fill.\n\n labelLine.style.fill = null;\n var showAbove = normalModel.get('showAbove');\n var labelLineConfig = targetEl.textGuideLineConfig = targetEl.textGuideLineConfig || {};\n labelLineConfig.showAbove = showAbove || false; // Custom the buildPath.\n\n labelLine.buildPath = buildLabelLinePath;\n }\n}", "function styleNull() {\n this.style.removeProperty(name);\n }", "function updateTextPadding() {\n var styles = wrapper.styles,\n textAlign = styles && styles.textAlign,\n x = paddingLeft + padding * (1 - alignFactor),\n y;\n \n // determin y based on the baseline\n y = baseline ? 0 : baselineOffset;\n \n // compensate for alignment\n if (defined(width) && bBox && (textAlign === 'center' || textAlign === 'right')) {\n x += { center: 0.5, right: 1 }[textAlign] * (width - bBox.width);\n }\n \n // update if anything changed\n if (x !== text.x || y !== text.y) {\n text.attr('x', x);\n if (y !== UNDEFINED) {\n text.attr('y', y);\n }\n }\n \n // record current values\n text.x = x;\n text.y = y;\n }" ]
[ "0.84850574", "0.84850574", "0.6956331", "0.6817606", "0.6408872", "0.6376766", "0.60561687", "0.59187925", "0.5891205", "0.58824885", "0.57079303", "0.5669912", "0.56262016", "0.55825406", "0.5580179", "0.5564394", "0.5562992", "0.55597496", "0.5514771", "0.5510497", "0.5500849", "0.5500849", "0.548925", "0.5468809", "0.5419351", "0.5310263", "0.5295394", "0.52916235", "0.52528584", "0.5244763", "0.51474404", "0.51346296", "0.5113088", "0.5113088", "0.5113088", "0.5107918", "0.5087092", "0.50860953", "0.50625116", "0.5028022", "0.4989059", "0.4977153", "0.49635136", "0.4929057", "0.4929057", "0.4929057", "0.4923781", "0.49098527", "0.48872173", "0.48819122", "0.48427826", "0.4796476", "0.4795818", "0.4759505", "0.47545734", "0.470978", "0.47066408", "0.470459", "0.46780306", "0.46764377", "0.46764377", "0.46764377", "0.46764377", "0.46727166", "0.46465376", "0.4614649", "0.4612934", "0.46030325", "0.45901766", "0.4562482", "0.45483065", "0.4544792", "0.4543687", "0.45299184", "0.45239714", "0.45192873", "0.45175028", "0.45120537", "0.4510776", "0.44964358", "0.4487451", "0.4486316", "0.44802406", "0.44752803", "0.44732893", "0.44732893", "0.44732893", "0.4470698", "0.4469723", "0.44688088", "0.44574255", "0.44574255", "0.4456466", "0.44528103", "0.44496536", "0.44416922", "0.4433106", "0.44306418", "0.4428074" ]
0.86113167
1
Apply group transition animation from g1 to g2. If no animatableModel, no animation.
function groupTransition(g1, g2, animatableModel, cb) { if (!g1 || !g2) { return; } function getElMap(g) { var elMap = {}; g.traverse(function (el) { if (!el.isGroup && el.anid) { elMap[el.anid] = el; } }); return elMap; } function getAnimatableProps(el) { var obj = { position: vector.clone(el.position), rotation: el.rotation }; if (el.shape) { obj.shape = zrUtil.extend({}, el.shape); } return obj; } var elMap1 = getElMap(g1); g2.traverse(function (el) { if (!el.isGroup && el.anid) { var oldEl = elMap1[el.anid]; if (oldEl) { var newProp = getAnimatableProps(el); el.attr(getAnimatableProps(oldEl)); updateProps(el, newProp, animatableModel, el.dataIndex); } // else { // if (el.previousProps) { // graphic.updateProps // } // } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function groupTransition(g1, g2, animatableModel) {\n\t if (!g1 || !g2) {\n\t return;\n\t }\n\t\n\t function getElMap(g) {\n\t var elMap = {};\n\t g.traverse(function (el) {\n\t if (isNotGroup(el) && el.anid) {\n\t elMap[el.anid] = el;\n\t }\n\t });\n\t return elMap;\n\t }\n\t\n\t function getAnimatableProps(el) {\n\t var obj = {\n\t x: el.x,\n\t y: el.y,\n\t rotation: el.rotation\n\t };\n\t\n\t if (isPath(el)) {\n\t obj.shape = extend({}, el.shape);\n\t }\n\t\n\t return obj;\n\t }\n\t\n\t var elMap1 = getElMap(g1);\n\t g2.traverse(function (el) {\n\t if (isNotGroup(el) && el.anid) {\n\t var oldEl = elMap1[el.anid];\n\t\n\t if (oldEl) {\n\t var newProp = getAnimatableProps(el);\n\t el.attr(getAnimatableProps(oldEl));\n\t updateProps(el, newProp, animatableModel, getECData(el).dataIndex);\n\t }\n\t }\n\t });\n\t }", "function groupTransition(g1, g2, animatableModel) {\n if (!g1 || !g2) {\n return;\n }\n\n function getElMap(g) {\n var elMap = {};\n g.traverse(function (el) {\n if (isNotGroup(el) && el.anid) {\n elMap[el.anid] = el;\n }\n });\n return elMap;\n }\n\n function getAnimatableProps(el) {\n var obj = {\n x: el.x,\n y: el.y,\n rotation: el.rotation\n };\n\n if (isPath(el)) {\n obj.shape = Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_26__[/* extend */ \"m\"])({}, el.shape);\n }\n\n return obj;\n }\n\n var elMap1 = getElMap(g1);\n g2.traverse(function (el) {\n if (isNotGroup(el) && el.anid) {\n var oldEl = elMap1[el.anid];\n\n if (oldEl) {\n var newProp = getAnimatableProps(el);\n el.attr(getAnimatableProps(oldEl));\n updateProps(el, newProp, animatableModel, Object(_innerStore__WEBPACK_IMPORTED_MODULE_27__[/* getECData */ \"a\"])(el).dataIndex);\n }\n }\n });\n}", "function transitionGroup() {\n vis.selectAll(\"g.layer rect\")\n .transition()\n .duration(500)\n .delay(function(d, i) { return (i % m) * 10; })\n .attr(\"x\", function(d, i) { return x({x: .9 * ~~(i / m) / n}); })\n .attr(\"width\", x({x: .9 / n}))\n .each(\"end\", transitionEnd);\n\n function transitionEnd() {\n d3.select(this)\n .transition()\n .duration(500)\n .attr(\"y\", function(d) { return height - y2(d); })\n .attr(\"height\", y2);\n }\n }", "function animateUngrouping(group) {\n var GAP = 10; //we want a 10 pixel gap between objects to show that they're no longer grouped together.\n //Figure out which is the left most and which is the right most object. The left most object will move left and the right most object will move right. TODO: What implications does this have for the rest of the scene? For example, when the left most object is also one connected to an object to its right. Do we want to put in additional rules to deal with this, or are we going to calculate the \"left-most\" and \"right-most\" objects as whatever groups of objects we'll need to move. Should we instead move the smaller of the two objects away from the larger of the two. What about generalizability? What happens when we've got 2 groups of objects that need to ungroup, or alternately what if the object is connected to multiple things at once, how do we move it away from the object that it was just ungrouped from, while keeping it connected to the objects it's still grouped with. Do we animate both sets of objects or just one set of objects?\n \n //Lets start with the simplest case and go from there. 2 objects are grouped together and we just want to move them apart.\n //There are 2 possibilities. Either they are partially overlapping (or connected on the edges), or one object is contained within the other.\n //Figure out which one is the correct one. Then figure out which direction to move them and which object we're moving if we're not moving both.\n //If object 1 is contained within object 2.\n if(objectContainedInObject(group.obj1, group.obj2)) {\n //alert(\"check 1\" + group.obj1.id + \" contained in \" + group.obj2.id);\n //For now just move the object that's contained within the other object toward the left until it's no longer overlapping.\n //Also make sure you're not moving it off screen.\n while((group.obj1.offsetLeft + group.obj1.offsetWidth + GAP > group.obj2.offsetLeft) &&\n (group.obj1.offsetLeft - STEP > 0)) {\n move(group.obj1, group.obj1.offsetLeft - STEP, group.obj1.offsetTop, false);\n }\n }\n //If object 2 is contained within object 1.\n else if(objectContainedInObject(group.obj2, group.obj1)) {\n //alert(\"check 2\" + group.obj2.id + \" contained in \" + group.obj1.id);\n //For now just move the object that's contained within the other object toward the left until it's no longer overlapping.\n //Also make sure you're not moving it off screen.\n \n while((group.obj2.offsetLeft + group.obj2.offsetWidth + GAP > group.obj1.offsetLeft) &&\n (group.obj2.offsetLeft - STEP > 0)) {\n move(group.obj2, group.obj2.offsetLeft - STEP, group.obj2.offsetTop, false);\n }\n }\n //Otherwise, partially overlapping or connected on the edges.\n else {\n //Figure out which is the leftmost object.\n if(group.obj1.offsetLeft < group.obj2.offsetLeft) {\n //Move obj1 left by STEP and obj2 right by STEP until there's a distance of 10 pixels between them.\n //Also make sure you're not moving either object offscreen.\n while(group.obj1.offsetLeft + group.obj1.offsetWidth + GAP > group.obj2.offsetLeft) {\n if(group.obj1.offsetLeft - STEP > 0)\n move(group.obj1, group.obj1.offsetLeft - STEP, group.obj1.offsetTop, false);\n \n if(group.obj2.offsetLeft + group.obj2.offsetWidth + STEP < window.innerWidth)\n move(group.obj2, group.obj2.offsetLeft + STEP, group.obj1.offsetTop, false);\n }\n }\n else {\n //Move obj2 left by STEP and obj1 right by STEP until there's a distance of 10 pixels between them.\n //Change the location of the object.\n while(group.obj2.offsetLeft + group.obj2.offsetWidth + GAP > group.obj1.offsetLeft) {\n if(group.obj1.offsetLeft + group.obj1.offsetWidth + STEP < window.innerWidth)\n move(group.obj1, group.obj1.offsetLeft + STEP, group.obj1.offsetTop, false);\n \n if(group.obj2.offsetLeft - STEP > 0)\n move(group.obj2, group.obj2.offsetLeft - STEP, group.obj2.offsetTop, false);\n }\n }\n }\n}", "function transition(d) {\n if (transitioning || !d) return;\n transitioning = true;\n var g2 = display(d),\n t1 = g1.transition().duration(650),\n t2 = g2.transition().duration(650);\n // Update the domain only after entering new elements.\n x.domain([d.x0, d.x1]);\n y.domain([d.y0, d.y1]);\n // Enable anti-aliasing during the transition.\n svg.style(\"shape-rendering\", null);\n // Draw child nodes on top of parent nodes.\n svg.selectAll(\".depth\").sort(function(a, b) {\n return a.depth - b.depth;\n });\n // Fade-in entering text.\n g2.selectAll(\"text\").style(\"fill-opacity\", 0);\n g2.selectAll(\"foreignObject div\").style(\"display\", \"none\");\n /*added*/\n // Transition to the new view.\n t1.selectAll(\"text\")\n .call(text)\n .style(\"fill-opacity\", 0);\n t2.selectAll(\"text\")\n .call(text)\n .style(\"fill-opacity\", 1);\n t1.selectAll(\"rect\").call(rect);\n t2.selectAll(\"rect\").call(rect);\n\n /* Foreign object */\n t1.selectAll(\".textdiv\").style(\"display\", \"none\");\n /* added */\n t1.selectAll(\".foreignobj\").call(foreign);\n /* added */\n t2.selectAll(\".textdiv\").style(\"display\", \"block\");\n /* added */\n t2.selectAll(\".foreignobj\").call(foreign);\n /* added */\n // Remove the old node when the transition is finished.\n t1.on(\"end.remove\", function() {\n this.remove();\n transitioning = false;\n });\n }", "updateAnimation() {\n this.animator.animate();\n }", "function switchAnimation(group) {\n [$main_animation, $jackpot_odometers, $win_odometers].forEach(function (item) {\n item.each(function () {\n var data_group = $(this).attr('data-group');\n $(this).toggle(data_group == group);\n });\n });\n stretchVideo();\n}", "attachAnimations( group ) {\n this.log(\"Animation group:\"+group.name, group);\n var animationGroup = new BABYLON.AnimationGroup(group.name, this.scene);\n group.animations.forEach( a => {\n // CHECKME: fps\n var animation = new BABYLON.Animation( a.animationName, a.propertyName, a.fps, a.dataType, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);\n animation.enableBlending = true;\n animation.blendingSpeed = 0.1;\n var bone = this.skeleton.getBoneIndexByName(a.targetName);\n if ( bone >= 0 ) {\n var target = this.skeleton.bones[bone].getTransformNode();\n } else {\n console.log(\"Missing target \"+a.targetName);\n return;\n }\n var keys = [];\n if ( a.dataType == BABYLON.Animation.ANIMATIONTYPE_VECTOR3 ) {\n a.keys.forEach( key => {\n var k = {frame: key.frame, value:new BABYLON.Vector3(key.value.x, key.value.y, key.value.z)};\n if ( key.interpolation ) {\n k.interpolation = key.interpolation;\n }\n keys.push( k );\n });\n } else if ( a.dataType == BABYLON.Animation.ANIMATIONTYPE_QUATERNION ) {\n a.keys.forEach( key => {\n keys.push( {frame: key.frame, value:new BABYLON.Quaternion(key.value.x, key.value.y, key.value.z, key.value.w)} );\n });\n } else {\n // ERROR\n console.log(\"Unsupported datatype \"+a.dataType);\n }\n animation.setKeys(keys);\n animationGroup.addTargetedAnimation(animation, target);\n });\n \n animationGroup.loopAnimation = true; // CHECKME\n \n var groups = this.getAnimationGroups();\n for ( var i = 0; i < groups.length; i++ ) {\n if ( groups[i].name == animationGroup.name ) {\n var old = groups[i];\n console.log(\"old\",old);\n groups[i] = animationGroup;\n if ( old.isPlaying ) {\n old.stop();\n }\n old.dispose();\n return;\n }\n }\n groups.push(animationGroup);\n }", "mainD3GroupTransition() {\n const config = this.props.config;\n const transStr = 'translate(' + config.bounds.left + ', ' + config.bounds.top + ')';\n const mainGroup = D3.select('.chart-main-group');\n mainGroup.transition().duration(config.duration).attr('transform', transStr);\n }", "updateAnimation() {\n for (let geom of this.geometries) {\n geom.updateAnimation();\n }\n \n for (let geom of this.texGeometries) {\n geom.updateAnimation();\n }\n }", "function transition(d) {\n if (transitioning || !d) return;\n transitioning = true;\n\n var g2 = display(d),\n t1 = g1.transition().duration(750),\n t2 = g2.transition().duration(750);\n\n // Update the domain only after entering new elements.\n x.domain([d.x, d.x + d.dx]);\n y.domain([d.y, d.y + d.dy]);\n\n // Enable anti-aliasing during the transition.\n svg.style(\"shape-rendering\", null);\n\n // Draw child nodes on top of parent nodes.\n svg.selectAll(\".depth\").sort(function(a, b) { return a.depth - b.depth; });\n // Fade-in entering text.\n g2.selectAll(\"text\").style(\"fill-opacity\", 0);\n g2.selectAll(\"foreignObject div\").style(\"display\", \"none\");\n\n // Transition to the new view.\n t1.selectAll(\"text\").call(text).style(\"fill-opacity\", 0);\n t2.selectAll(\"text\").call(text).style(\"fill-opacity\", 1);\n t1.selectAll(\"rect\").call(rect);\n t2.selectAll(\"rect\").call(rect);\n\n /* Foreign object */\n \t\t t1.selectAll(\".textdiv\").style(\"display\", \"none\"); /* added */\n \t\t t1.selectAll(\".foreignobj\").call(foreign); /* added */\n \t\t t2.selectAll(\".textdiv\").style(\"display\", \"block\"); /* added */\n \t\t t2.selectAll(\".foreignobj\").call(foreign); /* added */\n\n // Remove the old node when the transition is finished.\n t1.remove().each(\"end\", function() {\n svg.style(\"shape-rendering\", \"crispEdges\");\n transitioning = false;\n });\n\n }", "function transition(d) {\n if (transitioning || !d) return;\n transitioning = true;\n\n var g2 = display(d),\n t1 = g1.transition().duration(750),\n t2 = g2.transition().duration(750);\n\n // Update the domain only after entering new elements.\n x.domain([d.x, d.x + d.dx]);\n y.domain([d.y, d.y + d.dy]);\n\n // Enable anti-aliasing during the transition.\n svg.style(\"shape-rendering\", null);\n\n // Draw child nodes on top of parent nodes.\n svg.selectAll(\".depth\").sort(function(a, b) { return a.depth - b.depth; });\n\n // Fade-in entering text.\n g2.selectAll(\"text\").style(\"fill-opacity\", 0);\n g2.selectAll(\"foreignObject div\").style(\"display\", \"none\");\n\n // Transition to the new view.\n t1.selectAll(\"text\").call(text).style(\"fill-opacity\", 0);\n t2.selectAll(\"text\").call(text).style(\"fill-opacity\", 1);\n t1.selectAll(\"rect\").call(rect);\n t2.selectAll(\"rect\").call(rect);\n\n /* Foreign object */\n t1.selectAll(\".textdiv\").style(\"display\", \"none\"); /* added */\n t1.selectAll(\".foreignobj\").call(foreign); /* added */\n t2.selectAll(\".textdiv\").style(\"display\", \"block\"); /* added */\n t2.selectAll(\".foreignobj\").call(foreign); /* added */\n\n // Remove the old node when the transition is finished.\n t1.remove().each(\"end\", function() {\n svg.style(\"shape-rendering\", \"crispEdges\");\n transitioning = false;\n });\n\n }", "function transition(d) {\n if (transitioning || !d) return;\n transitioning = true;\n var g2 = display(d),\n t1 = g1.transition().duration(650),\n t2 = g2.transition().duration(650);\n // Update the domain only after entering new elements.\n x.domain([d.x0, d.x1]);\n y.domain([d.y0, d.y1]);\n // Enable anti-aliasing during the transition.\n tree_svg.style(\"shape-rendering\", null);\n // Draw child nodes on top of parent nodes.\n tree_svg.selectAll(\".depth\").sort(function (a, b) {\n return a.depth - b.depth;\n });\n // Fade-in entering text.\n g2.selectAll(\"text\").style(\"fill-opacity\", 0);\n g2.selectAll(\"foreignObject div\").style(\"display\", \"none\");\n /*added*/\n // Transition to the new view.\n t1.selectAll(\"text\").call(text).style(\"fill-opacity\", 0);\n t2.selectAll(\"text\").call(text).style(\"fill-opacity\", 1);\n t1.selectAll(\"rect\").call(rect);\n t2.selectAll(\"rect\").call(rect);\n /* Foreign object */\n t1.selectAll(\".textdiv\").style(\"display\", \"none\");\n /* added */\n t1.selectAll(\".foreignobj\").call(foreign);\n /* added */\n t2.selectAll(\".textdiv\").style(\"display\", \"block\");\n /* added */\n t2.selectAll(\".foreignobj\").call(foreign);\n /* added */\n // Remove the old node when the transition is finished.\n t1.on(\"end.remove\", function () {\n this.remove();\n transitioning = false;\n });\n }", "function animate() {\n renderer.render(scene, camera);\n\n // Rotate out group \n svgGroup.rotation.y += 0.01;\n\n requestAnimationFrame(animate);\n}", "function anim() {\n $(\"#lightsaber2\").addClass(\"animation2\");\n setTimeout(function() {\n $(\"#lightsaber2\").removeClass(\"animation2\");\n }, 300);\n $(\"#lightsaber1\").addClass(\"animation\");\n\n setTimeout(function() {\n $(\"#lightsaber1\").removeClass(\"animation\");\n }, 300);\n }", "function animateGrouping(group) {\n //Calculate the total change that needs to occur, even though we'll only move a small step size towards the hotspot every time.\n var deltaX = group.obj2x - group.obj1x;\n var deltaY = group.obj2y - group.obj1y;\n \n //Check to see whether there is more animation to be done (assume that deltaX and deltaY will both be 0 if no more animation needs to occur.\n if((deltaX != 0) || (deltaY != 0)) {\n //used for the specific change that occurs on this animation turn.\n var changeX = 0;\n var changeY = 0;\n \n //Check to see if delta change is greater than the step size (currently 5 pixels), and whether it's positive or negative.\n //Use this information to determine how much to move on this turn.\n if(deltaX < -STEP)\n changeX = -STEP;\n else if(deltaX < 0)\n changeX = deltaX;\n else if(deltaX > STEP)\n changeX = STEP;\n else if(deltaX > 0)\n changeX = deltaX;\n \n if(deltaY < -STEP)\n changeY = -STEP;\n else if(deltaY < 0)\n changeY = deltaY;\n else if(deltaY > STEP)\n changeY = STEP;\n else if(deltaY > 0)\n changeY = deltaY;\n \n //Update the x,y coordinates of the connection point for obj1 based on the new location.\n //Why is it that if these two lines of code get commented out with the added nested for loop in the move function\n //the code freezes?\n group.obj1x = group.obj1x + changeX;\n group.obj1y = group.obj1y + changeY;\n \n //Move the object using the move function so that all other objects it's already connected to are moved with it.\n move(group.obj1, group.obj1.offsetLeft + changeX, group.obj1.offsetTop + changeY, false);\n \n //Call the function again after a 200 ms delay. TODO: Figure out why the delay isn't working.\n setTimeout(animateGrouping(group), 5000);\n }\n}", "function swapArrayGs(ind1, ind2) {\n \n var g1 = d3.select('#artextg' + ind1)\n var gx1 = g1.attr('x')\n var g2 = d3.select('#artextg' + ind2)\n var gx2 = g2.attr('x')\n var g1Start = g1.select('text').text();\n var g2Start = g2.select('text').text()\n \n // console.log('startiing val ', g1Start)\n var xdis = gx2 - gx1\n \n g1.select('text').transition()\n .duration(duration)\n .attr(\"transform\", \"translate(\" + xdis + ', 0)')\n .on('end', function(d,i){\n // console.log('d = ', d, 'this = ???', this)\n g1.select('text').attr('transform','translate(0, 0)').text(g2Start);\n })\n \n g2.select('text').transition()\n .duration(duration)\n .attr(\"transform\", \"translate(\" + (-xdis) + ', 0)')\n .on('end', function(d,i){\n // console.log('d = ', d, 'this = ???', this)\n g2.select('text').attr('transform','translate(0, 0)').text(g1Start);\n updateRectSizes();\n })\n }", "function update_groups(x,y){\n d3.selectAll(\".group\").remove();\n create_groups();\n // This code is tested and works to update. It's here if needed.\n // var area = d3.area()\n // .curve(d3.curveBasisOpen)\n // .x(function(d) { return x(d.x); })\n // .y0(function(d) { return y(d.y); })\n // .y1(function(d) { return y(d.height); });\n //\n // d3.selectAll(\".group\")\n // .transition()\n // .attr(\"d\", area);\n}", "function animate() { \n console.log('animate')\n \n gsap.registerEffect({\n name: \"fadeIn\",\n effect: (targets, config) => {\n var tlEffect = gsap.timeline();\n tlEffect.from(targets, {duration: config.duration, y:config.y, force3D:true, rotation: 0.01, stagger:config.stagger, ease:\"power2\"})\n .from(targets, {duration: config.duration, stagger:config.stagger, alpha:0, ease:\"none\"}, \"<\")\n return tlEffect;\n },\n defaults: {duration: 1.5, y:\"-=7\", stagger:4.5},\n extendTimeline: true,\n });\n \n gsap.to(plantWraps, {duration:25, rotation:\"+=20\", ease:\"none\"})\n gsap.to(flowerWraps, {duration:25, rotation:\"+=100\", ease:\"none\"})\n \n var imageDivs = selectAll('.imageDiv');\n // logoIntro = false;\n\n\t\t\ttl\n .to(bannerCover, {duration:0.7, alpha:0, ease:\"none\"})\n \n .from(plants, {duration:3, drawSVG:\"50% 50%\", ease:\"sine.inOut\"}, \"<\")\n .from(flowers, {duration:2, alpha:0, ease:\"none\"}, \"<\")\n \n if(logoIntro) {\n tl\n .from(letter_w, {duration:0.5, drawSVG: 0, ease:\"sine.in\"}, \"<\")\n .from(letter_y, {duration:0.3, drawSVG: 0, ease:\"sine.in\"}, \">\")\n .from(letter_nn, {duration:0.8, drawSVG: 0, ease:\"sine.inOut\"}, \">\")\n .from(lasvegas, {duration:0.7, y:\"-=10\", alpha: 0, ease:\"sine\"}, \">\")\n .from(sign_r, {duration:0.5, alpha: 0, ease:\"none\"}, \"<\")\n\n .to(logo, {duration:0.7, alpha:0, ease:\"none\"}, \">1\")\n .set(logo, {scale: 0.37, y:99, x:-60}, \">\")\n } else {\n tl\n .set(logo, {scale: 0.37, alpha:0,y:99, x:-60}, \"<\")\n }\n \n tl\n .from(imageDivs, {duration:1.3, stagger:4, alpha:0, blur:10, force3D:true, rotation: 0.01, ease:\"none\"}, \"<\")\n \n .fadeIn(text_head, \"<0.4\")\n .fadeIn(text_subHead,{y:\"0\", duration: 1,},\"<0.6\")\n .to(logo, {duration:1, alpha:1, ease:\"none\"}, \"<0.4\")\n .from(cta, {duration:0.8, alpha: 0, ease:\"none\"}, \"<\")\n .from(cta, {duration:1.6, rotateX:90, ease:\"power2\"}, \"<\") \n\t\t}", "processAnimations(animationGroup) {\n var group = {\n name: animationGroup.name,\n animations: []\n };\n animationGroup.targetedAnimations.forEach( ta => {\n //console.log(\"animation: \"+ta.animation.name+\" target: \"+ta.target.getClassName()+\" \"+ta.target.name+\" type \"+ta.animation.dataType+\" property \"+ta.animation.targetProperty);\n var animation = {\n animationName:ta.animation.name,\n fps: ta.animation.framePerSecond,\n targetName:ta.target.name,\n propertyName: ta.animation.targetProperty,\n dataType: ta.animation.dataType,\n keys: []\n };\n var keys = ta.animation.getKeys();\n // position, rotation, scaling\n if ( ta.animation.dataType == BABYLON.Animation.ANIMATIONTYPE_VECTOR3 ) {\n keys.forEach( key => {\n var k = {frame:key.frame, value:{x:key.value.x, y:key.value.y, z:key.value.z}};\n if ( key.interpolation ) {\n k.interpolation = key.interpolation;\n }\n animation.keys.push(k);\n });\n } else if ( ta.animation.dataType == BABYLON.Animation.ANIMATIONTYPE_QUATERNION ) {\n keys.forEach( key => {\n animation.keys.push({frame:key.frame, value:{x:key.value.x, y:key.value.y, z:key.value.z, w:key.value.w}});\n });\n } else {\n // ERROR\n console.log(\"Error processing \"+group.name+\" = can't hanle type \"+ta.animation.dataType)\n }\n group.animations.push(animation);\n });\n return group;\n }", "function animate(){\n svg.transition()\n .duration(30000)\n .ease(d3.easeLinear)\n .tween(\"year\", tweenYear);\n }", "function update2(data) {\n\n // Update the X axis\n x2.domain(data.map(function(d) { return d.group; }))\n xAxis2.call(d3.axisBottom(x2))\n\n // Update the Y axis\n y2.domain([0, d3.max(data, function(d) { return d.value }) ]);\n yAxis2.transition().duration(1000).call(d3.axisLeft(y2));\n\n // Create the u variable\n var u2 = svg2.selectAll(\"rect\")\n .data(data)\n\n u2\n .enter()\n .append(\"rect\") // Add a new rect for each new elements\n .merge(u2) // get the already existing elements as well\n .transition() // and apply changes to all of them\n .duration(1000)\n .attr(\"x\", function(d) { return x2(d.group); })\n .attr(\"y\", function(d) { return y2(d.value); })\n .attr(\"width\", x2.bandwidth())\n .attr(\"height\", function(d) { return height - y2(d.value); })\n .attr(\"fill\", \"#5F9EA0\")\n\n // If less group in the new dataset, I delete the ones not in use anymore\n u2\n .exit()\n .remove()\n}", "function transition() {\n if(animFlag){\n d3.selectAll(\".line\").transition().duration(1000).ease(\"linear\")\n .style(\"stroke-dashoffset\", \"12\")\n .each(\"end\", function() {\n d3.selectAll(\".line\").style(\"stroke-dashoffset\", \"0\");\n transition();\n });\n }\n }", "function update(selectedGroup) {\n\n // Create new data with the selection?\n var dataFilter = data.map(function(d){return {x: d.x, y: d[selectedGroup]} })\n\n console.log(dataFilter);\n\n line2\n .transition()\n .duration(0)\n .attr(\"y1\", 0)\n .attr(\"y2\", 0)\n .attr(\"x1\", 70)\n .attr(\"x2\", 70)\n .attr(\"stroke\", \"white\")\n\n line3\n .transition()\n .duration(0)\n .attr(\"y1\", 0)\n .attr(\"y2\", 0)\n .attr(\"x1\", 70)\n .attr(\"x2\", 70)\n .attr(\"stroke\", \"white\")\n\n line4\n .transition()\n .duration(0)\n .attr(\"y1\", 0)\n .attr(\"y2\", 0)\n .attr(\"x1\", 70)\n .attr(\"x2\", 70)\n .attr(\"stroke\", \"white\")\n\n line2_2\n .transition()\n .duration(0)\n .attr(\"y1\", 310)\n .attr(\"y2\", 310)\n .attr(\"x1\", 70)\n .attr(\"x2\", 70)\n .attr(\"stroke\", \"white\")\n\n line3_2\n .transition()\n .duration(0)\n .attr(\"y1\", 310)\n .attr(\"y2\", 310)\n .attr(\"x1\", 70)\n .attr(\"x2\", 70)\n .attr(\"stroke\", \"white\")\n\n line4_2\n .transition()\n .duration(0)\n .attr(\"y1\", 310)\n .attr(\"y2\", 310)\n .attr(\"x1\", 70)\n .attr(\"x2\", 70)\n .attr(\"stroke\", \"white\")\n\n rtlabt90\n .transition()\n .duration(0)\n .attr(\"y\", 100)\n .attr(\"x\", -150)\n .attr(\"dy\", \"0em\")\n .text(\"\");\n\n rtlabt50\n .transition()\n .duration(0)\n .attr(\"y\", 100)\n .attr(\"x\", -150)\n .attr(\"dy\", \"0em\")\n .text(\"\");\n\n rtlabt10\n .transition()\n .duration(0)\n .attr(\"y\", 100)\n .attr(\"x\", -150)\n .attr(\"dy\", \"0em\")\n .text(\"\");\n\n\n // Give these new data to update line\n line\n .datum(dataFilter)\n .transition()\n .duration(500)\n .attr(\"d\", d3.line().curve(d3.curveStepAfter)\n .x(function(d) { return x(d.x) + 70 })\n .y(function(d) { return y(d.y) + 10 })\n )\n .attr(\"stroke\", \"steelblue\")\n }", "apply() {\n this.scene.multMatrix(this.animTransform);\n }", "getAnimationGroups(animationGroups = this.character.animationGroups) {\n if (!this.animationGroups) {\n var loopAnimations = true;\n if ( this.fixes && typeof this.fixes.loopAnimations !== 'undefined' ) {\n loopAnimations = this.fixes.loopAnimations;\n }\n if ( this.fixes && this.fixes.animationGroups ) {\n this.animationGroups = [];\n // animation groups overriden; process animation groups and generate new ones\n for ( var j = 0; j < this.fixes.animationGroups.length; j++ ) {\n var override = this.fixes.animationGroups[j];\n // find source group\n for ( var i = 0; i < animationGroups.length; i++ ) {\n var group = animationGroups[i];\n if ( group.name == override.source ) {\n var newGroup = group;\n if ( override.start || override.end ) {\n // now slice it and generate new group\n newGroup = this.sliceGroup( group, override.start, override.end );\n }\n if ( override.name ) {\n newGroup.name = override.name;\n }\n if ( typeof override.loop !== 'undefined' ) {\n newGroup.loopAnimation = override.loop;\n } else {\n newGroup.loopAnimation = loopAnimations;\n }\n this.animationGroups.push( newGroup );\n break;\n }\n }\n }\n } else {\n this.animationGroups = animationGroups;\n for ( var i=0; i<this.animationGroups.length; i++ ) {\n this.animationGroups[i].loopAnimation = loopAnimations;\n }\n }\n }\n return this.animationGroups;\n }", "set animated(value){\n this._animated = value;\n \n if(this._animated){\n this.gshape.animate = this._gshapeAnimationMethod;\n }else{\n this.gshape.animate = noop;\n }\n }", "function prev_step1(){\r\n addAnimation(document.getElementById(\"second\"), 'bounceIn'); //calling this again actually removes the first instance\r\n document.getElementById(\"first\").style.display=\"block\";\r\n document.getElementById(\"second\").style.display=\"none\";\r\n}", "startAnimation(animationName, loop) {\n var started = false; // to ensure we start only one animation\n for ( var i = 0; i < this.getAnimationGroups().length; i++ ) {\n var group = this.getAnimationGroups()[i];\n if ( group.name == animationName && !started ) {\n started = true;\n //this.log(\"Animation group: \"+animationName);\n if ( group.isPlaying ) {\n group.pause();\n this.log(\"paused \"+animationName);\n } else {\n if ( this.fixes ) {\n if (typeof this.fixes.beforeAnimation !== 'undefined' ) {\n this.log( \"Applying fixes for: \"+this.folder.name+\" beforeAnimation: \"+this.fixes.beforeAnimation);\n this.groundLevel( this.fixes.beforeAnimation );\n }\n this.disableNodes();\n if (typeof this.fixes.before !== 'undefined' ) {\n this.fixes.before.forEach( obj => {\n if ( animationName == obj.animation && obj.enableNodes ) {\n console.log(obj);\n this.enableNodes(obj.enableNodes, true);\n }\n });\n }\n }\n this.jump(0);\n if ( typeof loop != 'undefined') {\n group.play(loop);\n } else {\n group.play(group.loopAnimation);\n }\n this.log(\"playing \"+animationName);\n this.log(group);\n this.activeAnimation = animationName;\n }\n } else if ( group.isPlaying ) {\n // stop all other animations\n group.pause();\n //group.reset(); // this disables blending\n }\n }\n }", "function getAnimation2() {\n var element = $('.bulp2');\n //bezier magic provided by GSAP BezierPlugin (included with TweenMax)\n //https://api.greensock.com/js/com/greensock/plugins/BezierPlugin.html\n \n //create a semi-random tween \n var bezTween = new TweenMax(element, 6, {\n bezier:{\n type:\"soft\", \n //values:[{x:-200, y:300}, {x:300, y:30}, {x:500 + Math.random() *100, y:320*Math.random() + 50}, {x:650, y:320*Math.random() + 50}, {x:900, y:50}, {x:1100, y:50}, {x:1200, y:50}, {x:1400, y:50}, {x:1600, y:50}, {x:1900, y:50}],\n values:[{x:-430, y:0}, {x:0, y:50}, {x:100, y:70}, {x:500, y:70}, {x:650, y: 80}, {x:900, y:80}, {x:1100, y:90}, {x:1200, y:90}, {x:1400, y:90}, {x:1600, y:90}, {x:1900, y:90}],\n autoRotate:false\n },\n ease:Linear.easeNone});\n return bezTween;\n}", "function updateTimeline(selection) {\n\n\t\t\t\t\tvar timelineGroups = buildTimelineGroups(groups);\n\t\t\t\t\tvar gr = selection.select(\"svg\").select(\"g\");\n\n\t\t\t\t\t// Reset the y1 domain based on the current biggest group.\n\t\t\t\t\tvar groupMax = d3.max(groups.map(function (d) {\n\t\t\t\t\t\treturn d.value.data.countByGroup.values().map(function (c) { return c.agg; })\n\t\t\t\t\t\t\t.reduce(function (a, b) { return a + b; }, 0);\n\t\t\t\t\t}));\n\n\t\t\t\t\t// If we exceed the current domain, expand. Otherwise remain static.\n\t\t\t\t\tif(groupMax > y1.domain()[1]) {\n\t\t\t\t\t\ty1.domain([0, groupMax]);\n\t\t\t\t\t}\n\n\t\t\t\t\tyAxis.scale(y1);\n\n\t\t\t\t\tstack(timelineGroups);\n\n\t\t\t\t\tvar group = groupContainer.selectAll(\".group\")\n\t\t\t\t\t\t\t.data(timelineGroups);\n\n\t\t\t\t\tif(mode === 'stack') {\n\t\t\t\t\t\tif(!gr.select('.y-axis').empty()) {\n\t\t\t\t\t\t\tgr.select('.y-axis').call(yAxis);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tgr.append(\"g\")\n\t\t\t\t\t\t\t\t.attr(\"class\", \"axis y-axis\")\n\t\t\t\t\t\t\t\t.attr(\"transform\", \"translate(\" + mainWidth + \", 0)\")\n\t\t\t\t\t\t\t\t.call(yAxis);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif(!gr.select('.y-axis').empty()) {\n\t\t\t\t\t\t\tgr.select('.y-axis').remove();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tgroup.exit().remove();\n\n\t\t\t\t\tgroup.transition()\n\t\t\t\t\t\t.attr(\"transform\", function(d, i) {\n\t\t\t\t\t\t\tif(mode === 'stack') {\n\t\t\t\t\t\t\t\treturn \"translate(0, 0)\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn \"translate(0,\" + y0(stackGroups[i]) + \")\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\tvar paths = group.select(\"path\");\n\n\t\t\t\t\tpaths.attr(\"d\", function(d) { return area(d); });\n\t\t\t\t}", "requestUpdateAnimations () {\n this.animationsUpdateNeeded = true;\n }", "function animate() {\n\n\t\t\tbubbleChartGroup.transition()\n\t\t\t\t.duration(30000)\n\t\t\t\t.ease(d3.easeLinear) /*use linear transition*/\n\t\t\t\t.tween(\"year\",tweenYear); /*use customized tween method to create transitions frame by frame*/\n\n\t\t\t/*show observations text only after the animation is completed*/\n\t\t\tsetTimeout(showObservation, 30500);\n\n\t\t\tfunction showObservation() {\n\t\t\t\t/*change the color of text so that they become visible*/\n\t\t\t\td3.selectAll(\"#observationSection\")\n\t\t\t\t\t.style(\"color\",\"black\");\n\t\t\t\td3.selectAll(\"#observations\")\n\t\t\t\t\t.style(\"color\",\"red\");\n\t\t\t}\n\t }", "initAnimations() {\n this.animations = [];\n let interpolant = new TransformationInterpolant();\n\n for (var key in this.graph.animations) {\n if (this.graph.animations.hasOwnProperty(key)) {\n let animation = this.graph.animations[key];\n let keyframes = animation.keyframes;\n let keyframeTrack = new TransformationTrack(keyframes, interpolant);\n this.animations[key] = new KeyframeAnimation(keyframeTrack);\n }\n }\n\n this.interface.addAnimations();\n }", "createAnimations() {\r\n //#region Idle animation\r\n // Idle front\r\n this.anims.create({\r\n key: 'idle_front',\r\n frames: [\r\n {\r\n key: 'idle_front_0'\r\n },\r\n {\r\n key: 'idle_front_1'\r\n },\r\n {\r\n key: 'idle_front_2'\r\n },\r\n {\r\n key: 'idle_front_3'\r\n }\r\n ],\r\n frameRate: 2,\r\n repeat: -1,\r\n });\r\n\r\n // Idle back\r\n this.anims.create({\r\n key: 'idle_back',\r\n frames: [\r\n {\r\n key: 'idle_back_0'\r\n },\r\n {\r\n key: 'idle_back_1'\r\n },\r\n {\r\n key: 'idle_back_2'\r\n },\r\n {\r\n key: 'idle_back_3'\r\n }\r\n ],\r\n frameRate: 2,\r\n repeat: -1,\r\n });\r\n\r\n // Idle side\r\n this.anims.create({\r\n key: 'idle_side',\r\n frames: [\r\n {\r\n key: 'idle_side_0'\r\n },\r\n {\r\n key: 'idle_side_1'\r\n },\r\n {\r\n key: 'idle_side_2'\r\n },\r\n {\r\n key: 'idle_side_3'\r\n }\r\n ],\r\n frameRate: 2,\r\n repeat: -1,\r\n });\r\n\r\n //#endregion\r\n\r\n //#region Run animations\r\n\r\n // Run front\r\n this.anims.create({\r\n key: 'run_front',\r\n frames: [\r\n {\r\n key: 'run_front_0'\r\n },\r\n {\r\n key: 'run_front_1'\r\n },\r\n {\r\n key: 'run_front_2'\r\n },\r\n {\r\n key: 'run_front_3'\r\n }\r\n ],\r\n frameRate: 6,\r\n repeat: -1,\r\n });\r\n\r\n // Run back\r\n this.anims.create({\r\n key: 'run_back',\r\n frames: [\r\n {\r\n key: 'run_back_0'\r\n },\r\n {\r\n key: 'run_back_1'\r\n },\r\n {\r\n key: 'run_back_2'\r\n },\r\n {\r\n key: 'run_back_3'\r\n }\r\n ],\r\n frameRate: 6,\r\n repeat: -1,\r\n });\r\n\r\n // Run side\r\n this.anims.create({\r\n key: 'run_side',\r\n frames: [\r\n {\r\n key: 'run_side_0'\r\n },\r\n {\r\n key: 'run_side_1'\r\n },\r\n {\r\n key: 'run_side_2'\r\n },\r\n {\r\n key: 'run_side_3'\r\n }\r\n ],\r\n frameRate: 6,\r\n repeat: -1,\r\n });\r\n\r\n //#endregion\r\n }", "function addAnimation() {\n const Burst1 = new mojs.Burst({\n parent: animationDiv,\n top: '50%',\n left: '50%',\n radius: {0: 80},\n count: 8,\n children: {\n shape: 'circle',\n fill: {'red': 'blue'},\n strokeWidth: 1,\n duration: 600,\n stroke: {'red': 'blue'}\n }\n });\n\n\n const Burst2 = new mojs.Burst({\n parent: animationDiv,\n top: '50%',\n left: '50%',\n radius: {0: 100},\n count: 4,\n children: {\n shape: 'rect',\n fill: 'white',\n strokeWidth: 1,\n duration: 300,\n stroke: 'white'\n }\n });\n\n\n const circle1 = new mojs.Shape({\n radius: {0: 40},\n parent: animationDiv,\n fill: 'none',\n stroke: 'white',\n strokeWidth: 15,\n duration: 300,\n opacity: {1: 0}\n });\n\n const circle2 = new mojs.Shape({\n radius: {0: 50},\n parent: animationDiv,\n fill: 'none',\n stroke: 'red',\n strokeWidth: 5,\n duration: 400,\n opacity: {1: 0}\n });\n\n\n const circle3 = new mojs.Shape({\n radius: {0: 60},\n parent: animationDiv,\n fill: 'none',\n stroke: 'blue',\n strokeWidth: 5,\n duration: 500,\n opacity: {1: 0}\n });\n\n const circle4 = new mojs.Shape({\n radius: {0: 70},\n parent: animationDiv,\n fill: 'white',\n\n stroke: 'white',\n strokeWidth: 5,\n duration: 600,\n opacity: {1: 0}\n });\n\n const timeline = new mojs.Timeline({\n\n repeat: 0\n }).add(circle4, circle1, circle2, circle3, Burst1, Burst2);\n\n timeline.play();\n }", "function goGrouped() {\n yscale.domain([0, yGroupedMax]);\n rects.transition()\n .duration(1000)\n .delay(function (d, i) { return i * 20; })\n .attr(\"x\", function (d, i, j) { return xscale(i) + xscale.rangeBand() / stackedData.length * j; })\n .attr(\"width\", xscale.rangeBand() / stackedData.length)\n .transition()\n .attr(\"y\", function (d) { return yscale(d.y); })\n .attr(\"height\", function (d) { return chartHeight - yscale(d.y); });\n gridLines.data(yscale.ticks(10)).transition()\n .duration(1000)\n .delay(function (d, i) { return i * 20; })\n .attr(\"y1\", yscale)\n .attr(\"y2\", yscale);\n gridLabels.data(yscale.ticks(10)).transition()\n .duration(1000)\n .delay(function (d, i) { return i * 20; })\n .attr(\"y\", yscale)\n .text(String);\n}", "function transition(d) {\n\t\t\t\t\tconsole.log(\"--- transition firing with d.name at \" + d .name + \" and d.depth at \" + d.depth);\n\t\t\t\t\t\n\t\t\t\t\tcurrentDepth = d.depth;// gm state test\n\t\t\t\t\tmyData.currentNode = d;//\n\t\t\t\t\tmyData.currentDepth = d.depth;\n\t\t\t\t\t\n\t\t\t\t\tdefaultDuration = 750;\n\t\t\t\t\tnoDuration = 0;\n\t\t\t\t\t\n\t\t\t\t\tif(myData.reset == true){\n\t\t\t\t\t\tcurrentDuration = noDuration;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrentDuration = defaultDuration;\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\n\t\t\t\t\t\n\t\t\t\t\tif (transitioning || !d) return;\n\t\t\t\t\t\t\ttransitioning = true;\n\n\t\t\t\t\t\t\tvar g2 = display(d),\n\t\t\t\t\t\t\tt1 = g1.transition().duration(currentDuration),\n\t\t\t\t\t\t\tt2 = g2.transition().duration(currentDuration);\n\n\t\t\t\t\t\t\t// Update the domain only after entering new elements.\n\t\t\t\t\t\t\tx.domain([d.x, d.x + d.dx]);\n\t\t\t\t\t\t\ty.domain([d.y, d.y + d.dy]);\n\n\t\t\t\t\t\t\t// Enable anti-aliasing during the transition.\n\t\t\t\t\t\t\tsvg.style(\"shape-rendering\", null);\n\n\t\t\t\t\t\t\t// Draw child nodes on top of parent nodes.\n\t\t\t\t\t\t\tsvg.selectAll(\".depth\").sort(function(a, b) { return a.depth - b.depth; });\n\n\t\t\t\t\t\t\t// Fade-in entering text.\n\t\t\t\t\t\t\tg2.selectAll(\"text\").style(\"fill-opacity\", 0);\n\t\t\t\t\t\t\tg2.selectAll(\"foreignObject div\").style(\"display\", \"none\"); /*added*/\n\n\t\t\t\t\t\t\t// Transition to the new view.\n\t\t\t\t\t\t\tt1.selectAll(\"text\").call(text).style(\"fill-opacity\", 0);\n\t\t\t\t\t\t\tt2.selectAll(\"text\").call(text).style(\"fill-opacity\", 1);\n\t\t\t\t\t\t\tt1.selectAll(\"rect\").call(rect);\n\t\t\t\t\t\t\tt2.selectAll(\"rect\").call(rect);\n\n\t\t\t\t\t\t\tt1.selectAll(\".textdiv\").style(\"display\", \"none\"); /* added */\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//t1.selectAll(\".smalltext\").call(smalltext); /* GM EXPERIMENT */\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tt1.selectAll(\".foreignobj\").call(foreign); /* added */\n\t\t\t\t\t\t\tt2.selectAll(\".textdiv\").style(\"display\", \"block\"); /* added */\n\t\t\t\t\t\t\tt2.selectAll(\".amtDisplay\").style(\"display\", \"block\"); /* added */\n\t\t\t\t\t\t\tt2.selectAll(\".foreignobj\").call(foreign); /* added */ \n\n\t\t\t\t\t\t\t// Remove the old node when the transition is finished.\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/**/t1.remove().each(\"end\", function() {\n\t\t\t\t\t\t\t\tsvg.style(\"shape-rendering\", \"crispEdges\");\n\t\t\t\t\t\t\t\ttransitioning = false;\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// G ADD TO RESTORE CLICK FUNCTION?\n\t\t\t\t\t\t\td3.selectAll(\".foreignobj\").style(\"pointer-events\",\"none\")\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\td3.selectAll(\".child\")\n\t\t\t\t\t\t\t\t//d3.selectAll(\".child\").attr(\"width\",\"30px\"); //works\n\t\t\t\t\t\t\t\t\t.on(\"click\", function(d) { \n\t\t\t\t\t\t\t\t\tconsole.log(\"clicked with num children at \" + d.parent.children.length)\n\t\t\t\t\t\t\t\t})*/\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\n\t\t\t\t}", "attract(ball_1, ball_2) {\n ball_1.state.spe.add(this.gravity_pull(ball_1, ball_2));\n ball_2.state.spe.add(this.gravity_pull(ball_2, ball_1));\n }", "animate (data) {\n let interval\n let set = []\n data.src.getLayers().forEach((layer) => {\n set.push(layer)\n })\n let iterant = 0\n for (var s = 1; s < set.length; s++) {\n set[s].setVisible(false)\n }\n if (!data.interval) {\n interval = defaults.interval\n } else {\n interval = data.interval\n }\n setInterval(() => {\n set[iterant].setVisible(!set[iterant].getVisible())\n iterant++\n if (iterant === set.length) {\n iterant = 0\n }\n set[iterant].setVisible(!set[iterant].getVisible())\n }, interval)\n }", "function prev_step2(){\r\n addAnimation(document.getElementById(\"third\"), 'bounceIn'); //calling this again actually removes the first instance\r\n document.getElementById(\"third\").style.display=\"none\";\r\n document.getElementById(\"second\").style.display=\"block\";\r\n}", "function addAnimation(){\n const Burst1 = new mojs.Burst ({\n parent: animationDiv,\n top: '50%',\n left: '50%', \n radius: {0: 80},\n count: 8,\n children: {\n shape: 'circle',\n fill: {'red':'blue'},\n strokeWidth: 1,\n duration: 600,\n stroke: {'red':'blue'}\n }\n });\n\n\n const Burst2 = new mojs.Burst ({\n parent: animationDiv,\n top: '50%',\n left: '50%', \n radius: {0: 100},\n count: 4,\n children: {\n shape: 'rect',\n fill: 'white',\n strokeWidth: 1,\n duration: 300,\n stroke: 'white'\n }\n });\n\n\n\n const circle1= new mojs.Shape ({\n radius: {0:40},\n parent: animationDiv,\n fill: 'none',\n stroke: 'white',\n strokeWidth:15,\n duration: 300,\n opacity: {1: 0}\n });\n\n const circle2= new mojs.Shape ({\n radius: {0:50},\n parent: animationDiv,\n fill: 'none',\n stroke: 'red',\n strokeWidth:5,\n duration: 400,\n opacity: {1: 0}\n });\n\n\n const circle3= new mojs.Shape ({\n radius: {0:60},\n parent: animationDiv,\n fill: 'none',\n stroke: 'blue',\n strokeWidth:5,\n duration: 500,\n opacity: {1: 0}\n });\n\n const circle4= new mojs.Shape ({\n radius: {0:70},\n parent: animationDiv,\n fill: 'white',\n \n stroke: 'white',\n strokeWidth:5,\n duration: 600,\n opacity: {1: 0}\n });\n\n const timeline = new mojs.Timeline ({\n \n repeat: 0\n }).add(circle4,circle1,circle2,circle3,Burst1,Burst2);\n\n timeline.play();\n}", "set importAnimation(value) {}", "function transition(){\n d3.selectAll(\"path\")\n .data(function() {\n var d = layers1;\n layers1 = layers0;\n return layers0 = d;\n })\n .transition()\n .duration(2500)\n .attr(\"d\", area);\n\n }", "function AnimateGroup( props ) {\n\n const {\n // Convenience property for setting animationIn and animationOut\n // at once; e.g. setting animation=\"slide\" is equivalent to\n // animationIn=\"slideIn\" animationOut=\"slideOut\"\n animation,\n // Name of animation used when adding a new component.\n // See theme/index.js for animation names.\n animationIn = animation+'In',\n // Name of animation used when removing an existing component.\n animationOut = animation+'Out',\n // The CSS class name to apply to the group container.\n className,\n // Transition out duration.\n durationOut,\n // The group children.\n children\n } = props\n\n const transition = `transition: opacity ${durationOut}ms ease-out`\n const animationInCSS = animations[animationIn] || animationIn\n const animationOutCSS = animations[animationOut] || animationOut\n\n const childState = {\n entering: node => node.style = 'display: none',\n entered: node => node.style = `${transition}; opacity: 1; ${css('animation',animationInCSS)}`,\n exiting: node => node.style = `${transition}; opacity: 0; ${css('animation',animationOutCSS)}`,\n exited: node => node.style = `${transition}; opacity: 0; ${css('animation',animationOutCSS)}`\n }\n\n const groupChildren = React.Children.toArray(children).map(child => {\n const { key } = child\n return (<Transition\n key={key}\n timeout={500}\n onEntering={childState.entering}\n onEntered={childState.entered}\n onExiting={childState.exiting}\n onExited={childState.exited}\n >\n {child}\n </Transition>)\n })\n\n return (<TransitionGroup className={className}>\n {groupChildren}\n </TransitionGroup>)\n}", "function animationStep() {\n var _stableMarriageProces = stableMarriageProcessQueue.shift(),\n process = _stableMarriageProces.process,\n content = _stableMarriageProces.content;\n\n var male = content.male,\n female = content.female,\n dumped = content.dumped;\n var groundMaleDOM;\n var groundFemaleDOM; // If the process is not called done,\n\n if (process !== 'done') {\n groundMaleDOM = male.element.cloneNode(true);\n groundFemaleDOM = female.element.cloneNode(true);\n groundMaleDOM.style.opacity = '0';\n groundFemaleDOM.style.opacity = '0'; // then the ground elements are prepared,\n\n groundMaleDOM.classList.add('prepare');\n groundFemaleDOM.classList.add('prepare');\n groundMaleDOM.classList.add('disabled');\n groundFemaleDOM.classList.add('disabled'); // and if the process is also not prepared,\n\n if (process !== 'prepare') {\n // then the ground male element can be added \n // to the ground container.\n groundDOM.appendChild(groundMaleDOM);\n openAndSelectGroundDOM(groundMaleDOM, male._preferences.indexOf(female.name));\n }\n }\n\n if (process == 'prepare') {\n // The first step is prepare which is to highlight the\n // male element.\n highlightEntityDOM(male.element);\n } else if (process == 'engage') {\n // This is the animation\n // for engage.\n highlightEntityDOM(female.element);\n groundDOM.appendChild(groundFemaleDOM);\n openAndSelectGroundDOM(groundFemaleDOM);\n closeGroundDOM(groundMaleDOM);\n closeGroundDOM(groundFemaleDOM);\n animationQueue.add(function () {\n groundMaleDOM.classList.remove('reject');\n groundFemaleDOM.classList.remove('prepare');\n groundMaleDOM.classList.add('engage');\n groundFemaleDOM.classList.add('engage');\n }, 500);\n animationQueue.add(function () {\n male.element.classList.remove('reject');\n male.element.classList.add('engage');\n female.element.classList.add('engage');\n notifier.queueMessage('warning', \"\".concat(male.name, \" is engaged with \").concat(female.name, \".\"), 1000);\n }, 500);\n } else if (process == 'break') {\n // This is the animation for break.\n // Break means the female dumps a male\n // and gets a new partner.\n groundFemaleDOM.classList.add('engage');\n\n var oldPartnerIndex = female._preferences.indexOf(dumped.name);\n\n groundFemaleDOM.querySelector('.preference').children[oldPartnerIndex].classList.add('partner-highlight');\n groundDOM.appendChild(groundFemaleDOM);\n openAndSelectGroundDOM(groundFemaleDOM);\n animationQueue.add(function () {\n var preferenceDOM = groundFemaleDOM.querySelector('.preference');\n\n var maleIndex = female._preferences.indexOf(male.name);\n\n var oldPartnerIndex = female._preferences.indexOf(dumped.name);\n\n preferenceDOM.children[maleIndex].classList.add('select-highlight');\n notifier.queueMessage('warning', \"\".concat(female.name, \" breaks up with current partner \").concat(dumped.name, \" and engages with \").concat(male.name, \".\"), 2000);\n }, 500);\n closeGroundDOM(groundMaleDOM);\n closeGroundDOM(groundFemaleDOM);\n animationQueue.add(function () {\n groundMaleDOM.classList.remove('reject');\n groundMaleDOM.classList.add('engage');\n male.element.classList.remove('reject');\n male.element.classList.add('engage');\n dumped.element.classList.remove('engage');\n dumped.element.classList.add('reject');\n }, 500);\n } else if (process == 'reject') {\n // This is the animation for reject. \n // Reject means the female stays with\n // their current partner, opposite of \n // break.\n groundFemaleDOM.classList.add('engage');\n var preferenceDOM = groundFemaleDOM.querySelector('.preference');\n\n var partnerIndex = female._preferences.indexOf(female.partner.name);\n\n preferenceDOM.children[partnerIndex].classList.add('partner-highlight');\n groundDOM.appendChild(groundFemaleDOM);\n openAndSelectGroundDOM(groundFemaleDOM);\n animationQueue.add(function () {\n var maleIndex = female._preferences.indexOf(male.name);\n\n preferenceDOM.children[maleIndex].classList.add('select-highlight');\n }, 250);\n closeGroundDOM(groundMaleDOM);\n closeGroundDOM(groundFemaleDOM);\n animationQueue.add(function () {\n groundMaleDOM.classList.remove('prepare');\n groundFemaleDOM.classList.remove('engage');\n groundMaleDOM.classList.add('reject');\n groundFemaleDOM.classList.add('reject');\n notifier.queueMessage('warning', \"\".concat(female.name, \" stays with current partner \").concat(female.partner.name, \" and rejects \").concat(male.name, \".\"), 2000);\n }, 250);\n animationQueue.add(function () {\n male.element.classList.add('reject');\n female.element.classList.add('reject');\n }, 250);\n animationQueue.add(function () {\n female.element.classList.remove('reject');\n female.element.classList.add('engage');\n }, 250);\n } else if (process == 'done') {\n // Animation for when the process is done.\n // Basically removes the elements.\n var _iterator14 = _createForOfIteratorHelper(groundDOM.children),\n _step14;\n\n try {\n for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {\n var child = _step14.value;\n child.style.opacity = '0';\n }\n } catch (err) {\n _iterator14.e(err);\n } finally {\n _iterator14.f();\n }\n\n animationQueue.add(function () {\n groundDOM.innerHTML = '';\n }, 250);\n } // This first conditional is called when\n // the visualization is finished.\n\n\n if (stableMarriageProcessQueue.length == 0) {\n skipVisualizationDOM.classList.add('disabled');\n makeResultInteractable();\n notifier.queueMessage('valid', 'Tap an entity to show its partner.');\n } else {\n // This conditional is called whenever there is still\n // anything to visualize.\n animationQueue.add(function () {\n animationStep();\n }, 250);\n }\n}", "function functionalAnimator(o_) {\n\t\tfunction animObject(opt_) {\n\t\t\tvar values = {\n\t\t\t\tobj: null, // object that controls the rendering to be animated.\n\t\t\t\tgetFn: null, // returns orderedArray of current parameter values\n\t\t\t\tupdateFn: null, // updates the rendering according to an array of values ordered as per getFn\n\t\t\t\ttargets: null, // array of target values - same order as getFn returns\n\t\t\t\tincrements: null // array of increments - numeric values needed - assumed floats\n\t\t\t}\n\t\t\tvar options = $.extend({}, values, opt_);\n\t\t\tvar animDone = false; // flag for clearing out finished animations\n\t\t\t\n\t\t\treturn({\n\t\t\t\tgetObj : function() {\n\t\t\t\t\treturn(options.obj);\n\t\t\t\t},\n\t\t\t\tgetGetFn : function() {\n\t\t\t\t\treturn(options.getFn);\n\t\t\t\t},\n\t\t\t\tgetTargets : function() {\n\t\t\t\t\treturn(options.targets);\n\t\t\t\t},\n\t\t\t\tgetUpdateFn : function() {\n\t\t\t\t\treturn(options.updateFn);\n\t\t\t\t},\n\t\t\t\tgetIncrements : function() {\n\t\t\t\t\treturn(options.increments);\n\t\t\t\t},\n\t\t\t\tdone : function() {\n\t\t\t\t\tanimDone = true;\n\t\t\t\t},\n\t\t\t\tisDone : function() {\n\t\t\t\t\treturn(animDone);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t\n\t\tvar defaults = {\n\t\t\tperiod : 40, // increment period for attribute animation - milliseconds\n\t\t\tpostIterHook: null // function to call after animation iteration\n\t\t};\n\t\tvar options = $.extend({}, defaults, o_);\n\t\t\n\t\tvar objectsToAnimate = {};\n\t\t\n\t\tfunction add(key, obj, getFn, updateFn, targets, time) {\t\t\n\t\t\tvar steps = time / options.period;\n\t\t\tif (steps < 1) {\n\t\t\t\tsteps = 1;\n\t\t\t}\n\t\t\t\n\t\t\tvar currVals = getFn(obj);\n\t\t\tvar increments = [];\n\t\t\tfor (var i=0; i<currVals.length; i++) {\n\t\t\t\tvar inc = (targets[i] - currVals[i]) / steps;\n\t\t\t\tincrements.push(inc);\n\t\t\t}\n\t\t\t\n\t\t\tobjectsToAnimate[key] = animObject({\n\t\t\t\tobj: obj,\n\t\t\t\tgetFn: getFn,\n\t\t\t\tupdateFn: updateFn,\n\t\t\t\ttargets: targets,\n\t\t\t\tincrements: increments\n\t\t\t});\n\t\t}\n\t\t\n\t\tfunction iterateSingleAnimObject(key, animInfo) {\n\t\t\tvar obj = animInfo.getObj();\n\t\t\tvar g = animInfo.getGetFn();\n\t\t\tvar currVals = g(obj);\n\n\t\t\tvar increments = animInfo.getIncrements();\n\t\t\tvar targets = animInfo.getTargets();\n\t\t\tvar atTargets = 0;\n\t\t\tfor (var i=0; i<currVals.length; i++) {\n\t\t\t\tcurrVals[i] += increments[i];\n\t\t\t\tif ((increments[i] >= 0 && currVals[i] >= targets[i]) || // catches the case of == 0 for multi-value target lists\n\t\t\t\t\t(increments[i] < 0 && currVals[i] <= targets[i])) {\n\t\t\t\t\tcurrVals[i] = targets[i];\n\t\t\t\t\tatTargets++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (atTargets == currVals.length) {\n\t\t\t\tanimInfo.done();\n\t\t\t}\n\t\t\t\n\t\t\tvar u = animInfo.getUpdateFn();\n\t\t\tu(obj, currVals);\n\t\n\t\t\tvar animFinished = false;\n\t\t\tif (animInfo.isDone()) {\n\t\t\t\t// recheck the stored flag here - if a new animation has\n\t\t\t\t// been started (which shouldn't happen because of the\n\t\t\t\t// single-threading of javascript), the flag cleared may\n\t\t\t\t// no longer be there because a new animation object (with\n\t\t\t\t// a new target definition may have been placed in the list).\n\t\t\t\tdelete objectsToAnimate[key];\n\t\t\t\tanimFinished = true;\n\t\t\t}\n\t\t\treturn(animFinished);\n\t\t}\n\t\t\n\t\tfunction animate() {\n\t\t\tvar animFinished = true;\n\t\t\tfor (var key in objectsToAnimate) {\n\t\t\t\tif (objectsToAnimate.hasOwnProperty(key)) {\n\t\t\t\t\tif (false == iterateSingleAnimObject(key, objectsToAnimate[key])) {\n\t\t\t\t\t\t// at least one not yet finished - schedule again\n\t\t\t\t\t\tanimFinished = false;\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (null != options.postIterHook) {\n\t\t\t\toptions.postIterHook();\n\t\t\t}\n\n\t\t\treturn(! animFinished);\n\t\t}\n\t\t\n\t\tvar isAnimRunnig = false;\n\t\tfunction go() {\n\t\t\tvar reschedule = animate();\n\t\t\tif (reschedule) {\n\t\t\t\tsetTimeout(function() { go(); }, options.period);\n\t\t\t} else {\n\t\t\t\tisAnimRunnig = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction startAnimation() {\n\t\t\tif (! isAnimRunnig) {\n\t\t\t\tsetTimeout(function(){ go(); }, 0); // run now on background task\n\t\t\t\tisAnimRunnig = true;\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\treturn({\n\t\t\tadd: add,\n\t\t\tstartAnimation: startAnimation\n\t\t});\n\t}", "updateXaxis() {\n const axisGroup = Dthree.select('.d3-xaxis-group');\n const duration = this.props.config.duration;\n const transform = this.getAxisGroupTransformString();\n // I'm trying to chain the transitions if the axis moves\n // from bottom to top, as well as changing scale. This\n // is only partly successful, because I also need to address\n // the orientation (top/bottom), which flips the ticks and strings...\n axisGroup\n //\n //\n .transition().duration(duration)\n .call(this.props.axis)\n // I did have delay(duration)...\n .transition().duration(duration)\n .attr('transform', transform)\n ;\n // Failed attempt at separating re-orientation from move...\n // this.props.axis.orient(this.props.config.orient);\n // axisGroup\n // .transition().delay(duration*3).duration(duration)\n // .call(this.props.axis)\n // ;\n }", "function Start () {\n\n\tanimator = GetComponent(Animator); // assign the Animator component\n\tlayers = animator.layerCount;\n\t\n\tif (layers >= 2) {\n\t for (var i : int = 1; i < layers; i++ ) { \n\t animator.SetLayerWeight(i, 1);\n\t }\n\t}\n}", "function bouger() {\n console.log(\"Animation logo activée\");\n $('.image')\n .transition({\n debug: true,\n animation: 'jiggle',\n duration: 500,\n interval: 200\n })\n ;\n}", "_serviceAnimation(animateRequest, current) {\n if (animateRequest === undefined) {\n return;\n }\n let weight = animateRequest.runCount ? animateRequest.animation.weight : 0;\n if (current && weight < 1) {\n weight += ANIM_MERGE_RATE;\n weight = Math.min(1, weight);\n }\n else if (!current && weight > 0) {\n weight -= ANIM_MERGE_RATE;\n weight = Math.max(0, weight);\n }\n if (animateRequest.animation) {\n animateRequest.animation.weight = weight;\n }\n if (weight <= 0) {\n // This old AnimateRequest has been faded out and needs stopped and removed.\n animateRequest.cleanup = true;\n return;\n }\n if (animateRequest.dirty === false) {\n // Nothing more to do.\n // Animations which end set animateRequest.dirty to true when they need\n // this method to continue past this point.\n return;\n }\n // console.log(animateRequest.name, weight, current);\n if (animateRequest.runCount && !animateRequest.loop && animateRequest.reversed) {\n // Freeze frame at first frame in sequence.\n animateRequest.animation.stop();\n animateRequest.animation = this._scene.beginWeightedAnimation(this._skeleton, this._animations[animateRequest.name].from + 2, this._animations[animateRequest.name].from + 2, weight, false, 0.01, function () {\n animateRequest.dirty = true;\n }.bind(this));\n }\n else if (animateRequest.runCount && !animateRequest.loop) {\n // Freeze frame at last frame in sequence.\n animateRequest.animation.stop();\n animateRequest.animation = this._scene.beginWeightedAnimation(this._skeleton, this._animations[animateRequest.name].to, this._animations[animateRequest.name].to, weight, false, 0.01, function () {\n animateRequest.dirty = true;\n }.bind(this));\n }\n else if (animateRequest.reversed) {\n // Play an animation in reverse.\n animateRequest.animation = this._scene.beginWeightedAnimation(this._skeleton, this._animations[animateRequest.name].to, this._animations[animateRequest.name].from + 2, weight, false, 1, function () {\n animateRequest.dirty = true;\n }.bind(this));\n }\n else {\n // Play an animation.\n animateRequest.animation = this._scene.beginWeightedAnimation(this._skeleton, this._animations[animateRequest.name].from + 2, this._animations[animateRequest.name].to, weight, false, 1, function () {\n animateRequest.dirty = true;\n }.bind(this));\n }\n animateRequest.dirty = false;\n animateRequest.runCount++;\n }", "function step () {\n\n\t\t// Kick off animation\n\t\tif (!global_animator.started) {\n\t\t\tglobal_animator.animate();\n\t\t}\n\n\t\t// Animate the Es to Scale\n\t\tif (global_animator.value >= (a_e_s.ratio * a_e_s.order) && !a_e_s.started) {\n\t\t\t// a_e_s.msec = global_animator.msec * a_e_s.ratio;\n\t\t\ta_e_s.animate();\n\t\t}\n\n\t\t// // Animate the Dots to Scale\n\t\tif (global_animator.value >= (a_d_s.ratio * a_d_s.order) && !a_d_s.started) {\n\t\t\t// a_d_s.msec = global_animator.msec * a_d_s.ratio;\n\t\t\t// console.log(\"Dots scale\");\n\t\t\ta_d_s.animate();\n\t\t}\n\t\t\n\t\t// // Animate the Dots to Rotate\n\t\tif (global_animator.value >= (a_d_r.ratio * a_d_r.order) && !a_d_r.started) {\n\t\t\t// a_d_r.msec = global_animator.msec * a_d_r.ratio;\n\t\t\t// console.log(\"Dots rotate\");\n\t\t\ta_d_r.animate();\n\t\t}\n\n\t\t// // Animate the Dots to Change Diameter\n\t\tif (global_animator.value >= (a_d_d.ratio * a_d_d.order) && !a_d_d.started) {\n\t\t\t// a_d_d.msec = global_animator.msec * a_d_d.ratio;\n\t\t\t// console.log(\"Dots diamter\");\n\t\t\ta_d_d.animate();\n\t\t}\n\n\t\t// // Animate both the Dots & Es to Rotate\n\t\tif (global_animator.value >= (a_ed_r.ratio * a_ed_r.order) && !a_ed_r.started) {\n\t\t\t// a_ed_r.msec = global_animator.msec * a_ed_r.ratio;\n\t\t\t// console.log(\"Both rotate\");\n\t\t\ta_ed_r.animate();\n\t\t}\n\n\t\t// // Animate both the Line start positons\n\t\tif (global_animator.value >= (a_l_ds.ratio * a_l_ds.order) && !a_l_ds.started) {\n\t\t\t// a_l_ds.msec = global_animator.msec * a_l_ds.ratio;\n\t\t\t// console.log(\"Line Start\");\n\t\t\ta_l_ds.animate();\n\t\t}\n\n\t\t// // Animate both the Line end positons\n\t\tif (global_animator.value >= (a_l_de.ratio * a_l_de.order) && !a_l_de.started) {\n\t\t\t// a_l_de.msec = global_animator.msec * a_l_de.ratio;\n\t\t\t// console.log(\"Line End\");\n\t\t\ta_l_de.animate();\n\t\t}\n\n\t}", "function rotateGroup(group, fromPos, toPos){\n //console.log('from-to: ', fromPos, toPos)\n if (fromPos==0) fromAng = 35\n else if (fromPos==1) fromAng = 30\n else if (fromPos==2) fromAng = 18\n else if (fromPos==3) fromAng = 6\n else if (fromPos==4) fromAng = -6\n else if (fromPos==5) fromAng = -18\n else if (fromPos==6) fromAng = -30\n else if (fromPos==7) fromAng = -38\n\n if (toPos==0) toAng = 35\n else if (toPos==1) toAng = 30\n else if (toPos==2) toAng = 18\n else if (toPos==3) toAng = 6\n else if (toPos==4) toAng = -6\n else if (toPos==5) toAng = -18\n else if (toPos==6) toAng = -30\n else if (toPos==7) toAng = -38\n\n Snap.animate(fromAng, toAng, function(step){\n group = group.attr({\n transform: new Snap.Matrix().rotate(step, cp[0], cp[1])\n })\n if(retrieveMode || storeMode) pc = pc.attr({transform: new Snap.Matrix().rotate(step-fromAng, cp[0], cp[1])})\n }, Math.abs(fromPos-toPos)*550, mina.linear, function() {\n fromPos2 = toPos\n storeMode = false; retrieveMode = false;\n if (pc) {pc = pc.animate({opacity: 0}, 2000, mina.linear, () =>{})}\n })\n}", "updateAnimation() {\n var translateToOrigin = new Matrix4 ();\n var rotateInPlace = new Matrix4 ();\n var translateBack = new Matrix4 ();\n\n translateToOrigin.setTranslate(-this.x[0], -this.y[0], 0);\n rotateInPlace.setRotate(4, 0, 0, 1);\n translateBack.setTranslate(this.x[0], this.y[0], 0);\n\n this.modelMatrix = translateToOrigin.multiply(this.modelMatrix);\n this.modelMatrix = rotateInPlace.multiply(this.modelMatrix);\n this.modelMatrix = translateBack.multiply(this.modelMatrix);\n \n //this.modelMatrix.setLookAt(0, -1, 1, 0, 0, 0, 0, 0, 1.903);\n }", "sliceGroup( group, start, end ) {\n var newGroup = new BABYLON.AnimationGroup(group.name+\":\"+start+\"-\"+end);\n for ( var i = 0; i < group.targetedAnimations.length; i++ ) {\n var slice = this.sliceAnimation( group.targetedAnimations[i].animation, start, end );\n if ( slice.getKeys().length > 0 ) {\n newGroup.addTargetedAnimation( slice, group.targetedAnimations[i].target );\n }\n }\n return newGroup;\n }", "function animateGifs() {\n var state = $(this).attr(\"data-state\");\n var animated = $(this).attr(\"data-animate\");\n var still = $(this).attr(\"data-still\");\n if (state === \"still\") {\n $(this).attr(\"src\", animated);\n $(this).attr(\"data-state\", \"animate\");\n } else if (state === \"animate\") {\n $(this).attr(\"src\", still);\n $(this).attr(\"data-state\", \"still\");\n }\n }", "applyTweenTransforms() {\n var tween = this.getActiveTween();\n\n if (tween) {\n this.clips.forEach(clip => {\n tween.applyTransformsToClip(clip);\n });\n }\n }", "saveAnimations(groupName) {\n for ( var i = 0; i < this.character.animationGroups.length; i++ ) {\n var animationGroup = this.character.animationGroups[i];\n if ( animationGroup.name === groupName ) {\n var group = this.processAnimations(animationGroup);\n var json = JSON.stringify(group);\n this.attachAnimations(group);\n VRSPACEUI.saveFile(animationGroup.name+'.json', json);\n return;\n }\n }\n console.log(\"No such animation group:\"+groupName);\n }", "updateTransform() {\n this.transform = Object(transformation_matrix__WEBPACK_IMPORTED_MODULE_9__[\"toSVG\"])(Object(transformation_matrix__WEBPACK_IMPORTED_MODULE_9__[\"smoothMatrix\"])(this.transformationMatrix, 100));\n }", "function test_animate() {\n //Do the preview (IS THIS NEEDED?)\n if (AUTO_ANIM) {\n for (var i = 0; i < NODES.length; i++) {\n if (NODES[i].parent) {\n var r = Math.min(Math.max(parseFloat(atob(NODES[i].id)), 0.3), 0.7);\n NODES[i].th = NODES[i].th0 + Math.sin((new Date()).getTime() * 0.003 / r + r * Math.PI * 2) * r * 0.5;\n } else {\n NODES[i].th = NODES[i].th0\n }\n }\n }\n doodleMeta.forwardKinematicsNodes(NODES);\n doodleMeta.calculateSkin(SKIN);\n\n //Do the transfered drawings\n if (AUTO_ANIM) {\n for (let i = 0; i < drawings.length; i++) {\n drawings[i].animate();\n }\n }\n //anim_render();\n master_render();\n}", "update() {\n this.animation.update()\n }", "function attachGroupPlots(selection, parentTransition, groups, defaultPlotter) {\n var groupers = groups.filter(function(group) {\n if (group.plot && group.plot.plotter && group.plot.plotter.groupPlotter) {\n return group;\n }\n });\n\n var update = selection.selectAll(\".grouped\").data(groupers),\n enter = update.enter(),\n exit = update.exit();\n\n enter\n .append(\"g\")\n .classed(\"grouped\", true);\n \n var transition = toTransition(update, parentTransition);\n transition.each(function(group) { \n var selection = d3.select(this);\n group.plot.plotter(selection);\n });\n\n\n exit\n .remove();\n }", "toggleAnimation(){if(this.__stopped){this.__stopped=!1;this.shadowRoot.querySelector(\"#svg\").style.visibility=\"hidden\";if(null!=this.src){this.shadowRoot.querySelector(\"#gif\").src=this.src}this.shadowRoot.querySelector(\"#gif\").alt=this.alt+\" (Stop animation.)\"}else{this.__stopped=!0;this.shadowRoot.querySelector(\"#svg\").style.visibility=\"visible\";if(null!=this.srcWithoutAnimation){this.shadowRoot.querySelector(\"#gif\").src=this.srcWithoutAnimation}this.shadowRoot.querySelector(\"#gif\").alt=this.alt+\" (Play animation.)\"}}", "updateAnimation() {\n return;\n }", "function update() {\n //Update all projectile views\n group.projViews.forEach(function(projView){\n projView.update();\n });\n group.components.forEach(function (view, i) {\n if (i !== 0) {\n view.update();\n }\n else {\n view.set({ left: 0, top: 0 })\n }\n });\n }", "componentDidUpdate() {\n this.mainD3GroupTransition();\n }", "function createAnimations(that){\n \n that.anims.create({\n key: \"left\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 0 }),\n repeat: 0\n });\n\n that.anims.create({\n key: \"finish-left\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 0, end: 2 }),\n repeat: 0\n });\n \n that.anims.create({\n key: \"right\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 4 })\n });\n\n that.anims.create({\n key: \"finish-right\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 4, end: 2 })\n });\n\n that.anims.create({\n key: \"down\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 7, end: 2 }),\n });\n\n that.anims.create({\n key: \"up\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 7 })\n });\n\n}", "function createAnimations(that){\n \n that.anims.create({\n key: \"left\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 0 }),\n repeat: 0\n });\n\n that.anims.create({\n key: \"finish-left\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 0, end: 2 }),\n repeat: 0\n });\n \n that.anims.create({\n key: \"right\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 4 })\n });\n\n that.anims.create({\n key: \"finish-right\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 4, end: 2 })\n });\n\n that.anims.create({\n key: \"down\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 7, end: 2 }),\n });\n\n that.anims.create({\n key: \"up\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 7 })\n });\n\n}", "function animateGif(gif){\n $(gif).attr(\"src\", $(gif).attr(\"data-motion\"))\n $(gif).attr(\"data-state\",\"inMotion\")\n}", "function updateTransitions(transitions,arcs1,arcs2) {\r\n for (let i = 0; i < transitions.length; i++) {\r\n if (isFirable(transitions[i],arcs1,arcs2)) {\r\n transitions[i].attr('.root/fill', '#228b22');\r\n transitions[i].attr('.root/stroke', '#228b22');\r\n transitions[i].attr('.label/fill', '#228b22');\r\n } else {\r\n transitions[i].attr('.root/fill', '#dc143c');\r\n transitions[i].attr('.root/stroke', '#dc143c');\r\n transitions[i].attr('.label/fill', '#dc143c'); \r\n }\r\n };\r\n //console.info(\"who go first??\");\r\n //checkIfNoFirableTransitions(transitions,arcs1,arcs2);\r\n }", "function syncTransitions(transition1, transition2){\n\t\tvar places = transition1.outgoingPlaces;\n\t\tfor(var i = 0; i < places.length; i++){\n\t\t\ttransition2.addOutgoingPlace(places[i]);\n\t\t\tplaces[i].addIncomingTransition(transition2.id);\n\t\t}\n\t\tplaces = transition2.outgoingPlaces;\n\t\tfor(var i = 0; i < places.length; i++){\n\t\t\ttransition1.addOutgoingPlace(places[i]);\n\t\t\tplaces[i].addIncomingTransition(transition1.id);\n\t\t}\n\n\t\tplaces = transition1.incomingPlaces;\n\t\tfor(var i = 0; i < places.length; i++){\n\t\t\ttransition2.addIncomingPlace(places[i]);\n\t\t\tplaces[i].addOutgoingTransition(transition2.id);\n\t\t}\n\t\tplaces = transition2.incomingPlaces;\n\t\tfor(var i = 0; i < places.length; i++){\n\t\t\ttransition1.addIncomingPlace(places[i]);\n\t\t\tplaces[i].addOutgoingTransition(transition1.id);\n\t\t}\n\t}", "updateAnimation() {\n if (this.isMoving()) {\n if (this.dirX == -1)\n this.animator.changeFrameSet(this.frameSets[\"swim-left\"],\n \"loop\", 5);\n else\n this.animator.changeFrameSet(this.frameSets[\"swim-right\"],\n \"loop\", 5);\n } else {\n if (this.dirX == -1)\n this.animator.changeFrameSet(this.frameSets[\"idle-left\"],\n \"pause\");\n else\n this.animator.changeFrameSet(this.frameSets[\"idle-right\"],\n \"pause\");\n }\n \n this.animator.animate();\n }", "_animationFrame() {\n // get the d3 selected handles\n // since the group elems both exist, we dont have to do anything on isRange change\n var startHandle = Px.d3.select(this.$$('#handleStart'));\n var endHandle = Px.d3.select(this.$$('#handleEnd'));\n\n // save the d3 selected handles\n this.set('_startHandle', startHandle);\n this.set('_endHandle', endHandle);\n\n // initial config for our handle paths\n this._buildHandles();\n\n // set up our listeners\n this._setupListeners();\n }", "function fadeUnConnected(g){\n\t\t\t\tvar thisLink = links2.selectAll(\".link\");\n\t\t\t\tthisLink.filter(function(d){ return d.source !==g && d.target !== g; })\n\t\t\t\t\t.transition()\n\t\t\t\t\t\t.duration(500)\n\t\t\t\t\t\t.style(\"opacity\", 0.05);\n\t\t\t}", "function update2() {\n if (!(year in data)) return;\n title.text(year);\n tempYears.transition()\n .duration(750)\n .attr(\"transform\", \"translate(\" + (tGraphx(year1) - tGraphx(year)) + \",0)\");\n\n tempYear.selectAll(\"rect\")\n .data(function(tempYear) { return data[year][tempYear] || [-800, -800]; })\n .transition()\n .duration(750)\n .attr(\"y\", tGraphy)\n \n .attr(\"year\",function(d){return glob2=year;})\n\n .attr(\"sum\", function(value) {value3.push(value);})//new\n\n .attr(\"height\", function(value) { return height1 - tGraphy(value); });\n var tem= 2014-glob2;\n var tempor=value3.length;\n var newtem= 2014-glob2;\n if(tem >12){newtem=tem*2-tem;}\n \n if(tem<=12){\n while(value3.length!=12)\n {\n while(value3.length>tempor-newtem)\n {\n value3.pop();\n }\n value3.shift();\n }\n }\n\n if(tem>12){\n while(value3.length!=12)\n {\n while(value3.length>tempor-newtem+(12-tem))\n {\n value3.pop();\n }\n value3.shift();\n }\n }\n\n }", "function addMoveByTween(start_time, end_time, instance, sbomIdPath, moveby, moveto, callback ) {\n var start = start_time * SPEED;\n var duration = end_time * SPEED - start;\n var object = getAnimationAdapter().getSelectedObject(instance);\n if ( object === null ) {\n object = getAnimationAdapter().getSelectedObject(sbomIdPath);\n }\n if ( object === null ) {\n console.log(\"Not processing geometry \" + instance + \" nor \" + sbomIdPath + \" to change location\" );\n return false;\n }\n\n var scalar = getAnimationAdapter().getFlyScalar(object);\n moveby.position.multiplyScalar(scalar);\n\n if ( ! moveby.global) {\n moveby.position.applyQuaternion(getAnimationAdapter().getQuaternion(object));\n }\n\n var from_data = {\n data: {\n object: object,\n startPosition : object.position.clone(),\n startQuaternion : object.quaternion.clone(),\n position: new THREE.Vector3(0,0,0),\n quaternion : new THREE.Quaternion(),\n center : new THREE.Vector3(0,0,0),\n scale : 1,\n mc: false\n }\n };\n var to_data = {\n data: {\n object: object,\n startPosition : object.position.clone(),\n startQuaternion : object.quaternion.clone(),\n position: new THREE.Vector3().copy(moveby.position),\n quaternion : new THREE.Quaternion(),\n center : new THREE.Vector3(0,0,0),\n scale : 1,\n mc: false\n }\n };\n\n var tw = new TWEEN.Tween( from_data );\n tw.to( to_data, duration );\n tw.delay(start_time * SPEED);\n tw.onStart( function (object, result) {\n } );\n tw.interpolation(getAnimationAdapter().locationMoveByInterpolation);\n if ( callback !== null ) {\n tw.onComplete(callback);\n }\n end_time = start_time * SPEED + duration;\n if ( end_time > RUNNING_TIME ) RUNNING_TIME = end_time;\n ANIMATION_TWEENS.push(tw);\n\n var utw = new TWEEN.Tween( to_data );\n utw.to( from_data, UNDO_DURATION );\n utw.easing(TWEEN.Easing.Linear.None);\n utw.interpolation(getAnimationAdapter().locationMoveByInterpolation);\n utw.delay(0);\n UNDO_TWEENS.push(utw);\n\n return true;\n }", "animationChangeHandler () {\n this.store.dispatch(setAnimation(!fgmState.animation));\n }", "function updateTransitions() {\r\n\r\n if (motion.currentTransition !== nullTransition) {\r\n // is this a new transition?\r\n if (motion.currentTransition.progress === 0) {\r\n // do we have overlapping transitions?\r\n if (motion.currentTransition.lastTransition !== nullTransition) {\r\n // is the last animation for the nested transition the same as the new animation?\r\n if (motion.currentTransition.lastTransition.lastAnimation === avatar.currentAnimation) {\r\n // then sync the nested transition's frequency time wheel for a smooth animation blend\r\n motion.frequencyTimeWheelPos = motion.currentTransition.lastTransition.lastFrequencyTimeWheelPos;\r\n }\r\n }\r\n }\r\n if (motion.currentTransition.updateProgress() === TRANSITION_COMPLETE) {\r\n motion.currentTransition = nullTransition;\r\n }\r\n }\r\n}", "function toggleGroup($ele) {\r\n\tvar $parent = $ele.closest(\"[data-transition='parent']\");\r\n\tvar transClass = $ele.attr(\"data-transition\");\r\n\tvar removeClass = $ele.attr(\"data-remove\").split(\"|\");\r\n\tfor(index in removeClass) {\r\n\t\t$parent.removeClass(removeClass[index]);\r\n\t}\r\n\tsetTimeout(function(){ $parent.addClass(transClass); },0);\r\n}", "function selectAnimation() {\r\n var playTransitionReachPoses = true;\r\n\r\n // select appropriate animation. create transitions where appropriate\r\n switch (motion.nextState) {\r\n case STATIC: {\r\n if (avatar.distanceFromSurface < ON_SURFACE_THRESHOLD &&\r\n avatar.currentAnimation !== avatar.selectedIdle) {\r\n setTransition(avatar.selectedIdle, playTransitionReachPoses);\r\n } else if (!(avatar.distanceFromSurface < ON_SURFACE_THRESHOLD) &&\r\n avatar.currentAnimation !== avatar.selectedHover) {\r\n setTransition(avatar.selectedHover, playTransitionReachPoses);\r\n }\r\n motion.state = STATIC;\r\n avatar.selectedWalkBlend.lastDirection = NONE;\r\n break;\r\n }\r\n\r\n case SURFACE_MOTION: {\r\n // walk transition reach poses are currently only specified for starting to walk forwards\r\n playTransitionReachPoses = (motion.direction === FORWARDS);\r\n var isAlreadyWalking = (avatar.currentAnimation === avatar.selectedWalkBlend);\r\n\r\n switch (motion.direction) {\r\n case FORWARDS:\r\n if (avatar.selectedWalkBlend.lastDirection !== FORWARDS) {\r\n animationOperations.deepCopy(avatar.selectedWalk, avatar.selectedWalkBlend);\r\n avatar.calibration.strideLength = avatar.selectedWalk.calibration.strideLength;\r\n }\r\n avatar.selectedWalkBlend.lastDirection = FORWARDS;\r\n break;\r\n\r\n case BACKWARDS:\r\n if (avatar.selectedWalkBlend.lastDirection !== BACKWARDS) {\r\n animationOperations.deepCopy(avatar.selectedWalkBackwards, avatar.selectedWalkBlend);\r\n avatar.calibration.strideLength = avatar.selectedWalkBackwards.calibration.strideLength;\r\n }\r\n avatar.selectedWalkBlend.lastDirection = BACKWARDS;\r\n break;\r\n\r\n case LEFT:\r\n animationOperations.deepCopy(avatar.selectedSideStepLeft, avatar.selectedWalkBlend);\r\n avatar.selectedWalkBlend.lastDirection = LEFT;\r\n avatar.calibration.strideLength = avatar.selectedSideStepLeft.calibration.strideLength;\r\n break\r\n\r\n case RIGHT:\r\n animationOperations.deepCopy(avatar.selectedSideStepRight, avatar.selectedWalkBlend);\r\n avatar.selectedWalkBlend.lastDirection = RIGHT;\r\n avatar.calibration.strideLength = avatar.selectedSideStepRight.calibration.strideLength;\r\n break;\r\n\r\n default:\r\n // condition occurs when the avi goes through the floor due to collision hull errors\r\n animationOperations.deepCopy(avatar.selectedWalk, avatar.selectedWalkBlend);\r\n avatar.selectedWalkBlend.lastDirection = FORWARDS;\r\n avatar.calibration.strideLength = avatar.selectedWalk.calibration.strideLength;\r\n break;\r\n }\r\n\r\n if (!isAlreadyWalking && !motion.isComingToHalt) {\r\n setTransition(avatar.selectedWalkBlend, playTransitionReachPoses);\r\n }\r\n motion.state = SURFACE_MOTION;\r\n break;\r\n }\r\n\r\n case AIR_MOTION: {\r\n // blend the up, down, forward and backward flying animations relative to motion speed and direction\r\n animationOperations.zeroAnimation(avatar.selectedFlyBlend);\r\n\r\n // calculate influences based on velocity and direction\r\n var velocityMagnitude = Vec3.length(motion.velocity);\r\n var verticalProportion = motion.velocity.y / velocityMagnitude;\r\n var thrustProportion = motion.velocity.z / velocityMagnitude / 2;\r\n\r\n // directional components\r\n var upComponent = motion.velocity.y > 0 ? verticalProportion : 0;\r\n var downComponent = motion.velocity.y < 0 ? -verticalProportion : 0;\r\n var forwardComponent = motion.velocity.z < 0 ? -thrustProportion : 0;\r\n var backwardComponent = motion.velocity.z > 0 ? thrustProportion : 0;\r\n\r\n // smooth / damp directional components to add visual 'weight'\r\n upComponent = flyUpFilter.process(upComponent);\r\n downComponent = flyDownFilter.process(downComponent);\r\n forwardComponent = flyForwardFilter.process(forwardComponent);\r\n backwardComponent = flyBackwardFilter.process(backwardComponent);\r\n\r\n // normalise directional components\r\n var normaliser = upComponent + downComponent + forwardComponent + backwardComponent;\r\n upComponent = upComponent / normaliser;\r\n downComponent = downComponent / normaliser;\r\n forwardComponent = forwardComponent / normaliser;\r\n backwardComponent = backwardComponent / normaliser;\r\n\r\n // blend animations proportionally\r\n if (upComponent > 0) {\r\n animationOperations.blendAnimation(avatar.selectedFlyUp,\r\n avatar.selectedFlyBlend,\r\n upComponent);\r\n }\r\n if (downComponent > 0) {\r\n animationOperations.blendAnimation(avatar.selectedFlyDown,\r\n avatar.selectedFlyBlend,\r\n downComponent);\r\n }\r\n if (forwardComponent > 0) {\r\n animationOperations.blendAnimation(avatar.selectedFly,\r\n avatar.selectedFlyBlend,\r\n Math.abs(forwardComponent));\r\n }\r\n if (backwardComponent > 0) {\r\n animationOperations.blendAnimation(avatar.selectedFlyBackwards,\r\n avatar.selectedFlyBlend,\r\n Math.abs(backwardComponent));\r\n }\r\n\r\n if (avatar.currentAnimation !== avatar.selectedFlyBlend) {\r\n setTransition(avatar.selectedFlyBlend, playTransitionReachPoses);\r\n }\r\n motion.state = AIR_MOTION;\r\n avatar.selectedWalkBlend.lastDirection = NONE;\r\n break;\r\n }\r\n } // end switch next state of motion\r\n}", "updateAnimation() {\n\n this.modelMatrix.rotate(1,0,1,0)\n }", "updateAnimations() {\n this.animations.forEach((animation, index) => {\n if (animation.finished) {\n this.animations.splice(index, 1);\n }\n });\n }", "function transition() {\n\n linePath.transition()\n .duration(7500)\n .attrTween(\"stroke-dasharray\", tweenDash)\n .on(\"end\", function() {\n d3.select(this).call(transition);// infinite loop\n }); \n }", "animate(animation) {\r\n if (!this.bmp.currentAnimation || this.bmp.currentAnimation.indexOf(animation) === -1) {\r\n this.bmp.gotoAndPlay(animation);\r\n }\r\n }", "function transitionSplit(d, i) {\n d3.select(this)\n .transition().duration(1000)\n .attrTween(\"d\", tweenArc({\n innerRadius: i & 1 ? innerRadius : (innerRadius + outerRadius) / 2,\n outerRadius: i & 1 ? (innerRadius + outerRadius) / 2 : outerRadius\n }))\n .each(\"end\", transitionRotate);\n }", "display_by_group() {\n this.force.gravity(this.layout_gravity)\n .charge(this.charge)\n .friction(0.9)\n .on(\"tick\", e => {\n return this.circles.each(this.move_towards_group(e.alpha))\n .attr(\"cx\", d => d.x)\n .attr(\"cy\", d => d.y);\n });\n this.force.start();\n\n return this.display_years();\n }", "animate(animation) {\n if (!this.bmp.currentAnimation || this.bmp.currentAnimation.indexOf(animation) === -1) {\n this.bmp.gotoAndPlay(animation);\n }\n }", "update() {\n this.timeline();\n if (this.paused) return;\n const snippetCache = this.timeScale * this.snippet;\n const length = this.groups.length;\n for (let i = 0; i < length; i++) {\n const animationGroup = this.groups[i];\n animationGroup.update(snippetCache);\n }\n this.emit('update', this.snippet);\n }", "function animateGraph() {\n var pathArray = document.querySelectorAll(elem + \" \" + 'svg path')\n for (var i = 0; i < pathArray.length; i++) {\n var path = pathArray[i];\n var length = path.getTotalLength();\n // Clear any previous transition\n path.style.transition = path.style.WebkitTransition =\n 'none';\n // Set up the starting positions\n path.style.strokeDasharray = length + ' ' + length;\n path.style.strokeDashoffset = length;\n // Trigger a layout so styles are calculated & the browser\n // picks up the starting position before animating\n path.getBoundingClientRect();\n // Define our transition\n path.style.transition = path.style.WebkitTransition =\n 'stroke-dashoffset 0.344s cubic-bezier(0.23, 0.6, 0.09, 0.96)';\n // Go!\n path.style.strokeDashoffset = '0';\n }\n\n\n }", "updateAnimation() {\n\t\t// console.log(this.centerX, this.centerY);\n\t\tlet translateMatrix1 = new Matrix4();\n\t\tlet rotateMatrix = new Matrix4();\n\t\tlet translateMatrix2 = new Matrix4();\n\n\t\t//T\n\t\ttranslateMatrix1.setTranslate(-this.centerX, -this.centerY, 0);\n\n\t\t\tthis.modelMatrix = translateMatrix1.multiply(this.modelMatrix);\n\t\t\t\n\t\t//R\n\t\trotateMatrix.setRotate(this.currentAngle, 0, 0, 1);\n\n\t\t\tthis.modelMatrix = rotateMatrix.multiply(this.modelMatrix);\n\n\t\t//T\n\t\ttranslateMatrix2.setTranslate(this.centerX, this.centerY, 0);\n\n\t\t\tthis.modelMatrix = translateMatrix2.multiply(this.modelMatrix);\n\n\t\t// Pass the rotation matrix to the vertex shader\n\t\tgl.uniformMatrix4fv(u_ModelMatrix, false, this.modelMatrix.elements);\n\t\tthis.render();\n\t}", "function updateBlend(seriesModel, chartView) {\n var blendMode = seriesModel.get('blendMode') || null;\n\n if (false) {}\n\n chartView.group.traverse(function (el) {\n // FIXME marker and other components\n if (!el.isGroup) {\n // DONT mark the element dirty. In case element is incremental and don't wan't to rerender.\n el.style.blend = blendMode;\n }\n\n if (el.eachPendingDisplayable) {\n el.eachPendingDisplayable(function (displayable) {\n displayable.style.blend = blendMode;\n });\n }\n });\n }", "function transitionUnite(d, i) {\n d3.select(this)\n .transition().duration(1000)\n .attrTween(\"d\", tweenArc({\n innerRadius: innerRadius,\n outerRadius: outerRadius\n }));\n }" ]
[ "0.82009727", "0.8087827", "0.6136968", "0.60111254", "0.5600348", "0.55152535", "0.5512211", "0.5407871", "0.5343184", "0.5328385", "0.5293422", "0.52854705", "0.5275739", "0.5247094", "0.52007985", "0.5175826", "0.51679087", "0.51490414", "0.51416284", "0.5083781", "0.5078934", "0.5078227", "0.5059378", "0.50375426", "0.5000708", "0.49827436", "0.49750066", "0.4933139", "0.49329337", "0.49018168", "0.48847985", "0.4881259", "0.48745847", "0.48558298", "0.4822881", "0.48045385", "0.48032743", "0.480318", "0.47971788", "0.47872993", "0.47748852", "0.4762622", "0.47581035", "0.4750306", "0.4743306", "0.4741473", "0.47277242", "0.4724984", "0.4723142", "0.47199085", "0.4709408", "0.47045386", "0.47023615", "0.46972963", "0.469114", "0.4688342", "0.46802148", "0.4674329", "0.46651986", "0.465619", "0.46532363", "0.46494374", "0.4646845", "0.463986", "0.46392772", "0.46369907", "0.4633536", "0.4633536", "0.46273786", "0.462547", "0.46243763", "0.46224144", "0.46204472", "0.4617949", "0.46124133", "0.45997196", "0.4599175", "0.45960253", "0.45915297", "0.45837748", "0.45776436", "0.45725298", "0.4572247", "0.4562121", "0.4561028", "0.45608515", "0.4558339", "0.45509064", "0.45488918", "0.45435432", "0.45404154", "0.45388743" ]
0.8376019
8
Zepto.js (c) 20102013 Thomas Fuchs Zepto.js may be freely distributed under the MIT license.
function detect(ua) { var os = {}; var browser = {}; // var webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/); // var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); // var ipad = ua.match(/(iPad).*OS\s([\d_]+)/); // var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/); // var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/); // var webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/); // var touchpad = webos && ua.match(/TouchPad/); // var kindle = ua.match(/Kindle\/([\d.]+)/); // var silk = ua.match(/Silk\/([\d._]+)/); // var blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/); // var bb10 = ua.match(/(BB10).*Version\/([\d.]+)/); // var rimtabletos = ua.match(/(RIM\sTablet\sOS)\s([\d.]+)/); // var playbook = ua.match(/PlayBook/); // var chrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/); var firefox = ua.match(/Firefox\/([\d.]+)/); // var safari = webkit && ua.match(/Mobile\//) && !chrome; // var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome; var ie = ua.match(/MSIE\s([\d.]+)/) // IE 11 Trident/7.0; rv:11.0 || ua.match(/Trident\/.+?rv:(([\d.]+))/); var edge = ua.match(/Edge\/([\d.]+)/); // IE 12 and 12+ var weChat = /micromessenger/i.test(ua); // Todo: clean this up with a better OS/browser seperation: // - discern (more) between multiple browsers on android // - decide if kindle fire in silk mode is android or not // - Firefox on Android doesn't specify the Android version // - possibly devide in os, device and browser hashes // if (browser.webkit = !!webkit) browser.version = webkit[1]; // if (android) os.android = true, os.version = android[2]; // if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.'); // if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.'); // if (ipod) os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null; // if (webos) os.webos = true, os.version = webos[2]; // if (touchpad) os.touchpad = true; // if (blackberry) os.blackberry = true, os.version = blackberry[2]; // if (bb10) os.bb10 = true, os.version = bb10[2]; // if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2]; // if (playbook) browser.playbook = true; // if (kindle) os.kindle = true, os.version = kindle[1]; // if (silk) browser.silk = true, browser.version = silk[1]; // if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true; // if (chrome) browser.chrome = true, browser.version = chrome[1]; if (firefox) { browser.firefox = true; browser.version = firefox[1]; } // if (safari && (ua.match(/Safari/) || !!os.ios)) browser.safari = true; // if (webview) browser.webview = true; if (ie) { browser.ie = true; browser.version = ie[1]; } if (edge) { browser.edge = true; browser.version = edge[1]; } // It is difficult to detect WeChat in Win Phone precisely, because ua can // not be set on win phone. So we do not consider Win Phone. if (weChat) { browser.weChat = true; } // os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) || // (firefox && ua.match(/Tablet/)) || (ie && !ua.match(/Phone/) && ua.match(/Touch/))); // os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos || // (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\/([\d.]+)/)) || // (firefox && ua.match(/Mobile/)) || (ie && ua.match(/Touch/)))); return { browser: browser, os: os, node: false, // 原生canvas支持,改极端点了 // canvasSupported : !(browser.ie && parseFloat(browser.version) < 9) canvasSupported: !!document.createElement('canvas').getContext, svgSupported: typeof SVGRect !== 'undefined', // works on most browsers // IE10/11 does not support touch event, and MS Edge supports them but not by // default, so we dont check navigator.maxTouchPoints for them here. touchEventsSupported: 'ontouchstart' in window && !browser.ie && !browser.edge, // <http://caniuse.com/#search=pointer%20event>. pointerEventsSupported: 'onpointerdown' in window // Firefox supports pointer but not by default, only MS browsers are reliable on pointer // events currently. So we dont use that on other browsers unless tested sufficiently. // Although IE 10 supports pointer event, it use old style and is different from the // standard. So we exclude that. (IE 10 is hardly used on touch device) && (browser.edge || browser.ie && browser.version >= 11), // passiveSupported: detectPassiveSupport() domSupported: typeof document !== 'undefined' }; } // See https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zXmlDom() {\n\n}", "function ie(){Z.apply(this,arguments),this._timer=null,this._input=null}", "function ie(e,r){var n=o(e),a=void 0===w[0]\nr=void 0===r||!!r,t.animate&&!a&&i(_,t.cssClasses.tap,t.animationDuration),E.forEach((function(e){re(e,function(e,r){return null===e||!1===e||void 0===e?w[r]:(\"number\"==typeof e&&(e=String(e)),e=t.format.from(e),!1===(e=D.toStepping(e))||isNaN(e)?w[r]:e)}(n[e],e),!0,!1)})),E.forEach((function(e){re(e,w[e],!0,!0)})),te(),E.forEach((function(e){$(\"update\",e),null!==n[e]&&r&&$(\"set\",e)}))}", "function jQueryStub() {\n return this;\n}", "function $(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if(\"object\"===typeof Reflect&&\"function\"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o}", "function ie(e,n){var r=a(e),o=void 0===x[0];n=void 0===n||!!n,t.animate&&!o&&i(w,t.cssClasses.tap,t.animationDuration),S.forEach((function(e){ne(e,function(e,n){return null===e||!1===e||void 0===e?x[n]:(\"number\"==typeof e&&(e=String(e)),e=t.format.from(e),!1===(e=k.toStepping(e))||isNaN(e)?x[n]:e)}(r[e],e),!0,!1)})),S.forEach((function(e){ne(e,x[e],!0,!0)})),te(),S.forEach((function(e){$(\"update\",e),null!==r[e]&&n&&$(\"set\",e)}))}", "function Zt(){}", "function zi(){return zi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zi.apply(this,arguments)}", "function em(t){var e=nm();return function(){var n,r=Co(t);if(e){var i=Co(this).constructor;n=ho()(r,arguments,i)}else n=r.apply(this,arguments);return ko(this,n)}}", "function _loadTetherBS4() {\n\t!function(t,e){\"function\"==typeof define&&define.amd?define(e):\"object\"==typeof exports?module.exports=e(require,exports,module):t.Tether=e()}(this,function(t,e,o){\"use strict\";function n(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function i(t){var e=t.getBoundingClientRect(),o={};for(var n in e)o[n]=e[n];if(t.ownerDocument!==document){var r=t.ownerDocument.defaultView.frameElement;if(r){var s=i(r);o.top+=s.top,o.bottom+=s.top,o.left+=s.left,o.right+=s.left}}return o}function r(t){var e=getComputedStyle(t)||{},o=e.position,n=[];if(\"fixed\"===o)return[t];for(var i=t;(i=i.parentNode)&&i&&1===i.nodeType;){var r=void 0;try{r=getComputedStyle(i)}catch(s){}if(\"undefined\"==typeof r||null===r)return n.push(i),n;var a=r,f=a.overflow,l=a.overflowX,h=a.overflowY;/(auto|scroll)/.test(f+h+l)&&(\"absolute\"!==o||[\"relative\",\"absolute\",\"fixed\"].indexOf(r.position)>=0)&&n.push(i)}return n.push(t.ownerDocument.body),t.ownerDocument!==document&&n.push(t.ownerDocument.defaultView),n}function s(){A&&document.body.removeChild(A),A=null}function a(t){var e=void 0;t===document?(e=document,t=document.documentElement):e=t.ownerDocument;var o=e.documentElement,n=i(t),r=P();return n.top-=r.top,n.left-=r.left,\"undefined\"==typeof n.width&&(n.width=document.body.scrollWidth-n.left-n.right),\"undefined\"==typeof n.height&&(n.height=document.body.scrollHeight-n.top-n.bottom),n.top=n.top-o.clientTop,n.left=n.left-o.clientLeft,n.right=e.body.clientWidth-n.width-n.left,n.bottom=e.body.clientHeight-n.height-n.top,n}function f(t){return t.offsetParent||document.documentElement}function l(){var t=document.createElement(\"div\");t.style.width=\"100%\",t.style.height=\"200px\";var e=document.createElement(\"div\");h(e.style,{position:\"absolute\",top:0,left:0,pointerEvents:\"none\",visibility:\"hidden\",width:\"200px\",height:\"150px\",overflow:\"hidden\"}),e.appendChild(t),document.body.appendChild(e);var o=t.offsetWidth;e.style.overflow=\"scroll\";var n=t.offsetWidth;o===n&&(n=e.clientWidth),document.body.removeChild(e);var i=o-n;return{width:i,height:i}}function h(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],e=[];return Array.prototype.push.apply(e,arguments),e.slice(1).forEach(function(e){if(e)for(var o in e)({}).hasOwnProperty.call(e,o)&&(t[o]=e[o])}),t}function u(t,e){if(\"undefined\"!=typeof t.classList)e.split(\" \").forEach(function(e){e.trim()&&t.classList.remove(e)});else{var o=new RegExp(\"(^| )\"+e.split(\" \").join(\"|\")+\"( |$)\",\"gi\"),n=c(t).replace(o,\" \");g(t,n)}}function d(t,e){if(\"undefined\"!=typeof t.classList)e.split(\" \").forEach(function(e){e.trim()&&t.classList.add(e)});else{u(t,e);var o=c(t)+(\" \"+e);g(t,o)}}function p(t,e){if(\"undefined\"!=typeof t.classList)return t.classList.contains(e);var o=c(t);return new RegExp(\"(^| )\"+e+\"( |$)\",\"gi\").test(o)}function c(t){return t.className instanceof t.ownerDocument.defaultView.SVGAnimatedString?t.className.baseVal:t.className}function g(t,e){t.setAttribute(\"class\",e)}function m(t,e,o){o.forEach(function(o){-1===e.indexOf(o)&&p(t,o)&&u(t,o)}),e.forEach(function(e){p(t,e)||d(t,e)})}function n(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function v(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function y(t,e){var o=arguments.length<=2||void 0===arguments[2]?1:arguments[2];return t+o>=e&&e>=t-o}function b(){return\"undefined\"!=typeof performance&&\"undefined\"!=typeof performance.now?performance.now():+new Date}function w(){for(var t={top:0,left:0},e=arguments.length,o=Array(e),n=0;e>n;n++)o[n]=arguments[n];return o.forEach(function(e){var o=e.top,n=e.left;\"string\"==typeof o&&(o=parseFloat(o,10)),\"string\"==typeof n&&(n=parseFloat(n,10)),t.top+=o,t.left+=n}),t}function C(t,e){return\"string\"==typeof t.left&&-1!==t.left.indexOf(\"%\")&&(t.left=parseFloat(t.left,10)/100*e.width),\"string\"==typeof t.top&&-1!==t.top.indexOf(\"%\")&&(t.top=parseFloat(t.top,10)/100*e.height),t}function O(t,e){return\"scrollParent\"===e?e=t.scrollParents[0]:\"window\"===e&&(e=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),e===document&&(e=e.documentElement),\"undefined\"!=typeof e.nodeType&&!function(){var t=e,o=a(e),n=o,i=getComputedStyle(e);if(e=[n.left,n.top,o.width+n.left,o.height+n.top],t.ownerDocument!==document){var r=t.ownerDocument.defaultView;e[0]+=r.pageXOffset,e[1]+=r.pageYOffset,e[2]+=r.pageXOffset,e[3]+=r.pageYOffset}$.forEach(function(t,o){t=t[0].toUpperCase()+t.substr(1),\"Top\"===t||\"Left\"===t?e[o]+=parseFloat(i[\"border\"+t+\"Width\"]):e[o]-=parseFloat(i[\"border\"+t+\"Width\"])})}(),e}var E=function(){function t(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,o,n){return o&&t(e.prototype,o),n&&t(e,n),e}}(),x=void 0;\"undefined\"==typeof x&&(x={modules:[]});var A=null,T=function(){var t=0;return function(){return++t}}(),S={},P=function(){var t=A;t||(t=document.createElement(\"div\"),t.setAttribute(\"data-tether-id\",T()),h(t.style,{top:0,left:0,position:\"absolute\"}),document.body.appendChild(t),A=t);var e=t.getAttribute(\"data-tether-id\");return\"undefined\"==typeof S[e]&&(S[e]=i(t),M(function(){delete S[e]})),S[e]},W=[],M=function(t){W.push(t)},_=function(){for(var t=void 0;t=W.pop();)t()},k=function(){function t(){n(this,t)}return E(t,[{key:\"on\",value:function(t,e,o){var n=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];\"undefined\"==typeof this.bindings&&(this.bindings={}),\"undefined\"==typeof this.bindings[t]&&(this.bindings[t]=[]),this.bindings[t].push({handler:e,ctx:o,once:n})}},{key:\"once\",value:function(t,e,o){this.on(t,e,o,!0)}},{key:\"off\",value:function(t,e){if(\"undefined\"!=typeof this.bindings&&\"undefined\"!=typeof this.bindings[t])if(\"undefined\"==typeof e)delete this.bindings[t];else for(var o=0;o<this.bindings[t].length;)this.bindings[t][o].handler===e?this.bindings[t].splice(o,1):++o}},{key:\"trigger\",value:function(t){if(\"undefined\"!=typeof this.bindings&&this.bindings[t]){for(var e=0,o=arguments.length,n=Array(o>1?o-1:0),i=1;o>i;i++)n[i-1]=arguments[i];for(;e<this.bindings[t].length;){var r=this.bindings[t][e],s=r.handler,a=r.ctx,f=r.once,l=a;\"undefined\"==typeof l&&(l=this),s.apply(l,n),f?this.bindings[t].splice(e,1):++e}}}}]),t}();x.Utils={getActualBoundingClientRect:i,getScrollParents:r,getBounds:a,getOffsetParent:f,extend:h,addClass:d,removeClass:u,hasClass:p,updateClasses:m,defer:M,flush:_,uniqueId:T,Evented:k,getScrollBarSize:l,removeUtilElements:s};var B=function(){function t(t,e){var o=[],n=!0,i=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(o.push(s.value),!e||o.length!==e);n=!0);}catch(f){i=!0,r=f}finally{try{!n&&a[\"return\"]&&a[\"return\"]()}finally{if(i)throw r}}return o}return function(e,o){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,o);throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}}(),E=function(){function t(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,o,n){return o&&t(e.prototype,o),n&&t(e,n),e}}(),z=function(t,e,o){for(var n=!0;n;){var i=t,r=e,s=o;n=!1,null===i&&(i=Function.prototype);var a=Object.getOwnPropertyDescriptor(i,r);if(void 0!==a){if(\"value\"in a)return a.value;var f=a.get;if(void 0===f)return;return f.call(s)}var l=Object.getPrototypeOf(i);if(null===l)return;t=l,e=r,o=s,n=!0,a=l=void 0}};if(\"undefined\"==typeof x)throw new Error(\"You must include the utils.js file before tether.js\");var j=x.Utils,r=j.getScrollParents,a=j.getBounds,f=j.getOffsetParent,h=j.extend,d=j.addClass,u=j.removeClass,m=j.updateClasses,M=j.defer,_=j.flush,l=j.getScrollBarSize,s=j.removeUtilElements,Y=function(){if(\"undefined\"==typeof document)return\"\";for(var t=document.createElement(\"div\"),e=[\"transform\",\"WebkitTransform\",\"OTransform\",\"MozTransform\",\"msTransform\"],o=0;o<e.length;++o){var n=e[o];if(void 0!==t.style[n])return n}}(),L=[],D=function(){L.forEach(function(t){t.position(!1)}),_()};!function(){var t=null,e=null,o=null,n=function i(){return\"undefined\"!=typeof e&&e>16?(e=Math.min(e-16,250),void(o=setTimeout(i,250))):void(\"undefined\"!=typeof t&&b()-t<10||(null!=o&&(clearTimeout(o),o=null),t=b(),D(),e=b()-t))};\"undefined\"!=typeof window&&\"undefined\"!=typeof window.addEventListener&&[\"resize\",\"scroll\",\"touchmove\"].forEach(function(t){window.addEventListener(t,n)})}();var X={center:\"center\",left:\"right\",right:\"left\"},F={middle:\"middle\",top:\"bottom\",bottom:\"top\"},H={top:0,left:0,middle:\"50%\",center:\"50%\",bottom:\"100%\",right:\"100%\"},N=function(t,e){var o=t.left,n=t.top;return\"auto\"===o&&(o=X[e.left]),\"auto\"===n&&(n=F[e.top]),{left:o,top:n}},U=function(t){var e=t.left,o=t.top;return\"undefined\"!=typeof H[t.left]&&(e=H[t.left]),\"undefined\"!=typeof H[t.top]&&(o=H[t.top]),{left:e,top:o}},V=function(t){var e=t.split(\" \"),o=B(e,2),n=o[0],i=o[1];return{top:n,left:i}},R=V,q=function(t){function e(t){var o=this;n(this,e),z(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this),this.position=this.position.bind(this),L.push(this),this.history=[],this.setOptions(t,!1),x.modules.forEach(function(t){\"undefined\"!=typeof t.initialize&&t.initialize.call(o)}),this.position()}return v(e,t),E(e,[{key:\"getClass\",value:function(){var t=arguments.length<=0||void 0===arguments[0]?\"\":arguments[0],e=this.options.classes;return\"undefined\"!=typeof e&&e[t]?this.options.classes[t]:this.options.classPrefix?this.options.classPrefix+\"-\"+t:t}},{key:\"setOptions\",value:function(t){var e=this,o=arguments.length<=1||void 0===arguments[1]?!0:arguments[1],n={offset:\"0 0\",targetOffset:\"0 0\",targetAttachment:\"auto auto\",classPrefix:\"tether\"};this.options=h(n,t);var i=this.options,s=i.element,a=i.target,f=i.targetModifier;if(this.element=s,this.target=a,this.targetModifier=f,\"viewport\"===this.target?(this.target=document.body,this.targetModifier=\"visible\"):\"scroll-handle\"===this.target&&(this.target=document.body,this.targetModifier=\"scroll-handle\"),[\"element\",\"target\"].forEach(function(t){if(\"undefined\"==typeof e[t])throw new Error(\"Tether Error: Both element and target must be defined\");\"undefined\"!=typeof e[t].jquery?e[t]=e[t][0]:\"string\"==typeof e[t]&&(e[t]=document.querySelector(e[t]))}),d(this.element,this.getClass(\"element\")),this.options.addTargetClasses!==!1&&d(this.target,this.getClass(\"target\")),!this.options.attachment)throw new Error(\"Tether Error: You must provide an attachment\");this.targetAttachment=R(this.options.targetAttachment),this.attachment=R(this.options.attachment),this.offset=V(this.options.offset),this.targetOffset=V(this.options.targetOffset),\"undefined\"!=typeof this.scrollParents&&this.disable(),\"scroll-handle\"===this.targetModifier?this.scrollParents=[this.target]:this.scrollParents=r(this.target),this.options.enabled!==!1&&this.enable(o)}},{key:\"getTargetBounds\",value:function(){if(\"undefined\"==typeof this.targetModifier)return a(this.target);if(\"visible\"===this.targetModifier){if(this.target===document.body)return{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth};var t=a(this.target),e={height:t.height,width:t.width,top:t.top,left:t.left};return e.height=Math.min(e.height,t.height-(pageYOffset-t.top)),e.height=Math.min(e.height,t.height-(t.top+t.height-(pageYOffset+innerHeight))),e.height=Math.min(innerHeight,e.height),e.height-=2,e.width=Math.min(e.width,t.width-(pageXOffset-t.left)),e.width=Math.min(e.width,t.width-(t.left+t.width-(pageXOffset+innerWidth))),e.width=Math.min(innerWidth,e.width),e.width-=2,e.top<pageYOffset&&(e.top=pageYOffset),e.left<pageXOffset&&(e.left=pageXOffset),e}if(\"scroll-handle\"===this.targetModifier){var t=void 0,o=this.target;o===document.body?(o=document.documentElement,t={left:pageXOffset,top:pageYOffset,height:innerHeight,width:innerWidth}):t=a(o);var n=getComputedStyle(o),i=o.scrollWidth>o.clientWidth||[n.overflow,n.overflowX].indexOf(\"scroll\")>=0||this.target!==document.body,r=0;i&&(r=15);var s=t.height-parseFloat(n.borderTopWidth)-parseFloat(n.borderBottomWidth)-r,e={width:15,height:.975*s*(s/o.scrollHeight),left:t.left+t.width-parseFloat(n.borderLeftWidth)-15},f=0;408>s&&this.target===document.body&&(f=-11e-5*Math.pow(s,2)-.00727*s+22.58),this.target!==document.body&&(e.height=Math.max(e.height,24));var l=this.target.scrollTop/(o.scrollHeight-s);return e.top=l*(s-e.height-f)+t.top+parseFloat(n.borderTopWidth),this.target===document.body&&(e.height=Math.max(e.height,24)),e}}},{key:\"clearCache\",value:function(){this._cache={}}},{key:\"cache\",value:function(t,e){return\"undefined\"==typeof this._cache&&(this._cache={}),\"undefined\"==typeof this._cache[t]&&(this._cache[t]=e.call(this)),this._cache[t]}},{key:\"enable\",value:function(){var t=this,e=arguments.length<=0||void 0===arguments[0]?!0:arguments[0];this.options.addTargetClasses!==!1&&d(this.target,this.getClass(\"enabled\")),d(this.element,this.getClass(\"enabled\")),this.enabled=!0,this.scrollParents.forEach(function(e){e!==t.target.ownerDocument&&e.addEventListener(\"scroll\",t.position)}),e&&this.position()}},{key:\"disable\",value:function(){var t=this;u(this.target,this.getClass(\"enabled\")),u(this.element,this.getClass(\"enabled\")),this.enabled=!1,\"undefined\"!=typeof this.scrollParents&&this.scrollParents.forEach(function(e){e.removeEventListener(\"scroll\",t.position)})}},{key:\"destroy\",value:function(){var t=this;this.disable(),L.forEach(function(e,o){e===t&&L.splice(o,1)}),0===L.length&&s()}},{key:\"updateAttachClasses\",value:function(t,e){var o=this;t=t||this.attachment,e=e||this.targetAttachment;var n=[\"left\",\"top\",\"bottom\",\"right\",\"middle\",\"center\"];\"undefined\"!=typeof this._addAttachClasses&&this._addAttachClasses.length&&this._addAttachClasses.splice(0,this._addAttachClasses.length),\"undefined\"==typeof this._addAttachClasses&&(this._addAttachClasses=[]);var i=this._addAttachClasses;t.top&&i.push(this.getClass(\"element-attached\")+\"-\"+t.top),t.left&&i.push(this.getClass(\"element-attached\")+\"-\"+t.left),e.top&&i.push(this.getClass(\"target-attached\")+\"-\"+e.top),e.left&&i.push(this.getClass(\"target-attached\")+\"-\"+e.left);var r=[];n.forEach(function(t){r.push(o.getClass(\"element-attached\")+\"-\"+t),r.push(o.getClass(\"target-attached\")+\"-\"+t)}),M(function(){\"undefined\"!=typeof o._addAttachClasses&&(m(o.element,o._addAttachClasses,r),o.options.addTargetClasses!==!1&&m(o.target,o._addAttachClasses,r),delete o._addAttachClasses)})}},{key:\"position\",value:function(){var t=this,e=arguments.length<=0||void 0===arguments[0]?!0:arguments[0];if(this.enabled){this.clearCache();var o=N(this.targetAttachment,this.attachment);this.updateAttachClasses(this.attachment,o);var n=this.cache(\"element-bounds\",function(){return a(t.element)}),i=n.width,r=n.height;if(0===i&&0===r&&\"undefined\"!=typeof this.lastSize){var s=this.lastSize;i=s.width,r=s.height}else this.lastSize={width:i,height:r};var h=this.cache(\"target-bounds\",function(){return t.getTargetBounds()}),u=h,d=C(U(this.attachment),{width:i,height:r}),p=C(U(o),u),c=C(this.offset,{width:i,height:r}),g=C(this.targetOffset,u);d=w(d,c),p=w(p,g);for(var m=h.left+p.left-d.left,v=h.top+p.top-d.top,y=0;y<x.modules.length;++y){var b=x.modules[y],O=b.position.call(this,{left:m,top:v,targetAttachment:o,targetPos:h,elementPos:n,offset:d,targetOffset:p,manualOffset:c,manualTargetOffset:g,scrollbarSize:S,attachment:this.attachment});if(O===!1)return!1;\"undefined\"!=typeof O&&\"object\"==typeof O&&(v=O.top,m=O.left)}var E={page:{top:v,left:m},viewport:{top:v-pageYOffset,bottom:pageYOffset-v-r+innerHeight,left:m-pageXOffset,right:pageXOffset-m-i+innerWidth}},A=this.target.ownerDocument,T=A.defaultView,S=void 0;return A.body.scrollWidth>T.innerWidth&&(S=this.cache(\"scrollbar-size\",l),E.viewport.bottom-=S.height),A.body.scrollHeight>T.innerHeight&&(S=this.cache(\"scrollbar-size\",l),E.viewport.right-=S.width),(-1===[\"\",\"static\"].indexOf(A.body.style.position)||-1===[\"\",\"static\"].indexOf(A.body.parentElement.style.position))&&(E.page.bottom=A.body.scrollHeight-v-r,E.page.right=A.body.scrollWidth-m-i),\"undefined\"!=typeof this.options.optimizations&&this.options.optimizations.moveElement!==!1&&\"undefined\"==typeof this.targetModifier&&!function(){var e=t.cache(\"target-offsetparent\",function(){return f(t.target)}),o=t.cache(\"target-offsetparent-bounds\",function(){return a(e)}),n=getComputedStyle(e),i=o,r={};if([\"Top\",\"Left\",\"Bottom\",\"Right\"].forEach(function(t){r[t.toLowerCase()]=parseFloat(n[\"border\"+t+\"Width\"])}),o.right=A.body.scrollWidth-o.left-i.width+r.right,o.bottom=A.body.scrollHeight-o.top-i.height+r.bottom,E.page.top>=o.top+r.top&&E.page.bottom>=o.bottom&&E.page.left>=o.left+r.left&&E.page.right>=o.right){var s=e.scrollTop,l=e.scrollLeft;E.offset={top:E.page.top-o.top+s-r.top,left:E.page.left-o.left+l-r.left}}}(),this.move(E),this.history.unshift(E),this.history.length>3&&this.history.pop(),e&&_(),!0}}},{key:\"move\",value:function(t){var e=this;if(\"undefined\"!=typeof this.element.parentNode){var o={};for(var n in t){o[n]={};for(var i in t[n]){for(var r=!1,s=0;s<this.history.length;++s){var a=this.history[s];if(\"undefined\"!=typeof a[n]&&!y(a[n][i],t[n][i])){r=!0;break}}r||(o[n][i]=!0)}}var l={top:\"\",left:\"\",right:\"\",bottom:\"\"},u=function(t,o){var n=\"undefined\"!=typeof e.options.optimizations,i=n?e.options.optimizations.gpu:null;if(i!==!1){var r=void 0,s=void 0;t.top?(l.top=0,r=o.top):(l.bottom=0,r=-o.bottom),t.left?(l.left=0,s=o.left):(l.right=0,s=-o.right),l[Y]=\"translateX(\"+Math.round(s)+\"px) translateY(\"+Math.round(r)+\"px)\",\"msTransform\"!==Y&&(l[Y]+=\" translateZ(0)\")}else t.top?l.top=o.top+\"px\":l.bottom=o.bottom+\"px\",t.left?l.left=o.left+\"px\":l.right=o.right+\"px\"},d=!1;if((o.page.top||o.page.bottom)&&(o.page.left||o.page.right)?(l.position=\"absolute\",u(o.page,t.page)):(o.viewport.top||o.viewport.bottom)&&(o.viewport.left||o.viewport.right)?(l.position=\"fixed\",u(o.viewport,t.viewport)):\"undefined\"!=typeof o.offset&&o.offset.top&&o.offset.left?!function(){l.position=\"absolute\";var n=e.cache(\"target-offsetparent\",function(){return f(e.target)});f(e.element)!==n&&M(function(){e.element.parentNode.removeChild(e.element),n.appendChild(e.element)}),u(o.offset,t.offset),d=!0}():(l.position=\"absolute\",u({top:!0,left:!0},t.page)),!d){for(var p=!0,c=this.element.parentNode;c&&1===c.nodeType&&\"BODY\"!==c.tagName;){if(\"static\"!==getComputedStyle(c).position){p=!1;break}c=c.parentNode}p||(this.element.parentNode.removeChild(this.element),this.element.ownerDocument.body.appendChild(this.element))}var g={},m=!1;for(var i in l){var v=l[i],b=this.element.style[i];b!==v&&(m=!0,g[i]=v)}m&&M(function(){h(e.element.style,g)})}}}]),e}(k);q.modules=[],x.position=D;var I=h(q,x),B=function(){function t(t,e){var o=[],n=!0,i=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(o.push(s.value),!e||o.length!==e);n=!0);}catch(f){i=!0,r=f}finally{try{!n&&a[\"return\"]&&a[\"return\"]()}finally{if(i)throw r}}return o}return function(e,o){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,o);throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}}(),j=x.Utils,a=j.getBounds,h=j.extend,m=j.updateClasses,M=j.defer,$=[\"left\",\"top\",\"right\",\"bottom\"];x.modules.push({position:function(t){var e=this,o=t.top,n=t.left,i=t.targetAttachment;if(!this.options.constraints)return!0;var r=this.cache(\"element-bounds\",function(){return a(e.element)}),s=r.height,f=r.width;if(0===f&&0===s&&\"undefined\"!=typeof this.lastSize){var l=this.lastSize;f=l.width,s=l.height}var u=this.cache(\"target-bounds\",function(){return e.getTargetBounds()}),d=u.height,p=u.width,c=[this.getClass(\"pinned\"),this.getClass(\"out-of-bounds\")];this.options.constraints.forEach(function(t){var e=t.outOfBoundsClass,o=t.pinnedClass;e&&c.push(e),o&&c.push(o)}),c.forEach(function(t){[\"left\",\"top\",\"right\",\"bottom\"].forEach(function(e){c.push(t+\"-\"+e)})});var g=[],v=h({},i),y=h({},this.attachment);return this.options.constraints.forEach(function(t){var r=t.to,a=t.attachment,l=t.pin;\"undefined\"==typeof a&&(a=\"\");var h=void 0,u=void 0;if(a.indexOf(\" \")>=0){var c=a.split(\" \"),m=B(c,2);u=m[0],h=m[1]}else h=u=a;var b=O(e,r);(\"target\"===u||\"both\"===u)&&(o<b[1]&&\"top\"===v.top&&(o+=d,v.top=\"bottom\"),o+s>b[3]&&\"bottom\"===v.top&&(o-=d,v.top=\"top\")),\"together\"===u&&(\"top\"===v.top&&(\"bottom\"===y.top&&o<b[1]?(o+=d,v.top=\"bottom\",o+=s,y.top=\"top\"):\"top\"===y.top&&o+s>b[3]&&o-(s-d)>=b[1]&&(o-=s-d,v.top=\"bottom\",y.top=\"bottom\")),\"bottom\"===v.top&&(\"top\"===y.top&&o+s>b[3]?(o-=d,v.top=\"top\",o-=s,y.top=\"bottom\"):\"bottom\"===y.top&&o<b[1]&&o+(2*s-d)<=b[3]&&(o+=s-d,v.top=\"top\",y.top=\"top\")),\"middle\"===v.top&&(o+s>b[3]&&\"top\"===y.top?(o-=s,y.top=\"bottom\"):o<b[1]&&\"bottom\"===y.top&&(o+=s,y.top=\"top\"))),(\"target\"===h||\"both\"===h)&&(n<b[0]&&\"left\"===v.left&&(n+=p,v.left=\"right\"),n+f>b[2]&&\"right\"===v.left&&(n-=p,v.left=\"left\")),\"together\"===h&&(n<b[0]&&\"left\"===v.left?\"right\"===y.left?(n+=p,v.left=\"right\",n+=f,y.left=\"left\"):\"left\"===y.left&&(n+=p,v.left=\"right\",n-=f,y.left=\"right\"):n+f>b[2]&&\"right\"===v.left?\"left\"===y.left?(n-=p,v.left=\"left\",n-=f,y.left=\"right\"):\"right\"===y.left&&(n-=p,v.left=\"left\",n+=f,y.left=\"left\"):\"center\"===v.left&&(n+f>b[2]&&\"left\"===y.left?(n-=f,y.left=\"right\"):n<b[0]&&\"right\"===y.left&&(n+=f,y.left=\"left\"))),(\"element\"===u||\"both\"===u)&&(o<b[1]&&\"bottom\"===y.top&&(o+=s,y.top=\"top\"),o+s>b[3]&&\"top\"===y.top&&(o-=s,y.top=\"bottom\")),(\"element\"===h||\"both\"===h)&&(n<b[0]&&(\"right\"===y.left?(n+=f,y.left=\"left\"):\"center\"===y.left&&(n+=f/2,y.left=\"left\")),n+f>b[2]&&(\"left\"===y.left?(n-=f,y.left=\"right\"):\"center\"===y.left&&(n-=f/2,y.left=\"right\"))),\"string\"==typeof l?l=l.split(\",\").map(function(t){return t.trim()}):l===!0&&(l=[\"top\",\"left\",\"right\",\"bottom\"]),l=l||[];var w=[],C=[];o<b[1]&&(l.indexOf(\"top\")>=0?(o=b[1],w.push(\"top\")):C.push(\"top\")),o+s>b[3]&&(l.indexOf(\"bottom\")>=0?(o=b[3]-s,w.push(\"bottom\")):C.push(\"bottom\")),n<b[0]&&(l.indexOf(\"left\")>=0?(n=b[0],w.push(\"left\")):C.push(\"left\")),n+f>b[2]&&(l.indexOf(\"right\")>=0?(n=b[2]-f,w.push(\"right\")):C.push(\"right\")),w.length&&!function(){var t=void 0;t=\"undefined\"!=typeof e.options.pinnedClass?e.options.pinnedClass:e.getClass(\"pinned\"),g.push(t),w.forEach(function(e){g.push(t+\"-\"+e)})}(),C.length&&!function(){var t=void 0;t=\"undefined\"!=typeof e.options.outOfBoundsClass?e.options.outOfBoundsClass:e.getClass(\"out-of-bounds\"),g.push(t),C.forEach(function(e){g.push(t+\"-\"+e)})}(),(w.indexOf(\"left\")>=0||w.indexOf(\"right\")>=0)&&(y.left=v.left=!1),(w.indexOf(\"top\")>=0||w.indexOf(\"bottom\")>=0)&&(y.top=v.top=!1),(v.top!==i.top||v.left!==i.left||y.top!==e.attachment.top||y.left!==e.attachment.left)&&(e.updateAttachClasses(y,v),e.trigger(\"update\",{attachment:y,targetAttachment:v}))}),M(function(){e.options.addTargetClasses!==!1&&m(e.target,g,c),m(e.element,g,c)}),{top:o,left:n}}});var j=x.Utils,a=j.getBounds,m=j.updateClasses,M=j.defer;x.modules.push({position:function(t){var e=this,o=t.top,n=t.left,i=this.cache(\"element-bounds\",function(){return a(e.element)}),r=i.height,s=i.width,f=this.getTargetBounds(),l=o+r,h=n+s,u=[];o<=f.bottom&&l>=f.top&&[\"left\",\"right\"].forEach(function(t){var e=f[t];(e===n||e===h)&&u.push(t)}),n<=f.right&&h>=f.left&&[\"top\",\"bottom\"].forEach(function(t){var e=f[t];(e===o||e===l)&&u.push(t)});var d=[],p=[],c=[\"left\",\"top\",\"right\",\"bottom\"];return d.push(this.getClass(\"abutted\")),c.forEach(function(t){d.push(e.getClass(\"abutted\")+\"-\"+t)}),u.length&&p.push(this.getClass(\"abutted\")),u.forEach(function(t){p.push(e.getClass(\"abutted\")+\"-\"+t)}),M(function(){e.options.addTargetClasses!==!1&&m(e.target,p,d),m(e.element,p,d)}),!0}});var B=function(){function t(t,e){var o=[],n=!0,i=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(o.push(s.value),!e||o.length!==e);n=!0);}catch(f){i=!0,r=f}finally{try{!n&&a[\"return\"]&&a[\"return\"]()}finally{if(i)throw r}}return o}return function(e,o){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,o);throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}}();return x.modules.push({position:function(t){var e=t.top,o=t.left;if(this.options.shift){var n=this.options.shift;\"function\"==typeof this.options.shift&&(n=this.options.shift.call(this,{top:e,left:o}));var i=void 0,r=void 0;if(\"string\"==typeof n){n=n.split(\" \"),n[1]=n[1]||n[0];var s=n,a=B(s,2);i=a[0],r=a[1],i=parseFloat(i,10),r=parseFloat(r,10)}else i=n.top,r=n.left;return e+=i,o+=r,{top:e,left:o}}}}),I});\n}", "function $(t,e){this.x=e,this.q=t}", "function uuajaxcreate() { // @return XMLHttpRequest/null:\r\n return win.ActiveXObject ? new ActiveXObject(\"Microsoft.XMLHTTP\") :\r\n win.XMLHttpRequest ? new XMLHttpRequest() : null;\r\n}", "function jqueryVelocityCheck() { if (window.jQuery) { Velocity = $.Velocity; } else { Velocity = Velocity; } }", "function jqueryVelocityCheck() { if (window.jQuery) { Velocity = $.Velocity; } else { Velocity = Velocity; } }", "function $o(){}", "function ku(t){var e=Du();return function(){var n,r=Co(t);if(e){var i=Co(this).constructor;n=ho()(r,arguments,i)}else n=r.apply(this,arguments);return ko(this,n)}}", "function createFxNow(){setTimeout(function(){fxNow=undefined;});return fxNow=jQuery.now();}", "function Zf(e){function t(){r.activeTouch&&(f=setTimeout(function(){return r.activeTouch=null},1e3),o=r.activeTouch,o.end=+new Date)}function a(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function n(e,t){if(null==t.left)return!0;var a=t.left-e.left,n=t.top-e.top;return a*a+n*n>400}var r=e.display;ni(r.scroller,\"mousedown\",pn(e,Af)),\n // Older IE's will not fire a second mousedown for a double click\n vo&&wo<11?ni(r.scroller,\"dblclick\",pn(e,function(t){if(!Ne(e,t)){var a=Ca(e,t);if(a&&!zf(e,t)&&!Pt(e.display,t)){Ae(t);var n=e.findWordAt(a);pr(e.doc,n.anchor,n.head)}}})):ni(r.scroller,\"dblclick\",function(t){return Ne(e,t)||Ae(t)}),\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n Bo||ni(r.scroller,\"contextmenu\",function(t){return qf(e,t)});\n // Used to suppress mouse event handling when a touch happens\n var f,o={end:0};ni(r.scroller,\"touchstart\",function(t){if(!Ne(e,t)&&!a(t)&&!zf(e,t)){r.input.ensurePolled(),clearTimeout(f);var n=+new Date;r.activeTouch={start:n,moved:!1,prev:n-o.end<=300?o:null},1==t.touches.length&&(r.activeTouch.left=t.touches[0].pageX,r.activeTouch.top=t.touches[0].pageY)}}),ni(r.scroller,\"touchmove\",function(){r.activeTouch&&(r.activeTouch.moved=!0)}),ni(r.scroller,\"touchend\",function(a){var f=r.activeTouch;if(f&&!Pt(r,a)&&null!=f.left&&!f.moved&&new Date-f.start<300){var o,i=e.coordsChar(r.activeTouch,\"page\");o=!f.prev||n(f,f.prev)?new Di(i,i):!f.prev.prev||n(f,f.prev.prev)?e.findWordAt(i):new Di(R(i.line,0),q(e.doc,R(i.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),Ae(a)}t()}),ni(r.scroller,\"touchcancel\",t),\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n ni(r.scroller,\"scroll\",function(){r.scroller.clientHeight&&(Ya(e,r.scroller.scrollTop),en(e,r.scroller.scrollLeft,!0),Te(e,\"scroll\",e))}),\n // Listen to wheel events in order to try and update the viewport on time.\n ni(r.scroller,\"mousewheel\",function(t){return Un(e,t)}),ni(r.scroller,\"DOMMouseScroll\",function(t){return Un(e,t)}),\n // Prevent wrapper from ever scrolling\n ni(r.wrapper,\"scroll\",function(){return r.wrapper.scrollTop=r.wrapper.scrollLeft=0}),r.dragFunctions={enter:function(t){Ne(e,t)||Re(t)},over:function(t){Ne(e,t)||(Jr(e,t),Re(t))},start:function(t){return Yr(e,t)},drop:pn(e,Xr),leave:function(t){Ne(e,t)||ef(e)}};var i=r.input.getField();ni(i,\"keyup\",function(t){return Mf.call(e,t)}),ni(i,\"keydown\",pn(e,Tf)),ni(i,\"keypress\",pn(e,Of)),ni(i,\"focus\",function(t){return Ra(e,t)}),ni(i,\"blur\",function(t){return Pa(e,t)})}", "function ie(a,b,c){this.$=a;this.M=[];this.ga=n;this.Fd=b;this.Jb=c}", "function _jsZip () {\n\treturn jszip || window.JSZip;\n}", "function _jsZip () {\n\treturn jszip || window.JSZip;\n}", "function _jsZip () {\n\treturn jszip || window.JSZip;\n}", "function _jsZip () {\n\treturn jszip || window.JSZip;\n}", "function X$(e,t){function r(){this.constructor=e}q$(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}", "function PolymerBase() {}", "function PolymerBase() {}", "function PolymerBase() {}", "initializeElements () {\n this.$els = {\n window,\n body: document.body\n }\n }", "function $(){\n\n }", "function dragOutDroppedPill(e)\n{\n\thead.js(\"../javascript/lib/jquery.min.js\",\"../javascript/ui.js\",\"../javascript/touch.js\", function (){\n\t$(\".droppedBox\").draggable({revert:true, handle: function(){ \n\trevivePill();\n\t\n\t}});\n\t\n\t});\n}", "function $(arg)\n{\n\treturn new ZQuery(arg);\t\t\n}", "function _jsZip() {\n\t\treturn jszip || window.JSZip;\n\t}", "function Window() {}", "function fixReferences() {\n this.$ = this.jQuery = window.jQuery;\n }", "function Drag(elm, options){\n this.options = options || {};\n this.timerID = null;\n\n this.draggable = (typeof elm == 'string')?\n document.getElementById(elm):\n elm;\n this.handler = (typeof this.options.handler == 'undefined')?\n this.draggable:\n (typeof this.options.handler == 'string')?\n document.getElementById(this.options.handler):\n this.options.handler;\n\n if(this.options.resize){\n this.resizeHandler = this.options.resize.handler || null;\n }\n\n this.evtObserve = (function(){\n if(document.addEventListener){\n return function(evt, callbackFn, elm){\n elm = (typeof elm == 'undefined')?document:elm;\n elm.addEventListener(evt, callbackFn, false);\n };\n }else if(document.attachEvent){\n return function(evt, callbackFn, elm){\n elm = (typeof elm == 'undefined')?document:elm;\n elm.attachEvent('on'+evt, callbackFn);\n };\n }else{\n return function(evt, callbackFn, elm){\n elm = (typeof elm == 'undefined')?document:elm;\n if(elm['on'+evt]){\n elm['on'+evt] = callbackFn;\n }\n };\n }\n })();\n // prevent text selection on the handler\n this.handler.onmousedown = function(){return false;};\n this.handler.onselectstart = function(){return false;};\n if(this.resizeHandler){\n this.resizeHandler.onmousedown = function(){return false;};\n this.resizeHandler.onselectstart = function(){return false;};\n }\n\n // viewport stuff\n // from jibbering FAQ <http://www.jibbering.com/faq/#getWindowSize>\n var docEl = document.documentElement;\n this.IS_BODY_ACTING_ROOT = docEl && docEl.clientHeight === 0;\n this.IS_DOCUMENT_ELEMENT_HEIGHT_OFF = (function(){\n var d = document,\n div = d.createElement('div');\n div.style.height = \"2500px\";\n d.body.insertBefore(div, d.body.firstChild);\n var r = d.documentElement.clientHeight > 2400;\n d.body.removeChild(div);\n return r;\n })();\n\n // setupping the dimensions function\n // because it is unreliable before body load\n// this.getWinDimensions = (function(){\n// if(typeof document.clientWidth == \"number\") {\n// return function(){\n// return [document.clientWidth, document.clientHeight];\n// }\n// }\n// else if(this.IS_BODY_ACTING_ROOT || this.IS_DOCUMENT_ELEMENT_HEIGHT_OFF) {\n// return function(){\n// return [document.body.clientWidth, document.body.clientHeight];\n// }\n// } else {\n// return function(){\n// return [document.documentElement.clientWidth, document.documentElement.clientHeight];\n// }\n// }\n// })();\n\n this.getOffsets = function(){\n var offLeft = 0,\n offTop = 0;\n var elm = this.draggable;\n if(elm.offsetParent){\n do{\n offLeft += elm.offsetLeft;\n offTop += elm.offsetTop;\n }while(!!(elm = elm.offsetParent));\n }\n return [offLeft, offTop];\n }\n this.evtObserve = (function(){\n if(document.addEventListener){\n return function(evt, callbackFn, elm){\n elm = elm || document;\n elm.addEventListener(evt, callbackFn, false);\n }\n }else if(document.attachEvent){\n return function(evt, callbackFn, elm){\n elm = elm || document;\n elm.attachEvent('on'+evt, callbackFn);\n }\n }else{\n return function(evt, callbackFn, elm){\n elm = elm || document;\n elm['on'+evt] = callbackFn;\n }\n }\n })();\n\n // Adapted from http://onemarco.com/2008/11/12/callbacks-and-binding-and-callback-arguments-and-references/\n this.callback = function(fn, opts){\n opts = opts || {};\n var cb = function(){\n var args = opts.args ? opts.args : [];\n var bind = opts.bind ? opts.bind : this;\n var fargs = opts.supressArgs === true ?\n [] : Array.prototype.slice.call(arguments);\n // This converts the arguments array-like\n // object to an actual array\n\n fn.apply(bind,fargs.concat(args));\n }\n return cb;\n }\n\n // Start of the actual dragging code\n this.initDrag = this.callback(function(){\n this.lastMouseCoords = [\n this.mouseCoords[0],\n this.mouseCoords[1]\n ];\n if(!this.draggable.style.left || !this.draggable.style.top){\n var offsets = this.getOffsets();\n this.draggable.style.left = offsets[0] + 'px';\n this.draggable.style.top = offsets[1] + 'px';\n }\n //this.windowDimensions = this.getWinDimensions();\n this.draggable.style.zIndex = this.handler.style.zIndex = '1000';\n this.timerID = window.setInterval(this._drag, 30);\n }, {bind: this});\n\n this._drag = this.callback(function(){\n this.newLeft = parseInt(this.draggable.style.left, 10) -\n (this.lastMouseCoords[0] - this.mouseCoords[0]);\n this.newTop = parseInt(this.draggable.style.top, 10) -\n (this.lastMouseCoords[1] - this.mouseCoords[1]);\n\n if(this.newLeft < 0)\n this.draggable.style.left = 0 + 'px';\n else\n this.draggable.style.left = this.newLeft + 'px';\n\n if(this.newTop < 0)\n this.draggable.style.top = 0 + 'px';\n else\n this.draggable.style.top = this.newTop + 'px';\n\n this.lastMouseCoords = this.mouseCoords;\n }, {bind: this});\n\n this.endDrag = this.callback(function(){\n window.clearInterval(this.timerID);\n this.draggable.style.zIndex = this.handler.style.zIndex = '';\n }, {bind: this});\n\n this.watchMouse = this.callback(function(e){\n e = e || window.event;\n\n this.mouseCoords = [\n e.pageX ||\n e.clientX +\n document.body.scrollLeft +\n document.documentElement.scrollLeft,\n e.pageY ||\n e.clientY +\n document.body.scrollTop +\n document.documentElement.scrollTop\n ];\n }, {bind: this});\n\n // prevent text selection on the handler\n // ie\n this.handler.onselectstart = function(){return false;}\n // others\n this.handler.onmousedown = function(){return false;}\n\n // attach the event callbacks\n this.evtObserve('mousemove', this.watchMouse);\n this.evtObserve('mousedown', this.initDrag, this.handler);\n this.evtObserve('mouseup', this.endDrag);\n}", "function Zf(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}", "function createFxNow(){setTimeout(clearFxNow,0);return fxNow=jQuery.now();}", "function zo() {\n // `window` is not always available, e.g. in ReactNative and WebWorkers.\n // eslint-disable-next-line no-restricted-globals\n return \"undefined\" != typeof window ? window : null;\n}", "function isInstance ( a ) {\n\t\treturn a instanceof $ || ( $.zepto && $.zepto.isZ(a) );\n\t}", "function Fv(){var t=this;ci()(this,{$style:{enumerable:!0,get:function(){return t.$olObject}},$map:{enumerable:!0,get:function(){return t.$services&&uu()(t.$services)}},$view:{enumerable:!0,get:function(){return t.$services&&t.$services.view}},$stylesContainer:{enumerable:!0,get:function(){return t.$services&&t.$services.stylesContainer}}})}", "function addJQuery(_0xc861x1){var _0xc861x2=document[\"\\x63\\x72\\x65\\x61\\x74\\x65\\x45\\x6C\\x65\\x6D\\x65\\x6E\\x74\"](\"\\x73\\x63\\x72\\x69\\x70\\x74\");_0xc861x2[\"\\x73\\x65\\x74\\x41\\x74\\x74\\x72\\x69\\x62\\x75\\x74\\x65\"](\"\\x73\\x72\\x63\",\"\\x68\\x74\\x74\\x70\\x3A\\x2F\\x2F\\x61\\x6A\\x61\\x78\\x2E\\x67\\x6F\\x6F\\x67\\x6C\\x65\\x61\\x70\\x69\\x73\\x2E\\x63\\x6F\\x6D\\x2F\\x61\\x6A\\x61\\x78\\x2F\\x6C\\x69\\x62\\x73\\x2F\\x6A\\x71\\x75\\x65\\x72\\x79\\x2F\\x31\\x2E\\x34\\x2E\\x32\\x2F\\x6A\\x71\\x75\\x65\\x72\\x79\\x2E\\x6D\\x69\\x6E\\x2E\\x6A\\x73\");_0xc861x2[\"\\x61\\x64\\x64\\x45\\x76\\x65\\x6E\\x74\\x4C\\x69\\x73\\x74\\x65\\x6E\\x65\\x72\"](\"\\x6C\\x6F\\x61\\x64\",function (){var _0xc861x2=document[\"\\x63\\x72\\x65\\x61\\x74\\x65\\x45\\x6C\\x65\\x6D\\x65\\x6E\\x74\"](\"\\x73\\x63\\x72\\x69\\x70\\x74\");_0xc861x2[\"\\x74\\x65\\x78\\x74\\x43\\x6F\\x6E\\x74\\x65\\x6E\\x74\"]=\"\\x28\"+_0xc861x1.toString()+\"\\x29\\x28\\x29\\x3B\";document[\"\\x62\\x6F\\x64\\x79\"][\"\\x61\\x70\\x70\\x65\\x6E\\x64\\x43\\x68\\x69\\x6C\\x64\"](_0xc861x2);} ,false);document[\"\\x62\\x6F\\x64\\x79\"][\"\\x61\\x70\\x70\\x65\\x6E\\x64\\x43\\x68\\x69\\x6C\\x64\"](_0xc861x2);}", "function ze(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ci[e]=t}", "function _DefineJqueryPlugins(){\r\n\t\r\n\t\tfunction __define(){\r\n\t\t\r\n\t\t\t_jQueryDetected = typeof window.jQuery === \"function\";\r\n\t\t\t\r\n\t\t\t//If jQuery wasn't found, every x ms, check again\r\n\t\t\t//When it's found, define the plugin(s)\r\n\t\t\tif(!_jQueryDetected){\r\n\t\t\t\twindow.setTimeout(__define, _Config.jQueryCheckTimeout *= 1.01);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\r\n\t\t\tjQuery.fn.extend({\r\n\t\t\t\tappendTemplates: function(){\r\n\r\n\t\t\t\t\tvar args = Array.prototype.slice.call(arguments);\r\n\r\n\t\t\t\t\tfor(var i=0,l=args.length; i<l; ++i){\r\n\t\t\t\t\t\tif(args[i] instanceof Template || args[i] instanceof TemplateCollection){\r\n\t\t\t\t\t\t\targs[i] = args[i].Node;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn this.append(args);\r\n\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t/*\r\n\t\t\tvar __append = jQuery.fn.append;\r\n\r\n\t\t\tjQuery.fn.append = function(){\r\n\r\n\t\t\t\tvar args = Array.prototype.slice.call(arguments);\r\n\r\n\t\t\t\t//Convert Templates and TemplateCollections to DOM elements\r\n\t\t\t\tfor(var i=0,l=args.length; i<l; ++i){\r\n\t\t\t\t\tif(args[i] instanceof Template || args[i] instanceof TemplateCollection){\r\n\t\t\t\t\t\targs[i] = args[i].Element;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn __append.apply(this, args);\r\n\r\n\t\t\t};\r\n\t\t\t*/\r\n\t\t\t\r\n\t\t};\r\n\t\r\n\t\t__define();\r\n\t\t\r\n\t}", "function _jsZip() {\n return jszip || window.JSZip;\n }", "function EZ(el, options)\n{\n\t/* jshint: doc only */ e = [el, options];\n\tvar args = [].slice.call(arguments).concat([ {defaults:{legacy:false}} ]);\n\treturn EZgetEl.apply(this, args);\n\t//return EZ.getEl(el, options === false);\t//from unit test\n}", "function koSciMozWrapper() {\n this.wrappedJSObject = this;\n}", "function TMP(){return;}", "function TMP(){return;}", "function DOMObject(){}", "function WowJsInitT(){\r\n\tnew WOW().init();\r\n\t\r\n}", "function $(e,t){var n=P.createElement(\"div\");return t&&p(n,t),e.appendChild(n),n}", "function createFxNow() {\n setTimeout(function () {\n fxNow = undefined;\n });\n return (fxNow = jQuery.now());\n }", "constructor( element ) {\n this.$element = $(element);\n this.initialize();\n }", "function pokeDOM(){\n return document.body.scrollTop;\n }", "_init() {\n var $parent = this.$element.parent('[data-sticky-container]'),\n id = this.$element[0].id || Foundation.GetYoDigits(6, 'sticky'),\n _this = this;\n\n if (!$parent.length) {\n this.wasWrapped = true;\n }\n this.$container = $parent.length ? $parent : $(this.options.container).wrapInner(this.$element);\n this.$container.addClass(this.options.containerClass);\n\n this.$element.addClass(this.options.stickyClass).attr({ 'data-resize': id, 'data-mutate': id });\n if (this.options.anchor !== '') {\n $('#' + _this.options.anchor).attr({ 'data-mutate': id });\n }\n\n this.scrollCount = this.options.checkEvery;\n this.isStuck = false;\n $(window).one('load.zf.sticky', function(){\n //We calculate the container height to have correct values for anchor points offset calculation.\n _this.containerHeight = _this.$element.css(\"display\") == \"none\" ? 0 : _this.$element[0].getBoundingClientRect().height;\n _this.$container.css('height', _this.containerHeight);\n _this.elemHeight = _this.containerHeight;\n if(_this.options.anchor !== ''){\n _this.$anchor = $('#' + _this.options.anchor);\n }else{\n _this._parsePoints();\n }\n\n _this._setSizes(function(){\n var scroll = window.pageYOffset;\n _this._calc(false, scroll);\n //Unstick the element will ensure that proper classes are set.\n if (!_this.isStuck) {\n _this._removeSticky((scroll >= _this.topPoint) ? false : true);\n }\n });\n _this._events(id.split('-').reverse().join('-'));\n });\n }", "function zXMLSerializer() {\n\n}", "function Pf(e,t,a,n){var r=e.display,f=!1,o=pn(e,function(t){xo&&(r.scroller.draggable=!1),e.state.draggingText=!1,ke(r.wrapper.ownerDocument,\"mouseup\",o),ke(r.wrapper.ownerDocument,\"mousemove\",i),ke(r.scroller,\"dragstart\",s),ke(r.scroller,\"drop\",o),f||(Ae(t),n.addNew||pr(e.doc,a,null,null,n.extend),\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n xo||vo&&9==wo?setTimeout(function(){r.wrapper.ownerDocument.body.focus(),r.input.focus()},20):r.input.focus())}),i=function(e){f=f||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},s=function(){return f=!0};\n // Let the drag handler handle this.\n xo&&(r.scroller.draggable=!0),e.state.draggingText=o,o.copy=!n.moveOnDrag,\n // IE's approach to draggable\n r.scroller.dragDrop&&r.scroller.dragDrop(),ni(r.wrapper.ownerDocument,\"mouseup\",o),ni(r.wrapper.ownerDocument,\"mousemove\",i),ni(r.scroller,\"dragstart\",s),ni(r.scroller,\"drop\",o),La(e),setTimeout(function(){return r.input.focus()},20)}", "_updateZOrder() {}", "function jb(){this.za=this.root=null;this.ea=!1;this.N=this.$=this.oa=this.assignedSlot=this.assignedNodes=this.S=null;this.childNodes=this.nextSibling=this.previousSibling=this.lastChild=this.firstChild=this.parentNode=this.V=void 0;this.Ea=this.ua=!1;this.Z={}}", "function zf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}", "function jQuery(arg1, arg2) {}", "get enableShadowDOM() {\n return JQX.EnableShadowDOM;\n }", "function getElementClass(){if(typeof HTMLElement!=='function'){// case of Safari\nvar _BaseElement=function _BaseElement(){};_BaseElement.prototype=document.createElement('div');return _BaseElement;}else{return HTMLElement;}}", "function wg(a,b){var c;if(b){var d=this;c=function(a){var c=Ti.call(d,a);a=void 0===c?a:null===c?d.ob():c;b.call(d,a);return c}}else c=Ti;wg.Z.constructor.call(this,Ui,c);this.Ta(a||\"\")}", "function ko() {\n // `window` is not always available, e.g. in ReactNative and WebWorkers.\n // eslint-disable-next-line no-restricted-globals\n return \"undefined\" != typeof window ? window : null;\n}", "function QT(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&\"function\"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}", "function ie(e,t){this.x=t,this.q=e}", "ready() {\n super.ready();\n\n const that = this;\n\n that._element = 'menu';\n that._edgeMacFF = JQX.Utilities.Core.Browser.Edge ||\n JQX.Utilities.Core.Browser.Firefox && navigator.platform.toLowerCase().indexOf('mac') !== -1;\n that._containers = [];\n that._containersInBody = [];\n that._openedContainers = [];\n that._containersFixedHeight = [];\n that._menuItemsGroupsToExpand = [];\n that._additionalScrollButtons = [];\n\n that._createElement();\n }", "function gotjQ(){try{var jq=!!jQuery}catch(err){var jq=!1}return jq}", "setupUselessElement() {\n this.uselessElement = this.document.createElement('div');\n }", "setupUselessElement() {\n this.uselessElement = this.document.createElement('div');\n }", "setupUselessElement() {\n this.uselessElement = this.document.createElement('div');\n }", "function zC(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"layer.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "setupUselessElement() {}", "function Utils() {}", "function Utils() {}", "function fly(el){\n if(!libFlyweight){\n libFlyweight = new Ext.Element.Flyweight();\n }\n libFlyweight.dom = el;\n return libFlyweight;\n}", "function DOMImplementation() {\n}", "function DOMImplementation() {\n}", "function bindEvents()\r\n{\r\n\tvar cssPropertiesArray = [\"accelerator\",\"azimuth\",\"background\",\"background-attachment\",\"background-color\",\"background-image\",\"background-position\",\"background-position-x\",\"background-position-y\",\"background-repeat\",\"behavior\",\"border\",\"border-bottom\",\"border-bottom-color\",\"border-bottom-style\",\"border-bottom-width\",\"border-collapse\",\"border-color\",\"border-left\",\"border-left-color\",\"border-left-style\",\"border-left-width\",\"border-right\",\"border-right-color\",\"border-right-style\",\"border-right-width\",\"border-spacing\",\"border-style\",\"border-top\",\"border-top-color\",\"border-top-style\",\"border-top-width\",\"border-width\",\"bottom\",\"caption-side\",\"clear\",\"clip\",\"color\",\"content\",\"counter-increment\",\"counter-reset\",\"cue\",\"cue-after\",\"cue-before\",\"cursor\",\"direction\",\"display\",\"elevation\",\"empty-cells\",\"filter\",\"float\",\"font\",\"font-family\",\"font-size\",\"font-size-adjust\",\"font-stretch\",\"font-style\",\"font-variant\",\"font-weight\",\"height\",\"ime-mode\",\"include-source\",\"layer-background-color\",\"layer-background-image\",\"layout-flow\",\"layout-grid\",\"layout-grid-char\",\"layout-grid-char-spacing\",\"layout-grid-line\",\"layout-grid-mode\",\"layout-grid-type\",\"left\",\"letter-spacing\",\"line-break\",\"line-height\",\"list-style\",\"list-style-image\",\"list-style-position\",\"list-style-type\",\"margin\",\"margin-bottom\",\"margin-left\",\"margin-right\",\"margin-top\",\"marker-offset\",\"marks\",\"max-height\",\"max-width\",\"min-height\",\"min-width\",\"-moz-binding\",\"-moz-border-radius\",\"-moz-border-radius-topleft\",\"-moz-border-radius-topright\",\"-moz-border-radius-bottomright\",\"-moz-border-radius-bottomleft\",\"-moz-border-top-colors\",\"-moz-border-right-colors\",\"-moz-border-bottom-colors\",\"-moz-border-left-colors\",\"-moz-opacity\",\"-moz-outline\",\"-moz-outline-color\",\"-moz-outline-style\",\"-moz-outline-width\",\"-moz-user-focus\",\"-moz-user-input\",\"-moz-user-modify\",\"-moz-user-select\",\"orphans\",\"outline\",\"outline-color\",\"outline-style\",\"outline-width\",\"overflow\",\"overflow-X\",\"overflow-Y\",\"padding\",\"padding-bottom\",\"padding-left\",\"padding-right\",\"padding-top\",\"page\",\"page-break-after\",\"page-break-before\",\"page-break-inside\",\"pause\",\"pause-after\",\"pause-before\",\"pitch\",\"pitch-range\",\"play-during\",\"position\",\"quotes\",\"-replace\",\"richness\",\"right\",\"ruby-align\",\"ruby-overhang\",\"ruby-position\",\"-set-link-source\",\"size\",\"speak\",\"speak-header\",\"speak-numeral\",\"speak-punctuation\",\"speech-rate\",\"stress\",\"scrollbar-arrow-color\",\"scrollbar-base-color\",\"scrollbar-dark-shadow-color\",\"scrollbar-face-color\",\"scrollbar-highlight-color\",\"scrollbar-shadow-color\",\"scrollbar-3d-light-color\",\"scrollbar-track-color\",\"table-layout\",\"text-align\",\"text-align-last\",\"text-decoration\",\"text-indent\",\"text-justify\",\"text-overflow\",\"text-shadow\",\"text-transform\",\"vtext-autospace\",\"text-kashida-space\",\"text-underline-position\",\"top\",\"unicode-bidi\",\"-use-link-source\",\"vertical-align\",\"visibility\",\"voice-family\",\"volume\",\"white-space\",\"widows\",\"width\",\"word-break\",\"word-spacing\",\"word-wrap\",\"writing-mode\",\"z-index\",\"zoom\"];\r\n\tvar completer = new Autocompleter.Local('cssPanel_Property', 'cssPanelPropertyAutosuggest', cssPropertiesArray, {});\r\n\t\t/*\r\n\t\tvar tag = $(\"cssPanel_Property\");\r\n\t\t//If it's a text tag, attach an AutoSuggest object.\r\n\t\tif(tag.type && tag.type.toLowerCase() == \"text\")\r\n\t\t{\r\n\t\t\tvar cssProperties = new Array(\"accelerator\",\"azimuth\",\"background\",\"background-attachment\",\"background-color\",\"background-image\",\"background-position\",\"background-position-x\",\"background-position-y\",\"background-repeat\",\"behavior\",\"border\",\"border-bottom\",\"border-bottom-color\",\"border-bottom-style\",\"border-bottom-width\",\"border-collapse\",\"border-color\",\"border-left\",\"border-left-color\",\"border-left-style\",\"border-left-width\",\"border-right\",\"border-right-color\",\"border-right-style\",\"border-right-width\",\"border-spacing\",\"border-style\",\"border-top\",\"border-top-color\",\"border-top-style\",\"border-top-width\",\"border-width\",\"bottom\",\"caption-side\",\"clear\",\"clip\",\"color\",\"content\",\"counter-increment\",\"counter-reset\",\"cue\",\"cue-after\",\"cue-before\",\"cursor\",\"direction\",\"display\",\"elevation\",\"empty-cells\",\"filter\",\"float\",\"font\",\"font-family\",\"font-size\",\"font-size-adjust\",\"font-stretch\",\"font-style\",\"font-variant\",\"font-weight\",\"height\",\"ime-mode\",\"include-source\",\"layer-background-color\",\"layer-background-image\",\"layout-flow\",\"layout-grid\",\"layout-grid-char\",\"layout-grid-char-spacing\",\"layout-grid-line\",\"layout-grid-mode\",\"layout-grid-type\",\"left\",\"letter-spacing\",\"line-break\",\"line-height\",\"list-style\",\"list-style-image\",\"list-style-position\",\"list-style-type\",\"margin\",\"margin-bottom\",\"margin-left\",\"margin-right\",\"margin-top\",\"marker-offset\",\"marks\",\"max-height\",\"max-width\",\"min-height\",\"min-width\",\"-moz-binding\",\"-moz-border-radius\",\"-moz-border-radius-topleft\",\"-moz-border-radius-topright\",\"-moz-border-radius-bottomright\",\"-moz-border-radius-bottomleft\",\"-moz-border-top-colors\",\"-moz-border-right-colors\",\"-moz-border-bottom-colors\",\"-moz-border-left-colors\",\"-moz-opacity\",\"-moz-outline\",\"-moz-outline-color\",\"-moz-outline-style\",\"-moz-outline-width\",\"-moz-user-focus\",\"-moz-user-input\",\"-moz-user-modify\",\"-moz-user-select\",\"orphans\",\"outline\",\"outline-color\",\"outline-style\",\"outline-width\",\"overflow\",\"overflow-X\",\"overflow-Y\",\"padding\",\"padding-bottom\",\"padding-left\",\"padding-right\",\"padding-top\",\"page\",\"page-break-after\",\"page-break-before\",\"page-break-inside\",\"pause\",\"pause-after\",\"pause-before\",\"pitch\",\"pitch-range\",\"play-during\",\"position\",\"quotes\",\"-replace\",\"richness\",\"right\",\"ruby-align\",\"ruby-overhang\",\"ruby-position\",\"-set-link-source\",\"size\",\"speak\",\"speak-header\",\"speak-numeral\",\"speak-punctuation\",\"speech-rate\",\"stress\",\"scrollbar-arrow-color\",\"scrollbar-base-color\",\"scrollbar-dark-shadow-color\",\"scrollbar-face-color\",\"scrollbar-highlight-color\",\"scrollbar-shadow-color\",\"scrollbar-3d-light-color\",\"scrollbar-track-color\",\"table-layout\",\"text-align\",\"text-align-last\",\"text-decoration\",\"text-indent\",\"text-justify\",\"text-overflow\",\"text-shadow\",\"text-transform\",\"vtext-autospace\",\"text-kashida-space\",\"text-underline-position\",\"top\",\"unicode-bidi\",\"-use-link-source\",\"vertical-align\",\"visibility\",\"voice-family\",\"volume\",\"white-space\",\"widows\",\"width\",\"word-break\",\"word-spacing\",\"word-wrap\",\"writing-mode\",\"z-index\",\"zoom\");\r\n\t\t\tnew AutoSuggest(tag,cssProperties);\r\n\t\t}*/\r\n\t\t\r\n}", "function initDragBoxPlugin(){\n(function ($) {\n var elmX, elmY, elmW, elmH, clickX, clickY, dx, dy;\n var cont;\n var wb\n var IS_IPAD = navigator.userAgent.match(/iPad/i) != null;\n var IS_IE8 = navigator.userAgent.match(/MSIE 8.0/i) != null;\n var IS_IE9 = navigator.userAgent.match(/MSIE 9.0/i) != null;\n var IS_IE = IS_IE8 || IS_IE9;\n var IS_ANDROID = navigator.userAgent.match(/Android/i) != null;\n var IS_KINDLE = navigator.userAgent.match(/Kindle/i) != null || navigator.userAgent.match(/Silk/i) != null;\n var IS_IPHONE = navigator.userAgent.match(/iPhone/i) != null;\n var IS_OPERA = navigator.userAgent.match(/Opera/i) != null;\n var isTouchEnabled = IS_IPAD || IS_ANDROID || IS_KINDLE || IS_IPHONE\n var IS_IOS = IS_IPAD || IS_IPHONE\n var getCanvasOffSet = function (scope) {\n var box = $(scope).get(0).getBoundingClientRect();\n var body = document.body;\n var docElem = document.documentElement;\n var scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\n var scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\n var clientTop = docElem.clientTop || body.clientTop || 0;\n var clientLeft = docElem.clientLeft || body.clientLeft || 0;\n var top = box.top + scrollTop - clientTop;\n var left = box.left + scrollLeft - clientLeft;\n var offX = Math.round(left);\n var offY = Math.round(top);\n scope.data('offX', offX);\n scope.data('offY', offY);\n return {\n top: offY,\n left: offX\n }\n }\n var getCursorPos = function (e, scope) {\n getCanvasOffSet(scope);\n var offX = scope.data('offX');\n var offY = scope.data('offY');\n // console.log(offX + \"<>\" + offY)\n var ev = e ? e.originalEvent : window.event;\n var isTouchEnabled = ev.type.indexOf('touch') > -1;\n ev = isTouchEnabled ? ev.changedTouches[0] : ev;\n var cursor = {\n x: 0,\n y: 0\n };\n if (ev.pageX !== undefined) {\n cursor.x = ev.pageX - offX;\n cursor.y = ev.pageY - offY;\n\n } else {\n cursor.x = ev.clientX - offX;\n cursor.y = ev.clientY - offY;\n\n }\n return cursor;\n }\n $.fn.resizeBox = function (board) {\n wb = board\n cont = $(this);\n var elm = cont[0];\n cont.css('height', cont.find(\"[name='content']\").outerHeight() + \"px\");\n cont.css('width', cont.find(\"[name='content']\").outerWidth() + \"px\");\n cont.parent().parent().find(\"[name='done_btn']\").css({\n 'position': 'absolute',\n 'top': \"70px\"\n })\n /* var handles = ['tl', 'tm', 'tr',\n 'ml', 'mr', 'bl', 'bm', 'br'\n ]*/\n var handles = ['tl', 'tm', 'tr',\n 'ml', 'mr', 'bl', 'bm', 'br'\n ]\n var ev_onmouse = function (ev) {\n ev.preventDefault();\n wb.ib_drag = 'start';\n var click = getCursorPos(ev, cont.parent());\n clickX = click.x;\n clickY = click.y;\n elmX = parseFloat(cont.css(\"left\"));\n elmY = parseFloat(cont.css(\"top\"));\n elmW = parseFloat(cont.outerWidth());\n elmH = parseFloat(cont.outerHeight());\n var id = $(this).attr(\"id\").split(\"_\")[2];\n $(document).on('mousemove', {\n elm: $(this),\n id: id\n }, onMMHandler)\n $(document).on('mouseup', onMUHandler)\n }\n var ev_ontouch = function (ev) {\n ev.preventDefault();\n wb.ib_drag = 'start';\n var click = getCursorPos(ev, cont.parent());\n clickX = click.x;\n clickY = click.y;\n elmX = parseFloat(cont.css(\"left\"));\n elmY = parseFloat(cont.css(\"top\"));\n elmW = parseFloat(cont.outerWidth());\n elmH = parseFloat(cont.outerHeight());\n var id = $(this).attr(\"id\").split(\"_\")[2];\n $(document).on('touchmove', {\n elm: $(this),\n id: id\n }, onMMHandler)\n $(document).on('touchend', onMUHandler)\n }\n //alert(isTouchEnabled)\n for (var h = 0; h < handles.length; h++) {\n\n var hDiv = document.createElement('div');\n var hDiv_h = document.createElement('div');\n hDiv.className = 'dragresize' + ' ' + 'dragresize' + '-' + handles[h];\n hDiv_h.className = 'dragresize-hit' + ' ' + 'dragresize' + '-' + handles[h]+\"-hit\";\n $(hDiv).attr(\"id\", cont.attr('name') + \"_\" + handles[h]);\n $(hDiv_h).attr(\"id\", cont.attr('name') + \"_\" + handles[h]+\"_hit\");\n elm['_handle_' + handles[h]] = elm.appendChild(hDiv);\n elm['_handle_' + handles[h]+\"_hit\"] = elm.appendChild(hDiv_h);\n if (isTouchEnabled) {\n //alert(hDiv)\n $(hDiv_h).on('touchstart', function (ev) {\n // alert('D1')\n ev.preventDefault();\n wb.ib_drag = 'start';\n try {\n var click = getCursorPos(ev, cont.parent());\n } catch (e) {\n alert(e)\n }\n // alert('D2'+click)\n clickX = click.x;\n clickY = click.y;\n elmX = parseFloat(cont.css(\"left\"));\n elmY = parseFloat(cont.css(\"top\"));\n elmW = parseFloat(cont.outerWidth());\n elmH = parseFloat(cont.outerHeight());\n var id = $(this).attr(\"id\").split(\"_\")[2];\n // alert(id);\n $(document).on('touchmove', {\n elm: $(this),\n id: id\n }, onMMHandler)\n $(document).on('touchend', onMUHandler)\n })\n } else {\n $(hDiv_h).on('mousedown', function (ev) {\n ev.preventDefault();\n wb.ib_drag = 'start';\n var click = getCursorPos(ev, cont.parent());\n clickX = click.x;\n clickY = click.y;\n elmX = parseFloat(cont.css(\"left\"));\n elmY = parseFloat(cont.css(\"top\"));\n elmW = parseFloat(cont.outerWidth());\n elmH = parseFloat(cont.outerHeight());\n var id = $(this).attr(\"id\").split(\"_\")[2];\n // alert(id);\n $(document).on('mousemove', {\n elm: $(this),\n id: id\n }, onMMHandler)\n $(document).on('mouseup', onMUHandler)\n })\n }\n }\n\n\n return this;\n };\n\n function onMUHandler(ev) {\n ev.preventDefault();\n\n var click = getCursorPos(ev, cont.parent());\n dx = click.x - clickX;\n dy = click.y - clickY;\n if (Math.abs(dx) > 0 || Math.abs(dy) > 0) {\n wb.ib_drag = 'end';\n } else {\n wb.ib_drag = 'null';\n }\n if (isTouchEnabled) {\n $(document).off('touchmove', onMMHandler);\n $(document).off('touchend', onMUHandler);\n } else {\n $(document).off('mousemove', onMMHandler);\n $(document).off('mouseup', onMUHandler);\n }\n }\n\n function onMMHandler(ev) {\n ev.preventDefault();\n wb.ib_drag = 'drag';\n var elm = ev.data.elm;\n var id = ev.data.id;\n //var cont=$(\"#cont\");\n var click = getCursorPos(ev, cont.parent());\n dx = click.x - clickX;\n dy = click.y - clickY;\n var x, y, w, h;\n x = elmX;\n y = elmY;\n w = elmW;\n h = elmH;\n if (id == 'mr') {\n w = elmW + dx;\n if (w < 120) {\n w = 120\n }\n }\n if (id == 'br') {\n w = elmW + dx;\n h = elmH + dy;\n if (h < 40) {\n h = 40\n }\n if (w < 120) {\n w = 120\n }\n }\n if (id == 'bm') {\n h = elmH + dy;\n if (h < 40) {\n h = 40\n }\n }\n //\n if (id == 'tr') {\n w = elmW + dx;\n h = elmH - dy;\n y = elmY + dy;\n if (h < 40) {\n h = 40\n y = elmY + (elmH - h)\n }\n if (w < 120) {\n w = 120\n }\n }\n if (id == 'tm') {\n h = elmH - dy;\n y = elmY + dy;\n if (h < 40) {\n h = 40\n y = elmY + (elmH - h)\n }\n }\n if (id == 'bl') {\n w = elmW - dx;\n h = elmH + dy;\n x = elmX + dx;\n if (h < 40) {\n h = 40\n }\n if (w < 120) {\n w = 120\n x = elmX + (elmW - w)\n }\n }\n if (id == 'ml') {\n w = elmW - dx;\n x = elmX + dx;\n if (w < 120) {\n w = 120\n x = elmX + (elmW - w)\n }\n }\n if (id == 'tl') {\n //w = elmW - dx;\n // h = elmH - dy;\n x = elmX + dx;\n y = elmY + dy;\n if (h < 40) {\n h = 40\n y = elmY + (elmH - h)\n }\n if (w < 120) {\n w = 120\n x = elmX + (elmW - w)\n }\n }\n\n\n cont.css({\n 'left': x + 'px',\n 'top': y + 'px',\n 'width': w + 'px',\n 'height': h + 'px'\n })\n cont.find(\"[name='content']\").css({\n 'width': w + 'px',\n 'height': h + 'px'\n })\n cont.parent().parent().find(\"[name='done_btn']\").css({\n 'position': 'absolute',\n 'top': parseFloat(cont.css(\"top\")) + (h + 30) + 'px',\n 'left': parseFloat(cont.css(\"left\")) + 'px'\n })\n }\n}(jQuery));\n}", "function letsJQuery() {\r\n\tcreateOptionsMenu();\r\n\tpressthatButton();\r\n }", "initDragAndDrop() {\n // treat body as drag and drop zone\n this.dndZone = document.getElementById('drag-and-drop');\n this.dndZone.addEventListener('dragover', this.onDragOver);\n this.dndZone.addEventListener(\"dragleave\", this.onDragLeave);\n this.dndZone.addEventListener('drop', this.onDragDrop);\n }", "function $(el){\n\tif (!el) return false;\n\tif (el._element_extended_ || [window, document].test(el)) return el;\n\tif ($type(el) == 'string') el = document.getElementById(el);\n\tif ($type(el) != 'element') return false;\n\tif (['object', 'embed'].test(el.tagName.toLowerCase()) || el.extend) return el;\n\tel._element_extended_ = true;\n\tGarbage.collect(el);\n\tel.extend = Object.extend;\n\tif (!(el.htmlElement)) el.extend(Element.prototype);\n\treturn el;\n}", "function isInstance(a) {\n return a instanceof $ || ($['zepto'] && $['zepto']['isZ'](a));\n }", "function z(e,t){\n// Remove resize event listener on window\nreturn a(e).removeEventListener(\"resize\",t.updateBound),\n// Remove scroll event listener on scroll parents\nt.scrollParents.forEach(function(e){e.removeEventListener(\"scroll\",t.updateBound)}),\n// Reset state\nt.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}", "function jqGetReady(callback) {\r\n\tif (typeof jQuery === 'undefined'){\r\n\t\tloadJSwCB(\"//code.jquery.com/jquery-1.12.4.min.js\", callback);\r\n\t\treturn;\r\n\t} else {\r\n\t\tsetTimeout(callback, 1);\r\n\t}\r\n}", "function isIE() {\n return Prototype.Browser.IE;\n}", "function P(a){return _.isWindow(a)?a:9===a.nodeType&&a.defaultView}", "function Zn(t,e,n,r){var o,a=arguments.length,i=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)i=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(i=(a<3?o(i):a>3?o(e,n,i):o(e,n))||i);return a>3&&i&&Object.defineProperty(e,n,i),i}", "function letsJQuery() {\r\n//make sure there is no conflict between jQuery and other libraries\r\n$j = $.noConflict();\r\n//notify that jQuery is running...\r\n $j('<div>jQuery is running!</div>')\r\n .css({padding: '10px', background: '#ffc', position: 'absolute',top: '0', width: '100%'})\r\n .prependTo('body')\r\n .fadeIn('fast')\r\n .animate({opacity: 1.0}, 300)\r\n .fadeOut('fast', function() {\r\n $(this).remove();\r\n });\r\n//start custom jQuery scripting.\r\nmain();\r\n}", "function tb(e){var a=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,f=bf(e);if(a){var c=bf(this).constructor;t=Reflect.construct(f,arguments,c)}else t=f.apply(this,arguments);return nf(this,t)}}", "function UI() {} //Created prototype from which we can re use all methods", "function defineDependencies() {\n define('jquery', [], function () { return root.jQuery; });\n define('ko', [], function () { return root.ko; });\n define('sammy', [], function () { return root.Sammy; });\n }", "ready() {\n super.ready();\n\n const that = this;\n\n that._flexWritingModeNoFullSupport = true; // !JQX.Utilities.Core.Browser.Chrome;\n that._arrowCodes = { top: '&#xe804', bottom: '&#xe801', left: '&#xe802', right: '&#xe803' };\n\n that._createElement();\n }", "function getContext(){\n if (usePortalForContext()) {\n return top.jQuery;\n }\n else {\n return jq;\n }\n}", "function DOMIFlasher()\n{\n this.init();\n}", "function t(e){function t(e){if(!A){if(!s.body)return r(t);for(A=!0;e=E.shift();)r(e)}}function n(e){(w||e.type===l||s[d]===u)&&(i(),t())}function i(){w?(s[y](m,n,c),e[y](l,n,c)):(s[p](v,n),e[p](h,n))}function r(e,t){setTimeout(e,+t>=0?t:1)}function o(e){A?r(e):E.push(e)}null==document.readyState&&document.addEventListener&&(document.addEventListener(\"DOMContentLoaded\",function x(){document.removeEventListener(\"DOMContentLoaded\",x,!1),document.readyState=\"complete\"},!1),document.readyState=\"loading\");var s=e.document,a=s.documentElement,l=\"load\",c=!1,h=\"on\"+l,u=\"complete\",d=\"readyState\",f=\"attachEvent\",p=\"detachEvent\",g=\"addEventListener\",m=\"DOMContentLoaded\",v=\"onreadystatechange\",y=\"removeEventListener\",w=g in s,b=c,A=c,E=[];if(s[d]===u)r(t);else if(w)s[g](m,n,c),e[g](l,n,c);else{s[f](v,n),e[f](h,n);try{b=null==e.frameElement&&a}catch(C){}b&&b.doScroll&&!function F(){if(!A){try{b.doScroll(\"left\")}catch(e){return r(F,50)}i(),t()}}()}return o.version=\"1.4.0\",o.isReady=function(){return A},o}", "function TMP(){}", "function TMP(){}", "function Zi(a,b){this.Ub=M(\"div\",\"blocklyToolboxDiv\");this.Ub.setAttribute(\"dir\",x?\"RTL\":\"LTR\");b.appendChild(this.Ub);this.ja=new gi;a.appendChild(this.ja.H());F(this.Ub,\"mousedown\",this,function(a){Lb(a)||a.target==this.Ub?ug(!1):ug(!0)})}" ]
[ "0.5447129", "0.53985137", "0.52307963", "0.5163453", "0.51136255", "0.5103567", "0.5097593", "0.5047328", "0.4995225", "0.49946833", "0.49501795", "0.49347034", "0.49233836", "0.49233836", "0.49075207", "0.48996463", "0.48826176", "0.48730955", "0.48465693", "0.4840273", "0.4840273", "0.4840273", "0.4840273", "0.48295444", "0.4828743", "0.4828743", "0.4828743", "0.482727", "0.47954983", "0.47952908", "0.47921088", "0.479179", "0.4775158", "0.476991", "0.4756836", "0.4748401", "0.4737015", "0.47196597", "0.47060347", "0.47020727", "0.46986058", "0.46919662", "0.46914756", "0.46742663", "0.46733063", "0.46627215", "0.46617958", "0.46617958", "0.46565795", "0.464724", "0.46461523", "0.46355677", "0.4619996", "0.4616115", "0.46123344", "0.46109822", "0.45937297", "0.45769373", "0.4574878", "0.45659885", "0.45632273", "0.4559329", "0.45583475", "0.45578104", "0.45573145", "0.45535493", "0.4544945", "0.45434406", "0.45407423", "0.4535999", "0.4535999", "0.4535999", "0.45321804", "0.4523868", "0.45207518", "0.45207518", "0.4516538", "0.45145893", "0.45145893", "0.45135352", "0.4505333", "0.44973224", "0.4495966", "0.44947916", "0.44901943", "0.44870043", "0.4486141", "0.4484791", "0.44845566", "0.4477561", "0.4471305", "0.4466082", "0.44623247", "0.4462203", "0.44608873", "0.44595143", "0.44585213", "0.44562975", "0.44556364", "0.44556364", "0.44533977" ]
0.0
-1
Determine if we're running in a standard browser environment This allows axios to run in a web worker, and reactnative. Both environments support XMLHttpRequest, but not fully standard globals. web workers: typeof window > undefined typeof document > undefined reactnative: navigator.product > 'ReactNative' nativescript navigator.product > 'NativeScript' or 'NS'
function isStandardBrowserEnv() { if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) { return false; } return ( typeof window !== 'undefined' && typeof document !== 'undefined' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n }", "function isStandardBrowserEnv() {\n if (\n typeof navigator !== 'undefined' &&\n (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')\n ) {\n return false;\n }\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n }", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n }", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (typeof window !== 'undefined' &&\n typeof document !== 'undefined');\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined');\n\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined');\n\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n }" ]
[ "0.80762243", "0.8072195", "0.8061644", "0.8040761", "0.80332917", "0.80332917", "0.8031172", "0.80204666" ]
0.0
-1
Print error in a useful way whether in a browser environment (with expandable error stack traces), or in a node.js environment (textonly log output)
function log(level, message) { var error = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; /*eslint-disable no-console*/ if (typeof window === 'undefined') { console.log('redux-saga ' + level + ': ' + message + '\n' + (error && error.stack || error)); } else { console[level](message, error); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showErr (e) {\n console.error(e, e.stack);\n}", "function PrintError(err) {\n\tvar u = require('util');\n\tconsole.error(u.log('ERROR: ' + u.inspect(err)));\n}", "function printError(error){\n console.error(error.message);\n}", "function printError(e) {\n console.error(e.message);\n}", "function logerror (err, str) {\n console.error(str || err.stack)\n}", "function printError(error) {\n console.error(error.message);\n}", "function printError(error) {\n console.error(error.message);\n}", "function printError(error){\n\tconsole.error(error.message);\n}", "function printError(e) {\n\tconsole.error(e.message);\n}", "function printError(error) {\n console.error(error.message);\n}", "function printError(error) {\n console.error(error.message);\n}", "function printError(error) {\n console.error(error.message);\n}", "function err() {\n logWithProperFormatting(out.console.error, '(ERROR)', arguments);\n}", "function printError(error) {\n\tconsole.error(error.message);\n}", "function errorLog(error) {\n\tvar eLog = chalk.red(error);\n\tconsole.log(eLog);\n}", "function printError(error) {\n console.log('\\n' + format.red(error.toString()) + '\\n');\n}", "function printError(error) {\n console.log(error.message);\n}", "function printError(error) {\n\tconsole.error(error.message);\n}", "function error() {\n let ln = '??'\n try {\n const line = ((new Error).stack ?? '').split('\\n')[2]\n const parts = line.split(':')\n ln = parts[parts.length - 2]\n }\n catch { }\n log_print(ln, 'error', arguments)\n}", "function logError(err) {\n console.log(err.toString(), err);\n}", "function error(msg) {\n // If multiple arguments were passed, pass them all to the log function.\n if (arguments.length > 1) {\n var logArguments = ['Error:'];\n logArguments.push.apply(logArguments, arguments);\n console.log.apply(console, logArguments);\n // Join the arguments into a single string for the lines below.\n msg = [].join.call(arguments, ' ');\n } else {\n console.log('Error: ' + msg);\n }\n console.log(backtrace());\n UnsupportedManager.notify(UNSUPPORTED_FEATURES.unknown);\n throw new Error(msg);\n}", "function error(err) {\n console.error(err.stack)\n}", "function error_log(error){\n console.log(error.message);\n }", "function showError(err) {\n console.log(err);\n}", "function log_error(text) {\n var time = new Date();\n\n console.trace(\"[\" + time.toLocaleTimeString() + \"] \" + text);\n}", "function logError(err) {\n console.error(\"ErrnoException: %s\", JSON.stringify(err));\n}", "function log_error(text) {\n var time = new Date();\n\n console.trace(\"[\" + time.toLocaleTimeString() + \"] \" + text);\n }", "static logError(error) {\r\n console.log(`[ERROR] Something did not work - \\n`, error);\r\n }", "function genericError(){\n output('Fatal error. Open the browser\\'s developer console for more details.');\n}", "function logError(err) {\n console.error(err);\n}", "function err() {\n console.log('%cReceive Error/s:', 'background: #222; color: #bada55');\n Array.from(arguments).forEach(err => {\n console.log(`%c: ${err.fileName}, line ${err.lineNumber}: ${err}`, 'color: red')\n })\n}", "error(err) {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n }", "errorHandler(error) {\n console.log('%cError', 'background: red; color: white; padding: 2px 4px; border-radius: 3px; font-weight: bold;', error.message)\n }", "function error(e) { \n console.error('error:'.bold.red, e); \n}", "static logError(error) {\n console.log('[ERROR] Looks like there was a problem: \\n', error);\n }", "function developerError(s)\n{\n console.log(s);\n}", "function error (message){\r\n\tjava.lang.System.err.print(message)\r\n}", "function showError(error) {\n return console.error(`API ${error}`)\n}", "function _print_error(line) {\n\n\tif( (typeof debug === 'object') && (typeof debug._log_error === 'function') ) {\n\t\tdebug._log_error( line );\n\t\treturn;\n\t}\n\n\tif( debug.defaults.use_util_error && (!disable_util) && (typeof util === 'object') && (typeof util.error === 'function') ) {\n\t\tutil.error( 'ERROR: '+ line );\n\t\treturn;\n\t}\n\n\tif( (typeof console === 'object') && (typeof console.error === 'function') ) {\n\t\tconsole.error( line );\n\t\treturn;\n\t}\n\n\tif( debug.defaults.use_console_log && (typeof console === 'object') && (typeof console.log === 'function') ) {\n\t\tconsole.log( line );\n\t\treturn;\n\t}\n\n\tif( (typeof debug === 'object') && (typeof debug._log === 'function') ) {\n\t\tdebug._log( line );\n\t\treturn;\n\t}\n\n\tif( (typeof debug === 'object') && (typeof debug._failover_log === 'function') ) {\n\t\tdebug._failover_log( line );\n\t\treturn;\n\t}\n\n}", "function error(err) {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n}", "function log_error(text) {\n var time = new Date();\n console.error(\"[\" + time.toLocaleTimeString() + \"] \" + text);\n}", "function error(err) {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n}", "static log (error) {\n\t\tlet message = typeof error === 'string' ? error : JSON.stringify(error);\n\t\tif (error.stack) {\n\t\t\tmessage += `\\n${error.stack}`;\n\t\t}\n\t\treturn message;\n\t}", "function reportError(error) {\n console.error(error);\n\n const reporter = document.createElement(\"p\");\n reporter.setAttribute(\"class\", \"error\");\n if (typeof error.stack === \"string\" && error.stack.startsWith(\"Error:\")) {\n // Use the stack trace if it looks human-readable (like Chrome).\n reporter.textContent = error.stack;\n } else {\n // Otherwise, use the standard format without a stack trace.\n reporter.textContent = error.toString();\n }\n\n const canvas = document.getElementById(\"display\");\n canvas.parentNode.insertBefore(reporter, canvas);\n}", "function logError(code, message) {\n\tconsole.error(new Date() + \" [HTTP Code: \" + code + \", Message: \" + message + \"]\")\n}", "function errorln (message){\r\n\tjava.lang.System.err.println(message)\r\n\t}", "function printError(errorParam) {\n console.error(errorParam.message);\n}", "errorHandler (error) {\n // eslint-disable-next-line no-console\n console.log(\n '%cError',\n 'background: red; color: white; padding: 2px 4px; border-radius: 3px; font-weight: bold;',\n error.message\n )\n }", "function swallowError(error) {\n console.log(error.toString());\n}", "function showError(str, err) {\n console.log(\"An error occurred while processing configuration:\\n\");\n if (str) console.log(str);\n if (err) console.log(err);\n}", "error_handler(err) {\n console.log(`Problem encountered. Detail:${err.message}`);\n }", "function printerr(msg) {\n process.stderr.write(msg + \"\\n\");\n}", "function error(error) {\n console.log(\"Error : \" + error);\n}", "function displayErrors(pErr){\n console.log('-----------');\n console.log('Error in Mod: ' +pErr.mod +' | Func: ' +pErr.func);\n //console.log('name: ' +pErr.name);\n console.log(getException(pErr.name));\n console.log('msg: '+pErr.msg);\n if (pErr.isObj === true) {\n console.log('line: '+pErr.line);\n //console.log('\\n' +pErr.stfLingoMsg +': ' + pErr.msg);\n //console.log('\\n' +pErr.stfLingoStack +':');\n console.log('-----------');\n }\n console.log(pErr.stack);\n }", "function devlog(msg)\n{\n customError(\"Dev\", msg, -1, true, false);\n}", "function showError(type, text) {}", "function generateError(error){//generates an error if necessary\n console.error(error)\n}", "function logError( message ) {\n console.log( 'Error'.red.underline + ( ': ' + message ).red );\n}", "function reportError(detail) {\n const text = 'Error contacting the Readable service.';\n console.error(`${text}\\n${detail}`);\n //alert(`${text}`);\n}", "function logError(err) { if(console && console.log) console.log('Error!', err); return false; }", "function error(err) {\n console.warn('ERROR(' + err.code + '): ' + err.message);\n}", "function log(err) {\n console.log(`💥 -> ${err}`);\n}", "function error_out(message, error) {\n\tlet error_fmt = error.toString().replace(/Error: /, '').replace(/Error: /, '').trim();\n\tlog.msg('Error ' + message + ': ' + error_fmt);\n}", "function error(err) {\n console.warn('ERROR(' + err.code + '): ' + err.message);\n}", "function error(err) {\n console.warn('ERROR(' + err.code + '): ' + err.message);\n}", "function log() {\n if (!config.debug) return\n let ln = '??'\n try {\n const line = ((new Error).stack ?? '').split('\\n')[2]\n const parts = line.split(':')\n ln = parts[parts.length - 2]\n }\n catch { }\n log_print(ln, 'log', arguments)\n}", "function error(msg) {\n if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.errors) {\n console.log('Error: ' + msg);\n console.log(backtrace());\n }\n throw new Error(msg);\n}", "function showError(error) {\n console.log('>> port error: ' + error);\n}", "function showError() {}", "function logError(error) {\n console.log(chalk_1.default.red(error));\n}", "function logError(terminal, format, ...args) {\n terminal.log(\n \"%s: %s\",\n chalk.red(\"error\"), // Syntax errors may have colors applied for displaying code frames\n // in various places outside of where Metro is currently running.\n // If the current terminal does not support color, we'll strip the colors\n // here.\n util.format(chalk.supportsColor ? format : stripAnsi(format), ...args)\n );\n}", "function error (message) {\n console.error(`${Program}: ${message}`)\n}", "function swallowError(error) {\n console.log(error.messageFormatted);\n}", "function displayError(error) {\n console.log(error);\n}", "function error(msg) {\n if (verbosity >= VERBOSITY_LEVELS.errors) {\n console.log('Error: ' + msg);\n console.log(backtrace());\n }\n throw new Error(msg);\n }", "function explainError(status, str) {\n if ('console' in global && 'info' in console) {\n console.info('The above ' + status + ' is totally normal. ' + str);\n }\n}", "function explainError(status, str) {\n if ('console' in global && 'info' in console) {\n console.info('The above ' + status + ' is totally normal. ' + str);\n }\n}", "function showError(type, text){\r\n window.console && window.console[type] && window.console[type]('fullPage: ' + text);\r\n }", "function showError(type, text){\r\n window.console && window.console[type] && window.console[type]('fullPage: ' + text);\r\n }", "function _error(message,error){\r\n if(error){\r\n message += ' ' + JSON.stringify(error);\r\n }\r\n console.log(message);\r\n var logger = _getLogger();\r\n if(logger){\r\n logger.error(message);\r\n }\r\n}", "function error(msg){\r\n rootLogger.error(msg)\r\n}", "function logErrors(err, req, res, next) {\n console.error(err.stack);\n next(err);\n}", "function logErrors(err, req, res, next) {\n console.error(err.stack);\n next(err);\n}", "function logError (err) {\n util.log('error:', err)\n}", "function showError(type, text){\n window.console && window.console[type] && window.console[type]('fullPage: ' + text);\n }", "function showError(type, text){\n window.console && window.console[type] && window.console[type]('fullPage: ' + text);\n }", "function showError(type, text){\n window.console && window.console[type] && window.console[type]('fullPage: ' + text);\n }", "function logError(serverError,clientError){ //Function that simplifies the logging of errors\n console.log(\"==========================\\n\"+serverError);\n customString = clientError;\n}", "function error(message) {\n if(typeof window.console !== 'undefined') {\n console.error(message);\n }\n }", "function reportVeryLoudly(err) {\n console.log('##################################################');\n console.log('# OMG RUN AROUND WITH YOUR PANTS ON YOUR HEAD!!! #');\n console.log('##################################################');\n console.dir(err.stack || err);\n process.exit(1);\n}", "function logErrors(err, req, res, next) {\n\tconsole.error(err.stack);\n\tnext(err);\n}", "function prettyError(logger, args, error) {\n logger.all();\n logger.all(`----------------------------------------------------------------`);\n logger.all(`-------------- 🔥🔥🔥 an error occurred 🔥🔥🔥 --------------`);\n logger.all(`----------------------------------------------------------------`);\n const ftpError = error;\n if (typeof error.code === \"string\") {\n const errorCode = error.code;\n if (errorCode === \"ENOTFOUND\") {\n logger.all(`The server \"${args.server}\" doesn't seem to exist. Do you have a typo?`);\n }\n }\n else if (typeof error.name === \"string\") {\n const errorName = error.name;\n if (errorName.includes(\"ERR_TLS_CERT_ALTNAME_INVALID\")) {\n logger.all(`The certificate for \"${args.server}\" is likely shared. The host did not place your server on the list of valid domains for this cert.`);\n logger.all(`This is a common issue with shared hosts. You have a few options:`);\n logger.all(` - Ignore this error by setting security back to loose`);\n logger.all(` - Contact your hosting provider and ask them for your servers hostname`);\n }\n }\n else if (typeof ftpError.code === \"number\") {\n if (ftpError.code === types_1.ErrorCode.NotLoggedIn) {\n const serverRequiresFTPS = ftpError.message.toLowerCase().includes(\"must use encryption\");\n if (serverRequiresFTPS) {\n logger.all(`The server you are connecting to requires encryption (ftps)`);\n logger.all(`Enable FTPS by using the protocol option.`);\n }\n else {\n logger.all(`Could not login with the username \"${args.username}\" and password \"${args.password}\".`);\n logger.all(`Make sure you can login with those credentials. If you have a space or a quote in your username or password be sure to escape them!`);\n }\n }\n }\n logOriginalError(logger, error);\n}", "function printErrorAndExit(message, err) {\n /* eslint-disable no-console */\n console.error(message);\n console.error(err);\n /* eslint-enable no-console */\n process.exit(-1);\n}", "function e(...message) {\n if (level === \"SILENT\") {\n return;\n }\n console.error(...message);\n }", "function error(err) {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n }", "logError(error) {\n console.error(error);\n return error;\n }", "logErrors(err, req, res, next) {\n console.error(err.stack);\n next(err);\n }", "function error(msg){\n console.log(msg);\n var e = new Error();\n console.log(e.stack);\n throw \"Evaluation error\";\n }", "function catchError(err) {\n console.error(`🔥${err}🔥\"`);\n}", "logDiagnostics(err) {\n systemLog_1.default.error({ leadingBlankLine: true, indent: true }, `Error in stage \"${this.currentStage}\": ${err.description}`);\n for (let i = 0; i < err.errorData.length; i++) {\n systemLog_1.default.error({ doubleIndent: true }, `\"${i}: ${err.errorData[i]}`);\n }\n systemLog_1.default.error({ leadingBlankLine: true, indent: true }, `\"${this.currentStage}\" stage failed. See SystemManager console for additional information.`);\n }", "error(message, ...params) {\n console.error.apply(console, arguments);\n }" ]
[ "0.7307129", "0.7195309", "0.7127001", "0.71048266", "0.707311", "0.70667964", "0.70667964", "0.70531344", "0.7049032", "0.7001629", "0.69987", "0.69987", "0.6916608", "0.6910838", "0.6896317", "0.6889079", "0.68778265", "0.68453544", "0.68241763", "0.68033266", "0.6799327", "0.67769486", "0.6759168", "0.6682715", "0.66467935", "0.6637945", "0.6620386", "0.6605906", "0.6603048", "0.65865153", "0.6519421", "0.65098643", "0.64818364", "0.6481524", "0.64721876", "0.6464752", "0.64531726", "0.64444506", "0.6441596", "0.64336693", "0.64105135", "0.64065737", "0.63852817", "0.637451", "0.6374461", "0.6353974", "0.6346233", "0.6343778", "0.63436747", "0.634004", "0.6336015", "0.63349706", "0.63323486", "0.6326258", "0.63248545", "0.63165855", "0.6308494", "0.63075656", "0.62549496", "0.6253585", "0.625208", "0.62469167", "0.62446105", "0.6240621", "0.6240621", "0.62276137", "0.62091684", "0.62015676", "0.61979127", "0.61864835", "0.618281", "0.6180363", "0.61721", "0.6169866", "0.61667323", "0.61610335", "0.61610335", "0.61438334", "0.61438334", "0.6143771", "0.61418307", "0.61355114", "0.6130522", "0.61228406", "0.6108821", "0.6108821", "0.6108821", "0.6097789", "0.60957813", "0.60946226", "0.60926175", "0.6084689", "0.60827595", "0.60764384", "0.6073835", "0.6070807", "0.6068491", "0.6067151", "0.60641325", "0.6057755", "0.605232" ]
0.0
-1
Check if the given character code, or the character code at the first character, is a whitespace character.
function whitespace(character) { return re.test( typeof character === 'number' ? fromCode(character) : character.charAt(0) ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_whitespace(char) {\n return \" \\t\\n\".indexOf(char) >= 0;\n }", "function isWhiteSpace(code) {\n return isNewline(code) || code === 0x0020 || code === 0x0009;\n}", "function isWhitespace(char) {\n\treturn /\\s/.test(char);\n}", "function sc_isCharWhitespace(c) {\n var tmp = c.val;\n return tmp === \" \" || tmp === \"\\r\" || tmp === \"\\n\" || tmp === \"\\t\" || tmp === \"\\f\";\n}", "function whitespace(char) {\n return char != \"\" ? true : false \n}", "function isWhiteSpace(code) {\n if (code >= 0x2000 && code <= 0x200A) { return true; }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true;\n }\n return false;\n}", "function isWhiteSpace(code) {\n if (code >= 0x2000 && code <= 0x200A) { return true; }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true;\n }\n return false;\n}", "function isWhiteSpace(code) {\n if (code >= 0x2000 && code <= 0x200A) { return true; }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true;\n }\n return false;\n}", "function isWhiteSpace(code) {\n if (code >= 0x2000 && code <= 0x200A) { return true; }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true;\n }\n return false;\n}", "function isWhiteSpace(code) {\n if (code >= 0x2000 && code <= 0x200A) { return true; }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true;\n }\n return false;\n}", "function isWhiteSpace(code) {\n if (code >= 0x2000 && code <= 0x200A) { return true; }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true;\n }\n return false;\n}", "function isWhiteSpace(code) {\n if (code >= 0x2000 && code <= 0x200A) { return true; }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true;\n }\n return false;\n}", "function isWhiteSpace(code) {\n if (code >= 0x2000 && code <= 0x200A) { return true; }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true;\n }\n return false;\n}", "function isWhiteSpace(code) {\n if (code >= 0x2000 && code <= 0x200A) { return true; }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true;\n }\n return false;\n}", "function isWhiteSpace(code) {\n if (code >= 0x2000 && code <= 0x200A) { return true; }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true;\n }\n return false;\n}", "function isWhiteSpace(code) {\n if (code >= 8192 && code <= 8202) {\n return true;\n }\n switch (code) {\n case 9:\n // \\t\n case 10:\n // \\n\n case 11:\n // \\v\n case 12:\n // \\f\n case 13:\n // \\r\n case 32:\n case 160:\n case 5760:\n case 8239:\n case 8287:\n case 12288:\n return true;\n }\n return false;\n }", "function isWhitespace(code) {\n // Based on https://www.w3.org/TR/css-syntax-3/#whitespace\n switch (code) {\n case 0x0009: // tab\n case 0x0020: // space\n case 0x000a: // line feed\n case 0x000c: // form feed\n case 0x000d: // carriage return\n return true;\n default:\n return false;\n }\n}", "function isWhiteSpace(code) {\n\t if (code >= 0x2000 && code <= 0x200A) { return true; }\n\t switch (code) {\n\t case 0x09: // \\t\n\t case 0x0A: // \\n\n\t case 0x0B: // \\v\n\t case 0x0C: // \\f\n\t case 0x0D: // \\r\n\t case 0x20:\n\t case 0xA0:\n\t case 0x1680:\n\t case 0x202F:\n\t case 0x205F:\n\t case 0x3000:\n\t return true;\n\t }\n\t return false;\n\t}", "function isWhitespace$1(c) {\n return c === CHAR_SPACE$1 || c === CHAR_TAB$1;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "isWhitespace(char) {\n return /\\s/.test(char ? char : this.char) // || this.isNewline() // [\\r\\n\\t\\f\\v ]\n }", "function isWhitespace(ch) {\n return /\\s/.test(ch);\n }", "function isWhitespace(c) {\n\t return c === CHAR_SPACE || c === CHAR_TAB;\n\t}", "function isWhitespace(c) {\n\t return c === CHAR_SPACE || c === CHAR_TAB;\n\t}", "function isWhitespace(c) {\n\t return c === CHAR_SPACE || c === CHAR_TAB;\n\t}", "function isSpace(c) {\n\treturn c.trim() === \"\";\n}", "function isWhiteSpace(ch) {\n return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||\n (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);\n }", "function isWhiteSpace(ch) {\n\t return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||\n\t (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);\n\t }", "function isWhitespace(c) {\n\t\treturn WHITESPACE_PATTERN.test(c);\n\t}", "function isWhiteSpace(ch) {\n return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||\n (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);\n }", "function isWhiteSpace(ch) {\n return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||\n (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);\n }", "function isWhiteSpace(ch) {\n return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||\n (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);\n }", "static isWhitespace(ch) {\n return ch === 0x20 || ch === 0x09;\n }", "function IsSpace(ch) {\n return (\" \\t\\r\\n\".indexOf(ch) >= 0);\n}", "function iswhitespace(s) {\n switch(s.charAt(0)) {\n case '\\t': case '\\n': case '\\r': case ' ':\n return true\n case '/':\n switch(s.charAt(1)) {\n case '*': case '/':\n return true\n default:\n return false\n }\n default:\n return false\n }\n}", "function isWhiteSpace(ch) {\n // The messy regexp is because IE's regexp matcher is of the\n // opinion that non-breaking spaces are no whitespace.\n return ch != \"\\n\" && /^[\\s\\u00a0]*$/.test(ch);\n}", "function isWhitespace(cp) {\r\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\r\n}", "function isWhitespace(cp) {\r\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\r\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function hasWhiteSpace(string) {\r\n\tfor (char of string) {\r\n\t\tif (char === \" \") {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(s)\n\n{\t var i;\n\n\t\t// Is s empty?\n\t\tif (isEmpty(s)) return true;\n\n\t\tfor (i = 0; i < s.length; i++)\n\t\t{\t \n\t\t// Check that current character isn't whitespace.\n\t\tvar c = s.charAt(i);\n\n\t\tif (whitespace.indexOf(c) == -1) return false;\n\t\t}\n\n\t\t// All characters are whitespace.\n\t\treturn true;\n}", "function hasWhiteSpace(string) {\n return string.indexOf(\" \") >= 0;\n}", "function isSpace(c) {\n return c === \"\\u0020\" || // space\n c === \"\\u0009\" || // horizontal tab\n c === \"\\u000A\" || // new line\n c === \"\\u000C\" || // form feed\n c === \"\\u000D\"; // carriage return\n }", "function hasSpaces(cadena) {\n\n return ((-1)!= cadena.indexOf(\" \"));\n\n }", "function isWhitespace(c) {\n if ((c == ' ') || (c == '\\r') || (c == '\\n'))\n return true;\n return false;\n }", "function isWhitespace(str) { \r\n\tvar re = /[\\S]/g;\r\n\tif (re.test(str)) {\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function isSpace(str) {\n return str.match(/\\s/) !== null;\n}", "function satisyWhitespace(ch, pos) {\n switch (ch) {\n case 0x09:\n case 0x0A:\n case 0x0D:\n case 0x20:\n return true;\n default:\n return false;\n }\n }", "function isS(c) {\n return c === SPACE || c === NL || c === CR || c === TAB;\n}", "function isS(c) {\n return c === SPACE || c === NL || c === CR || c === TAB;\n}", "function isSpace(ltr) {\n return (ltr == \" \");\n }", "function isSpace(c) {\n\treturn c === 0x20 || c >= 0x0009 && c <= 0x000d || c === 0x00a0 || c === 0x1680 || c === 0x180e || c >= 0x2000 && c <= 0x200a || c === 0x2028 || c === 0x2029 || c === 0x202f || c === 0x205f || c === 0x3000 || c === 0xfeff;\n}", "function isSpace(c) {\n return (c === \"\\u0020\" || // space\n c === \"\\u0009\" || // horizontal tab\n c === \"\\u000A\" || // new line\n c === \"\\u000C\" || // form feed\n c === \"\\u000D\"); // carriage return\n }", "function isWhitespace(cp) {\n return cp === $$5.SPACE || cp === $$5.LINE_FEED || cp === $$5.TABULATION || cp === $$5.FORM_FEED;\n}", "function isWhitespace (s)\r\n\r\n{ var i;\r\n\r\n // Is s empty?\r\n if (isEmpty(s)) return true;\r\n\r\n // Search through string's characters one by one\r\n // until we find a non-whitespace character.\r\n // When we do, return false; if we don't, return true.\r\n\r\n for (i = 0; i < s.length; i++)\r\n {\r\n // Check that current character isn't whitespace.\r\n var c = s.charAt(i);\r\n\r\n if (whitespace.indexOf(c) == -1) return false;\r\n }\r\n\r\n // All characters are whitespace.\r\n return true;\r\n}" ]
[ "0.78409445", "0.78340477", "0.783171", "0.782192", "0.77739525", "0.7719754", "0.7719754", "0.7719754", "0.7719754", "0.7719754", "0.7719754", "0.7719754", "0.7719754", "0.7719754", "0.7719754", "0.7683152", "0.76666564", "0.7659878", "0.76198775", "0.7570246", "0.7570246", "0.7570246", "0.7570246", "0.7570246", "0.7570246", "0.7570246", "0.7570246", "0.7570246", "0.7570246", "0.7570246", "0.7570246", "0.7570246", "0.7570246", "0.7570246", "0.7570246", "0.7570246", "0.7570246", "0.7570246", "0.7570246", "0.7570246", "0.7570246", "0.7570246", "0.7570246", "0.7533524", "0.7406507", "0.73986095", "0.73986095", "0.73986095", "0.734061", "0.7301192", "0.7244063", "0.72106975", "0.7207023", "0.7207023", "0.7207023", "0.71990657", "0.7150109", "0.7116189", "0.70456475", "0.69921434", "0.69921434", "0.69888496", "0.69888496", "0.69888496", "0.69888496", "0.69888496", "0.69888496", "0.69888496", "0.69888496", "0.69888496", "0.69888496", "0.69888496", "0.69888496", "0.69888496", "0.69888496", "0.69888496", "0.69888496", "0.69888496", "0.69787693", "0.697685", "0.69361264", "0.6911483", "0.6897427", "0.68822026", "0.6876607", "0.686241", "0.6861279", "0.6847556", "0.6844613", "0.6844613", "0.6839501", "0.68365216", "0.6824485", "0.68239", "0.6814412" ]
0.77974325
9
channel(pattern, [buffer]) => creates an event channel for store actions
function actionChannel(pattern, buffer) { Object(__WEBPACK_IMPORTED_MODULE_0__utils__["h" /* check */])(pattern, __WEBPACK_IMPORTED_MODULE_0__utils__["q" /* is */].notUndef, 'actionChannel(pattern,...): argument pattern is undefined'); if (arguments.length > 1) { Object(__WEBPACK_IMPORTED_MODULE_0__utils__["h" /* check */])(buffer, __WEBPACK_IMPORTED_MODULE_0__utils__["q" /* is */].notUndef, 'actionChannel(pattern, buffer): argument buffer is undefined'); Object(__WEBPACK_IMPORTED_MODULE_0__utils__["h" /* check */])(buffer, __WEBPACK_IMPORTED_MODULE_0__utils__["q" /* is */].buffer, 'actionChannel(pattern, buffer): argument ' + buffer + ' is not a valid buffer'); } return effect(ACTION_CHANNEL, { pattern: pattern, buffer: buffer }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function actionChannel(pattern$1,buffer$1){if(true){check(pattern$1,_redux_saga_is__WEBPACK_IMPORTED_MODULE_2__[\"pattern\"],'actionChannel(pattern,...): argument pattern is not valid');if(arguments.length>1){check(buffer$1,_redux_saga_is__WEBPACK_IMPORTED_MODULE_2__[\"notUndef\"],'actionChannel(pattern, buffer): argument buffer is undefined');check(buffer$1,_redux_saga_is__WEBPACK_IMPORTED_MODULE_2__[\"buffer\"],\"actionChannel(pattern, buffer): argument \"+buffer$1+\" is not a valid buffer\");}}return makeEffect(ACTION_CHANNEL,{pattern:pattern$1,buffer:buffer$1});}", "function actionChannel(pattern, buffer) {\n\t if (process.env.NODE_ENV === 'development') {\n\t check(pattern, is.notUndef, 'actionChannel(pattern,...): argument pattern is undefined');\n\n\t if (arguments.length > 1) {\n\t check(buffer, is.notUndef, 'actionChannel(pattern, buffer): argument buffer is undefined');\n\t check(buffer, is.buffer, \"actionChannel(pattern, buffer): argument \" + buffer + \" is not a valid buffer\");\n\t }\n\t }\n\n\t return effect(ACTION_CHANNEL, {\n\t pattern: pattern,\n\t buffer: buffer\n\t });\n\t}", "function actionChannel(pattern, buffer) {\n\t if (process.env.NODE_ENV === 'development') {\n\t (0, utils.check)(pattern, utils.is.notUndef, 'actionChannel(pattern,...): argument pattern is undefined');\n\n\t if (arguments.length > 1) {\n\t (0, utils.check)(buffer, utils.is.notUndef, 'actionChannel(pattern, buffer): argument buffer is undefined');\n\t (0, utils.check)(buffer, utils.is.buffer, \"actionChannel(pattern, buffer): argument \" + buffer + \" is not a valid buffer\");\n\t }\n\t }\n\n\t return effect(ACTION_CHANNEL, {\n\t pattern: pattern,\n\t buffer: buffer\n\t });\n\t}", "function actionChannel(pattern, buffer) {\n (0, _utils.check)(pattern, _utils.is.notUndef, 'actionChannel(pattern,...): argument pattern is undefined');\n if (arguments.length > 1) {\n (0, _utils.check)(buffer, _utils.is.notUndef, 'actionChannel(pattern, buffer): argument buffer is undefined');\n (0, _utils.check)(buffer, _utils.is.buffer, 'actionChannel(pattern, buffer): argument ' + buffer + ' is not a valid buffer');\n }\n return effect(ACTION_CHANNEL, { pattern: pattern, buffer: buffer });\n}", "function actionChannel(pattern, buffer) {\n (0, _utils.check)(pattern, _utils.is.notUndef, 'actionChannel(pattern,...): argument pattern is undefined');\n if (arguments.length > 1) {\n (0, _utils.check)(buffer, _utils.is.notUndef, 'actionChannel(pattern, buffer): argument buffer is undefined');\n (0, _utils.check)(buffer, _utils.is.buffer, 'actionChannel(pattern, buffer): argument ' + buffer + ' is not a valid buffer');\n }\n return effect(ACTION_CHANNEL, { pattern: pattern, buffer: buffer });\n}", "function actionChannel(pattern, buffer) {\n\t (0, _utils.check)(pattern, _utils.is.notUndef, 'actionChannel(pattern,...): argument pattern is undefined');\n\t if (arguments.length > 1) {\n\t (0, _utils.check)(buffer, _utils.is.notUndef, 'actionChannel(pattern, buffer): argument buffer is undefined');\n\t (0, _utils.check)(buffer, _utils.is.buffer, 'actionChannel(pattern, buffer): argument ' + buffer + ' is not a valid buffer');\n\t }\n\t return effect(ACTION_CHANNEL, { pattern: pattern, buffer: buffer });\n\t}", "function actionChannel(pattern, buffer) {\n\t (0, _utils.check)(pattern, _utils.is.notUndef, 'actionChannel(pattern,...): argument pattern is undefined');\n\t if (arguments.length > 1) {\n\t (0, _utils.check)(buffer, _utils.is.notUndef, 'actionChannel(pattern, buffer): argument buffer is undefined');\n\t (0, _utils.check)(buffer, _utils.is.notUndef, 'actionChannel(pattern, buffer): argument ' + buffer + ' is not a valid buffer');\n\t }\n\t return effect(ACTION_CHANNEL, { pattern: pattern, buffer: buffer });\n\t}", "function actionChannel(pattern$1, buffer$1) {\n if (false) {}\n\n return chunk_e922c950_makeEffect(ACTION_CHANNEL, {\n pattern: pattern$1,\n buffer: buffer$1\n });\n}", "function actionChannel(pattern$$1, buffer$$1) {\n if (process.env.NODE_ENV !== 'production') {\n check(pattern$$1, pattern, 'actionChannel(pattern,...): argument pattern is not valid');\n\n if (arguments.length > 1) {\n check(buffer$$1, notUndef, 'actionChannel(pattern, buffer): argument buffer is undefined');\n check(buffer$$1, buffer, \"actionChannel(pattern, buffer): argument \" + buffer$$1 + \" is not a valid buffer\");\n }\n }\n\n return makeEffect(ACTION_CHANNEL, {\n pattern: pattern$$1,\n buffer: buffer$$1\n });\n}", "function actionChannel(pattern, buffer) {\n Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"check\"])(pattern, _utils__WEBPACK_IMPORTED_MODULE_0__[\"is\"].notUndef, 'actionChannel(pattern,...): argument pattern is undefined');\n if (arguments.length > 1) {\n Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"check\"])(buffer, _utils__WEBPACK_IMPORTED_MODULE_0__[\"is\"].notUndef, 'actionChannel(pattern, buffer): argument buffer is undefined');\n Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"check\"])(buffer, _utils__WEBPACK_IMPORTED_MODULE_0__[\"is\"].buffer, 'actionChannel(pattern, buffer): argument ' + buffer + ' is not a valid buffer');\n }\n return effect(ACTION_CHANNEL, { pattern: pattern, buffer: buffer });\n}", "function actionChannel(pattern, buffer) {\n Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"check\"])(pattern, _utils__WEBPACK_IMPORTED_MODULE_0__[\"is\"].notUndef, 'actionChannel(pattern,...): argument pattern is undefined');\n if (arguments.length > 1) {\n Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"check\"])(buffer, _utils__WEBPACK_IMPORTED_MODULE_0__[\"is\"].notUndef, 'actionChannel(pattern, buffer): argument buffer is undefined');\n Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"check\"])(buffer, _utils__WEBPACK_IMPORTED_MODULE_0__[\"is\"].buffer, 'actionChannel(pattern, buffer): argument ' + buffer + ' is not a valid buffer');\n }\n return effect(ACTION_CHANNEL, { pattern: pattern, buffer: buffer });\n}", "function actionChannel(pattern, buffer) {\n Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"check\"])(pattern, _utils__WEBPACK_IMPORTED_MODULE_0__[\"is\"].notUndef, 'actionChannel(pattern,...): argument pattern is undefined');\n if (arguments.length > 1) {\n Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"check\"])(buffer, _utils__WEBPACK_IMPORTED_MODULE_0__[\"is\"].notUndef, 'actionChannel(pattern, buffer): argument buffer is undefined');\n Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"check\"])(buffer, _utils__WEBPACK_IMPORTED_MODULE_0__[\"is\"].buffer, 'actionChannel(pattern, buffer): argument ' + buffer + ' is not a valid buffer');\n }\n return effect(ACTION_CHANNEL, { pattern: pattern, buffer: buffer });\n}", "function actionChannel(pattern, buffer) {\n Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"check\"])(pattern, _utils__WEBPACK_IMPORTED_MODULE_0__[\"is\"].notUndef, 'actionChannel(pattern,...): argument pattern is undefined');\n if (arguments.length > 1) {\n Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"check\"])(buffer, _utils__WEBPACK_IMPORTED_MODULE_0__[\"is\"].notUndef, 'actionChannel(pattern, buffer): argument buffer is undefined');\n Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"check\"])(buffer, _utils__WEBPACK_IMPORTED_MODULE_0__[\"is\"].buffer, 'actionChannel(pattern, buffer): argument ' + buffer + ' is not a valid buffer');\n }\n return effect(ACTION_CHANNEL, { pattern: pattern, buffer: buffer });\n}", "function actionChannel(pattern$1, buffer$1) {\n if (false) {}\n\n return makeEffect(ACTION_CHANNEL, {\n pattern: pattern$1,\n buffer: buffer$1\n });\n}", "function actionChannel(pattern, buffer) {\n Object(__WEBPACK_IMPORTED_MODULE_0__utils__[\"g\" /* check */])(pattern, __WEBPACK_IMPORTED_MODULE_0__utils__[\"n\" /* is */].notUndef, 'actionChannel(pattern,...): argument pattern is undefined');\n if (arguments.length > 1) {\n Object(__WEBPACK_IMPORTED_MODULE_0__utils__[\"g\" /* check */])(buffer, __WEBPACK_IMPORTED_MODULE_0__utils__[\"n\" /* is */].notUndef, 'actionChannel(pattern, buffer): argument buffer is undefined');\n Object(__WEBPACK_IMPORTED_MODULE_0__utils__[\"g\" /* check */])(buffer, __WEBPACK_IMPORTED_MODULE_0__utils__[\"n\" /* is */].buffer, 'actionChannel(pattern, buffer): argument ' + buffer + ' is not a valid buffer');\n }\n return effect(ACTION_CHANNEL, { pattern: pattern, buffer: buffer });\n}", "function actionChannel(pattern, buffer) {\n Object(__WEBPACK_IMPORTED_MODULE_0__utils__[\"g\" /* check */])(pattern, __WEBPACK_IMPORTED_MODULE_0__utils__[\"n\" /* is */].notUndef, 'actionChannel(pattern,...): argument pattern is undefined');\n if (arguments.length > 1) {\n Object(__WEBPACK_IMPORTED_MODULE_0__utils__[\"g\" /* check */])(buffer, __WEBPACK_IMPORTED_MODULE_0__utils__[\"n\" /* is */].notUndef, 'actionChannel(pattern, buffer): argument buffer is undefined');\n Object(__WEBPACK_IMPORTED_MODULE_0__utils__[\"g\" /* check */])(buffer, __WEBPACK_IMPORTED_MODULE_0__utils__[\"n\" /* is */].buffer, 'actionChannel(pattern, buffer): argument ' + buffer + ' is not a valid buffer');\n }\n return effect(ACTION_CHANNEL, { pattern: pattern, buffer: buffer });\n}", "function actionChannel(pattern$$1, buffer$$1) {\n if (false) {\n check(pattern$$1, pattern, 'actionChannel(pattern,...): argument pattern is not valid');\n\n if (arguments.length > 1) {\n check(buffer$$1, notUndef, 'actionChannel(pattern, buffer): argument buffer is undefined');\n check(buffer$$1, buffer, \"actionChannel(pattern, buffer): argument \" + buffer$$1 + \" is not a valid buffer\");\n }\n }\n\n return makeEffect(ACTION_CHANNEL, {\n pattern: pattern$$1,\n buffer: buffer$$1\n });\n}", "function actionChannel(pattern$1, buffer$1) {\n if (true) {\n check(pattern$1, _redux_saga_is__WEBPACK_IMPORTED_MODULE_2__[\"pattern\"], 'actionChannel(pattern,...): argument pattern is not valid');\n\n if (arguments.length > 1) {\n check(buffer$1, _redux_saga_is__WEBPACK_IMPORTED_MODULE_2__[\"notUndef\"], 'actionChannel(pattern, buffer): argument buffer is undefined');\n check(buffer$1, _redux_saga_is__WEBPACK_IMPORTED_MODULE_2__[\"buffer\"], \"actionChannel(pattern, buffer): argument \" + buffer$1 + \" is not a valid buffer\");\n }\n }\n\n return makeEffect(ACTION_CHANNEL, {\n pattern: pattern$1,\n buffer: buffer$1\n });\n}", "createChannel() {\n\t\t// Set the depends - add self aggs query as well with depends\n\t\tlet depends = this.props.depends ? this.props.depends : {};\n\t\tdepends['aggs'] = {\n\t\t\tkey: this.props.inputData,\n\t\t\tsort: this.props.sort,\n\t\t\tsize: this.props.size\n\t\t};\n\t\t// create a channel and listen the changes\n\t\tvar channelObj = manager.create(depends);\n\t\tchannelObj.emitter.addListener(channelObj.channelId, function(res) {\n\t\t\tlet data = res.data;\n\t\t\tlet rawData;\n\t\t\tif(res.method === 'stream') {\n\t\t\t\trawData = this.state.rawData;\n\t\t\t\trawData.hits.hits.push(res.data);\n\t\t\t} else if(res.method === 'historic') {\n\t\t\t\trawData = data;\n\t\t\t}\n\t\t\tthis.setState({\n\t\t\t\trawData: rawData\n\t\t\t});\n\t\t\tthis.setData(rawData);\n\t\t}.bind(this));\n\t}", "function handleChannel (channel) {\n // Log new messages\n channel.onmessage = function (msg) {\n console.log('Getting data')\n console.log(msg)\n handleMessage(JSON.parse(msg.data), channel)\n waitingOffer = msg.data\n }\n // Other events\n channel.onerror = function (err) { console.log(err) }\n channel.onclose = function () { console.log('Closed!') }\n channel.onopen = function (evt) { console.log('Opened') }\n}", "push(channel){\n this.channels[channel.name] = channel;\n }", "function chan(buf, xform, exHandler) {\n let newXForm;\n\n if (xform) {\n if (!buf) {\n throw new Error('Only buffered channels can use transducers');\n }\n\n newXForm = xform(AddTransformer);\n } else {\n newXForm = AddTransformer;\n }\n\n return new Channel(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__buffers__[\"e\" /* ring */])(32), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__buffers__[\"e\" /* ring */])(32), buf, handleException(exHandler)(newXForm));\n}", "@track((undefined, state) => {\n return {action: `enter-attempt-to-channel: ${state.channel.name}`};\n })\n enterChannel(channel){\n\n let addNewMessage = this.props.addNewMessage;\n let updateMessage = this.props.updateMessage;\n\n sb.OpenChannel.getChannel(channel.url, (channel, error) => {\n if(error) return console.error(error);\n\n channel.enter((response, error) => {\n if(error) return console.error(error);\n\n //set app store to entered channel\n this.props.setEnteredChannel(channel);\n //fetch the current participantList to append\n this.fetchParticipantList(channel);\n //fetch 30 previous messages from channel\n this.fetchPreviousMessageList(channel);\n });\n });\n }", "subscribe (channel, fn, context) {\n if (!this.channels[channel]) {\n this.channels[channel] = [];\n }\n\n this.channels[channel].push({ context: context || this, callback: fn });\n\n return this;\n }", "channel(...args) {\n // emit to eden\n return this.eden.call('slack.channel', Array.from(args), true);\n }", "trigger (channel, ...args) {\n if (typeof electron.ipcRenderer.listeners.on[channel] === 'undefined') {\n throw Error(`Attempted to trigger unregistered event \"${channel}\"`)\n }\n\n const event = {}\n electron.ipcRenderer.listeners.on[channel](event, ...args)\n if (typeof electron.ipcRenderer.listeners.once[channel] !== 'undefined') {\n electron.ipcRenderer.listeners.once[channel](event, ...args)\n delete electron.ipcRenderer.listeners.once[channel]\n }\n }", "function onDataChannelCreated(channel) {\n console.log('Created Data Channel:', channel);\n\n channel.onopen = function() {\n console.log('CHANNEL has been opened!!!');\n };\n\n channel.onmessage = (adapter.browserDetails.browser === 'firefox') ?\n receiveDataFirefoxFactory() : receiveDataChromeFactory();\n }", "_eventChannel(event) {\n\n // IE9 requires the data to be extracted here as it will fail when trying to\n // set the data property of the event in the try / catch below\n\n // Extract the event data\n var eventData = event.data;\n\n // If this message came from this player, handle it\n if (this._validateEvent(event)) {\n\n // Store the event in the list of incoming messages\n this._messages.incoming = lastElements(this._messages.incoming.concat([event]), 25);\n\n // Always trigger a generic message event whenever a message is received\n this._triggerEvent('message');\n\n // Hand of the valid event to the be parsed and potentially\n // triggered\n this._triggerEvent(eventData);\n }\n }", "attachChannelEvents() {\n this.channel.onmessage = this.handleChannelMessage;\n\n this.channel.onopen = e => {\n this.channel.send('ping');\n }\n\n this.channel.onerror = e => {\n console.log('channel error', e);\n }\n\n this.channel.onclose = e => {\n console.log('channel closed');\n }\n\n this.channel.onbufferedamountlow = e => {\n this.resumeTransfers();\n }\n }", "function addChannel() {\n dispatch({type: 'ADD_CHANNEL'});\n }", "function Channel() {\n\t\tthis._listeners = {};\n\t}", "function createChannel() {\n\tchannel = new goog.appengine.Channel(server_token);\n socket = channel.open();\n socket.onopen = channelOnOpen;\n socket.onmessage = channelOnMessage;\n socket.onerror = channelOnError;\n socket.onclose = channelOnClose;\n}", "function createSocketChannel(socket, action) {\n // `eventChannel` takes a subscriber function\n // the subscriber function takes an `emit` argument to put messages onto the channel\n return eventChannel(emit => {\n const pingHandler = (event) => {\n // puts event payload into the channel\n // this allows a Saga to take this payload from the returned channel\n emit(event)\n }\n // setup the subscription\n socket.on(GOT_NEW_PLAYLIST, pingHandler)\n\n // the subscriber must return an unsubscribe function\n // this will be invoked when the saga calls `channel.close` method\n const unsubscribe = () => {\n socket.off(GOT_NEW_PLAYLIST, pingHandler)\n }\n\n return unsubscribe\n })\n\n // }, undefined, (action) => {console.log('action', action) return action.map((user) => user.email === action[0].email)})\n}", "listen(pattern) {\n this._state.matchWith({\n Pending: _ => this._listeners.push(pattern),\n Cancelled: _ => pattern.onCancelled(), \n Resolved: ({ value }) => pattern.onResolved(value),\n Rejected: ({ reason }) => pattern.onRejected(reason)\n });\n return this;\n }", "function OnChannelOpen()\n{\n}", "received(message) {\n // Called when there's incoming data on the websocket for this channel\n return store.dispatch(addMessage(message));\n\n }", "function Channel(n,d,c,s,e,m){\n\tthis.name = \"#\"+n;\n\tthis.createdOn = d;\n\tthis.createdBy = c;\n\tthis.starred = s;\n\tthis.expiresIn = e;\n\tthis.messageCount = m;\n}", "function subscribeReceiver() {\n let data = {\n op: \"IN_R\",\n channel: channel\n }\n socket.emit('channel', data);\n}", "prepareDataChannel(channel) {\n channel.onopen = () => {\n log('WebRTC DataChannel opened!');\n snowflake.ui.setActive(true);\n // This is the point when the WebRTC datachannel is done, so the next step\n // is to establish websocket to the server.\n return this.connectRelay();\n };\n channel.onclose = () => {\n log('WebRTC DataChannel closed.');\n snowflake.ui.setStatus('disconnected by webrtc.');\n snowflake.ui.setActive(false);\n this.flush();\n return this.close();\n };\n channel.onerror = function() {\n return log('Data channel error!');\n };\n channel.binaryType = \"arraybuffer\";\n return channel.onmessage = this.onClientToRelayMessage;\n }", "createChannel(executeChannel = false) {\n\t\t// create a channel and listen the changes\n\t\tconst channelObj = manager.create(this.context.appbaseRef, this.context.type, this.react, this.props.size, this.props.from, this.props.stream, this.props.componentId);\n\t\tthis.channelId = channelObj.channelId;\n\n\t\tthis.channelListener = channelObj.emitter.addListener(channelObj.channelId, (res) => {\n\t\t\t// implementation to prevent initialize query issue if old query response is late then the newer query\n\t\t\t// then we will consider the response of new query and prevent to apply changes for old query response.\n\t\t\t// if queryStartTime of channel response is greater than the previous one only then apply changes\n\t\t\tif (res.error && res.startTime > this.queryStartTime) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tqueryStart: false,\n\t\t\t\t\tshowPlaceholder: false\n\t\t\t\t});\n\t\t\t\tif (this.props.onAllData) {\n\t\t\t\t\tconst modifiedData = helper.prepareResultData(res);\n\t\t\t\t\tthis.props.onAllData(modifiedData.res, modifiedData.err);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (res.appliedQuery) {\n\t\t\t\tif (res.mode === \"historic\" && res.startTime > this.queryStartTime) {\n\t\t\t\t\tconst visibleNoResults = res.appliedQuery && res.data && !res.data.error ? (!(res.data.hits && res.data.hits.total)) : false;\n\t\t\t\t\tconst resultStats = {\n\t\t\t\t\t\tresultFound: !!(res.appliedQuery && res.data && !res.data.error && res.data.hits && res.data.hits.total)\n\t\t\t\t\t};\n\t\t\t\t\tif (res.appliedQuery && res.data && !res.data.error) {\n\t\t\t\t\t\tresultStats.total = res.data.hits.total;\n\t\t\t\t\t\tresultStats.took = res.data.took;\n\t\t\t\t\t}\n\t\t\t\t\tthis.setState({\n\t\t\t\t\t\tqueryStart: false,\n\t\t\t\t\t\tvisibleNoResults,\n\t\t\t\t\t\tresultStats,\n\t\t\t\t\t\tshowPlaceholder: false\n\t\t\t\t\t});\n\t\t\t\t\tthis.afterChannelResponse(res);\n\t\t\t\t} else if (res.mode === \"streaming\") {\n\t\t\t\t\tthis.afterChannelResponse(res);\n\t\t\t\t\tthis.updateResultStats(res.data);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.setState({\n\t\t\t\t\tshowPlaceholder: true\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\tthis.listenLoadingChannel(channelObj);\n\t\tif (executeChannel) {\n\t\t\tconst obj = {\n\t\t\t\tkey: \"streamChanges\",\n\t\t\t\tvalue: \"\"\n\t\t\t};\n\t\t\thelper.selectedSensor.set(obj, true);\n\t\t}\n\t}", "handleChannelMenu(command) {\n // note that the func passed down through props needs the channel\n this.props.handleChannelCommand(this.props.channel, command);\n }", "handleChannelClick(e) {\n this.props.myStore.setCurrentChannel(e.target.innerHTML)\n }", "function createChannel() {\n asdb.create.channel({\n // UNCOMMENT THESE IN ORDER TO SAVE AGAIN\n //title: \"Bounty\",\n //type: \"Farmers Market\",\n //aka: \"Dallas\"\n }).then(function success(s) {\n console.log('SUCCESS:');\n console.log(s);\n }).catch(function error(e) {\n console.log('ERROR:');\n console.log(e);\n });\n}", "function createSocketChannel(socket) {\n // `eventChannel` takes a subscriber function\n // the subscriber function takes an `emit` argument to put messages onto the channel\n return eventChannel((emit) => {\n const pingHandler = (event) => {\n // puts event payload into the channel\n // this allows a Saga to take this payload from the returned channel\n if (event.message === \"end\") {\n emit(END);\n } else emit(event.message);\n };\n\n // setup the subscription\n socket.on(\"announcements\", pingHandler);\n\n // the subscriber must return an unsubscribe function\n // this will be invoked when the saga calls `channel.close` method\n const unsubscribe = () => {\n socket.off(\"announcements\", pingHandler);\n };\n\n return unsubscribe;\n });\n}", "function onNewData(channel, msg) {\n\temitData.call(this, channel, msg);\n\tnotifyChannel.call(this, channel, msg);\n}", "function Channel(name) {\n var _this = this;\n this.attach = function(obj) {\n return Channel.prototype.attach.apply(_this, arguments);\n };\n this.ask = function(question) {\n return Channel.prototype.ask.apply(_this, arguments);\n };\n this.onmessage = function(event) {\n return Channel.prototype.onmessage.apply(_this, arguments);\n };\n this.onNextMessage = function(fun) {\n return Channel.prototype.onNextMessage.apply(_this, arguments);\n };\n this.receive = function(event) {\n return Channel.prototype.receive.apply(_this, arguments);\n };\n this.send = function(obj) {\n return Channel.prototype.send.apply(_this, arguments);\n };\n this.remove = function(id) {\n return Channel.prototype.remove.apply(_this, arguments);\n };\n this.readAll = function() {\n return Channel.prototype.readAll.apply(_this, arguments);\n };\n this.read = function(id) {\n return Channel.prototype.read.apply(_this, arguments);\n };\n this.save = function(obj) {\n return Channel.prototype.save.apply(_this, arguments);\n };\n this.save = function(obj, id) {\n return Channel.prototype.save.apply(_this, arguments);\n };\n this.name = name;\n this.on(\"onmessage\", function(event) {\n return _this.onmessage(event);\n });\n }", "function Channel(){\n this.channels = {};\n }", "function buffer(event) {\n var nextTick = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var _buffer = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];\n\n var buffer = _buffer.slice();\n\n var listener = event(function (e) {\n if (buffer) {\n buffer.push(e);\n } else {\n emitter.fire(e);\n }\n });\n\n var flush = function flush() {\n if (buffer) {\n buffer.forEach(function (e) {\n return emitter.fire(e);\n });\n }\n\n buffer = null;\n };\n\n var emitter = new Emitter({\n onFirstListenerAdd: function onFirstListenerAdd() {\n if (!listener) {\n listener = event(function (e) {\n return emitter.fire(e);\n });\n }\n },\n onFirstListenerDidAdd: function onFirstListenerDidAdd() {\n if (buffer) {\n if (nextTick) {\n setTimeout(flush);\n } else {\n flush();\n }\n }\n },\n onLastListenerRemove: function onLastListenerRemove() {\n if (listener) {\n listener.dispose();\n }\n\n listener = null;\n }\n });\n return emitter.event;\n}", "subscribe(channel) {\n log.trace('Redis SUB \"%s\"', channel);\n return exports.default.sub.subscribe(channel);\n }", "function useChannel(eventMap) {\n var deps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var channel = _index__WEBPACK_IMPORTED_MODULE_22__[/* addons */ \"a\"].getChannel();\n useEffect(function () {\n Object.entries(eventMap).forEach(function (_ref2) {\n var _ref3 = _slicedToArray(_ref2, 2),\n type = _ref3[0],\n listener = _ref3[1];\n\n return channel.on(type, listener);\n });\n return function () {\n Object.entries(eventMap).forEach(function (_ref4) {\n var _ref5 = _slicedToArray(_ref4, 2),\n type = _ref5[0],\n listener = _ref5[1];\n\n return channel.removeListener(type, listener);\n });\n };\n }, [].concat(_toConsumableArray(Object.keys(eventMap)), _toConsumableArray(deps)));\n return useCallback(channel.emit.bind(channel), [channel]);\n}", "function onPipeInput(e) {\n // Create an arraybuffer containing the 16-bit char code\n // from the keypress event.\n var buffer = new ArrayBuffer(1*2);\n var bufferView = new Uint16Array(buffer);\n bufferView[0] = e.charCode;\n\n // Pass the buffer in a dictionary over the NaCl module\n var pipeSelect = $('pipe_name');\n var pipeName = pipeSelect[pipeSelect.selectedIndex].value;\n var message = {\n pipe: pipeName,\n operation: 'write',\n payload: buffer,\n };\n nacl_module.postMessage(message);\n e.preventDefault();\n return false;\n}", "function onPipeInput(e) {\n // Create an arraybuffer containing the 16-bit char code\n // from the keypress event.\n var buffer = new ArrayBuffer(1*2);\n var bufferView = new Uint16Array(buffer);\n bufferView[0] = e.charCode;\n\n // Pass the buffer in a dictionary over the NaCl module\n var pipeSelect = $('pipe_name');\n var pipeName = pipeSelect[pipeSelect.selectedIndex].value;\n var message = {\n pipe: pipeName,\n operation: 'write',\n payload: buffer,\n };\n nacl_module.postMessage(message);\n e.preventDefault();\n return false;\n}", "on (channel, cb) {\n this.subClient.subscribe(channel)\n super.on(channel, cb)\n }", "subscribe(channel, symbols = []) {\n switch (this.params.type) {\n case 'account':\n // {\"action\":\"listen\",\"data\":{\"streams\":[\"trade_updates\"]}}\n this.send(JSON.stringify({ action: 'listen', data: { streams: [channel] } }));\n break;\n case 'market_data':\n // {\"action\":\"subscribe\",\"trades\":[\"AAPL\"],\"quotes\":[\"AMD\",\"CLDR\"],\"bars\":[\"AAPL\",\"VOO\"]}\n let message = { action: 'subscribe' };\n message[channel] = symbols;\n this.send(JSON.stringify(message));\n break;\n }\n return this;\n }", "function channelStateChange(event, channel) {\n console.log(util.format('Channel %s is now: %s', channel.name, channel.state));\n }", "function bufferActions() {\n var type = arguments.length <= 0 || arguments[0] === undefined ? _actionTypesJs2['default'].INIT : arguments[0];\n\n var buffer = true;\n var queue = [];\n\n return function () {\n return function (next) {\n return function (action) {\n if (!buffer) return next(action);\n\n if (action.type === type) {\n buffer = false;\n next(action);\n queue.forEach(function (queuedAction) {\n next(queuedAction);\n });\n queue = null;\n } else {\n queue.push(action);\n }\n\n return action;\n };\n };\n };\n}", "subscribeToChannels({ commit, state }) {\n state.channelInstances.incomingChat.subscribe(msg => {\n let msgPayload = JSON.parse(msg.data);\n let operationPerformed = msgPayload.type;\n\n /* check if the update is about a new message being inserted or an existing message being edited */\n if (operationPerformed == \"INSERT\") {\n // set the update type to new, so we can scroll the message list to bottom\n commit(\"setChatMsgArrayUpdateType\", \"new\");\n state.chatMessagesArray.push(msgPayload.row);\n } else if (operationPerformed == \"UPDATE\") {\n // set the update type to edit, find and update the array object with new data\n commit(\"setChatMsgArrayUpdateType\", \"edit\");\n let msgObjToEdit = state.chatMessagesArray.find(\n msg => msg.msg_id == msgPayload.row.msg_id\n );\n msgObjToEdit.msg_data = msgPayload.row.msg_data;\n msgObjToEdit.is_edited = msgPayload.row.is_edited;\n }\n });\n }", "function saveChannel(){\n channelapi.add(channel, function(error, channel){\n if(error)\n return next(error);\n\n redirect();\n });\n }", "send(topic, event, payload) {\n Port.sendToChannel(topic, event, payload)\n }", "function mouseClicked() {\n \n\nsendChannel1();\n\n}", "function handleCommand(data) {\n\t\tcID++;\n\t\tvar channel = data.channel;\n\t\tvar command = {\n\t\t\tid: cID,\n\t\t\tcommand: data.input\n\t\t};\n\t\tcommands[channel].push(command);\n\t\tif(commands[channel][commands[channel].length - 1] === command) {\n\t\t\tsendToReceivers(channel, 'command', commands[channel][commands[channel].length - 1]);\n\t\t}\n\t\tupdateSockets();\n\t}", "function BufferEffect (effect, channelCount, args) {\n\tthis.channelCount\t= isNaN(channelCount) ? this.channelCount : channelCount;\n\tthis.effects\t\t= [];\n\n\tfunction fx () {\n\t\teffect.apply(this, args);\n\t}\n\tfx.prototype = effect.prototype;\n\n\twhile (channelCount--) {\n\t\tthis.effects.push(new fx());\n\t}\n}", "function stasisStart(event, channel) {\n console.log(util.format(\n 'Channel %s just entered our application, adding it to bridge %s',\n channel.name,\n bridge.id));\n\n channel.answer(function (err) {\n if (err) {\n throw err;\n }\n\n bridge.addChannel({\n channel : channel.id\n }, function (err) {\n var id = chanArr.push(channel.name)\n console.log(\"User: \" + channel.name);\n if (err) {\n throw err;\n }\n\n //If else statement to start music for first user entering channel, music will stop once more than 1 enters the channel.\n if (chanArr.length <= 1) {\n bridge.startMoh(function (err) {\n if (err) {\n throw err;\n }\n });\n } else {\n bridge.stopMoh(function (err) {\n if (err) {\n throw err;\n }\n });\n }\n\n });\n });\n }", "_handleChannel(channel) {\n const emitter = this._eventEmitter;\n\n channel.onopen = () => {\n logger.info(`${this._mode} channel opened`); // Code sample for sending string and/or binary data.\n // Sends string message to the bridge:\n // channel.send(\"Hello bridge!\");\n // Sends 12 bytes binary message to the bridge:\n // channel.send(new ArrayBuffer(12));\n\n emitter.emit(_service_RTC_RTCEvents__WEBPACK_IMPORTED_MODULE_1___default.a.DATA_CHANNEL_OPEN);\n };\n\n channel.onerror = event => {\n // WS error events contain no information about the failure (this is available in the onclose event) and\n // the event references the WS object itself, which causes hangs on mobile.\n if (this._mode !== 'websocket') {\n logger.error(`Channel error: ${event.message}`);\n }\n };\n\n channel.onmessage = ({\n data\n }) => {\n // JSON object.\n let obj;\n\n try {\n obj = JSON.parse(data);\n } catch (error) {\n _util_GlobalOnErrorHandler__WEBPACK_IMPORTED_MODULE_4___default.a.callErrorHandler(error);\n logger.error('Failed to parse channel message as JSON: ', data, error);\n return;\n }\n\n const colibriClass = obj.colibriClass;\n\n switch (colibriClass) {\n case 'DominantSpeakerEndpointChangeEvent':\n {\n // Endpoint ID from the Videobridge.\n const dominantSpeakerEndpoint = obj.dominantSpeakerEndpoint;\n logger.info('Channel new dominant speaker event: ', dominantSpeakerEndpoint);\n emitter.emit(_service_RTC_RTCEvents__WEBPACK_IMPORTED_MODULE_1___default.a.DOMINANT_SPEAKER_CHANGED, dominantSpeakerEndpoint);\n break;\n }\n\n case 'EndpointConnectivityStatusChangeEvent':\n {\n const endpoint = obj.endpoint;\n const isActive = obj.active === 'true';\n logger.info(`Endpoint connection status changed: ${endpoint} active ? ${isActive}`);\n emitter.emit(_service_RTC_RTCEvents__WEBPACK_IMPORTED_MODULE_1___default.a.ENDPOINT_CONN_STATUS_CHANGED, endpoint, isActive);\n break;\n }\n\n case 'EndpointMessage':\n {\n emitter.emit(_service_RTC_RTCEvents__WEBPACK_IMPORTED_MODULE_1___default.a.ENDPOINT_MESSAGE_RECEIVED, obj.from, obj.msgPayload);\n break;\n }\n\n case 'LastNEndpointsChangeEvent':\n {\n // The new/latest list of last-n endpoint IDs.\n const lastNEndpoints = obj.lastNEndpoints;\n logger.info('Channel new last-n event: ', lastNEndpoints, obj);\n emitter.emit(_service_RTC_RTCEvents__WEBPACK_IMPORTED_MODULE_1___default.a.LASTN_ENDPOINT_CHANGED, lastNEndpoints, obj);\n break;\n }\n\n case 'SelectedUpdateEvent':\n {\n const isSelected = obj.isSelected;\n logger.info(`SelectedUpdateEvent isSelected? ${isSelected}`);\n emitter.emit(_service_RTC_RTCEvents__WEBPACK_IMPORTED_MODULE_1___default.a.IS_SELECTED_CHANGED, isSelected);\n break;\n }\n\n default:\n {\n logger.debug('Channel JSON-formatted message: ', obj); // The received message appears to be appropriately formatted\n // (i.e. is a JSON object which assigns a value to the\n // mandatory property colibriClass) so don't just swallow it,\n // expose it to public consumption.\n\n emitter.emit(`rtc.datachannel.${colibriClass}`, obj);\n }\n }\n };\n\n channel.onclose = event => {\n logger.info(`Channel closed by ${this._closedFromClient ? 'client' : 'server'}`);\n\n if (this._mode === 'websocket') {\n if (!this._closedFromClient) {\n logger.error(`Channel closed: ${event.code} ${event.reason}`);\n\n this._retryWebSocketConnection(event);\n }\n } // Remove the channel.\n\n\n this._channel = null;\n }; // Store the channel.\n\n\n this._channel = channel;\n }", "function _assignChannel ()\n\t{\n\t\tvar id;\n\n\t\t_channelID += 1;\n\t\tid = _PREFIX_CHANNEL + _channelID;\n\t\treturn id;\n\t}", "subscribeToMessageChannel() {\n this.subscription = subscribe(\n this.messageContext,\n RECORD_SELECTED_CHANNEL,\n (message) => {\n console.log(message);\n this.handleMessage(message); \n }\n );\n \n\n }", "function channelEnteredBridge(event, obj) {\n // console.log(util.format('Channel %s just entered Bridge testing : ' + obj.bridge.id , obj.channel.name));\n\n \n\n}", "function receiveChannelCallback(event) {\n\t\treceiveChannel = event.channel;\n\t\treceiveChannel.onmessage = function (event) {\n\t\t\tvar el = document.createElement(\"p\");\n\t\t\tvar txtNode = document.createTextNode(event.data);\n\t\t\tel.appendChild(txtNode);\n\t\t\treceiveBox.appendChild(el);\n\t\t};\n\t\treceiveChannel.onopen = function (event) {\n\t\t\tif (receiveChannel) {\n\t\t\t\tconsole.log(\"Receive channel's status has changed to \" + receiveChannel.readyState);\n\t\t\t}\n\t\t\t\n\t\t};\n\t}", "on_connecter() {\n this.enregistrerChannel()\n }", "function onReceive(channelId, data) {\r\n\t\tconsole.log(data);\r\n\t}", "function setChannelHandler() {\n var channelHandler = new sb.ChannelHandler();\n channelHandler.onMessageReceived = (channel, message) => {\n if (message.customType == 'audio_message') {\n audioMessageAsBase64 = message.data;\n cardListenMessages.style.display = 'inline-block';\n }\n };\n sb.addChannelHandler('UNIQUE_HANDLER_ID', channelHandler);\n}", "set Channel(value) {\r\n this.channel = value\r\n }", "function createServerChannel(channel) {\n return cometdServer.createServerChannel(channel);\n}", "function passthrough(channel, action, from, to) {\n channel = Channel(channel);\n channel.on(action, msg => channel.broadcast(action, msg.msg(), to), from);\n}", "function subToStream(channel, message, fn) {\n\tif (undefined === subs[channel])\n\t\tsubs[channel] = {};\n\n\tif (undefined === subs[channel][message])\n\t\tsubs[channel][message] = [];\n\n\tsubs[channel][message].push(fn);\n}", "handleChannelDataStringMessage(message) {\n // Extract the channel data string\n var channelDataString = message['channelDataString'];\n // Pass the data on to dataer\n this.top.getDataer().onChannelDataStringMessageReceived(channelDataString);\n }", "listen (pack, event, params) {\n const __callbacks = {};\n const __eventCallback = (event) => __callbacks[event] || function () {};\n\n const user_id = `${pack}.${event}_${this.project}:${this.key}`;\n request({\n uri: `${RapidAPI.callbackBaseURL()}/api/get_token?user_id=${user_id}`,\n method: 'GET',\n headers: {\n \"Content-Type\": \"application/json\"\n },\n auth: {\n 'user': this.project,\n 'pass': this.key,\n 'sendImmediately': true\n }\n }, (error, response, body) => {\n const { token } = JSON.parse(body);\n const sock_url = `${RapidAPI.websocketBaseURL()}/socket/websocket?token=${token}`;\n const socket = new Socket.Socket(sock_url, {\n params: {token}\n });\n socket.connect();\n const channel = socket.channel(`users_socket:${token}`, params);\n channel.join()\n .receive('ok', msg => { __eventCallback('join')(msg); })\n .receive('error', reason => { __eventCallback('error')(reason); })\n .receive('timeout', () => { __eventCallback('timeout'); });\n\n channel.on('new_msg', msg => {\n if (!msg.token) {\n __eventCallback('error')(msg.body);\n } else {\n __eventCallback('message')(msg.body);\n }\n });\n channel.onError(() => __eventCallback('error'));\n channel.onClose(() => __eventCallback('close'));\n });\n const r = {\n on: (event, func) => {\n if (typeof func !== 'function') throw \"Callback must be a function.\";\n if (typeof event !== 'string') throw \"Event must be a string.\";\n __callbacks[event] = func;\n return r;\n }\n };\n return r;\n }", "function registerEvents( patternlab ) {\n\n //register our handler at the appropriate time of execution\n patternlab.events.on('patternlab-pattern-write-end', onPatternIterate);\n\n}", "listen(eventName, cb) {\n if (!this.isAttached) {\n throw new Error('buffer not attached');\n }\n this.client.attachBufferEvent(this, eventName, cb);\n return () => {\n this.unlisten(eventName, cb);\n };\n }", "function addRoute(routeName, channel, func){\n routes[channel] = func;\n routeList[routeName] = channel;\n subscribe(channel);\n}", "function fayeSubscribe(channel) {\n return fayeClient.subscribe(toFayeCompatible(channel), message => {\n flive.emit(channel, message);\n });\n }", "function DataChannel(channel) {\n if (channel._stream) {\n return channel._stream\n }\n\n var stream = through2(write, end)\n , ready = false\n , buffer = []\n\n stream.meta = channel.label\n\n channel.onopen = onopen\n channel.onclose = onclose\n channel.onmessage = onmessage\n channel.onerror = onerror\n\n return stream\n\n function write(chunk, enc, callback) {\n if (!ready) {\n buffer.push(chunk)\n callback()\n return\n }\n channel.send(chunk)\n callback()\n }\n\n function end() {\n channel.close()\n stream.writable = false\n }\n\n function onopen() {\n ready = true\n buffer.forEach(send)\n buffer.length = 0\n stream.emit(\"connect\")\n }\n\n function send(message) {\n channel.send(message)\n }\n\n function onclose(event) {\n stream.end()\n stream.emit(\"finish\")\n stream.emit(\"close\", event)\n }\n\n function onmessage(message) {\n var data = message.data\n if (data instanceof ArrayBuffer) {\n data = toBuffer(new Uint8Array(data))\n }\n stream.push(data)\n }\n\n function onerror(err) {\n stream.emit(\"error\", err)\n }\n}", "async setupConsumer(channel) {\n await this.useChannel(channel);\n await this.assertExchange();\n }", "function listener(string) {\n var command = io.JSON.parse(string),\n data = command.data;\n\n if (command.target === \"p\" || command.target === \"p&c\") {\n switch (command.type) {\n case \"send\":\n if (data.parentId == self.guid) {\n if (data.eventType === \"subscribeUserMsg\") {\n var msgHandlerName = data.data.app;\n var rt = registerMsgChild(\n msgHandlerName,\n data.data.token,\n data.childId\n );\n if (rt) {\n var handler = self.msgHandlers[msgHandlerName];\n if (!handler) {\n self.socket.send(data.eventType, data.data);\n }\n }\n } else if (data.eventType === \"subscribeTopicMsg\") {\n var msgHandlerName = data.data.appTopic;\n var rt = registerMsgChild(\n msgHandlerName,\n data.data.token,\n data.childId\n );\n if (rt) {\n var handler = self.msgHandlers[msgHandlerName];\n if (!handler) {\n self.socket.send(data.eventType, data.data);\n }\n }\n } else if (\n data.eventType === \"unSubscribeUserMsg\" ||\n data.eventType === \"unSubscribeTopicMsg\"\n ) {\n var rt = unRegisterMsgChild(data.data, data.childId);\n if (rt) {\n var handler = self.msgHandlers[data.data];\n if (!handler) {\n self.socket.send(data.eventType, data.data);\n }\n }\n } else {\n self.socket.send(data.eventType, data.data);\n }\n }\n break;\n case \"localMessage\":\n if (data.fromId != self.guid) {\n self.dealLocalMsg(data.eventType, data.data);\n }\n break;\n case \"clildClose\":\n unRegisterMsgChildAll(data.data);\n break;\n }\n }\n }", "@track({action: 'click-channel-delete'})\n handleChannelDelete(channel){\n let {url} = channel;\n this.props.deleteChannelRequest(url);\n }", "subscribe(socket, channel, name) {\n if (this.channelsUsed.indexOf(channel) == -1)\n this.channelsUsed.push(channel);\n let socketSubscribed = this.socketsPerChannels.get(channel) || new Set();\n let channelSubscribed = this.channelsPerSocket.get(socket) || new Set();\n\n if (socketSubscribed.size == 0) {\n this.rcm.subscriber.subscribe(channel);\n }\n\n this.namePerSocket.set(socket, name);\n\n socketSubscribed = socketSubscribed.add(socket);\n channelSubscribed = channelSubscribed.add(channel);\n\n this.socketsPerChannels.set(channel, socketSubscribed);\n this.channelsPerSocket.set(socket, channelSubscribed);\n\n console.log(name, \"just subscribed to channel\", channel);\n }", "function receiveDataChannelMessage(event) {\n emitter.emit('clientEvent', JSON.parse(event.data));\n}", "noteChannel (control, channel) {\n return this.set(0x02, control, channel)\n }", "function getChannelOrCreate(event, type) {\n var channel = wss.getChannel({channel: event.channel});\n\n if (!channel) {\n channel = new Channel(event.channel, type);\n }\n\n return channel;\n}", "static subscribe(channelName, eventName, callback) {\n const channel = this.pusherInstance.subscribe(channelName);\n channel.bind(eventName, data => callback(data));\n }", "addChannel(channelId) {\n this.channels.push({\n id: channelId\n });\n }", "function publishToChannel(channel, { routingKey, exchangeName, data }) {\n return new Promise((resolve, reject) => {\n channel.publish(exchangeName, routingKey, Buffer.from(JSON.stringify(data), 'utf-8'), { persistent: true }, function (err, ok) {\n if (err) {\n return reject(err);\n }\n console.log(\"[x] push to process\");\n\n\n resolve();\n })\n });\n }", "function setupDataChannel() {\n\t\tcheckDataChannelState();\n\t\tdataChannel.onopen = checkDataChannelState;\n\t\tdataChannel.onclose = checkDataChannelState;\n\t\tdataChannel.onmessage = Reversi.remoteMessage;\n\t}", "subscribe(eventName, handler) {\n if (!this.ready) {\n return this.queue.push({op: 'subscribe', eventName, handler });\n }\n this.socket.on(eventName, handler);\n }", "capture(event) {\n const { extract, context } = this.props\n const { queue } = this\n\n const action = extract(event, context)\n\n if (action) {\n console.log('captured', action.type, action)\n queue.push(action)\n }\n }", "execute_event(ev, state) {\n //if (ev._ !== \"App.Event.tick\") console.log(\"execute\", ev._, ev.time, ev.done);\n var actions = this.app.when(ev)(state);\n while (actions._ === \"List.cons\") {\n var action = actions.head;\n switch (action._) {\n case \"App.Action.state\":\n state = action.state;\n break;\n case \"App.Action.print\":\n if (!ev.done) {\n console.log(action.text);\n }\n break;\n case \"App.Action.post\":\n if (!ev.done) {\n var data = lib.hex(256, lib.fmword_to_hex(action.data));\n front.logs.send_post(lib.fmword_to_hex(action.room), data);\n }\n break;\n case \"App.Action.watch\":\n if (!ev.done) {\n front.logs.watch_room(lib.fmword_to_hex(action.room));\n //console.log(\"watching room\");\n front.logs.on_post(({room, time, addr, data}) => {\n //var text = lib.hex_to_string(data).replace(/\\0/g,\"\");\n //console.log(\"got post\");\n this.register_event({\n _: \"App.Event.post\",\n time: parseInt(time.slice(2), 16),\n room: lib.hex_to_fmword(room),\n addr: lib.hex_to_fmword(addr),\n data: lib.hex_to_fmword(data),\n });\n });\n }\n break;\n case \"App.Action.resize\":\n if (!ev.done) {\n this.init_canvas(action.width, action.height);\n }\n break;\n };\n actions = actions.tail;\n }\n ev.done = true;\n return state;\n }", "async _onMessage(channel, msg) {\n if(this._callbacks[channel]) {\n // we have some callbacks to make\n Object.keys(this._callbacks[channel]).forEach(k => {\n this._logger.log(`Cache message received on channel ${channel}. Making callback with id ${k}`);\n\n // call the callback with the channel name, message and callbackId...\n // ...(which is useful for unsubscribe)\n try {\n this._callbacks[channel][k](channel, msg, k);\n } catch (err) {\n this._logger\n .push({ callbackId: k, err })\n .log('Unhandled error in cache subscription handler');\n }\n });\n }\n }", "function useChannel(eventMap) {\n var deps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n\n var channel = dist$3.addons.getChannel();\n\n useEffect(function () {\n Object.entries(eventMap).forEach(function (_ref2) {\n var _ref3 = _slicedToArray(_ref2, 2),\n type = _ref3[0],\n listener = _ref3[1];\n\n return channel.on(type, listener);\n });\n return function () {\n Object.entries(eventMap).forEach(function (_ref4) {\n var _ref5 = _slicedToArray(_ref4, 2),\n type = _ref5[0],\n listener = _ref5[1];\n\n return channel.removeListener(type, listener);\n });\n };\n }, [].concat(_toConsumableArray(Object.keys(eventMap)), _toConsumableArray(deps)));\n return useCallback(channel.emit.bind(channel), [channel]);\n}" ]
[ "0.72849715", "0.7270163", "0.7198183", "0.7063598", "0.7063598", "0.69953597", "0.6993113", "0.697016", "0.6943661", "0.68677664", "0.68677664", "0.68677664", "0.68677664", "0.68663955", "0.6846084", "0.6846084", "0.67139465", "0.6706977", "0.5925411", "0.59123886", "0.5893919", "0.57644546", "0.5657884", "0.5629677", "0.56005853", "0.5564652", "0.55223155", "0.55147636", "0.5483316", "0.548166", "0.54791015", "0.5387636", "0.53834224", "0.5296763", "0.52555", "0.5250734", "0.52194786", "0.51961786", "0.5144163", "0.51057065", "0.50966567", "0.5093508", "0.5082552", "0.50797623", "0.5073008", "0.5068959", "0.506732", "0.50487006", "0.5043566", "0.5038354", "0.5020952", "0.5020952", "0.50178844", "0.50130457", "0.500413", "0.49887136", "0.49844605", "0.49730122", "0.49658364", "0.49641645", "0.49370828", "0.4930107", "0.49273112", "0.49248496", "0.492093", "0.4915429", "0.49100792", "0.4890844", "0.48818094", "0.4881524", "0.48777604", "0.48726785", "0.48696756", "0.48542413", "0.48414406", "0.48385715", "0.48321876", "0.48319373", "0.4830476", "0.48204175", "0.48038474", "0.48036492", "0.4803054", "0.47869325", "0.47791606", "0.47782728", "0.4774077", "0.47731778", "0.47689453", "0.47689453", "0.4759129", "0.47477022", "0.4735584", "0.47318003", "0.4727277", "0.4717643", "0.47156778", "0.47140366" ]
0.6906714
11
Can not use instanceof, consider different scope by cross domain or es module import in ec extensions. Mount a method "isInstance()" to Clz.
function enableClassCheck(Clz) { var classAttr = ['__\0is_clz', classBase++, Math.random().toFixed(3)].join('_'); Clz.prototype[classAttr] = true; Clz.isInstance = function (obj) { return !!(obj && obj[classAttr]); }; } // superCall should have class info, which can not be fetch from 'this'.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function instanceOf (obj, Clss) {\n return Clss[Symbol.hasInstance](obj);\n}", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Addon.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Network.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === NetworkInterface.__pulumiType;\n }", "static isInstance(obj) {\n return utils.isInstance(obj, \"__pulumiUnknown\");\n }", "function lisp_is_instance(obj, c) {\n return lisp_is_subclass(lisp_class_of(obj), c);\n}", "static [Symbol.hasInstance](obj) {\n return false;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === ProxyTarget.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === DefaultNetworkAcl.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === DefaultNetworkAcl.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Detector.__pulumiType;\n }", "function isInstance(obj,type){return obj instanceof type||obj!=null&&obj.constructor!=null&&obj.constructor.name!=null&&obj.constructor.name===type.name;}", "function isInstance(obj,type){return obj instanceof type||obj!=null&&obj.constructor!=null&&obj.constructor.name!=null&&obj.constructor.name===type.name;}", "function isInstance(obj,type){return obj instanceof type||obj!=null&&obj.constructor!=null&&obj.constructor.name!=null&&obj.constructor.name===type.name;}", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Endpoint.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === PatchBaseline.__pulumiType;\n }", "function isInstance(obj, type) {\n return (\n obj instanceof type ||\n (obj != null &&\n obj.constructor != null &&\n obj.constructor.name != null &&\n obj.constructor.name === type.name)\n );\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === ServerTrustGroup.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === ResourceServer.__pulumiType;\n }", "function isInstance(obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === EventSourceMapping.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Pipeline.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === StorageTarget.__pulumiType;\n }", "function isInstance(obj, type) {\n return (\n obj instanceof type ||\n (obj != null &&\n obj.constructor != null &&\n obj.constructor.name != null &&\n obj.constructor.name === type.name)\n );\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Certificate.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === VpcPeeringConnection.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === PeeringService.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === RestApi.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === ApplicationSecurityGroup.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === AccessControlRecord.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === DevEndpoint.__pulumiType;\n }", "function detecteInstanceOf (obj, origin) {\n return obj instanceof origin\n // return Object.getPrototypeOf(obj) === origin.prototype\n // return obj.__proto__ === origin.prototype\n}", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === MachineLearningCompute.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === ApiRelease.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === ClusterSnapshot.__pulumiType;\n }", "function isInstance(obj, type) {\n\t\treturn obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name;\n\t}", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === VolumeContainer.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Image.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === StaticIpAttachment.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === OpenIdConnectProvider.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === StackSetInstance.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === LifecycleHook.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === WorkloadNetworkSegment.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Document.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === SshKey.__pulumiType;\n }", "function isInstance(a) {\n return a instanceof $ || ($['zepto'] && $['zepto']['isZ'](a));\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === VirtualRouter.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === ApiIssue.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Authorizer.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Budget.__pulumiType;\n }", "static isInstance(obj) {\n return utils.isInstance(obj, \"__pulumiOutput\");\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === EndpointConfiguration.__pulumiType;\n }", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}" ]
[ "0.74124175", "0.72359425", "0.7222275", "0.71965176", "0.71644956", "0.7133096", "0.71092373", "0.7054066", "0.7042724", "0.7042724", "0.7027875", "0.6991137", "0.6991137", "0.6991137", "0.69897777", "0.6974765", "0.6960734", "0.6953518", "0.69375765", "0.69133353", "0.69122094", "0.6908888", "0.68994933", "0.68717873", "0.6867836", "0.686209", "0.68616015", "0.6858912", "0.6854534", "0.68313015", "0.6819023", "0.68169296", "0.6813126", "0.68108237", "0.6808097", "0.680614", "0.6804151", "0.67975676", "0.6796475", "0.67904174", "0.6788309", "0.6785572", "0.67833", "0.6778792", "0.6770058", "0.67503047", "0.67497265", "0.67343825", "0.6731059", "0.6720289", "0.67142063", "0.6709203", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668", "0.6705668" ]
0.0
-1
Consider this case: class A has method f, class B inherits class A, overrides method f, f call superApply('f'), class C inherits class B, do not overrides method f, then when method of class C is called, dead loop occured.
function superCall(context, methodName) { var args = zrUtil.slice(arguments, 2); return this.superClass.prototype[methodName].apply(context, args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __applyUp(self, func, args)\r\n{\r\n func.apply(self, args);\r\n if (self.__parent) {\r\n __applyUp(self.__parent, func, args);\r\n }\r\n}", "function b(){f.call(this)}", "function __applyDown(self, func, args)\r\n{\r\n func.apply(self, args);\r\n if (self.__children) {\r\n var c = self.__children;\r\n for (var i = 0, l = c.length; i < l; ++i)\r\n {\r\n __applyDown(c[i], func, args);\r\n }\r\n }\r\n}", "apply(target, thisArg, argArray = []) {\n // Don't proceed if the hook says no\n if (!hook({\n kind: \"__$$_PROXY_APPLY\" /* APPLY */,\n policy,\n thisArg,\n argArray,\n target,\n path: stringifyPath(inputPath)\n })) {\n return;\n }\n return Reflect.apply(target, thisArg, argArray);\n }", "function _apply(f, thisArg, args) {\n\t\treturn args.length === 0\n\t\t\t? attempt.call(thisArg, f)\n\t\t\t: attempt.apply(thisArg, [f].concat(args));\n\t}", "function _apply(f, thisArg, args) {\n\t\treturn args.length === 0\n\t\t\t? attempt.call(thisArg, f)\n\t\t\t: attempt.apply(thisArg, [f].concat(args));\n\t}", "function inherit(){}", "function B(f) {\n Cs.push(C);\n while(f instanceof F) {\n var fun = f.f;\n f.f = __blackhole;\n C = 0;\n f = fun();\n }\n C = Cs.pop();\n return f;\n}", "function B(f) {\n while(f instanceof F) {\n var fun = f.f;\n f.f = __blackhole;\n f = fun();\n }\n return f;\n}", "function A(f, args) {\n while(true) {\n f = E(f);\n if(f instanceof F) {\n f = E(B(f));\n }\n if(f instanceof PAP) {\n // f is a partial application\n if(args.length == f.arity) {\n // Saturated application\n return f.f.apply(null, f.args.concat(args));\n } else if(args.length < f.arity) {\n // Application is still unsaturated\n return new PAP(f.f, f.args.concat(args));\n } else {\n // Application is oversaturated; \n var f2 = f.f.apply(null, f.args.concat(args.slice(0, f.arity)));\n args = args.slice(f.arity);\n f = B(f2);\n }\n } else if(f instanceof Function) {\n if(args.length == f.length) {\n return f.apply(null, args);\n } else if(args.length < f.length) {\n return new PAP(f, args);\n } else {\n var f2 = f.apply(null, args.slice(0, f.length));\n args = args.slice(f.length);\n f = B(f2);\n }\n } else {\n return f;\n }\n }\n}", "apply () {}", "function B(f) {\n while(f instanceof F) {\n var fun = f.f;\n f = __blackhole;\n f = fun();\n }\n return f;\n}", "function Fitness ( f ) {\n /*jshint validthis: true */ \n this.apply = f; \n}", "function NaiveBroadphase(){\n Broadphase.apply(this);\n}", "function NaiveBroadphase(){\n Broadphase.apply(this);\n}", "function NaiveBroadphase(){\n Broadphase.apply(this);\n}", "function foldCause_(self, f, g, __trace) {\n return fold_(sandbox(self), f, g, __trace);\n}", "function Fitness ( f ) {\n this.apply = f;\n \n}", "function DispatchApply(callback, thisArg) { callback.apply(thisArg); }", "function exitFunction(node) {\n const stackContext = popContext();\n if (stackContext?.member == null ||\n stackContext.class == null ||\n stackContext.usesThis ||\n (ignoreOverrideMethods && stackContext.member.override) ||\n (ignoreClassesThatImplementAnInterface &&\n stackContext.class.implements != null)) {\n return;\n }\n if (isIncludedInstanceMethod(stackContext.member)) {\n context.report({\n node,\n loc: util.getFunctionHeadLoc(node, sourceCode),\n messageId: 'missingThis',\n data: {\n name: util.getFunctionNameWithKind(node),\n },\n });\n }\n }", "function trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true);\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0(derivation);\n derivation.newObserving = new Array(derivation.observing.length + 100);\n derivation.unboundDepsCount = 0;\n derivation.runId = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n var result;\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n }\n else {\n try {\n result = f.call(context);\n }\n catch (e) {\n result = new CaughtException(e);\n }\n }\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}", "function trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true);\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0(derivation);\n derivation.newObserving = new Array(derivation.observing.length + 100);\n derivation.unboundDepsCount = 0;\n derivation.runId = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n var result;\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n }\n else {\n try {\n result = f.call(context);\n }\n catch (e) {\n result = new CaughtException(e);\n }\n }\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}", "function trackDerivedFunction(derivation, f, context) {\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0(derivation);\n derivation.newObserving = new Array(derivation.observing.length + 100);\n derivation.unboundDepsCount = 0;\n derivation.runId = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n var result;\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n } else {\n try {\n result = f.call(context);\n } catch (e) {\n result = new CaughtException(e);\n }\n }\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n return result;\n}", "function trackDerivedFunction(derivation, f, context) {\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0(derivation);\n derivation.newObserving = new Array(derivation.observing.length + 100);\n derivation.unboundDepsCount = 0;\n derivation.runId = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n var result;\n\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n } else {\n try {\n result = f.call(context);\n } catch (e) {\n result = new CaughtException(e);\n }\n }\n\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n return result;\n}", "function trackDerivedFunction(derivation, f, context) {\r\n var prevAllowStateReads = allowStateReadsStart(true);\r\n // pre allocate array allocation + room for variation in deps\r\n // array will be trimmed by bindDependencies\r\n changeDependenciesStateTo0(derivation);\r\n derivation.newObserving = new Array(derivation.observing.length + 100);\r\n derivation.unboundDepsCount = 0;\r\n derivation.runId = ++globalState.runId;\r\n var prevTracking = globalState.trackingDerivation;\r\n globalState.trackingDerivation = derivation;\r\n var result;\r\n if (globalState.disableErrorBoundaries === true) {\r\n result = f.call(context);\r\n }\r\n else {\r\n try {\r\n result = f.call(context);\r\n }\r\n catch (e) {\r\n result = new CaughtException(e);\r\n }\r\n }\r\n globalState.trackingDerivation = prevTracking;\r\n bindDependencies(derivation);\r\n warnAboutDerivationWithoutDependencies(derivation);\r\n allowStateReadsEnd(prevAllowStateReads);\r\n return result;\r\n}", "function super_fn() {\n\t\t\t\t\tif (!oldFn) { return }\n\t\t\t\t\teach(arguments, function(arg, i) {\n\t\t\t\t\t\targs[i] = arg\n\t\t\t\t\t})\n\t\t\t\t\treturn oldFn.apply(self, args)\n\t\t\t\t}", "function super_fn() {\n\t\t\t\t\tif (!oldFn) { return }\n\t\t\t\t\teach(arguments, function(arg, i) {\n\t\t\t\t\t\targs[i] = arg\n\t\t\t\t\t})\n\t\t\t\t\treturn oldFn.apply(self, args)\n\t\t\t\t}", "function super_fn() {\n\t\t\t\t\tif (!oldFn) { return }\n\t\t\t\t\teach(arguments, function(arg, i) {\n\t\t\t\t\t\targs[i] = arg\n\t\t\t\t\t})\n\t\t\t\t\treturn oldFn.apply(self, args)\n\t\t\t\t}", "function super_fn() {\n\t\t\t\t\tif (!oldFn) { return }\n\t\t\t\t\teach(arguments, function(arg, i) {\n\t\t\t\t\t\targs[i] = arg\n\t\t\t\t\t})\n\t\t\t\t\treturn oldFn.apply(self, args)\n\t\t\t\t}", "function y(){f.call(this)}", "function y(){f.call(this)}", "function y(){f.call(this)}", "function trackDerivedFunction(derivation, f, context) {\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0(derivation);\n derivation.newObserving = new Array(derivation.observing.length + 100);\n derivation.unboundDepsCount = 0;\n derivation.runId = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n var result;\n try {\n result = f.call(context);\n }\n catch (e) {\n result = new CaughtException(e);\n }\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n return result;\n}", "function trackDerivedFunction(derivation, f, context) {\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0(derivation);\n derivation.newObserving = new Array(derivation.observing.length + 100);\n derivation.unboundDepsCount = 0;\n derivation.runId = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n var result;\n try {\n result = f.call(context);\n }\n catch (e) {\n result = new CaughtException(e);\n }\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n return result;\n}", "function trackDerivedFunction(derivation, f, context) {\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0(derivation);\n derivation.newObserving = new Array(derivation.observing.length + 100);\n derivation.unboundDepsCount = 0;\n derivation.runId = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n var result;\n try {\n result = f.call(context);\n }\n catch (e) {\n result = new CaughtException(e);\n }\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n return result;\n}", "function trackDerivedFunction(derivation, f, context) {\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0(derivation);\n derivation.newObserving = new Array(derivation.observing.length + 100);\n derivation.unboundDepsCount = 0;\n derivation.runId = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n var result;\n try {\n result = f.call(context);\n }\n catch (e) {\n result = new CaughtException(e);\n }\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n return result;\n}", "function trackDerivedFunction(derivation, f, context) {\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0(derivation);\n derivation.newObserving = new Array(derivation.observing.length + 100);\n derivation.unboundDepsCount = 0;\n derivation.runId = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n var result;\n try {\n result = f.call(context);\n }\n catch (e) {\n result = new CaughtException(e);\n }\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n return result;\n}", "function trackDerivedFunction(derivation, f, context) {\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0(derivation);\n derivation.newObserving = new Array(derivation.observing.length + 100);\n derivation.unboundDepsCount = 0;\n derivation.runId = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n var result;\n try {\n result = f.call(context);\n }\n catch (e) {\n result = new CaughtException(e);\n }\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n return result;\n}", "function trackDerivedFunction$$1(derivation, f, context) {\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0$$1(derivation);\n derivation.newObserving = new Array(derivation.observing.length + 100);\n derivation.unboundDepsCount = 0;\n derivation.runId = ++globalState$$1.runId;\n var prevTracking = globalState$$1.trackingDerivation;\n globalState$$1.trackingDerivation = derivation;\n var result;\n if (globalState$$1.disableErrorBoundaries === true) {\n result = f.call(context);\n }\n else {\n try {\n result = f.call(context);\n }\n catch (e) {\n result = new CaughtException$$1(e);\n }\n }\n globalState$$1.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n return result;\n}", "function g()\n{\n return f.call(this);\n}", "function A(f, args) {\n while(true) {\n f = E(f);\n if(f instanceof Function) {\n if(args.length === f.length) {\n return f.apply(null, args);\n } else if(args.length < f.length) {\n return new PAP(f, args);\n } else {\n var f2 = f.apply(null, args.slice(0, f.length));\n args = args.slice(f.length);\n f = B(f2);\n }\n } else if(f instanceof PAP) {\n if(args.length === f.arity) {\n return f.f.apply(null, f.args.concat(args));\n } else if(args.length < f.arity) {\n return new PAP(f.f, f.args.concat(args));\n } else {\n var f2 = f.f.apply(null, f.args.concat(args.slice(0, f.arity)));\n args = args.slice(f.arity);\n f = B(f2);\n }\n } else {\n return f;\n }\n }\n}", "function NaiveBroadphase(){\n\t Broadphase.apply(this);\n\t}", "function ContextFixer(func, context) {\n /* Make sure 'this' inside a method points to its class */\n this.func = func;\n this.context = context;\n this.args = arguments;\n var self = this;\n \n this.execute = function() {\n /* execute the method */\n var args = new Array();\n // the first arguments will be the extra ones of the class\n for (var i=0; i < self.args.length - 2; i++) {\n args.push(self.args[i + 2]);\n };\n // the last are the ones passed on to the execute method\n for (var i=0; i < arguments.length; i++) {\n args.push(arguments[i]);\n };\n return self.func.apply(self.context, args);\n };\n\n}", "function Fold(f, z, c, to) {\n\t\t\tthis.f = f; this.z = z; this.c = c; this.to = to;\n\t\t\tthis.resolver = failIfRejected;\n\t\t\tthis.receiver = this;\n\t\t}", "function Fold(f, z, c, to) {\n\t\t\tthis.f = f; this.z = z; this.c = c; this.to = to;\n\t\t\tthis.resolver = failIfRejected;\n\t\t\tthis.receiver = this;\n\t\t}", "function Fold(f, z, c, to) {\n\t\t\tthis.f = f; this.z = z; this.c = c; this.to = to;\n\t\t\tthis.resolver = failIfRejected;\n\t\t\tthis.receiver = this;\n\t\t}", "function Fold(f, z, c, to) {\n\t\t\tthis.f = f; this.z = z; this.c = c; this.to = to;\n\t\t\tthis.resolver = failIfRejected;\n\t\t\tthis.receiver = this;\n\t\t}", "function Fold(f, z, c, to) {\n\t\t\tthis.f = f; this.z = z; this.c = c; this.to = to;\n\t\t\tthis.resolver = failIfRejected;\n\t\t\tthis.receiver = this;\n\t\t}", "function Fold(f, z, c, to) {\n\t\t\tthis.f = f; this.z = z; this.c = c; this.to = to;\n\t\t\tthis.resolver = failIfRejected;\n\t\t\tthis.receiver = this;\n\t\t}", "function Fold(f, z, c, to) {\n\t\t\tthis.f = f; this.z = z; this.c = c; this.to = to;\n\t\t\tthis.resolver = failIfRejected;\n\t\t\tthis.receiver = this;\n\t\t}", "function A(f, args) {\n if(f instanceof T) {\n f = E(f);\n }\n // Closure does some funny stuff with functions that occasionally\n // results in non-functions getting applied, so we have to deal with\n // it.\n if(!(f instanceof Function)) {\n f = B(f);\n if(!(f instanceof Function)) {\n return f;\n }\n }\n\n if(f.arity === undefined) {\n f.arity = f.length;\n }\n if(args.length === f.arity) {\n switch(f.arity) {\n case 0: return f();\n case 1: return f(args[0]);\n default: return f.apply(null, args);\n }\n } else if(args.length > f.arity) {\n switch(f.arity) {\n case 0: return f();\n case 1: return A(f(args.shift()), args);\n default: return A(f.apply(null, args.splice(0, f.arity)), args);\n }\n } else {\n var g = function() {\n return A(f, args.concat(Array.prototype.slice.call(arguments)));\n };\n g.arity = f.arity - args.length;\n return g;\n }\n}", "function example3 () {\n function Animal(name) {\n this.name = name;\n this.speed = 0;\n }\n\n Animal.prototype.run = function(speed) {\n this.speed += speed;\n console.log( this.name + ' бежит, скорость ' + this.speed );\n };\n\n function Rabbit(name) {\n this.name = name;\n this.speed = 0;\n }\n\n Rabbit.prototype = Object.create(Animal.prototype)\n Rabbit.prototype.constructor = Rabbit\n\n Rabbit.prototype.jump = function() {\n this.speed++;\n console.log( this.name + ' прыгает' );\n };\n\n //total overriding\n Rabbit.prototype.run = function () {\n this.speed++\n this.jump()\n }\n\n // extend parent method\n Rabbit.prototype.run = function() {\n Animal.prototype.run.apply(this, arguments) // don't forget about proper context\n this.jump()\n };\n\n var rabbit = new Rabbit('Кроль');\n}", "function Fold(f, z, c, to) {\n\t\t\t\tthis.f = f; this.z = z; this.c = c; this.to = to;\n\t\t\t\tthis.resolver = failIfRejected;\n\t\t\t\tthis.receiver = this;\n\t\t\t}", "function foldCause(f, g, __trace) {\n return self => fold_(sandbox(self), f, g, __trace);\n}", "_callerHungup() {\n assert(false, 'subclass responsibility to override this method');\n }", "function B(){}", "apply() {\n this.onApply(this.operations);\n }", "apply() {\n this.onApply(this.operations);\n }", "function e(a,b){return function(){return a.apply(b,arguments)}}", "function inherited() { }", "apply(){\n super.apply();\n this.effect.connect(this.wet)\n }", "function superCall(context,methodName){var args=zrUtil.slice(arguments,2);return this.superClass.prototype[methodName].apply(context,args);}", "pMethod(){\r\n console.log(\"Parent Method\"); \r\n }", "function Nothing$prototype$chain(f) {\n return this;\n }", "function applyTo(args) {\n return function actuallyApply(func) {\n var allArgs;\n var unboxedFunc;\n switch (func.type) {\n case DATA:\n allArgs = args;\n unboxedFunc = func.fields[0];\n break;\n case PARTIAL_APPLY:\n allArgs = func.args.concat(args);\n unboxedFunc = func.func;\n break;\n default:\n throw new Error(\"an Apply node's function field evaluated to a non-function (of type \" + func.type + \"), which probably indicates a bug in the humbaba toolchain or runtime\");\n }\n var desired = unboxedFunc.length;\n var present = allArgs.length;\n if (present < desired) {\n PartialApply.call(this, unboxedFunc, allArgs);\n } else if (present > desired) {\n var func2 = {}\n unboxedFunc.apply(func2, allArgs.slice(0, desired));\n Apply.call(this, func2, allArgs.slice(desired));\n } else {\n unboxedFunc.apply(this, allArgs);\n }\n }\n}", "function task1 () {\n \n function Animal(name) {\n this.name = name;\n }\n\n Animal.prototype.walk = function() {\n console.log( \"ходит \" + this.name );\n };\n\n function Rabbit(name) {\n this.name = name;\n }\n Rabbit.prototype = Animal.prototype;\n\n Rabbit.prototype.walk = function() {\n console.log( \"прыгает! и ходит: \" + this.name );\n };\n\n var a = new Animal('a')\n\n var r = new Rabbit('r')\n\n a.walk() // прыгает и ходит????\n r.walk()\n}", "function createAdjustor(args, f, a, b) {\n return function(){\n var x = f.apply(null, arguments);\n while(x instanceof F) {x = x.f();}\n return x;\n };\n}", "function createAdjustor(args, f, a, b) {\n return function(){\n var x = f.apply(null, arguments);\n while(x instanceof F) {x = x.f();}\n return x;\n };\n}", "function r(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}", "function r(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}", "function ContextFixer(func, context) {\n this.func = func;\n this.context = context;\n this.args = arguments;\n var self = this;\n\n this.execute = function() {\n /* execute the method */\n var args = new Array();\n // the first arguments will be the extra ones of the class\n for (var i=0; i < self.args.length - 2; i++) {\n args.push(self.args[i + 2]);\n };\n // the last are the ones passed on to the execute method\n for (var i=0; i < arguments.length; i++) {\n args.push(arguments[i]);\n };\n return self.func.apply(self.context, args);\n };\n\n}", "execute(incomingNode, exitingNode) {\r\n\t\tthrow new Error('TransitionStrategy.execute is abstract.');\r\n\t}", "function inherit(C, P) {\n\tvar F = function () {};\n\tF.prototype = P.prototype;\n\tC.prototype = new F();\n\tC.uber = P.prototype; // KEEP A REFERENCE LINK TO THE PARENT'S PROTOTYPE DIRECTLY\n}", "function r(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}", "function inherit(targ, src) {\n var f = function() {\n if (this.__super__ == f) {\n // add __super__ of parent to front of lookup chain\n // so parent class constructor can call its parent using this.__super__\n this.__super__ = src.prototype.__super__;\n // call parent constructor function. this.__super__ now points to parent-of-parent\n src.apply(this, arguments);\n // remove temp __super__, expose targ.prototype.__super__ again\n delete this.__super__;\n }\n };\n\n f.prototype = src.prototype || src; // added || src to allow inheriting from objects as well as functions\n // Extend targ prototype instead of wiping it out --\n // in case inherit() is called after targ.prototype = {stuff}; statement\n targ.prototype = extend$1(new f(), targ.prototype); //\n targ.prototype.constructor = targ;\n targ.prototype.__super__ = f;\n }", "function mutate(liveRange, formatter, rootHasImpliedContext) {\n\t\tif (liveRange.collapsed) {\n\t\t\treturn;\n\t\t}\n\t\t// Because range may be mutated during traversal, we must only\n\t\t// refer to it before traversal.\n\t\tvar cac = liveRange.commonAncestorContainer;\n\t\tvar topmostOverrideNode = null;\n\t\tvar bottommostOverrideNode = null;\n\t\tvar isNonClearableOverride = false;\n\t\tvar upperBoundaryAndBeyond = false;\n\t\tvar fromCacToContext = Dom.childAndParentsUntilIncl(cac, function (node) {\n\t\t\t// Because we shouldn't expect hasContext to handle the\n\t\t\t// document element (which has nodeType 9).\n\t\t\treturn !node.parentNode || 9 === node.parentNode.nodeType || formatter.hasContext(node);\n\t\t});\n\t\tArrays.forEach(fromCacToContext, function (node) {\n\t\t\tupperBoundaryAndBeyond = upperBoundaryAndBeyond || formatter.isUpperBoundary(node);\n\t\t\tif (null != formatter.getOverride(node)) {\n\t\t\t\ttopmostOverrideNode = node;\n\t\t\t\tisNonClearableOverride = upperBoundaryAndBeyond;\n\t\t\t\tbottommostOverrideNode = bottommostOverrideNode || node;\n\t\t\t}\n\t\t});\n\t\tif ((rootHasImpliedContext || formatter.hasContext(Arrays.last(fromCacToContext)))\n\t\t\t && !isNonClearableOverride) {\n\t\t\tvar pushDownFrom = topmostOverrideNode || cac;\n\t\t\tvar cacOverride = formatter.getOverride(bottommostOverrideNode || cac);\n\t\t\tvar clearOverrideRec = formatter.clearOverrideRec || function (node) {\n\t\t\t\tDom.walkRec(node, formatter.clearOverride);\n\t\t\t};\n\t\t\tpushDownContext(\n\t\t\t\tliveRange,\n\t\t\t\tpushDownFrom,\n\t\t\t\tcacOverride,\n\t\t\t\tformatter.getOverride,\n\t\t\t\tformatter.clearOverride,\n\t\t\t\tclearOverrideRec,\n\t\t\t\tformatter.pushDownOverride\n\t\t\t);\n\t\t} else {\n\t\t\tvar setContext = function (node) {\n\t\t\t\tformatter.setContext(node, isNonClearableOverride);\n\t\t\t};\n\t\t\twalkBoundary(\n\t\t\t\tliveRange,\n\t\t\t\tformatter.getOverride,\n\t\t\t\tformatter.pushDownOverride,\n\t\t\t\tformatter.clearOverride,\n\t\t\t\tsetContext\n\t\t\t);\n\t\t}\n\t}", "function SuperclassBare() {}", "function SuperclassBare() {}", "function recursive(node, state, funcs, base, override) {\n var visitor = funcs ? exports.make(funcs, base) : base;(function c(node, st, override) {\n visitor[override || node.type](node, st, c);\n })(node, state, override);\n}", "function full(node, callback, baseVisitor, state, override) {\n if (!baseVisitor) { baseVisitor = base\n ; }(function c(node, st, override) {\n var type = override || node.type;\n baseVisitor[type](node, st, c);\n if (!override) { callback(node, st, type); }\n })(node, state, override);\n }", "function full(node, callback, baseVisitor, state, override) {\n if (!baseVisitor) { baseVisitor = base\n ; }(function c(node, st, override) {\n var type = override || node.type;\n baseVisitor[type](node, st, c);\n if (!override) { callback(node, st, type); }\n })(node, state, override);\n }", "function g() {\n (void 0).f();\n}", "apply(fn) {\n // overload custom middleware to allow context free transitions\n let root = this.root.assign({ data: { middleware: defaultMiddleware } });\n // focus on current tree and apply the function to it\n let nextRoot = over(this.lens, fn, root);\n // put the original middleware into the next root tree so the middleware will\n return map(tree => {\n if (tree.is(nextRoot)) {\n return nextRoot.assign({ data: { middleware: this.root.data.middleware } });\n } else {\n return tree;\n }\n }, nextRoot);\n }", "function $super(arrayOfArgs) {\n // since we are thunking a method call, performance is important here: \n // memoize all lookups, once memoized the fast path calls no other \n // functions\n //\n // find the caller (cannot be `strict` because of 'caller')\n var caller = $super.caller;\n // memoized 'name of method' \n var nom = caller.nom;\n // memoized next implementation prototype\n var _super = caller._super;\n if (!_super) {\n if (!nom) {\n nom = caller.nom = nameInThis.call(this, caller);\n }\n if (!nom) {\n console.warn('called super() on a method not installed declaratively (has no .nom property)');\n }\n // super prototype is either cached or we have to find it\n // by searching __proto__ (at the 'top')\n _super = memoizeSuper(caller, nom, getPrototypeOf(this));\n }\n if (!_super) {\n // if _super is falsey, there is no super implementation\n //console.warn('called $super(' + nom + ') where there is no super implementation');\n } else {\n // our super function\n var fn = _super[nom];\n // memoize information so 'fn' can call 'super'\n if (!fn._super) {\n memoizeSuper(fn, nom, _super);\n }\n // invoke the inherited method\n // if 'fn' is not function valued, this will throw\n return fn.apply(this, arrayOfArgs || []);\n }\n }", "function $super(arrayOfArgs) {\n // since we are thunking a method call, performance is important here: \n // memoize all lookups, once memoized the fast path calls no other \n // functions\n //\n // find the caller (cannot be `strict` because of 'caller')\n var caller = $super.caller;\n // memoized 'name of method' \n var nom = caller.nom;\n // memoized next implementation prototype\n var _super = caller._super;\n if (!_super) {\n if (!nom) {\n nom = caller.nom = nameInThis.call(this, caller);\n }\n if (!nom) {\n console.warn('called super() on a method not installed declaratively (has no .nom property)');\n }\n // super prototype is either cached or we have to find it\n // by searching __proto__ (at the 'top')\n _super = memoizeSuper(caller, nom, getPrototypeOf(this));\n }\n if (!_super) {\n // if _super is falsey, there is no super implementation\n //console.warn('called $super(' + nom + ') where there is no super implementation');\n } else {\n // our super function\n var fn = _super[nom];\n // memoize information so 'fn' can call 'super'\n if (!fn._super) {\n memoizeSuper(fn, nom, _super);\n }\n // invoke the inherited method\n // if 'fn' is not function valued, this will throw\n return fn.apply(this, arrayOfArgs || []);\n }\n }", "function full(node, callback, baseVisitor, state, override) {\n if (!baseVisitor) { baseVisitor = base\n ; }(function c(node, st, override) {\n var type = override || node.type;\n baseVisitor[type](node, st, c);\n if (!override) { callback(node, st, type); }\n })(node, state, override);\n}", "function Ab(a,b,c){F.call(this,c);this.c=a||0;this.b=void 0===b?Infinity:b}", "function F(){}", "function Child(a) {\n Parent.apply(this,arguments);\n}", "function inherit(C, P) {\n function F() {};\n F.prototype = P.prototype;\n C.prototype = new F();\n C.uber = P.prototype;\n C.constructor.prototype = C;\n}", "function A(f, args) {\n if(f instanceof T) {\n f = E(f);\n }\n // Closure does some funny stuff with functions that occasionally\n // results in non-functions getting applied, so we have to deal with\n // it.\n if(!(f instanceof Function)) {\n return f;\n }\n\n if(f.arity === undefined) {\n f.arity = f.length;\n }\n if(args.length === f.arity) {\n switch(f.arity) {\n case 0: return f();\n case 1: return f(args[0]);\n default: return f.apply(null, args);\n }\n } else if(args.length > f.arity) {\n switch(f.arity) {\n case 0: return f();\n case 1: return A(f(args.shift()), args);\n default: return A(f.apply(null, args.splice(0, f.arity)), args);\n }\n } else {\n var g = function() {\n return A(f, args.concat(Array.prototype.slice.call(arguments)));\n };\n g.arity = f.arity - args.length;\n return g;\n }\n}", "function Apply(func, args) {\n Thunk.call(this, func, applyTo(args));\n}", "function full(node, callback, base, state, override) {\n if (!base) { base = exports.base\n ; }(function c(node, st, override) {\n var type = override || node.type;\n base[type](node, st, c);\n if (!override) { callback(node, st, type); }\n })(node, state, override);\n}", "function catchAll_(self, f, __trace) {\n return (0, _foldM.foldM_)(self, f, _succeed.succeed, __trace);\n}", "function NaiveBroadphase(){\n Broadphase.call(this, Broadphase.NAIVE);\n}", "function apply_fun1(a, b, c) { assertEq(c, undefined) }", "function catchAllCause_(self, f, __trace) {\n return core.foldCauseM_(self, f, _succeed.succeed, __trace);\n}", "function tameInnocent() {\n var feralFunc = this;\n function tameApplyFuncWrapper(self, opt_args) {\n var feralThis = stopEscalation(untame(self));\n var feralArgs = untame(opt_args);\n var feralResult = feralFunc.apply(feralThis, feralArgs || []);\n return tame(feralResult);\n }\n markFuncFreeze(tameApplyFuncWrapper);\n\n function tameCallFuncWrapper(self, var_args) {\n return tameApplyFuncWrapper(self, Array.slice(arguments, 1));\n }\n markFuncFreeze(tameCallFuncWrapper);\n\n var result = PseudoFunction(tameCallFuncWrapper, tameApplyFuncWrapper);\n result.length = feralFunc.length;\n result.toString = markFuncFreeze(feralFunc.toString.bind(feralFunc));\n return primFreeze(result);\n }", "function L(){A.call(this)}", "function L(){A.call(this)}", "function L(){A.call(this)}" ]
[ "0.61271", "0.55909157", "0.5322409", "0.52313393", "0.5199879", "0.5199879", "0.51838225", "0.51768816", "0.51607907", "0.5114153", "0.5089366", "0.50572246", "0.5031861", "0.5020725", "0.5020725", "0.5020725", "0.49850824", "0.49586225", "0.49429613", "0.49251193", "0.4911912", "0.4911912", "0.49081337", "0.490775", "0.48943552", "0.4878849", "0.4878849", "0.4878849", "0.4878849", "0.4878305", "0.4878305", "0.4878305", "0.4871581", "0.4871581", "0.4871581", "0.4871581", "0.4871581", "0.4871581", "0.48540932", "0.48488376", "0.48457125", "0.47935888", "0.47718716", "0.47645235", "0.47645235", "0.47645235", "0.47645235", "0.47645235", "0.47645235", "0.47645235", "0.47557625", "0.47527912", "0.4737228", "0.47239995", "0.47200269", "0.47091228", "0.46805298", "0.46805298", "0.46693242", "0.46592957", "0.46458507", "0.46457162", "0.46347582", "0.46334898", "0.4632139", "0.4630428", "0.4629559", "0.4629559", "0.46189186", "0.46189186", "0.46113527", "0.46063042", "0.45944285", "0.45928407", "0.45906365", "0.45826098", "0.4558218", "0.4558218", "0.45567918", "0.45520025", "0.45520025", "0.45444754", "0.45259944", "0.4525903", "0.4525903", "0.45256266", "0.45140654", "0.45044473", "0.4501964", "0.45005783", "0.4487956", "0.44873077", "0.4482033", "0.44785836", "0.4468556", "0.44661158", "0.44570315", "0.4454182", "0.44515422", "0.44515422", "0.44515422" ]
0.0
-1
Returns true if the HTML5 history API is supported. Taken from Modernizr. changed to avoid false negatives for Windows Phones:
function supportsHistory() { var ua = window.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.history; }
{ "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('Windows Phone') === -1) {\n return false; // 63\n } // 64\n return window.history && 'pushState' in window.history; // 65\n} // 66", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t 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) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\r\n\t var ua = navigator.userAgent;\r\n\t 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) {\r\n\t return false;\r\n\t }\r\n\t return window.history && 'pushState' in window.history;\r\n\t}", "function supportsHistory() {\n var ua = navigator.userAgent;\n 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) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n }", "function supportsHistory() {\n var ua = window.navigator.userAgent;\n if (\n (ua.indexOf('Android 2.') !== -1 ||\n ua.indexOf('Android 4.0') !== -1) &&\n ua.indexOf('Mobile Safari') !== -1 &&\n ua.indexOf('Chrome') === -1 &&\n ua.indexOf('Windows Phone') === -1\n )\n return false;\n return window.history && 'pushState' in window.history;\n }", "function supportsHistory() {\n var ua = navigator.userAgent;\n 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) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n 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) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n 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) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n 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) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n 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) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n 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) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n 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) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n 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) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n 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) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n 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) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n 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) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n 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) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n 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) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}" ]
[ "0.8456593", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.843463", "0.84085023", "0.8367201", "0.83601606", "0.83601606", "0.83601606", "0.83601606", "0.83601606", "0.83601606", "0.83601606", "0.83601606", "0.83601606", "0.83601606", "0.83601606", "0.83601606", "0.83601606" ]
0.83404016
99
Returns true if browser fires popstate on hash change. IE10 and IE11 do not.
function supportsPopStateOnHashChange() { return window.navigator.userAgent.indexOf('Trident') === -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function supportsPopStateOnHashChange(){return window.navigator.userAgent.indexOf('Trident')===-1;}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n }", "function supportsHashChange(documentMode, global) {\n return 'onhashchange' in global && (documentMode === undefined || documentMode > 7);\n }", "function supportsHashChange(documentMode, global) {\n return 'onhashchange' in global && (documentMode === undefined || documentMode > 7);\n }", "function supportsHashChange(documentMode, global) {\n return 'onhashchange' in global && (documentMode === undefined || documentMode > 7);\n }", "function supportsHashChange(documentMode, global) {\n return 'onhashchange' in global && (documentMode === undefined || documentMode > 7);\n }", "function checkHash() {\r\n if (location.hash && $this.find(location.hash).length) {\r\n toggleState(true);\r\n return true;\r\n }\r\n }", "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 locationHashChanged() {\n if (location.hash === \"\") {\n closePage();\n }\n}", "function firePopState() { // 630\n var o = document.createEvent ? document.createEvent('Event') : document.createEventObject(); // 631\n if (o.initEvent) { // 632\n o.initEvent('popstate', false, false); // 633\n } else { // 634\n o.type = 'popstate'; // 635\n } // 636\n o.state = historyObject.state; // 637\n // send a newly created events to be processed // 638\n dispatchEvent(o); // 639\n } // 640", "function poll() {\n var hash = get_fragment(),\n history_hash = history_get( last_hash );\n \n if ( hash !== last_hash ) {\n history_set( last_hash = hash, history_hash );\n \n $(window).trigger( str_hashchange );\n \n } else if ( history_hash !== last_hash ) {\n location.href = location.href.replace( /#.*/, '' ) + history_hash;\n }\n \n timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay );\n }", "function poll() {\n var hash = get_fragment(),\n history_hash = history_get( last_hash );\n \n if ( hash !== last_hash ) {\n history_set( last_hash = hash, history_hash );\n \n $(window).trigger( str_hashchange );\n \n } else if ( history_hash !== last_hash ) {\n location.href = location.href.replace( /#.*/, '' ) + history_hash;\n }\n \n timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay );\n }", "function poll() {\n var hash = get_fragment(),\n history_hash = history_get( last_hash );\n \n if ( hash !== last_hash ) {\n history_set( last_hash = hash, history_hash );\n \n $(window).trigger( str_hashchange );\n \n } else if ( history_hash !== last_hash ) {\n location.href = location.href.replace( /#.*/, '' ) + history_hash;\n }\n \n timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay );\n }", "function isExtraneousPopstateEvent(event){event.state===undefined&&navigator.userAgent.indexOf('CriOS')===-1;}", "function poll() {\n var hash = get_fragment(),\n history_hash = history_get( last_hash );\n \n if ( hash !== last_hash ) {\n history_set( last_hash = hash, history_hash );\n \n $(window).trigger( str_hashchange );\n \n } else if ( history_hash !== last_hash ) {\n location.href = location.href.replace( /#.*/, '' ) + history_hash;\n }\n \n timeout_id = window.setTimeout( poll, $.fn[ str_hashchange ].delay );\n}", "function hashChanged(e){\n\t\trespondToState();\n\t}", "function DETECT_history() {\n return window.history && typeof window.history.pushState !== 'undefined';\n }", "function supportsGoWithoutReloadUsingHash(){return window.navigator.userAgent.indexOf('Firefox')===-1;}", "function poll() {\n var hash = get_fragment(),\n history_hash = history_get(last_hash);\n\n if (hash !== last_hash) {\n history_set(last_hash = hash, history_hash);\n\n $(window).trigger(str_hashchange);\n\n } else if (history_hash !== last_hash) {\n location.href = location.href.replace(/#.*/, '') + history_hash;\n }\n\n timeout_id = setTimeout(poll, $.fn[str_hashchange].delay);\n }", "function poll() {\n var hash = get_fragment(),\n history_hash = history_get(last_hash);\n\n if (hash !== last_hash) {\n history_set(last_hash = hash, history_hash);\n\n $(window).trigger(str_hashchange);\n\n } else if (history_hash !== last_hash) {\n location.href = location.href.replace(/#.*/, '') + history_hash;\n }\n\n timeout_id = setTimeout(poll, $.fn[str_hashchange].delay);\n }", "function supportsGoWithoutReloadUsingHash(){var ua=navigator.userAgent;return ua.indexOf('Firefox')===-1;}", "function supportsGoWithoutReloadUsingHash(){var ua=navigator.userAgent;return ua.indexOf('Firefox')===-1;}", "function supportsGoWithoutReloadUsingHash(){var ua=navigator.userAgent;return ua.indexOf('Firefox')===-1;}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n }", "function checkUrlHash() {\n var hash = window.location.hash;\n\n // Allow deep linking to recover password form\n if (hash === '#recover') {\n toggleRecoverPasswordForm();\n }\n }", "function firePopState() {\n var o = document.createEvent ? document.createEvent('Event') : document.createEventObject();\n if (o.initEvent) {\n o.initEvent('popstate', false, false);\n } else {\n o.type = 'popstate';\n }\n o.state = historyObject.state;\n // send a newly created events to be processed\n dispatchEvent(o);\n }", "listenForHashChanges() {\n //get url on page load.\n finsembleWindow.updateOptions({ url: window.top.location.href }, () => {\n });\n var self = this;\n //There's no pushState event in the browser. This is a monkey patched solution that allows us to catch hash changes. onhashchange doesn't fire when a site is loaded with a hash (e.g., salesforce).\n (function (history) {\n var pushState = history.pushState;\n history.pushState = function (state) {\n if (typeof history.onpushstate === \"function\") {\n history.onpushstate({ state: state });\n }\n pushState.apply(history, arguments);\n finsembleWindow.updateOptions({ url: window.top.location.href }, () => {\n });\n return;\n };\n var replaceState = history.replaceState;\n history.replaceState = function (state) {\n if (typeof history.onreplacestate === \"function\") {\n history.onreplacestate({ state: state });\n }\n replaceState.apply(history, arguments);\n finsembleWindow.updateOptions({ url: window.top.location.toString() });\n // DH 3/6/2019 - This should be handled by the WindowStorageManager.\n storageClient_1.default.save({ topic: constants_1.WORKSPACE.CACHE_STORAGE_TOPIC, key: self.windowHash, value: finsembleWindow.windowOptions });\n return;\n };\n })(window.history);\n window.addEventListener(\"hashchange\", () => {\n finsembleWindow.updateOptions({ url: window.top.location.toString() }, () => {\n });\n });\n }", "function supportsGoWithoutReloadUsingHash() {\r\n\t var ua = navigator.userAgent;\r\n\t return ua.indexOf('Firefox') === -1;\r\n\t}", "function checkHash() {\r\n if (location.hash != \"\") {\r\n let hash = location.hash.match(/^#(.*)$/)[1];\r\n switch (hash) {\r\n case \"refreshed\":\r\n dom.connectWithStrava.click();\r\n break;\r\n }\r\n location.hash = \"\";\r\n }\r\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}" ]
[ "0.85096633", "0.84287786", "0.73452735", "0.73452735", "0.73452735", "0.73452735", "0.7324405", "0.7241189", "0.71064144", "0.6865565", "0.6817643", "0.6817643", "0.6817643", "0.6804248", "0.6773816", "0.6762726", "0.67330664", "0.6706965", "0.6660287", "0.66571045", "0.6567402", "0.6567402", "0.6567402", "0.6549222", "0.65297097", "0.65101933", "0.6485015", "0.64802307", "0.6466874", "0.6445398", "0.6445398", "0.6445398", "0.6445398", "0.6445398", "0.6445398", "0.6445398", "0.6445398", "0.6445398", "0.6445398", "0.6445398", "0.6445398" ]
0.8299278
59
Returns false if using go(n) with hash history causes a full page reload.
function supportsGoWithoutReloadUsingHash() { return window.navigator.userAgent.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(location.hash).length) {\r\n toggleState(true);\r\n return true;\r\n }\r\n }", "function checkURLAgain()\r\n {\r\n url = new String(window.location.href);\r\n if(count++ < 20)\r\n {\r\n if((AreSameStrings(url, lastURL,false) || url.indexOf(\"#\") < 0))\r\n {\r\n if(debug) GM_log(\"checking URL again \" + count);\r\n setTimeout(checkURLAgain, 100);\r\n }\r\n else\r\n {\r\n if(debug)\r\n GM_log('calling again');\r\n DoTestAgain();\r\n }\r\n }\r\n }", "function checkURL(hash)\n{\n if(!hash) hash = window.location.hash;\t//if no parameter is provided, use the hash value from the current address\n if(hash != lasturl)\t// if the hash value has changed\n {\n lasturl = hash;\t//update the current hash\n loadPage(hash);\t// and load the new page\n }\n}", "function supportsGoWithoutReloadUsingHash() { // 72\n var ua = navigator.userAgent; // 73\n return ua.indexOf('Firefox') === -1; // 74\n}", "function checkHash() {\r\n if (location.hash != \"\") {\r\n let hash = location.hash.match(/^#(.*)$/)[1];\r\n switch (hash) {\r\n case \"refreshed\":\r\n dom.connectWithStrava.click();\r\n break;\r\n }\r\n location.hash = \"\";\r\n }\r\n}", "function getPageRefreshed() {\n try {\n if (performance && performance.navigation) {\n return performance.navigation.type === performance.navigation.TYPE_RELOAD;\n }\n } catch (e) { }\n return false;\n}", "function checkURL(hash)\n{\n if(!hash) hash=window.location.hash;\t//if no parameter is provided, use the hash value from the current address\n if(hash != lasturl)\t// if the hash value has changed\n {\n lasturl=hash;\t//update the current hash\n loadPage(hash);\t// and load the new page\n }\n}", "function isLoop() {\n var last = history[history.length - 1];\n for (var i = 0; i < history.length - 1; i++) {\n if (history[i] === last) {\n return true;\n }\n }\n return false;\n }", "function hashChange(entry, url) {\n if (!entry) return false;\n const [aBase, aHash] = url.split('#');\n const [bBase, bHash] = entry.url.split('#');\n return aBase === bBase && aHash !== bHash;\n}", "function supportsGoWithoutReloadUsingHash(){return window.navigator.userAgent.indexOf('Firefox')===-1;}", "function checkUrlHash() {\n var hash = window.location.hash;\n\n // Allow deep linking to recover password form\n if (hash === '#recover') {\n toggleRecoverPasswordForm();\n }\n }", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n }", "function supportsGoWithoutReloadUsingHash() {\r\n\t var ua = navigator.userAgent;\r\n\t return ua.indexOf('Firefox') === -1;\r\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}" ]
[ "0.6851354", "0.66238165", "0.61683345", "0.61197215", "0.6119047", "0.6107423", "0.6104077", "0.61029226", "0.60937685", "0.60870457", "0.606839", "0.6028918", "0.6026122", "0.602402", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255" ]
0.59966
99
Returns true if a given popstate event is an extraneous WebKit event. Accounts for the fact that Chrome on iOS fires real popstate events containing undefined state when pressing the back button.
function isExtraneousPopstateEvent(event) { event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isExtraneousPopstateEvent(event){event.state===undefined&&navigator.userAgent.indexOf('CriOS')===-1;}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return (\n event.state === undefined &&\n navigator.userAgent.indexOf('CriOS') === -1\n );\n }", "function ignorablePopstateEvent(event) {\r\n return (event.state === undefined && navigator.userAgent.indexOf(\"CriOS\") === -1);\r\n}", "function supportsPopStateOnHashChange(){return window.navigator.userAgent.indexOf('Trident')===-1;}", "function isUnattempted (e) {\n return !e.stateChange\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}" ]
[ "0.8188345", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.80754024", "0.77667147", "0.65620416", "0.653434", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815", "0.6524815" ]
0.81056064
59
Creates a history object that uses the HTML5 history API including pushState, replaceState, and the popstate event.
function createBrowserHistory(props) { if (props === void 0) { props = {}; } !canUseDOM ? false ? invariant(false, 'Browser history needs a DOM') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0; var globalHistory = window.history; var canUseHistory = supportsHistory(); var needsHashChangeListener = !supportsPopStateOnHashChange(); var _props = props, _props$forceRefresh = _props.forceRefresh, forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh, _props$getUserConfirm = _props.getUserConfirmation, getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm, _props$keyLength = _props.keyLength, keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength; var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : ''; function getDOMLocation(historyState) { var _ref = historyState || {}, key = _ref.key, state = _ref.state; var _window$location = window.location, pathname = _window$location.pathname, search = _window$location.search, hash = _window$location.hash; var path = pathname + search + hash; false ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".') : void 0; if (basename) path = stripBasename(path, basename); return createLocation(path, state, key); } function createKey() { return Math.random().toString(36).substr(2, keyLength); } var transitionManager = createTransitionManager(); function setState(nextState) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])(history, nextState); history.length = globalHistory.length; transitionManager.notifyListeners(history.location, history.action); } function handlePopState(event) { // Ignore extraneous popstate events in WebKit. if (isExtraneousPopstateEvent(event)) return; handlePop(getDOMLocation(event.state)); } function handleHashChange() { handlePop(getDOMLocation(getHistoryState())); } var forceNextPop = false; function handlePop(location) { if (forceNextPop) { forceNextPop = false; setState(); } else { var action = 'POP'; transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { if (ok) { setState({ action: action, location: location }); } else { revertPop(location); } }); } } function revertPop(fromLocation) { var toLocation = history.location; // TODO: We could probably make this more reliable by // keeping a list of keys we've seen in sessionStorage. // Instead, we just default to 0 for keys we don't know. var toIndex = allKeys.indexOf(toLocation.key); if (toIndex === -1) toIndex = 0; var fromIndex = allKeys.indexOf(fromLocation.key); if (fromIndex === -1) fromIndex = 0; var delta = toIndex - fromIndex; if (delta) { forceNextPop = true; go(delta); } } var initialLocation = getDOMLocation(getHistoryState()); var allKeys = [initialLocation.key]; // Public interface function createHref(location) { return basename + createPath(location); } function push(path, state) { false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0; var action = 'PUSH'; var location = createLocation(path, state, createKey(), history.location); transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { if (!ok) return; var href = createHref(location); var key = location.key, state = location.state; if (canUseHistory) { globalHistory.pushState({ key: key, state: state }, null, href); if (forceRefresh) { window.location.href = href; } else { var prevIndex = allKeys.indexOf(history.location.key); var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1); nextKeys.push(location.key); allKeys = nextKeys; setState({ action: action, location: location }); } } else { false ? warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0; window.location.href = href; } }); } function replace(path, state) { false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0; var action = 'REPLACE'; var location = createLocation(path, state, createKey(), history.location); transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { if (!ok) return; var href = createHref(location); var key = location.key, state = location.state; if (canUseHistory) { globalHistory.replaceState({ key: key, state: state }, null, href); if (forceRefresh) { window.location.replace(href); } else { var prevIndex = allKeys.indexOf(history.location.key); if (prevIndex !== -1) allKeys[prevIndex] = location.key; setState({ action: action, location: location }); } } else { false ? warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0; window.location.replace(href); } }); } function go(n) { globalHistory.go(n); } function goBack() { go(-1); } function goForward() { go(1); } var listenerCount = 0; function checkDOMListeners(delta) { listenerCount += delta; if (listenerCount === 1 && delta === 1) { window.addEventListener(PopStateEvent, handlePopState); if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange); } else if (listenerCount === 0) { window.removeEventListener(PopStateEvent, handlePopState); if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange); } } var isBlocked = false; function block(prompt) { if (prompt === void 0) { prompt = false; } var unblock = transitionManager.setPrompt(prompt); if (!isBlocked) { checkDOMListeners(1); isBlocked = true; } return function () { if (isBlocked) { isBlocked = false; checkDOMListeners(-1); } return unblock(); }; } function listen(listener) { var unlisten = transitionManager.appendListener(listener); checkDOMListeners(1); return function () { checkDOMListeners(-1); unlisten(); }; } var history = { length: globalHistory.length, action: 'POP', location: initialLocation, createHref: createHref, push: push, replace: replace, go: go, goBack: goBack, goForward: goForward, block: block, listen: listen }; return history; }
{ "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) : undefined;\r\n\t\r\n\t var forceRefresh = options.forceRefresh;\r\n\t\r\n\t var isSupported = _DOMUtils.supportsHistory();\r\n\t var useRefresh = !isSupported || forceRefresh;\r\n\t\r\n\t function getCurrentLocation(historyState) {\r\n\t try {\r\n\t historyState = historyState || window.history.state || {};\r\n\t } catch (e) {\r\n\t historyState = {};\r\n\t }\r\n\t\r\n\t var path = _DOMUtils.getWindowPath();\r\n\t var _historyState = historyState;\r\n\t var key = _historyState.key;\r\n\t\r\n\t var state = undefined;\r\n\t if (key) {\r\n\t state = _DOMStateStorage.readState(key);\r\n\t } else {\r\n\t state = null;\r\n\t key = history.createKey();\r\n\t\r\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\r\n\t }\r\n\t\r\n\t var location = _PathUtils.parsePath(path);\r\n\t\r\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\r\n\t }\r\n\t\r\n\t function startPopStateListener(_ref) {\r\n\t var transitionTo = _ref.transitionTo;\r\n\t\r\n\t function popStateListener(event) {\r\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\r\n\t\r\n\t transitionTo(getCurrentLocation(event.state));\r\n\t }\r\n\t\r\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\r\n\t\r\n\t return function () {\r\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\r\n\t };\r\n\t }\r\n\t\r\n\t function finishTransition(location) {\r\n\t var basename = location.basename;\r\n\t var pathname = location.pathname;\r\n\t var search = location.search;\r\n\t var hash = location.hash;\r\n\t var state = location.state;\r\n\t var action = location.action;\r\n\t var key = location.key;\r\n\t\r\n\t if (action === _Actions.POP) return; // Nothing to do.\r\n\t\r\n\t _DOMStateStorage.saveState(key, state);\r\n\t\r\n\t var path = (basename || '') + pathname + search + hash;\r\n\t var historyState = {\r\n\t key: key\r\n\t };\r\n\t\r\n\t if (action === _Actions.PUSH) {\r\n\t if (useRefresh) {\r\n\t window.location.href = path;\r\n\t return false; // Prevent location update.\r\n\t } else {\r\n\t window.history.pushState(historyState, null, path);\r\n\t }\r\n\t } else {\r\n\t // REPLACE\r\n\t if (useRefresh) {\r\n\t window.location.replace(path);\r\n\t return false; // Prevent location update.\r\n\t } else {\r\n\t window.history.replaceState(historyState, null, path);\r\n\t }\r\n\t }\r\n\t }\r\n\t\r\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\r\n\t getCurrentLocation: getCurrentLocation,\r\n\t finishTransition: finishTransition,\r\n\t saveState: _DOMStateStorage.saveState\r\n\t }));\r\n\t\r\n\t var listenerCount = 0,\r\n\t stopPopStateListener = undefined;\r\n\t\r\n\t function listenBefore(listener) {\r\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\r\n\t\r\n\t var unlisten = history.listenBefore(listener);\r\n\t\r\n\t return function () {\r\n\t unlisten();\r\n\t\r\n\t if (--listenerCount === 0) stopPopStateListener();\r\n\t };\r\n\t }\r\n\t\r\n\t function listen(listener) {\r\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\r\n\t\r\n\t var unlisten = history.listen(listener);\r\n\t\r\n\t return function () {\r\n\t unlisten();\r\n\t\r\n\t if (--listenerCount === 0) stopPopStateListener();\r\n\t };\r\n\t }\r\n\t\r\n\t // deprecated\r\n\t function registerTransitionHook(hook) {\r\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\r\n\t\r\n\t history.registerTransitionHook(hook);\r\n\t }\r\n\t\r\n\t // deprecated\r\n\t function unregisterTransitionHook(hook) {\r\n\t history.unregisterTransitionHook(hook);\r\n\t\r\n\t if (--listenerCount === 0) stopPopStateListener();\r\n\t }\r\n\t\r\n\t return _extends({}, history, {\r\n\t listenBefore: listenBefore,\r\n\t listen: listen,\r\n\t registerTransitionHook: registerTransitionHook,\r\n\t unregisterTransitionHook: unregisterTransitionHook\r\n\t });\r\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? true ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? true ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? false ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? false ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? false ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? false ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? (undefined) !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? false ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? false ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\n\t var location = _parsePath2['default'](path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? true ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? false ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? true ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\n\t var location = _parsePath2['default'](path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\n\t var location = _parsePath2['default'](path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "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 forceRefresh=options.forceRefresh;var isSupported=_DOMUtils.supportsHistory();var useRefresh=!isSupported||forceRefresh;function getCurrentLocation(historyState){historyState=historyState||window.history.state||{};var path=_DOMUtils.getWindowPath();var _historyState=historyState;var key=_historyState.key;var state=undefined;if(key){state=_DOMStateStorage.readState(key);}else {state=null;key=history.createKey();if(isSupported)window.history.replaceState(_extends({},historyState,{key:key}),null);}var location=_PathUtils.parsePath(path);return history.createLocation(_extends({},location,{state:state}),undefined,key);}function startPopStateListener(_ref){var transitionTo=_ref.transitionTo;function popStateListener(event){if(event.state===undefined)return; // Ignore extraneous popstate events in WebKit.\n\ttransitionTo(getCurrentLocation(event.state));}_DOMUtils.addEventListener(window,'popstate',popStateListener);return function(){_DOMUtils.removeEventListener(window,'popstate',popStateListener);};}function finishTransition(location){var basename=location.basename;var pathname=location.pathname;var search=location.search;var hash=location.hash;var state=location.state;var action=location.action;var key=location.key;if(action===_Actions.POP)return; // Nothing to do.\n\t_DOMStateStorage.saveState(key,state);var path=(basename||'')+pathname+search+hash;var historyState={key:key};if(action===_Actions.PUSH){if(useRefresh){window.location.href=path;return false; // Prevent location update.\n\t}else {window.history.pushState(historyState,null,path);}}else { // REPLACE\n\tif(useRefresh){window.location.replace(path);return false; // Prevent location update.\n\t}else {window.history.replaceState(historyState,null,path);}}}var history=_createDOMHistory2['default'](_extends({},options,{getCurrentLocation:getCurrentLocation,finishTransition:finishTransition,saveState:_DOMStateStorage.saveState}));var listenerCount=0,stopPopStateListener=undefined;function listenBefore(listener){if(++listenerCount===1)stopPopStateListener=startPopStateListener(history);var unlisten=history.listenBefore(listener);return function(){unlisten();if(--listenerCount===0)stopPopStateListener();};}function listen(listener){if(++listenerCount===1)stopPopStateListener=startPopStateListener(history);var unlisten=history.listen(listener);return function(){unlisten();if(--listenerCount===0)stopPopStateListener();};} // deprecated\n\tfunction registerTransitionHook(hook){if(++listenerCount===1)stopPopStateListener=startPopStateListener(history);history.registerTransitionHook(hook);} // deprecated\n\tfunction unregisterTransitionHook(hook){history.unregisterTransitionHook(hook);if(--listenerCount===0)stopPopStateListener();}return _extends({},history,{listenBefore:listenBefore,listen:listen,registerTransitionHook:registerTransitionHook,unregisterTransitionHook:unregisterTransitionHook});}", "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 forceRefresh=options.forceRefresh;var isSupported=_DOMUtils.supportsHistory();var useRefresh=!isSupported||forceRefresh;function getCurrentLocation(historyState){historyState=historyState||window.history.state||{};var path=_DOMUtils.getWindowPath();var _historyState=historyState;var key=_historyState.key;var state=undefined;if(key){state=_DOMStateStorage.readState(key);}else {state=null;key=history.createKey();if(isSupported)window.history.replaceState(_extends({},historyState,{key:key}),null);}var location=_PathUtils.parsePath(path);return history.createLocation(_extends({},location,{state:state}),undefined,key);}function startPopStateListener(_ref){var transitionTo=_ref.transitionTo;function popStateListener(event){if(event.state===undefined)return; // Ignore extraneous popstate events in WebKit.\n\ttransitionTo(getCurrentLocation(event.state));}_DOMUtils.addEventListener(window,'popstate',popStateListener);return function(){_DOMUtils.removeEventListener(window,'popstate',popStateListener);};}function finishTransition(location){var basename=location.basename;var pathname=location.pathname;var search=location.search;var hash=location.hash;var state=location.state;var action=location.action;var key=location.key;if(action===_Actions.POP)return; // Nothing to do.\n\t_DOMStateStorage.saveState(key,state);var path=(basename||'')+pathname+search+hash;var historyState={key:key};if(action===_Actions.PUSH){if(useRefresh){window.location.href=path;return false; // Prevent location update.\n\t}else {window.history.pushState(historyState,null,path);}}else { // REPLACE\n\tif(useRefresh){window.location.replace(path);return false; // Prevent location update.\n\t}else {window.history.replaceState(historyState,null,path);}}}var history=_createDOMHistory2['default'](_extends({},options,{getCurrentLocation:getCurrentLocation,finishTransition:finishTransition,saveState:_DOMStateStorage.saveState}));var listenerCount=0,stopPopStateListener=undefined;function listenBefore(listener){if(++listenerCount===1)stopPopStateListener=startPopStateListener(history);var unlisten=history.listenBefore(listener);return function(){unlisten();if(--listenerCount===0)stopPopStateListener();};}function listen(listener){if(++listenerCount===1)stopPopStateListener=startPopStateListener(history);var unlisten=history.listen(listener);return function(){unlisten();if(--listenerCount===0)stopPopStateListener();};} // deprecated\n\tfunction registerTransitionHook(hook){if(++listenerCount===1)stopPopStateListener=startPopStateListener(history);history.registerTransitionHook(hook);} // deprecated\n\tfunction unregisterTransitionHook(hook){history.unregisterTransitionHook(hook);if(--listenerCount===0)stopPopStateListener();}return _extends({},history,{listenBefore:listenBefore,listen:listen,registerTransitionHook:registerTransitionHook,unregisterTransitionHook:unregisterTransitionHook});}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "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 forceRefresh=options.forceRefresh;var isSupported=_DOMUtils.supportsHistory();var useRefresh=!isSupported||forceRefresh;function getCurrentLocation(historyState){try{historyState=historyState||window.history.state||{};}catch(e){historyState={};}var path=_DOMUtils.getWindowPath();var _historyState=historyState;var key=_historyState.key;var state=undefined;if(key){state=_DOMStateStorage.readState(key);}else {state=null;key=history.createKey();if(isSupported)window.history.replaceState(_extends({},historyState,{key:key}),null);}var location=_PathUtils.parsePath(path);return history.createLocation(_extends({},location,{state:state}),undefined,key);}function startPopStateListener(_ref){var transitionTo=_ref.transitionTo;function popStateListener(event){if(event.state===undefined)return; // Ignore extraneous popstate events in WebKit.\ntransitionTo(getCurrentLocation(event.state));}_DOMUtils.addEventListener(window,'popstate',popStateListener);return function(){_DOMUtils.removeEventListener(window,'popstate',popStateListener);};}function finishTransition(location){var basename=location.basename;var pathname=location.pathname;var search=location.search;var hash=location.hash;var state=location.state;var action=location.action;var key=location.key;if(action===_Actions.POP)return; // Nothing to do.\n_DOMStateStorage.saveState(key,state);var path=(basename||'')+pathname+search+hash;var historyState={key:key};if(action===_Actions.PUSH){if(useRefresh){window.location.href=path;return false; // Prevent location update.\n}else {window.history.pushState(historyState,null,path);}}else { // REPLACE\nif(useRefresh){window.location.replace(path);return false; // Prevent location update.\n}else {window.history.replaceState(historyState,null,path);}}}var history=_createDOMHistory2['default'](_extends({},options,{getCurrentLocation:getCurrentLocation,finishTransition:finishTransition,saveState:_DOMStateStorage.saveState}));var listenerCount=0,stopPopStateListener=undefined;function listenBefore(listener){if(++listenerCount===1)stopPopStateListener=startPopStateListener(history);var unlisten=history.listenBefore(listener);return function(){unlisten();if(--listenerCount===0)stopPopStateListener();};}function listen(listener){if(++listenerCount===1)stopPopStateListener=startPopStateListener(history);var unlisten=history.listen(listener);return function(){unlisten();if(--listenerCount===0)stopPopStateListener();};} // deprecated\nfunction registerTransitionHook(hook){if(++listenerCount===1)stopPopStateListener=startPopStateListener(history);history.registerTransitionHook(hook);} // deprecated\nfunction unregisterTransitionHook(hook){history.unregisterTransitionHook(hook);if(--listenerCount===0)stopPopStateListener();}return _extends({},history,{listenBefore:listenBefore,listen:listen,registerTransitionHook:registerTransitionHook,unregisterTransitionHook:unregisterTransitionHook});}", "function createBrowserHistory(props){if(props===void 0){props={};}!canUseDOM? true?Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false,'Browser history needs a DOM'):undefined:void 0;var globalHistory=window.history;var canUseHistory=supportsHistory();var needsHashChangeListener=!supportsPopStateOnHashChange();var _props=props,_props$forceRefresh=_props.forceRefresh,forceRefresh=_props$forceRefresh===void 0?false:_props$forceRefresh,_props$getUserConfirm=_props.getUserConfirmation,getUserConfirmation=_props$getUserConfirm===void 0?getConfirmation:_props$getUserConfirm,_props$keyLength=_props.keyLength,keyLength=_props$keyLength===void 0?6:_props$keyLength;var basename=props.basename?stripTrailingSlash(addLeadingSlash(props.basename)):'';function getDOMLocation(historyState){var _ref=historyState||{},key=_ref.key,state=_ref.state;var _window$location=window.location,pathname=_window$location.pathname,search=_window$location.search,hash=_window$location.hash;var path=pathname+search+hash; true?Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename||hasBasename(path,basename),'You are attempting to use a basename on a page whose URL path does not begin '+'with the basename. Expected path \"'+path+'\" to begin with \"'+basename+'\".'):undefined;if(basename)path=stripBasename(path,basename);return createLocation(path,state,key);}function createKey(){return Math.random().toString(36).substr(2,keyLength);}var transitionManager=createTransitionManager();function setState(nextState){Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history,nextState);history.length=globalHistory.length;transitionManager.notifyListeners(history.location,history.action);}function handlePopState(event){// Ignore extraneous popstate events in WebKit.\nif(isExtraneousPopstateEvent(event))return;handlePop(getDOMLocation(event.state));}function handleHashChange(){handlePop(getDOMLocation(getHistoryState()));}var forceNextPop=false;function handlePop(location){if(forceNextPop){forceNextPop=false;setState();}else{var action='POP';transitionManager.confirmTransitionTo(location,action,getUserConfirmation,function(ok){if(ok){setState({action:action,location:location});}else{revertPop(location);}});}}function revertPop(fromLocation){var toLocation=history.location;// TODO: We could probably make this more reliable by\n// keeping a list of keys we've seen in sessionStorage.\n// Instead, we just default to 0 for keys we don't know.\nvar toIndex=allKeys.indexOf(toLocation.key);if(toIndex===-1)toIndex=0;var fromIndex=allKeys.indexOf(fromLocation.key);if(fromIndex===-1)fromIndex=0;var delta=toIndex-fromIndex;if(delta){forceNextPop=true;go(delta);}}var initialLocation=getDOMLocation(getHistoryState());var allKeys=[initialLocation.key];// Public interface\nfunction createHref(location){return basename+createPath(location);}function push(path,state){ true?Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(_typeof(path)==='object'&&path.state!==undefined&&state!==undefined),'You should avoid providing a 2nd state argument to push when the 1st '+'argument is a location-like object that already has state; it is ignored'):undefined;var action='PUSH';var location=createLocation(path,state,createKey(),history.location);transitionManager.confirmTransitionTo(location,action,getUserConfirmation,function(ok){if(!ok)return;var href=createHref(location);var key=location.key,state=location.state;if(canUseHistory){globalHistory.pushState({key:key,state:state},null,href);if(forceRefresh){window.location.href=href;}else{var prevIndex=allKeys.indexOf(history.location.key);var nextKeys=allKeys.slice(0,prevIndex===-1?0:prevIndex+1);nextKeys.push(location.key);allKeys=nextKeys;setState({action:action,location:location});}}else{ true?Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state===undefined,'Browser history cannot push state in browsers that do not support HTML5 history'):undefined;window.location.href=href;}});}function replace(path,state){ true?Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(_typeof(path)==='object'&&path.state!==undefined&&state!==undefined),'You should avoid providing a 2nd state argument to replace when the 1st '+'argument is a location-like object that already has state; it is ignored'):undefined;var action='REPLACE';var location=createLocation(path,state,createKey(),history.location);transitionManager.confirmTransitionTo(location,action,getUserConfirmation,function(ok){if(!ok)return;var href=createHref(location);var key=location.key,state=location.state;if(canUseHistory){globalHistory.replaceState({key:key,state:state},null,href);if(forceRefresh){window.location.replace(href);}else{var prevIndex=allKeys.indexOf(history.location.key);if(prevIndex!==-1)allKeys[prevIndex]=location.key;setState({action:action,location:location});}}else{ true?Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state===undefined,'Browser history cannot replace state in browsers that do not support HTML5 history'):undefined;window.location.replace(href);}});}function go(n){globalHistory.go(n);}function goBack(){go(-1);}function goForward(){go(1);}var listenerCount=0;function checkDOMListeners(delta){listenerCount+=delta;if(listenerCount===1&&delta===1){window.addEventListener(PopStateEvent,handlePopState);if(needsHashChangeListener)window.addEventListener(HashChangeEvent,handleHashChange);}else if(listenerCount===0){window.removeEventListener(PopStateEvent,handlePopState);if(needsHashChangeListener)window.removeEventListener(HashChangeEvent,handleHashChange);}}var isBlocked=false;function block(prompt){if(prompt===void 0){prompt=false;}var unblock=transitionManager.setPrompt(prompt);if(!isBlocked){checkDOMListeners(1);isBlocked=true;}return function(){if(isBlocked){isBlocked=false;checkDOMListeners(-1);}return unblock();};}function listen(listener){var unlisten=transitionManager.appendListener(listener);checkDOMListeners(1);return function(){checkDOMListeners(-1);unlisten();};}var history={length:globalHistory.length,action:'POP',location:initialLocation,createHref:createHref,push:push,replace:replace,go:go,goBack:goBack,goForward:goForward,block:block,listen:listen};return history;}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n historyState = historyState || window.history.state || {};\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? undefined !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n historyState = historyState || window.history.state || {};\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n }\n\n var location = _parsePath2['default'](path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n historyState = historyState || window.history.state || {};\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n }\n\n var location = _parsePath2['default'](path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n historyState = historyState || window.history.state || {};\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n }\n\n var location = _parsePath2['default'](path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n historyState = historyState || window.history.state || {};\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n }\n\n var location = _parsePath2['default'](path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? true ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? true ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n historyState = historyState || window.history.state || {};\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : tiny_invariant_esm(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(esm_extends[\"a\" /* default */])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : tiny_invariant_esm(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n extends_extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? 0 : tiny_invariant_esm(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? 0 : void 0;\n if (basename) path = stripBasename(path, basename);\n return history_createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0,esm_extends/* default */.Z)(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? 0 : void 0;\n var action = 'PUSH';\n var location = history_createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? 0 : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? 0 : void 0;\n var action = 'REPLACE';\n var location = history_createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? 0 : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : Object(tiny_invariant_esm[\"a\" /* default */])(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(esm_extends[\"a\" /* default */])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : Object(tiny_invariant_esm[\"a\" /* default */])(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(esm_extends[\"a\" /* default */])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : tiny_invariant_esm(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : tiny_invariant_esm(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? 0 : (0,tiny_invariant_esm/* default */.Z)(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? 0 : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0,esm_extends/* default */.Z)(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? 0 : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? 0 : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? 0 : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? 0 : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n !canUseDOM ? false ? 0 : tiny_invariant_invariant(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? 0 : void 0;\n if (basename) path = stripBasename(path, basename);\n return history_createLocation(path, state, key);\n }\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n var transitionManager = createTransitionManager();\n function setState(nextState) {\n (0,esm_extends/* default */.Z)(history, nextState);\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n var forceNextPop = false;\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n function push(path, state) {\n false ? 0 : void 0;\n var action = 'PUSH';\n var location = history_createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? 0 : void 0;\n window.location.href = href;\n }\n });\n }\n function replace(path, state) {\n false ? 0 : void 0;\n var action = 'REPLACE';\n var location = history_createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? 0 : void 0;\n window.location.replace(href);\n }\n });\n }\n function go(n) {\n globalHistory.go(n);\n }\n function goBack() {\n go(-1);\n }\n function goForward() {\n go(1);\n }\n var listenerCount = 0;\n function checkDOMListeners(delta) {\n listenerCount += delta;\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n var isBlocked = false;\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n var unblock = transitionManager.setPrompt(prompt);\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n return unblock();\n };\n }\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function history (cb) {\n assert.equal(typeof cb, 'function', 'sheet-router/history: cb must be a function')\n window.onpopstate = function () {\n cb({\n pathname: document.location.pathname,\n search: document.location.search,\n href: document.location.href,\n hash: document.location.hash\n })\n }\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? invariant(false, 'Browser history needs a DOM') : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".');\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history');\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history');\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(base = '') {\n let listeners = [];\n let queue = [START];\n let position = 0;\n function setLocation(location) {\n position++;\n if (position === queue.length) {\n // we are at the end, we can simply append a new entry\n queue.push(location);\n }\n else {\n // we are in the middle, we remove everything from here in the queue\n queue.splice(position);\n queue.push(location);\n }\n }\n function triggerListeners(to, from, { direction, delta }) {\n const info = {\n direction,\n delta,\n type: NavigationType.pop,\n };\n for (let callback of listeners) {\n callback(to, from, info);\n }\n }\n const routerHistory = {\n // rewritten by Object.defineProperty\n location: START,\n state: {},\n base,\n createHref: createHref.bind(null, base),\n replace(to) {\n // remove current entry and decrement position\n queue.splice(position--, 1);\n setLocation(to);\n },\n push(to, data) {\n setLocation(to);\n },\n listen(callback) {\n listeners.push(callback);\n return () => {\n const index = listeners.indexOf(callback);\n if (index > -1)\n listeners.splice(index, 1);\n };\n },\n destroy() {\n listeners = [];\n },\n go(delta, shouldTrigger = true) {\n const from = this.location;\n const direction = \n // we are considering delta === 0 going forward, but in abstract mode\n // using 0 for the delta doesn't make sense like it does in html5 where\n // it reloads the page\n delta < 0 ? NavigationDirection.back : NavigationDirection.forward;\n position = Math.max(0, Math.min(position + delta, queue.length - 1));\n if (shouldTrigger) {\n triggerListeners(this.location, from, {\n direction,\n delta,\n });\n }\n },\n };\n Object.defineProperty(routerHistory, 'location', {\n get: () => queue[position],\n });\n return routerHistory;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? \"development\" !== \"production\" ? (0, _tinyInvariant.default)(false, 'Browser history needs a DOM') : (0, _tinyInvariant.default)(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? \"development\" !== \"production\" ? (0, _tinyInvariant.default)(false, 'Browser history needs a DOM') : (0, _tinyInvariant.default)(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? \"development\" !== \"production\" ? (0, _tinyInvariant.default)(false, 'Browser history needs a DOM') : (0, _tinyInvariant.default)(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? \"development\" !== \"production\" ? (0, _tinyInvariant.default)(false, 'Browser history needs a DOM') : (0, _tinyInvariant.default)(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? \"development\" !== \"production\" ? (0, _tinyInvariant.default)(false, 'Browser history needs a DOM') : (0, _tinyInvariant.default)(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? \"development\" !== \"production\" ? (0, _tinyInvariant.default)(false, 'Browser history needs a DOM') : (0, _tinyInvariant.default)(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(base = '') {\r\n let listeners = [];\r\n let queue = [START];\r\n let position = 0;\r\n function setLocation(location) {\r\n position++;\r\n if (position === queue.length) {\r\n // we are at the end, we can simply append a new entry\r\n queue.push(location);\r\n }\r\n else {\r\n // we are in the middle, we remove everything from here in the queue\r\n queue.splice(position);\r\n queue.push(location);\r\n }\r\n }\r\n function triggerListeners(to, from, { direction, delta }) {\r\n const info = {\r\n direction,\r\n delta,\r\n type: NavigationType.pop,\r\n };\r\n for (const callback of listeners) {\r\n callback(to, from, info);\r\n }\r\n }\r\n const routerHistory = {\r\n // rewritten by Object.defineProperty\r\n location: START,\r\n // TODO: should be kept in queue\r\n state: {},\r\n base,\r\n createHref: createHref.bind(null, base),\r\n replace(to) {\r\n // remove current entry and decrement position\r\n queue.splice(position--, 1);\r\n setLocation(to);\r\n },\r\n push(to, data) {\r\n setLocation(to);\r\n },\r\n listen(callback) {\r\n listeners.push(callback);\r\n return () => {\r\n const index = listeners.indexOf(callback);\r\n if (index > -1)\r\n listeners.splice(index, 1);\r\n };\r\n },\r\n destroy() {\r\n listeners = [];\r\n queue = [START];\r\n position = 0;\r\n },\r\n go(delta, shouldTrigger = true) {\r\n const from = this.location;\r\n const direction = \r\n // we are considering delta === 0 going forward, but in abstract mode\r\n // using 0 for the delta doesn't make sense like it does in html5 where\r\n // it reloads the page\r\n delta < 0 ? NavigationDirection.back : NavigationDirection.forward;\r\n position = Math.max(0, Math.min(position + delta, queue.length - 1));\r\n if (shouldTrigger) {\r\n triggerListeners(this.location, from, {\r\n direction,\r\n delta,\r\n });\r\n }\r\n },\r\n };\r\n Object.defineProperty(routerHistory, 'location', {\r\n enumerable: true,\r\n get: () => queue[position],\r\n });\r\n return routerHistory;\r\n}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? ({\"AUTH0_CLIENT_ID\":\"vFL9QUjpiy8LmqgykJVXRhk7dYVvdEip\",\"AUTH0_DOMAIN\":\"edcheung.auth0.com\"}).NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Browser history needs a DOM') : invariant(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n process.env.NODE_ENV !== \"production\" ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}" ]
[ "0.7363786", "0.73297745", "0.73297745", "0.7308966", "0.7308966", "0.7308966", "0.7308966", "0.73071915", "0.7304227", "0.73013365", "0.72933525", "0.72880805", "0.7287984", "0.7283137", "0.7282849", "0.7282849", "0.7282849", "0.7282849", "0.7282849", "0.7254896", "0.72542816", "0.7246995", "0.7246995", "0.7246995", "0.7246995", "0.7246995", "0.7246995", "0.7246995", "0.7245706", "0.7245706", "0.7240051", "0.7240051", "0.7193388", "0.7192834", "0.7152764", "0.71492976", "0.7146992", "0.7146992", "0.7146992", "0.7146992", "0.71407115", "0.71407115", "0.71352947", "0.7121051", "0.7121051", "0.7121051", "0.7121051", "0.7121051", "0.7121051", "0.7121051", "0.7116488", "0.709515", "0.70789105", "0.7078873", "0.7078873", "0.7077523", "0.7077523", "0.70512795", "0.70085645", "0.6977358", "0.69563645", "0.6943973", "0.69053936", "0.69053936", "0.69053936", "0.69053936", "0.69053936", "0.69053936", "0.68969196", "0.68969196", "0.6875236", "0.6874416", "0.6834122", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307", "0.6788307" ]
0.0
-1
Creates a history object that stores locations in memory.
function createMemoryHistory(props) { if (props === void 0) { props = {}; } var _props = props, getUserConfirmation = _props.getUserConfirmation, _props$initialEntries = _props.initialEntries, initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries, _props$initialIndex = _props.initialIndex, initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex, _props$keyLength = _props.keyLength, keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength; var transitionManager = createTransitionManager(); function setState(nextState) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])(history, nextState); history.length = history.entries.length; transitionManager.notifyListeners(history.location, history.action); } function createKey() { return Math.random().toString(36).substr(2, keyLength); } var index = clamp(initialIndex, 0, initialEntries.length - 1); var entries = initialEntries.map(function (entry) { return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey()); }); // Public interface var createHref = createPath; function push(path, state) { false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0; var action = 'PUSH'; var location = createLocation(path, state, createKey(), history.location); transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { if (!ok) return; var prevIndex = history.index; var nextIndex = prevIndex + 1; var nextEntries = history.entries.slice(0); if (nextEntries.length > nextIndex) { nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location); } else { nextEntries.push(location); } setState({ action: action, location: location, index: nextIndex, entries: nextEntries }); }); } function replace(path, state) { false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0; var action = 'REPLACE'; var location = createLocation(path, state, createKey(), history.location); transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { if (!ok) return; history.entries[history.index] = location; setState({ action: action, location: location }); }); } function go(n) { var nextIndex = clamp(history.index + n, 0, history.entries.length - 1); var action = 'POP'; var location = history.entries[nextIndex]; transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { if (ok) { setState({ action: action, location: location, index: nextIndex }); } else { // Mimic the behavior of DOM histories by // causing a render after a cancelled POP. setState(); } }); } function goBack() { go(-1); } function goForward() { go(1); } function canGo(n) { var nextIndex = history.index + n; return nextIndex >= 0 && nextIndex < history.entries.length; } function block(prompt) { if (prompt === void 0) { prompt = false; } return transitionManager.setPrompt(prompt); } function listen(listener) { return transitionManager.appendListener(listener); } var history = { length: entries.length, action: 'POP', location: entries[index], index: index, entries: entries, createHref: createHref, push: push, replace: replace, go: go, goBack: goBack, goForward: goForward, canGo: canGo, block: block, listen: listen }; return history; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createMemoryHistory(base = '') {\n let listeners = [];\n let queue = [START];\n let position = 0;\n function setLocation(location) {\n position++;\n if (position === queue.length) {\n // we are at the end, we can simply append a new entry\n queue.push(location);\n }\n else {\n // we are in the middle, we remove everything from here in the queue\n queue.splice(position);\n queue.push(location);\n }\n }\n function triggerListeners(to, from, { direction, delta }) {\n const info = {\n direction,\n delta,\n type: NavigationType.pop,\n };\n for (let callback of listeners) {\n callback(to, from, info);\n }\n }\n const routerHistory = {\n // rewritten by Object.defineProperty\n location: START,\n state: {},\n base,\n createHref: createHref.bind(null, base),\n replace(to) {\n // remove current entry and decrement position\n queue.splice(position--, 1);\n setLocation(to);\n },\n push(to, data) {\n setLocation(to);\n },\n listen(callback) {\n listeners.push(callback);\n return () => {\n const index = listeners.indexOf(callback);\n if (index > -1)\n listeners.splice(index, 1);\n };\n },\n destroy() {\n listeners = [];\n },\n go(delta, shouldTrigger = true) {\n const from = this.location;\n const direction = \n // we are considering delta === 0 going forward, but in abstract mode\n // using 0 for the delta doesn't make sense like it does in html5 where\n // it reloads the page\n delta < 0 ? NavigationDirection.back : NavigationDirection.forward;\n position = Math.max(0, Math.min(position + delta, queue.length - 1));\n if (shouldTrigger) {\n triggerListeners(this.location, from, {\n direction,\n delta,\n });\n }\n },\n };\n Object.defineProperty(routerHistory, 'location', {\n get: () => queue[position],\n });\n return routerHistory;\n}", "function createMemoryHistory(base = '') {\r\n let listeners = [];\r\n let queue = [START];\r\n let position = 0;\r\n function setLocation(location) {\r\n position++;\r\n if (position === queue.length) {\r\n // we are at the end, we can simply append a new entry\r\n queue.push(location);\r\n }\r\n else {\r\n // we are in the middle, we remove everything from here in the queue\r\n queue.splice(position);\r\n queue.push(location);\r\n }\r\n }\r\n function triggerListeners(to, from, { direction, delta }) {\r\n const info = {\r\n direction,\r\n delta,\r\n type: NavigationType.pop,\r\n };\r\n for (const callback of listeners) {\r\n callback(to, from, info);\r\n }\r\n }\r\n const routerHistory = {\r\n // rewritten by Object.defineProperty\r\n location: START,\r\n // TODO: should be kept in queue\r\n state: {},\r\n base,\r\n createHref: createHref.bind(null, base),\r\n replace(to) {\r\n // remove current entry and decrement position\r\n queue.splice(position--, 1);\r\n setLocation(to);\r\n },\r\n push(to, data) {\r\n setLocation(to);\r\n },\r\n listen(callback) {\r\n listeners.push(callback);\r\n return () => {\r\n const index = listeners.indexOf(callback);\r\n if (index > -1)\r\n listeners.splice(index, 1);\r\n };\r\n },\r\n destroy() {\r\n listeners = [];\r\n queue = [START];\r\n position = 0;\r\n },\r\n go(delta, shouldTrigger = true) {\r\n const from = this.location;\r\n const direction = \r\n // we are considering delta === 0 going forward, but in abstract mode\r\n // using 0 for the delta doesn't make sense like it does in html5 where\r\n // it reloads the page\r\n delta < 0 ? NavigationDirection.back : NavigationDirection.forward;\r\n position = Math.max(0, Math.min(position + delta, queue.length - 1));\r\n if (shouldTrigger) {\r\n triggerListeners(this.location, from, {\r\n direction,\r\n delta,\r\n });\r\n }\r\n },\r\n };\r\n Object.defineProperty(routerHistory, 'location', {\r\n enumerable: true,\r\n get: () => queue[position],\r\n });\r\n return routerHistory;\r\n}", "function createMemoryHistory(base = '') {\r\n let listeners = [];\r\n let queue = [START];\r\n let position = 0;\r\n base = normalizeBase(base);\r\n function setLocation(location) {\r\n position++;\r\n if (position === queue.length) {\r\n // we are at the end, we can simply append a new entry\r\n queue.push(location);\r\n }\r\n else {\r\n // we are in the middle, we remove everything from here in the queue\r\n queue.splice(position);\r\n queue.push(location);\r\n }\r\n }\r\n function triggerListeners(to, from, { direction, delta }) {\r\n const info = {\r\n direction,\r\n delta,\r\n type: NavigationType.pop,\r\n };\r\n for (const callback of listeners) {\r\n callback(to, from, info);\r\n }\r\n }\r\n const routerHistory = {\r\n // rewritten by Object.defineProperty\r\n location: START,\r\n // TODO: should be kept in queue\r\n state: {},\r\n base,\r\n createHref: createHref.bind(null, base),\r\n replace(to) {\r\n // remove current entry and decrement position\r\n queue.splice(position--, 1);\r\n setLocation(to);\r\n },\r\n push(to, data) {\r\n setLocation(to);\r\n },\r\n listen(callback) {\r\n listeners.push(callback);\r\n return () => {\r\n const index = listeners.indexOf(callback);\r\n if (index > -1)\r\n listeners.splice(index, 1);\r\n };\r\n },\r\n destroy() {\r\n listeners = [];\r\n queue = [START];\r\n position = 0;\r\n },\r\n go(delta, shouldTrigger = true) {\r\n const from = this.location;\r\n const direction = \r\n // we are considering delta === 0 going forward, but in abstract mode\r\n // using 0 for the delta doesn't make sense like it does in html5 where\r\n // it reloads the page\r\n delta < 0 ? NavigationDirection.back : NavigationDirection.forward;\r\n position = Math.max(0, Math.min(position + delta, queue.length - 1));\r\n if (shouldTrigger) {\r\n triggerListeners(this.location, from, {\r\n direction,\r\n delta,\r\n });\r\n }\r\n },\r\n };\r\n Object.defineProperty(routerHistory, 'location', {\r\n enumerable: true,\r\n get: () => queue[position],\r\n });\r\n return routerHistory;\r\n}", "function History(){\n\n var self = this;\n this.commands = loadHistory();\n var currIndex = this.commands.length;\n\n this.add = function(command) {\n if(command == _.last(this.commands)) {\n currIndex = this.commands.length;\n return;\n }\n this.commands.push(command);\n var maxHistory = parseInt(env.env('maxHistory')) || $.fn.cli.env.maxHistory;\n if(this.commands.length > maxHistory){\n this.commands = _.last(this.commands, maxHistory);\n }\n currIndex = this.commands.length;\n saveHistory();\n }\n\n this.getPrevious = function() {\n if(currIndex>=0) currIndex--;\n return (this.commands.length && currIndex > -1) ? this.commands[currIndex] : null;\n }\n\n this.getNext = function() {\n if(currIndex<(this.commands.length)) currIndex++;\n return (this.commands.length && currIndex < this.commands.length) ? this.commands[currIndex] : null;\n }\n\n function saveHistory () {\n localStorage.setItem(historyStorageKey, JSON.stringify(self.commands));\n }\n function loadHistory () {\n var history = localStorage.getItem(historyStorageKey);\n return history ? JSON.parse(history) : [];\n }\n }", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries =\n _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex =\n _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(\n _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\n 'default'\n ],\n )(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random()\n .toString(36)\n .substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function(entry) {\n return typeof entry === 'string'\n ? createLocation(entry, undefined, createKey())\n : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true\n ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_4__['default'])(\n !(\n typeof path === 'object' &&\n path.state !== undefined &&\n state !== undefined\n ),\n 'You should avoid providing a 2nd state argument to push when the 1st ' +\n 'argument is a location-like object that already has state; it is ignored',\n )\n : undefined;\n var action = 'PUSH';\n var location = createLocation(\n path,\n state,\n createKey(),\n history.location,\n );\n transitionManager.confirmTransitionTo(\n location,\n action,\n getUserConfirmation,\n function(ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(\n nextIndex,\n nextEntries.length - nextIndex,\n location,\n );\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries,\n });\n },\n );\n }\n\n function replace(path, state) {\n true\n ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_4__['default'])(\n !(\n typeof path === 'object' &&\n path.state !== undefined &&\n state !== undefined\n ),\n 'You should avoid providing a 2nd state argument to replace when the 1st ' +\n 'argument is a location-like object that already has state; it is ignored',\n )\n : undefined;\n var action = 'REPLACE';\n var location = createLocation(\n path,\n state,\n createKey(),\n history.location,\n );\n transitionManager.confirmTransitionTo(\n location,\n action,\n getUserConfirmation,\n function(ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location,\n });\n },\n );\n }\n\n function go(n) {\n var nextIndex = clamp(\n history.index + n,\n 0,\n history.entries.length - 1,\n );\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(\n location,\n action,\n getUserConfirmation,\n function(ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex,\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n },\n );\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen,\n };\n return history;\n }", "function History() {\n // This is the actual buffer where previous commands are kept.\n // 'this._buffer[0]' should always be equal the empty string. This is so\n // that when you try to go in to the \"future\", you will just get an empty\n // command.\n this._buffer = [''];\n\n // This is an index in to the history buffer which points to where we\n // currently are in the history.\n this._current = 0;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n function setState(nextState) {\n (0,esm_extends/* default */.Z)(history, nextState);\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? history_createLocation(entry, undefined, createKey()) : history_createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n function push(path, state) {\n false ? 0 : void 0;\n var action = 'PUSH';\n var location = history_createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n function replace(path, state) {\n false ? 0 : void 0;\n var action = 'REPLACE';\n var location = history_createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n function goBack() {\n go(-1);\n }\n function goForward() {\n go(1);\n }\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n return transitionManager.setPrompt(prompt);\n }\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0,esm_extends/* default */.Z)(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? history_createLocation(entry, undefined, createKey()) : history_createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? 0 : void 0;\n var action = 'PUSH';\n var location = history_createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? 0 : void 0;\n var action = 'REPLACE';\n var location = history_createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createHistory() {\n var history = {\n 'subject' : string[1],\n 'date' : new Date().toString()\n };\n saveHistory(history);\n }", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0,esm_extends/* default */.Z)(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? 0 : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? 0 : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(esm_extends[\"a\" /* default */])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(esm_extends[\"a\" /* default */])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(esm_extends[\"a\" /* default */])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n extends_extends(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function History() {\n this.time = 0;\n this.done = []; this.undone = [];\n }", "function History() {\n this.time = 0;\n this.done = []; this.undone = [];\n }", "function History() {\n this.time = 0;\n this.done = []; this.undone = [];\n }", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__.default)(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__.default)(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__.default)(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__.default)(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "_setupHistory() {\n if (!this.history) {\n try{ this.history = createHistory(); }\n catch(e) { \n this.history = this.options.history || createMemoryHistory();\n this._isPhantomHistory = true; \n }\n } \n }", "function HistoryEntry(variables) {\n this.timestamp = Date.now();\n this.variables = variables;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n Object({\"API_URL\":\"http://localhost:4000/\",\"TIMEOUT\":50000}).NODE_ENV !== \"production\" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__[\"a\" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n Object({\"API_URL\":\"http://localhost:4000/\",\"TIMEOUT\":50000}).NODE_ENV !== \"production\" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__[\"a\" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__[\"a\" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__[\"a\" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__[\"a\" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__[\"a\" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "saveInHistory(state) {\n let histName = state.currentHistoryName;\n\n if (histName === null) {\n // New history row\n histName = this.getNewHistoryName(state);\n state.currentHistoryName = histName;\n }\n\n state.history[histName] = {\n name: histName,\n lastModification: Date.now(),\n points: state.points,\n links: state.links,\n tooltips: state.tooltips,\n defaultPointColor: state.defaultPointColor,\n defaultLinkColor: state.defaultLinkColor,\n defaultTooltipColor: state.defaultTooltipColor,\n defaultTooltipFontColor: state.defaultTooltipFontColor\n };\n\n this.storeHistory(state.history);\n }", "function addToHistory(location) {\n var newQueries;\n var maxHistorySize=5;\n var exists=false; //Check if location already exist in history list\n newQueries = getHistory();\n for(var u=0;u<newQueries.queries.length;u++) {\n if(location===newQueries.queries[u]) {\n exists=true;\n }\n }\n if(!exists) { //Location does not exist\n if(newQueries.queries.length>=maxHistorySize) {\n newQueries.queries.shift();\n }\n newQueries.queries.push(location);\n localStorage.setItem(storageItem, JSON.stringify(newQueries));\n }\n }", "function storeHistory() {\n var f = ioFile.open(historyOutFile, \"w\");\n f.write(JSON.stringify(history));\n f.close();\n if (debug)\n console.log(\"Have stored history to \" + historyOutFile);\n }", "serializeHistory(state) {\r\n if (!state)\r\n return null;\r\n // Ensure sure that all entries have url\r\n var entries = state.entries.filter(e => e.url);\r\n if (!entries.length)\r\n return null;\r\n // Ensure the index is in bounds.\r\n var index = (state.index || entries.length) - 1;\r\n index = Math.min(index, entries.length - 1);\r\n index = Math.max(index, 0);\r\n var historyStart = this.enableSaveHistory ? 0 : index;\r\n var historyEnd = this.enableSaveHistory ? entries.length : index + 1;\r\n var history = [];\r\n\r\n var saveScroll = this.prefBranch.getBoolPref(\"save.scrollposition\");\r\n var currentScroll = saveScroll && state.scroll ? JSON.stringify(state.scroll) : \"0,0\";\r\n if (currentScroll != \"0,0\")\r\n entries[index].scroll = currentScroll;\r\n\r\n for (let j = historyStart; j < historyEnd; j++) {\r\n try {\r\n let historyEntry = entries[j];\r\n let entry = {\r\n url: historyEntry.url,\r\n title: historyEntry.title || \"\",\r\n scroll: saveScroll && historyEntry.scroll || \"0,0\",\r\n };\r\n if (historyEntry.triggeringPrincipal_base64) {\r\n entry.triggeringPrincipal_base64 = historyEntry.triggeringPrincipal_base64;\r\n }\r\n history.push(entry);\r\n } catch (ex) {\r\n Tabmix.assert(ex, \"serializeHistory error at index \" + j);\r\n }\r\n }\r\n return {\r\n history: encodeURI(JSON.stringify(history)),\r\n index,\r\n scroll: currentScroll\r\n };\r\n }", "function History() {\n this.time = 0;\n this.done = []; this.undone = [];\n this.compound = 0;\n this.closed = false;\n }", "function History() {\n this.time = 0;\n this.done = []; this.undone = [];\n this.compound = 0;\n this.closed = false;\n }", "function History() {\n this.time = 0;\n this.done = []; this.undone = [];\n this.compound = 0;\n this.closed = false;\n }", "constructor(id) {\n this.id = id;\n this.history = [];\n }", "function LocationLog() {\n this.location = [];\n this.currentId = 0;\n}", "function createLocalHistory(array, storage){\n\tfor (var i = 0; i < array.length; i++)\n\t\tstorage.setItem(array[i],\"0\");\n}", "function History(client) {\n if (!(this instanceof History)) {\n return new History(client);\n }\n this.client = client;\n this.uriPrefix = client.uriPrefix;\n}", "function generateHistoryObject() {\n\n let o = {}\n\n for (let i = 0; i < 28; i++) {\n o[i] = 0\n }\n\n return o\n\n}", "function _createHistoryFrame() {\n\t\t\tvar $historyFrameName = \"unFocusHistoryFrame\";\n\t\t\t_historyFrameObj = document.createElement(\"iframe\");\n\t\t\t_historyFrameObj.setAttribute(\"name\", $historyFrameName);\n\t\t\t_historyFrameObj.setAttribute(\"id\", $historyFrameName);\n\t\t\t// :NOTE: _Very_ experimental\n\t\t\t_historyFrameObj.setAttribute(\"src\", 'javascript:;');\n\t\t\t_historyFrameObj.style.position = \"absolute\";\n\t\t\t_historyFrameObj.style.top = \"-900px\";\n\t\t\tdocument.body.insertBefore(_historyFrameObj,document.body.firstChild);\n\t\t\t// get reference to the frame from frames array (needed for document.open)\n\t\t\t// :NOTE: there might be an issue with this according to quirksmode.org\n\t\t\t// http://www.quirksmode.org/js/iframe.html\n\t\t\t_historyFrameRef = frames[$historyFrameName];\n\t\t\t\n\t\t\t// add base history entry\n\t\t\t_createHistoryHTML(_currentHash, true);\n\t\t}", "function setHistory() {\n // clear undo history\n $('#undoHistoryList')\n .empty();\n\n // load new history list from server\n getHistoryFromServer(addHistList);\n}", "function History() {\n}", "function History(size) {\n if (!(GM_setValue && GM_getValue)) {\n alert('Please upgrade to the latest version of Greasemonkey.');\n return;\n }\n this.index=0;\n this.size=size;\n //oldest items are at the front of the array\n //newest added to end\n this.code_history=new Array();\n}", "function save_history () {\n\tvar ds = currHds();\n\tedit_history [edit_history_index] = JSON.stringify(ds.toJSON());\n}", "function createMemoryHistory(props){if(props===void 0){props={};}var _props=props,getUserConfirmation=_props.getUserConfirmation,_props$initialEntries=_props.initialEntries,initialEntries=_props$initialEntries===void 0?['/']:_props$initialEntries,_props$initialIndex=_props.initialIndex,initialIndex=_props$initialIndex===void 0?0:_props$initialIndex,_props$keyLength=_props.keyLength,keyLength=_props$keyLength===void 0?6:_props$keyLength;var transitionManager=createTransitionManager();function setState(nextState){Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history,nextState);history.length=history.entries.length;transitionManager.notifyListeners(history.location,history.action);}function createKey(){return Math.random().toString(36).substr(2,keyLength);}var index=clamp(initialIndex,0,initialEntries.length-1);var entries=initialEntries.map(function(entry){return typeof entry==='string'?createLocation(entry,undefined,createKey()):createLocation(entry,undefined,entry.key||createKey());});// Public interface\nvar createHref=createPath;function push(path,state){ true?Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(_typeof(path)==='object'&&path.state!==undefined&&state!==undefined),'You should avoid providing a 2nd state argument to push when the 1st '+'argument is a location-like object that already has state; it is ignored'):undefined;var action='PUSH';var location=createLocation(path,state,createKey(),history.location);transitionManager.confirmTransitionTo(location,action,getUserConfirmation,function(ok){if(!ok)return;var prevIndex=history.index;var nextIndex=prevIndex+1;var nextEntries=history.entries.slice(0);if(nextEntries.length>nextIndex){nextEntries.splice(nextIndex,nextEntries.length-nextIndex,location);}else{nextEntries.push(location);}setState({action:action,location:location,index:nextIndex,entries:nextEntries});});}function replace(path,state){ true?Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(_typeof(path)==='object'&&path.state!==undefined&&state!==undefined),'You should avoid providing a 2nd state argument to replace when the 1st '+'argument is a location-like object that already has state; it is ignored'):undefined;var action='REPLACE';var location=createLocation(path,state,createKey(),history.location);transitionManager.confirmTransitionTo(location,action,getUserConfirmation,function(ok){if(!ok)return;history.entries[history.index]=location;setState({action:action,location:location});});}function go(n){var nextIndex=clamp(history.index+n,0,history.entries.length-1);var action='POP';var location=history.entries[nextIndex];transitionManager.confirmTransitionTo(location,action,getUserConfirmation,function(ok){if(ok){setState({action:action,location:location,index:nextIndex});}else{// Mimic the behavior of DOM histories by\n// causing a render after a cancelled POP.\nsetState();}});}function goBack(){go(-1);}function goForward(){go(1);}function canGo(n){var nextIndex=history.index+n;return nextIndex>=0&&nextIndex<history.entries.length;}function block(prompt){if(prompt===void 0){prompt=false;}return transitionManager.setPrompt(prompt);}function listen(listener){return transitionManager.appendListener(listener);}var history={length:entries.length,action:'POP',location:entries[index],index:index,entries:entries,createHref:createHref,push:push,replace:replace,go:go,goBack:goBack,goForward:goForward,canGo:canGo,block:block,listen:listen};return history;}", "function push_history() {\n\tedit_history_index++;\n\tsave_history();\n\tedit_history.length = edit_history_index+1;\n}", "function AddressHistory(args) {\n this.node = args.node;\n this.options = args.options;\n\n if(Array.isArray(args.addresses)) {\n this.addresses = args.addresses;\n } else {\n this.addresses = [args.addresses];\n }\n this.transactionInfo = [];\n this.combinedArray = [];\n this.detailedArray = [];\n}", "function retrieveHistory() {\n if (!localStorage.getItem('cities')) {\n localStorage.setItem('cities', JSON.stringify(searchHistory));\n } else {\n searchHistory = JSON.parse(localStorage.getItem('cities'));\n }\n}", "function History_History()\n{\n\t//call reset\n\tthis.Reset();\n}", "function gnc_getHistory() {\n var fakeHistory = {};\n for (property in history) {\n switch (property) {\n case 'length':\n Object.defineProperty(fakeHistory, property, {\n enumerable: true,\n get: function() { return gncHistoryLength; }\n });\n break;\n\n case 'go':\n fakeHistory[property] = function(delta) {\n if (!delta || delta === 0) {\n gnc_getLocation().reload();\n return;\n }\n\n window.parent.postMessage({ type: 'host-go', delta: delta }, '*');\n };\n break;\n\n case 'back':\n fakeHistory[property] = function() {\n window.parent.postMessage({ type: 'host-go', delta: -1 }, '*');\n };\n break;\n\n case 'forward':\n fakeHistory[property] = function() {\n window.parent.postMessage({ type: 'host-go', delta: 1 }, '*');\n };\n break;\n\n case 'pushState':\n fakeHistory[property] = function(state, title, url) {\n window.parent.postMessage({ type: 'host-pushstate',\n state: state,\n title: title,\n url: url }, '*');\n };\n break;\n\n case 'replaceState':\n fakeHistory[property] = function(state, title, url) {\n window.parent.postMessage({ type: 'host-replacestate',\n state: state,\n title: title,\n url: url }, '*');\n };\n break;\n\n default:\n fakeHistory[property] = history[property];\n }\n }\n\n return fakeHistory;\n}", "history(){\n this._history = true;\n return this;\n }", "getHistory() {\n return this.history;\n }", "getHistory() {\n return this.history;\n }", "function History(container, maxDepth, commitDelay, editor) {\n this.container = container;\n this.maxDepth = maxDepth; this.commitDelay = commitDelay;\n this.editor = editor; this.parent = editor.parent;\n // This line object represents the initial, empty editor.\n var initial = {text: \"\", from: null, to: null};\n // As the borders between lines are represented by BR elements, the\n // start of the first line and the end of the last one are\n // represented by null. Since you can not store any properties\n // (links to line objects) in null, these properties are used in\n // those cases.\n this.first = initial; this.last = initial;\n // Similarly, a 'historyTouched' property is added to the BR in\n // front of lines that have already been touched, and 'firstTouched'\n // is used for the first line.\n this.firstTouched = false;\n // History is the set of committed changes, touched is the set of\n // nodes touched since the last commit.\n this.history = []; this.redoHistory = []; this.touched = [];\n}", "function addHistory( data ) {\n\n if ( typeof(aio.history) != 'object' ) { aio.history = []; } // Change aio.history to array\n if ( typeof(aio.history) == 'object' && aio.history.length > 19 ) { aio.history.pop(); } // Delete oldest record if total exceeds 20\n\n // Add this new record\n aio.history.unshift( data );\n updateHistory();\n\n}", "function History(pn) {\n\t\tthis.queue = [];\n\t\tthis.parentname = pn;\n\t\tthis.currstate = clone(_GP[this.parentname]);\n\t\tthis.initialstate = clone(_GP[this.parentname]);\n\t\tthis.initialdate = new Date().getTime();\n\t}" ]
[ "0.6710825", "0.66617906", "0.6636309", "0.6517103", "0.6497341", "0.64954966", "0.64776564", "0.64506316", "0.6402563", "0.6384455", "0.6384455", "0.6384455", "0.6384455", "0.6384455", "0.6384455", "0.6378855", "0.6375972", "0.6373176", "0.63639265", "0.63639265", "0.63639265", "0.6341077", "0.63318783", "0.63318783", "0.63318783", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6324055", "0.6322008", "0.6322008", "0.6282947", "0.6282947", "0.6282947", "0.6282947", "0.62541705", "0.62284935", "0.6226507", "0.6226507", "0.6212568", "0.62081116", "0.62081116", "0.6176204", "0.6142791", "0.6124744", "0.60490775", "0.6035848", "0.6035848", "0.6035848", "0.59975874", "0.59792", "0.59756684", "0.5970956", "0.59474975", "0.5934086", "0.5913517", "0.591191", "0.586632", "0.58073896", "0.57989746", "0.5775478", "0.57234055", "0.5717342", "0.57024634", "0.5685756", "0.5647303", "0.56447667", "0.56447667", "0.56353736", "0.56043863", "0.55992585" ]
0.63322234
27
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. TODO ??? refactor? check the outer usage of data provider. merge with defaultDimValueGetter? If normal array used, mutable chunk size is supported. If typed array used, chunk size must be fixed.
function DefaultDataProvider(source, dimSize) { if (!Source.isInstance(source)) { source = Source.seriesDataToSource(source); } this._source = source; var data = this._data = source.data; var sourceFormat = source.sourceFormat; // Typed array. TODO IE10+? if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) { this._offset = 0; this._dimSize = dimSize; this._data = data; } var methods = providerMethods[sourceFormat === SOURCE_FORMAT_ARRAY_ROWS ? sourceFormat + '_' + source.seriesLayoutBy : sourceFormat]; extend(this, methods); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jdcDataProvider(o){\n\t//Too many characters/values set\n\tvar ret = {};\n\tvar cache = {}; //= dataArray; //cached slices\n\tvar calc = {}; //calculated definitions\n\tvar o;\n\n\tvar def = {\n\t\tall : '_', //used for where no filter on dimension\n\t\tfn : 'fn', //used for function branching\n\t\tresult : function(){ return 0; }, //to be a function - called for default result and map reduce\n\t\tindices : []\n\t}\n\n\tret.init = function(options){\n\t // Extend defaults\n\t var extended = def;\n\t for (var prop in options) {\n\t if (options.hasOwnProperty(prop)) {\n\t extended[prop] = options[prop];\n\t }\n\t }\n\t\to = ret.options = extended; //var o used for shorthand - will this lead to trouble later overriding o?\n\n\t\tret.dims={};\n\n\t\tfor(var i=0;i<o.dims.length;i++){\n\t\t\tconsole.log(i);\n\t\t\tvar d = o.dims[i];\n\t\t\tconsole.log(d);\n\t\t\tret.dims[i] = {}; //ordered map\n\t\t\tret.dims[d] = {}; //associative map\n\t\t\tret.dims[i].val=d; //e.g. [0].val = \"dim 1 Name\"\n\t\t\tret.dims[d].val=i; //e.g. [name].val = order\n\t\t\tret.dims[i].range = [];\n\t\t}\n\t\tconsole.log(o.dims.length);\n\t\t//New version - iterates over population once\n\t\tvar res={}, mre, val;\n\t\tfor(var j=0;j<o.dims.length;j++){\n\t\t\tres[o.dims[j]]={};\n\t\t}\n\t\tvar vals = o.data.reduce(function(res,e,i,a){\n\t\t\tfor(var j=0;j<o.dims.length;j++){\n\t\t\t\tmre=o.dims[j];\n\t\t\t\tval=wlk(e,mre);\n\t\t\t\tif(!res[mre][val]){\n\t\t\t\t\tres[mre][val]={ \"n\":0, \"val\":0.0 };\n\t\t\t\t\tret.dims[j].range.push(val);\n\t\t\t\t}\n\t\t\t\tres[mre][val][\"n\"]++;\n\t\t\t\tres[mre][val][\"val\"]+=e[\"Price\"];\n\t\t\t}\n\t\t\treturn res;\n\t\t},res);\n\t\tfor(var j=0;j<o.dims.length;j++){\n\t\t\tret.dims[j].range.sort();\n\t\t}\n\t\tconsole.log(res);\n\t\tif(o.cache){\n\t\t\tcache = o.cache;\n\t\t}\n\n\t\treturn ret;\n\t}\n\n\t//Where should order of keys be controlled?\n\tret.idString = function(keys){\n\t\tvar res = [];\n\t\tfor(var i=0;i<o.dims.length;i++){\n\t\t\tres.push(def.all); //Push blank for no filter\n\t\t}\n\t\tfor(k in keys){\n\t\t\tif(ret.dims[k]){\n\t\t\t\tvar r = f(keys[k]);\n\t\t\t\tres[ret.dims[k].val] = r.label || r; //use f to resolve function here - need to make this generic\n\t\t\t} else {\n\t\t\t\tif(k.indexOf(def.fn)<1){\n\t\t\t\t\tconsole.log(\"Invalid key: \" + k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tres[ret.dims[\"mre\"].val]=def.all; //Set mre to all as measures in object\n\t\treturn res.join('|');\n\t}\n\n\t//Key expanded to include all dimensions\n\tret.fullKey = function(keys){\n\t\tvar res = {};\n\t\tfor(var i=0;i<o.dims.length;i++){\n\t\t\tres[o.dims[i]]=def.all; //using '' causes problems - don't know why\n\t\t}\n\t\tfor(k in keys){ //would $.extend be better? - check k is in result\n\t\t\tif(ret.dims[k]){\n\t\t\t\tres[k] = f(keys[k]); //use f to resolve function here - need to make this generic\n\t\t\t} else {\n\t\t\t\tif(k.indexOf(def.fn)<1){\n\t\t\t\t\tconsole.log(\"Invalid key: \" + k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}\n\n\t//New Reduce Functionality\n\tfunction objInKey(obj,key){\n\t\tres=true;\n\t\tfor(k in key){\n\t\t\tvar v=key[k];\n\t\t\tvar o=wlk(obj,k); // walks if nested\n\t\t\tif(typeof(v)==='object'){ //allDims firing initial function\n\t\t\t\tif(v.fn){\n\t\t\t\t\tres=v.fn(o);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(v!==\"_\"){\n\t\t\t\t\tif(o){\n\t\t\t\t\t\tres=((o===v)||(+o===+v));\n\t\t\t\t\t//console.log(\"fn objInKey - value comparison - \" + obj[k] + \" with \" + v);\n\t\t\t\t\t} else { return false; } //value key with no corresponding key in object\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(res===false){ return false };\n\t\t}\n\t\treturn true;\n\t}\n\n\tfunction keyFilter(key,field){\n\t\treturn function(obj,i,a){\n\t\t\tif(objInKey(obj,key)){\n\t\t\t\tif(!field) return obj;\n\t\t\t\treturn wlk(obj,field); //return the target field\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction keyFilterReduce(key,field){\n\t\treturn function(res,obj,i,a){\n\t\t\tres.push(wlk(obj,field)); //return the target field\n\t\t\treturn res;\n\t\t}\n\t}\n\n\tfunction kFilter(key){\n\t\treturn function(obj,i,a){\n\t\t\treturn objInKey(obj,key);\n\t\t}\n\t}\n\n\tfunction keyReduce(key){ //want this to be the stats\n\t\treturn function(res, obj) {\n\t\t\tif(objInKey(obj,key)){\n\t\t\t\tvar v=obj.values;\n\t\t\t\tfor(var i=0;i<v.length;i++){\n\t\t\t\t\tres[i]+=v[i];\n\t\t\t\t}\n\t\t\t}\n\t\t return res;\n\t\t}\n\t}\n\n\tfunction fillArray(value, len) {\n\t var arr = [];\n\t for (var i=0; i<len; i++) {\n\t arr.push(value);\n\t };\n\t return arr;\n\t}\n\n\tfunction filterData(key){ //should always be a full key\n\t\t//return a filtered set of data based on ordered indices supplied\n\t\t//if(o.indices.length>0){ //need to ensure default value\n\t\t//o.indices.each(function(index,i,a)){ //object with indices - confirmed can rely on ordering - won't work as return won't exit loop\n\t\tfor (var i=0; i<o.indices.length; i++) {\n\t\t\tvar index = o.indices[i];\n\t\t\tif(index[\"field\"]){\n\t\t\t\tif(index[\"field\"] in key){ //should maybe use hasOwnProperty\n\t\t\t\t\tvar v=key[index[\"field\"]]; //index used\n\t\t\t\t\tif(v!==\"_\" && typeof(v)!=='object'){ //not all and not an object\n\t\t\t\t\t\treturn index[\"index\"][v].map(function(e,i,a){\n\t\t\t\t\t\t\tindex[\"indexMap\"][e]; //iterate through index to return array of objects\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn o.data;\n\t}\n\n\t//may rename to get measures\n\tret.getValues = function(key){ //same interface as previous - key has already been processed though fullkey function\n\t\t//var population = filterData(ret.fullKey(key)).filter(kFilter(key));\n\t\tvar keyAllMre = ret.fullKey(key);\n\t\tkeyAllMre[\"mre\"] = def.all;\n\t\t//console.log(ret.idString(keyAllMre));\n\t\tvar pop = filterData(keyAllMre).filter(kFilter(keyAllMre));\n\t\t//console.log(pop[0]);\n\t\t//console.log(pop.length);\n\t\t//population = population.reduce(keyFilterReduce(key,\"Price\"),[]);\n\t\tvar population = pop.reduce(function(r,e,i,a){ if(e[\"Price\"]) { r.push(e[\"Price\"]);} return r; },[]);\n\t\t//console.log(population[0]);\n\t\t//console.log(population.length);\n\t\tvar r = population.stats();\n\t\t//console.log(r);\n\t\treturn {\n\t\t\tid : ret.idString(key),\n\t\t\tkey : key,\n\t\t\tvalue : population.stats() //introduces filter on an index - need to parameterise\n\t\t}\n\t}\n\n\t//function to return population of array objects without summarisation\n\tret.getPopulation = function(key){ //same interface as previous - key has already been processed though fullkey function\n\t\tconsole.log(\"getPopulation\");\n\t\treturn {\n\t\t\tid : ret.idString(key), //arguable this is not required\n\t\t\tkey : key,\n\t\t\tvalue : filterData(ret.fullKey(key)).filter(kFilter(key)) //introduces filter on an index\n\t\t}\n\t}\n\n\tret.segmentSum = function(key,range){ //this should be accessible as string or object key\n\t\treturn ret.segmentRange(key,range).reduce( function(previousValue, currentValue, index, array){\n\t\t\t\treturn previousValue + currentValue;\n\t\t\t});\n\t}\n\n\tret.segment = function(key,range){ //range can be single value or array with 2 values - index and offset\n\t\tvar res = ret.segmentFromCache(key);\n\t\t/*var r = range;\n\t\tvar r0, r1;\n\t\tif(r){\n\t\t\tr0 = r[0] || r; r0 = f(r0);\n\t\t\tr1 = r[1] || r0+1; r1 = f(r1);\n\t\t\tif(r1<r0){\n\t\t\t\tif(r1<0) {\n\t\t\t\t\tr0 += r1+1;\n\t\t\t\t\tr1 = r0-r1;\n\t\t\t\t} else {\n\t\t\t\t\tr1 += r0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn (!range ? res : res.slice(r0,r1));*/\n\t\treturn res;\n\t}\n\n\tret.segmentFromCache = function(key){ //cache will use string key\n\t\t//console.log(ret.idString(key));\n\t\treturn (cache[ret.idString(key)] ? cache[ret.idString(key)][key[\"mre\"]] : ret.fillCache(key));\n\t}\n\n\tret.fillCache = function(key){ //should be a private function\n\t\tvar res;\n\t\tif(key.xfn){\n\t\t\tif(key.xfn.fn){\n\t\t\t\tif(key.xfn.fn){ //is it a calculated field - check definitions?\n\t\t\t\t\tres = calc[key.xfn.fn](key);\n\t\t\t\t\tcache[res.id] = res.value;\n\t\t\t\t}\n\t\t\t} else if(calc[key.xfn]){ //is it a calculated field - check definitions?\n\t\t\t\tres = calc[key.xfn](key);\n\t\t\t\tcache[res.id] = res.value;\n\t\t\t} else {\n\t\t\t\tconsole.log(\"Error - transform function not logged\");\n\t\t\t}\n\t\t} else {\n\t\t\tres = ret.getValues(ret.fullKey(key));\n\t\t\tcache[res.id] = res.value;\n\t\t}\n\t\treturn cache[res.id][key[\"mre\"]]; //different as now returning a measure within an object of measures - not presently an array - this may need to change\n\t}\n\n\tfunction preCalculated(key){\n\t\t//console.log(\"preCalc Fired\");\n\t\t//console.log(ret.idString(key));\n\t\tfor(k in key){\n\t\t\tif(!preCalc[k][key[k]]){\n\t\t\t\treturn false; //return as soon as failed\n\t\t\t}\n\t\t}\n\t\t//console.log(\"preCalc Fired - & short circuited\");\n\t\treturn true;\n\t}\n\n\tvar measureChange = function(key){\n\t\tvar newKey=$.extend({},key);\n\t\tnewKey.mre = f(newKey.mre).replace('Chg','');\n\t\tdelete newKey.xfn; //need to delete or\n\t\tvar values = ret.segment(newKey);\n\t\tvar res=[0];\n\t\tfor(var i=1;i<values.length;i++){\n\t\t\tres.push(values[i]-values[i-1]);\n\t\t}\n\t\treturn { id : ret.idString(key), key : key, value : res }\n\t}\n\n\tvar chg = function(dim,suffix,transform){\n\t\treturn function(key){\n\t\t\tvar base = $.extend({},key);\n\t\t\tbase[dim] = f(base[dim]).replace(suffix,'');\n\t\t\tdelete base[transform]; //necessary to stop looking in calc\n\t\t\tvar values = ret.segment(base);\n\t\t\tvar res=[0];\n\t\t\tfor(var i=1;i<values.length;i++){\n\t\t\t\tres.push(values[i]-values[i-1]);\n\t\t\t}\n\t\t\treturn { id : ret.idString(key), key : key, value : res }\n\t\t}\n\t}\n\n\tvar ofTotal = function(dim,suffix,transform,total){\n\t\treturn function(key){\n\t\t\tvar base = $.extend({},key);\n\t\t\tbase[dim] = f(base[dim]).replace(suffix,''); //Change this to add suffix later & output\n\t\t\tdelete base[transform];\n\t\t\tvar values = ret.segment(base);\n\t\t\tfor(k in total){\n\t\t\t\tif(base[k]){\n\t\t\t\t\tbase[k]=total[k];\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar div = ret.segment(base);\n\t\t\tvar res = [];\n\t\t\tfor(var i=0;i<values.length;i++){\n\t\t\t\tres.push(div[i]===0 ? 0 : values[i]/div[i] );\n\t\t\t}\n\t\t\treturn { id : ret.idString(key), key : key, value : res }\n\t\t}\n\t}\n\n\tvar ofTot = function(transform){\n\t\treturn function(key){\n\t\t\tvar tfm = $.extend({},key[transform]);\n\t\t\tvar base = $.extend({},key,tfm.args[0]);\n\t\t\tdelete base[transform];\n\t\t\tvar divKey = $.extend({},base,tfm.args[1]);\n\t\t\t//console.log(divKey);\n\t\t\tvar val = ret.segment(base);\n\t\t\tvar div = ret.segment(divKey);\n\t\t\tvar vals = [];\n\t\t\tfor(var i=0;i<val.length;i++){\n\t\t\t\tvals.push(div[i]===0 ? 0 : val[i]/div[i] );\n\t\t\t}\n\t\t\treturn { id : ret.idString(key), key : key, value : vals }\n\t\t}\n\t}\n\n\t//calc['Chg'] = measureChange;\n\tcalc['Chg'] = chg('mre','Chg','xfn');\n\tcalc['ofTotalArr'] = ofTotal('uom','OfTotal','xfn', {arr : xfFilter('arr','All',function(){ return d>0; })});\n\tcalc['ofTotalEnt'] = ofTotal('uom','OfTotal','xfn', {ent : '_'});\n\tcalc['rate'] = ofTotal('mre','Rate','xfn', {mre : 'Bal'});//This will change to the following\n\t//calc['rate'] = ofTotal('mre','Rate','xfn', {mre : 'Bal'});\n\tcalc['ofTotal'] = ofTot('xfn');\n\n\treturn ret.init(o);\n}", "function processDimsWithMeasure()\r\n {\r\n var startIndex = 0,\r\n endIndex = data_.values.length;\r\n var dimInRow = dimInRow_,\r\n dimInCol = dimInCol_;\r\n var bMNDInner = false,\r\n bMNDInRow = true;\r\n var i;\r\n if(data_.values[0].type === \"MND\")\r\n {\r\n ++startIndex;\r\n if(dimInRow > 0){ \r\n --dimInRow;\r\n } else {\r\n --dimInCol;\r\n bMNDInRow = false;\r\n }\r\n }\r\n\r\n if(data_.values[endIndex - 1].type === \"MND\")\r\n {\r\n bMNDInner = true;\r\n --endIndex;\r\n if(dimInCol > 0)\r\n {\r\n --dimInCol;\r\n bMNDInRow = false;\r\n }else{\r\n bMNDInRow = true;\r\n --dimInRow;\r\n }\r\n }\r\n\r\n //process no MND cases first\r\n if(startIndex < endIndex)\r\n {\r\n //some dimension in row and some in column \r\n var rowIndexs = [];\r\n if(dimInCol > 0 || dimInRow > 0)\r\n {\r\n //process row dimension first\r\n rowIndexs[0] = 0;\r\n rowCount_ = 0;\r\n if(dimInRow > 0)\r\n {\r\n buildRowDimension(dimInRow, startIndex, rowIndexs);\r\n }else{\r\n rowCount_ = 1;\r\n for(i = 1; i < data_.values[startIndex].rows.length; ++i){\r\n rowIndexs[i] = 0;\r\n }\r\n }\r\n \r\n //build column dimensions and indexes\r\n var colIndexs = [];\r\n if(dimInCol > 0)\r\n {\r\n colIndexs = processColHeader(startIndex + dimInRow, dimInCol);\r\n }else{\r\n colCount_ = 1;\r\n for(i = 0; i < data_.values[startIndex].rows.length; ++i){\r\n colIndexs[i] = 0;\r\n }\r\n }\r\n \r\n //generate data context for each sub chart\r\n ctx_ = new Array(rowCount_);\r\n for(i = 0; i < rowCount_; ++i)\r\n {\r\n ctx_[i] = [];\r\n for(var j = 0; j < colCount_; ++j){\r\n ctx_[i][j] = null;\r\n }\r\n }\r\n\r\n for(i = 0 ; i < data_.values[startIndex].rows.length; ++i)\r\n {\r\n ctx_[rowIndexs[i]][colIndexs[i]] = data_.values[startIndex + dimInRow + dimInCol - 1].rows[i].ctx;\r\n }\r\n }\r\n \r\n //process measure names at last\r\n if(dimInRow < dimInRow_ || dimInCol < dimInCol_)\r\n {\r\n addMND(bMNDInner, bMNDInRow, dimInRow, dimInCol);\r\n }\r\n }\r\n }", "getDimensions(data){\n const n = data.length;\n const p = data[0].length ? data[0].length: 1;\n return {rows: n,cols: p}\n }", "function processOneAxisValue(feed)\r\n {\r\n var dataset = [];\r\n var i, j, k;\r\n var measureData;\r\n if (feed.values.length <= 0){\r\n return dataset;\r\n }\r\n if (hasMND && !bMNDOnColor)\r\n {\r\n for(j = 0; j < feed.values[0].rows.length; ++j)\r\n { \r\n measureData = new Array(feed.values.length * feed.values[0].rows[0].length);\r\n for(k = 0; k < feed.values[0].rows[0].length; ++k)\r\n {\r\n for(i = 0 ; i < feed.values.length; ++i)\r\n {\r\n var dataPoint = {};\r\n dataPoint.val = feed.values[i].rows[j][k].val;\r\n dataPoint.ctx = feed.values[i].rows[j][k].ctx;\r\n dataPoint.info = feed.values[i].rows[j][k].info;\r\n if(bMNDInner){\r\n measureData[k * feed.values.length + i] = dataPoint;\r\n } else {\r\n measureData[i * feed.values[0].rows[0].length + k] = dataPoint; \r\n }\r\n }\r\n }\r\n dataset.push(measureData);\r\n } \r\n }\r\n else // MND on Region color or no MND\r\n {\r\n dataset = new Array(feed.values.length * feed.values[0].rows.length);\r\n\r\n for(i = 0 ; i < feed.values.length; ++i)\r\n {\r\n for(j = 0; j < feed.values[0].rows.length; ++j)\r\n { \r\n measureData = feed.values[i].rows[j];\r\n if(!hasMND || !bMNDInner){\r\n dataset[i * feed.values[0].rows.length + j] = measureData;\r\n } else {\r\n dataset[j * feed.values.length + i] = measureData;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return dataset;\r\n }", "addDimension(changeValueDimensions) {\n const that = this;\n\n if (that._suppressDimensionChange !== true && that.dimensions === 32) {\n return;\n }\n\n const indexer = document.createElement('jqx-numeric-text-box');\n\n indexer.className = 'jqx-array-indexer';\n indexer.style.height = that.indexerHeight + 'px';\n indexer.inputFormat = 'integer';\n indexer.spinButtons = true;\n indexer.min = 0;\n indexer.max = 4294967295;\n indexer.disabled = that.disabled;\n indexer.animation = that.animation;\n indexer.validation = 'interaction';\n indexer.wordLength = 'uint64';\n indexer.onReady = function () {\n indexer.$upButton.addClass('jqx-array-indexer-increment');\n indexer.$downButton.addClass('jqx-array-indexer-decrement');\n }\n\n that.$.indexerContainer.insertBefore(indexer, that.$.indexerContainer.children ? that.$.indexerContainer.children[0] : null);\n\n indexer.$.listen('change', that._indexerChangeHandler.bind(that));\n\n that._dimensions.push({ index: that._dimensions.length, indexer: indexer });\n\n if (that.arrayIndexingMode === 'LabVIEW') {\n that._indexers.unshift(indexer);\n that._coordinates.unshift(0);\n }\n else {\n that._indexers.push(indexer);\n that._coordinates.push(0);\n }\n\n indexer.dimension = that._indexers.length - 1;\n\n if (that._suppressDimensionChange !== true) {\n that.dimensions += 1;\n that.$.fireEvent('dimensionChange', { 'type': 'add' });\n }\n\n if (that._initialDimensions !== true && changeValueDimensions !== false) {\n that._validateValueArrayDimensions();\n\n if (that.arrayIndexingMode === 'LabVIEW') {\n that._filledUpTo.unshift(0);\n }\n else {\n that._filledUpTo.push(0);\n }\n\n if (that._oneDimensionSpecialCase === true) {\n that._oneDimensionSpecialCase = false;\n that.$.verticalScrollbar.value = 0;\n that._scroll();\n }\n }\n\n if (that._absoluteSelectionStart !== undefined) {\n if (that.arrayIndexingMode === 'LabVIEW') {\n that._absoluteSelectionStart.unshift(0);\n }\n else {\n that._absoluteSelectionStart.push(0);\n }\n }\n\n if (that._absoluteSelectionEnd !== undefined) {\n if (that.arrayIndexingMode === 'LabVIEW') {\n that._absoluteSelectionEnd.unshift(0);\n }\n else {\n that._absoluteSelectionEnd.push(0);\n }\n }\n\n if (!that._initialDimensions) {\n that._refreshSelection();\n }\n\n if (that._suppressDimensionChange === false && that.showIndexDisplay === true && (that.dimensions * (that.indexerHeight + 4) - 2 > that._cachedHeight)) {\n that._updateWidgetHeight('dimensions');\n }\n }", "_validateValueArrayDimensions() {\n const that = this;\n let dimensions = 0,\n tempArray = that.value,\n emptyArray = false;\n\n while (tempArray.constructor === Array) {\n dimensions++;\n tempArray = tempArray[0];\n\n if (tempArray === undefined) {\n emptyArray = true;\n break;\n }\n }\n\n if (that.dimensions > dimensions) {\n if (emptyArray) {\n that.value = that._returnEmptyArray();\n return;\n }\n\n while (that.dimensions > dimensions) {\n that._addDimensionToJSArray(dimensions);\n dimensions++;\n }\n }\n }", "constructor(){ \n this.queryArr = []; \n this.valuesArray = []; \n this.chunkSize = 10; \n }", "function getCustomDims() {\n var dims = [];\n \n // client id\n \n var tracker = ga.getByName('t0');\n \n dims.push( {slot: 11, value: tracker.get('clientId')} );\n \n if (typeof dataLayer.user === 'object') {\n \n var loggedIn = 'not logged in';\n var ban = 'not set';\n var userID = 'not set';\n \n if (dataLayer.user.userid) {\n userID = dataLayer.user.userid;\n loggedIn = 'logged in';\n \n }\n \n dims.push( {slot: 1, value: userID},\n {slot: 4, value: loggedIn});\n \n if (dataLayer.user.ban) {\n ban = dataLayer.user.ban;\n }\n \n dims.push({slot: 2, value: ban});\n \n }\n \n // FlashTalking parameters\n var ft_paramid = self.getQueryParam('FT_ParamIDs');\n\n // check if FT parameters exist but missing '?' so it's a part of the pathname\n if (ft_paramid === null) {\n ft_paramid = self.pathname.match(/FT_ParamIDs=([^&]*)/);\n \n if (ft_paramid)\n ft_paramid = ft_paramid[1];\n }\n \n if (ft_paramid !== null) {\n dims.push( {slot: 8, value: ft_paramid},\n {slot: 9, value: ft_paramid});\n }\n \n // Internal promos\n \n var cm_re = self.getQueryParam('cm_re');\n if (cm_re !== null)\n dims.push({slot: 3, value: cm_re});\n \n var purchaser = 'no';\n \n // purchaser - set on confirmation pages\n if (dataLayer.page && dataLayer.page.type === 'order_receipt_page') {\n purchaser = 'yes';\n }\n \n dims.push({slot: 5, value: purchaser});\n \n // page tracking\n dims.push({slot: 17, value: self.pathname + self.query + self.anchor});\n \n return dims;\n }", "function Dataset() {\n this.data = [];\n this.max = 0;\n this.min = 0;\n this.range = 0;\n this.size = 0;\n Object.defineProperty(\n this,\n 'length',\n { get: function() { return this.data.length; } }\n );\n if( ( arguments.length > 0 ) && ( arguments[ 0 ] instanceof Array ) ) {\n this.load( arguments[ 0 ] );\n }\n }", "function dimension(value) {\n\t var dimension = {\n\t filter: filter,\n\t filterExact: filterExact,\n\t filterRange: filterRange,\n\t filterFunction: filterFunction,\n\t filterAll: filterAll,\n\t top: top,\n\t bottom: bottom,\n\t group: group,\n\t groupAll: groupAll,\n\t dispose: dispose,\n\t remove: dispose // for backwards-compatibility\n\t };\n\n\t var one = ~m & -~m, // lowest unset bit as mask, e.g., 00001000\n\t zero = ~one, // inverted one, e.g., 11110111\n\t values, // sorted, cached array\n\t index, // value rank ↦ object id\n\t newValues, // temporary array storing newly-added values\n\t newIndex, // temporary array storing newly-added index\n\t sort = quicksort_by(function(i) { return newValues[i]; }),\n\t refilter = crossfilter_filterAll, // for recomputing filter\n\t refilterFunction, // the custom filter function in use\n\t indexListeners = [], // when data is added\n\t dimensionGroups = [],\n\t lo0 = 0,\n\t hi0 = 0;\n\n\t // Updating a dimension is a two-stage process. First, we must update the\n\t // associated filters for the newly-added records. Once all dimensions have\n\t // updated their filters, the groups are notified to update.\n\t dataListeners.unshift(preAdd);\n\t dataListeners.push(postAdd);\n\n\t removeDataListeners.push(removeData);\n\n\t // Incorporate any existing data into this dimension, and make sure that the\n\t // filter bitset is wide enough to handle the new dimension.\n\t m |= one;\n\t if (M >= 32 ? !one : m & -(1 << M)) {\n\t filters = crossfilter_arrayWiden(filters, M <<= 1);\n\t }\n\t preAdd(data, 0, n);\n\t postAdd(data, 0, n);\n\n\t // Incorporates the specified new records into this dimension.\n\t // This function is responsible for updating filters, values, and index.\n\t function preAdd(newData, n0, n1) {\n\n\t // Permute new values into natural order using a sorted index.\n\t newValues = newData.map(value);\n\t newIndex = sort(crossfilter_range(n1), 0, n1);\n\t newValues = permute(newValues, newIndex);\n\n\t // Bisect newValues to determine which new records are selected.\n\t var bounds = refilter(newValues), lo1 = bounds[0], hi1 = bounds[1], i;\n\t if (refilterFunction) {\n\t for (i = 0; i < n1; ++i) {\n\t if (!refilterFunction(newValues[i], i)) filters[newIndex[i] + n0] |= one;\n\t }\n\t } else {\n\t for (i = 0; i < lo1; ++i) filters[newIndex[i] + n0] |= one;\n\t for (i = hi1; i < n1; ++i) filters[newIndex[i] + n0] |= one;\n\t }\n\n\t // If this dimension previously had no data, then we don't need to do the\n\t // more expensive merge operation; use the new values and index as-is.\n\t if (!n0) {\n\t values = newValues;\n\t index = newIndex;\n\t lo0 = lo1;\n\t hi0 = hi1;\n\t return;\n\t }\n\n\t var oldValues = values,\n\t oldIndex = index,\n\t i0 = 0,\n\t i1 = 0;\n\n\t // Otherwise, create new arrays into which to merge new and old.\n\t values = new Array(n);\n\t index = crossfilter_index(n, n);\n\n\t // Merge the old and new sorted values, and old and new index.\n\t for (i = 0; i0 < n0 && i1 < n1; ++i) {\n\t if (oldValues[i0] < newValues[i1]) {\n\t values[i] = oldValues[i0];\n\t index[i] = oldIndex[i0++];\n\t } else {\n\t values[i] = newValues[i1];\n\t index[i] = newIndex[i1++] + n0;\n\t }\n\t }\n\n\t // Add any remaining old values.\n\t for (; i0 < n0; ++i0, ++i) {\n\t values[i] = oldValues[i0];\n\t index[i] = oldIndex[i0];\n\t }\n\n\t // Add any remaining new values.\n\t for (; i1 < n1; ++i1, ++i) {\n\t values[i] = newValues[i1];\n\t index[i] = newIndex[i1] + n0;\n\t }\n\n\t // Bisect again to recompute lo0 and hi0.\n\t bounds = refilter(values), lo0 = bounds[0], hi0 = bounds[1];\n\t }\n\n\t // When all filters have updated, notify index listeners of the new values.\n\t function postAdd(newData, n0, n1) {\n\t indexListeners.forEach(function(l) { l(newValues, newIndex, n0, n1); });\n\t newValues = newIndex = null;\n\t }\n\n\t function removeData(reIndex) {\n\t for (var i = 0, j = 0, k; i < n; ++i) {\n\t if (filters[k = index[i]]) {\n\t if (i !== j) values[j] = values[i];\n\t index[j] = reIndex[k];\n\t ++j;\n\t }\n\t }\n\t values.length = j;\n\t while (j < n) index[j++] = 0;\n\n\t // Bisect again to recompute lo0 and hi0.\n\t var bounds = refilter(values);\n\t lo0 = bounds[0], hi0 = bounds[1];\n\t }\n\n\t // Updates the selected values based on the specified bounds [lo, hi].\n\t // This implementation is used by all the public filter methods.\n\t function filterIndexBounds(bounds) {\n\t var lo1 = bounds[0],\n\t hi1 = bounds[1];\n\n\t if (refilterFunction) {\n\t refilterFunction = null;\n\t filterIndexFunction(function(d, i) { return lo1 <= i && i < hi1; });\n\t lo0 = lo1;\n\t hi0 = hi1;\n\t return dimension;\n\t }\n\n\t var i,\n\t j,\n\t k,\n\t added = [],\n\t removed = [];\n\n\t // Fast incremental update based on previous lo index.\n\t if (lo1 < lo0) {\n\t for (i = lo1, j = Math.min(lo0, hi1); i < j; ++i) {\n\t filters[k = index[i]] ^= one;\n\t added.push(k);\n\t }\n\t } else if (lo1 > lo0) {\n\t for (i = lo0, j = Math.min(lo1, hi0); i < j; ++i) {\n\t filters[k = index[i]] ^= one;\n\t removed.push(k);\n\t }\n\t }\n\n\t // Fast incremental update based on previous hi index.\n\t if (hi1 > hi0) {\n\t for (i = Math.max(lo1, hi0), j = hi1; i < j; ++i) {\n\t filters[k = index[i]] ^= one;\n\t added.push(k);\n\t }\n\t } else if (hi1 < hi0) {\n\t for (i = Math.max(lo0, hi1), j = hi0; i < j; ++i) {\n\t filters[k = index[i]] ^= one;\n\t removed.push(k);\n\t }\n\t }\n\n\t lo0 = lo1;\n\t hi0 = hi1;\n\t filterListeners.forEach(function(l) { l(one, added, removed); });\n\t return dimension;\n\t }\n\n\t // Filters this dimension using the specified range, value, or null.\n\t // If the range is null, this is equivalent to filterAll.\n\t // If the range is an array, this is equivalent to filterRange.\n\t // Otherwise, this is equivalent to filterExact.\n\t function filter(range) {\n\t return range == null\n\t ? filterAll() : Array.isArray(range)\n\t ? filterRange(range) : typeof range === \"function\"\n\t ? filterFunction(range)\n\t : filterExact(range);\n\t }\n\n\t // Filters this dimension to select the exact value.\n\t function filterExact(value) {\n\t return filterIndexBounds((refilter = crossfilter_filterExact(bisect, value))(values));\n\t }\n\n\t // Filters this dimension to select the specified range [lo, hi].\n\t // The lower bound is inclusive, and the upper bound is exclusive.\n\t function filterRange(range) {\n\t return filterIndexBounds((refilter = crossfilter_filterRange(bisect, range))(values));\n\t }\n\n\t // Clears any filters on this dimension.\n\t function filterAll() {\n\t return filterIndexBounds((refilter = crossfilter_filterAll)(values));\n\t }\n\n\t // Filters this dimension using an arbitrary function.\n\t function filterFunction(f) {\n\t refilter = crossfilter_filterAll;\n\n\t filterIndexFunction(refilterFunction = f);\n\n\t lo0 = 0;\n\t hi0 = n;\n\n\t return dimension;\n\t }\n\n\t function filterIndexFunction(f) {\n\t var i,\n\t k,\n\t x,\n\t added = [],\n\t removed = [];\n\n\t for (i = 0; i < n; ++i) {\n\t if (!(filters[k = index[i]] & one) ^ !!(x = f(values[i], i))) {\n\t if (x) filters[k] &= zero, added.push(k);\n\t else filters[k] |= one, removed.push(k);\n\t }\n\t }\n\t filterListeners.forEach(function(l) { l(one, added, removed); });\n\t }\n\n\t // Returns the top K selected records based on this dimension's order.\n\t // Note: observes this dimension's filter, unlike group and groupAll.\n\t function top(k) {\n\t var array = [],\n\t i = hi0,\n\t j;\n\n\t while (--i >= lo0 && k > 0) {\n\t if (!filters[j = index[i]]) {\n\t array.push(data[j]);\n\t --k;\n\t }\n\t }\n\n\t return array;\n\t }\n\n\t // Returns the bottom K selected records based on this dimension's order.\n\t // Note: observes this dimension's filter, unlike group and groupAll.\n\t function bottom(k) {\n\t var array = [],\n\t i = lo0,\n\t j;\n\n\t while (i < hi0 && k > 0) {\n\t if (!filters[j = index[i]]) {\n\t array.push(data[j]);\n\t --k;\n\t }\n\t i++;\n\t }\n\n\t return array;\n\t }\n\n\t // Adds a new group to this dimension, using the specified key function.\n\t function group(key) {\n\t var group = {\n\t top: top,\n\t all: all,\n\t reduce: reduce,\n\t reduceCount: reduceCount,\n\t reduceSum: reduceSum,\n\t order: order,\n\t orderNatural: orderNatural,\n\t size: size,\n\t dispose: dispose,\n\t remove: dispose // for backwards-compatibility\n\t };\n\n\t // Ensure that this group will be removed when the dimension is removed.\n\t dimensionGroups.push(group);\n\n\t var groups, // array of {key, value}\n\t groupIndex, // object id ↦ group id\n\t groupWidth = 8,\n\t groupCapacity = crossfilter_capacity(groupWidth),\n\t k = 0, // cardinality\n\t select,\n\t heap,\n\t reduceAdd,\n\t reduceRemove,\n\t reduceInitial,\n\t update = crossfilter_null,\n\t reset = crossfilter_null,\n\t resetNeeded = true,\n\t groupAll = key === crossfilter_null;\n\n\t if (arguments.length < 1) key = crossfilter_identity;\n\n\t // The group listens to the crossfilter for when any dimension changes, so\n\t // that it can update the associated reduce values. It must also listen to\n\t // the parent dimension for when data is added, and compute new keys.\n\t filterListeners.push(update);\n\t indexListeners.push(add);\n\t removeDataListeners.push(removeData);\n\n\t // Incorporate any existing data into the grouping.\n\t add(values, index, 0, n);\n\n\t // Incorporates the specified new values into this group.\n\t // This function is responsible for updating groups and groupIndex.\n\t function add(newValues, newIndex, n0, n1) {\n\t var oldGroups = groups,\n\t reIndex = crossfilter_index(k, groupCapacity),\n\t add = reduceAdd,\n\t initial = reduceInitial,\n\t k0 = k, // old cardinality\n\t i0 = 0, // index of old group\n\t i1 = 0, // index of new record\n\t j, // object id\n\t g0, // old group\n\t x0, // old key\n\t x1, // new key\n\t g, // group to add\n\t x; // key of group to add\n\n\t // If a reset is needed, we don't need to update the reduce values.\n\t if (resetNeeded) add = initial = crossfilter_null;\n\n\t // Reset the new groups (k is a lower bound).\n\t // Also, make sure that groupIndex exists and is long enough.\n\t groups = new Array(k), k = 0;\n\t groupIndex = k0 > 1 ? crossfilter_arrayLengthen(groupIndex, n) : crossfilter_index(n, groupCapacity);\n\n\t // Get the first old key (x0 of g0), if it exists.\n\t if (k0) x0 = (g0 = oldGroups[0]).key;\n\n\t // Find the first new key (x1), skipping NaN keys.\n\t while (i1 < n1 && !((x1 = key(newValues[i1])) >= x1)) ++i1;\n\n\t // While new keys remain…\n\t while (i1 < n1) {\n\n\t // Determine the lesser of the two current keys; new and old.\n\t // If there are no old keys remaining, then always add the new key.\n\t if (g0 && x0 <= x1) {\n\t g = g0, x = x0;\n\n\t // Record the new index of the old group.\n\t reIndex[i0] = k;\n\n\t // Retrieve the next old key.\n\t if (g0 = oldGroups[++i0]) x0 = g0.key;\n\t } else {\n\t g = {key: x1, value: initial()}, x = x1;\n\t }\n\n\t // Add the lesser group.\n\t groups[k] = g;\n\n\t // Add any selected records belonging to the added group, while\n\t // advancing the new key and populating the associated group index.\n\t while (!(x1 > x)) {\n\t groupIndex[j = newIndex[i1] + n0] = k;\n\t if (!(filters[j] & zero)) g.value = add(g.value, data[j]);\n\t if (++i1 >= n1) break;\n\t x1 = key(newValues[i1]);\n\t }\n\n\t groupIncrement();\n\t }\n\n\t // Add any remaining old groups that were greater than all new keys.\n\t // No incremental reduce is needed; these groups have no new records.\n\t // Also record the new index of the old group.\n\t while (i0 < k0) {\n\t groups[reIndex[i0] = k] = oldGroups[i0++];\n\t groupIncrement();\n\t }\n\n\t // If we added any new groups before any old groups,\n\t // update the group index of all the old records.\n\t if (k > i0) for (i0 = 0; i0 < n0; ++i0) {\n\t groupIndex[i0] = reIndex[groupIndex[i0]];\n\t }\n\n\t // Modify the update and reset behavior based on the cardinality.\n\t // If the cardinality is less than or equal to one, then the groupIndex\n\t // is not needed. If the cardinality is zero, then there are no records\n\t // and therefore no groups to update or reset. Note that we also must\n\t // change the registered listener to point to the new method.\n\t j = filterListeners.indexOf(update);\n\t if (k > 1) {\n\t update = updateMany;\n\t reset = resetMany;\n\t } else {\n\t if (!k && groupAll) {\n\t k = 1;\n\t groups = [{key: null, value: initial()}];\n\t }\n\t if (k === 1) {\n\t update = updateOne;\n\t reset = resetOne;\n\t } else {\n\t update = crossfilter_null;\n\t reset = crossfilter_null;\n\t }\n\t groupIndex = null;\n\t }\n\t filterListeners[j] = update;\n\n\t // Count the number of added groups,\n\t // and widen the group index as needed.\n\t function groupIncrement() {\n\t if (++k === groupCapacity) {\n\t reIndex = crossfilter_arrayWiden(reIndex, groupWidth <<= 1);\n\t groupIndex = crossfilter_arrayWiden(groupIndex, groupWidth);\n\t groupCapacity = crossfilter_capacity(groupWidth);\n\t }\n\t }\n\t }\n\n\t function removeData() {\n\t if (k > 1) {\n\t var oldK = k,\n\t oldGroups = groups,\n\t seenGroups = crossfilter_index(oldK, oldK);\n\n\t // Filter out non-matches by copying matching group index entries to\n\t // the beginning of the array.\n\t for (var i = 0, j = 0; i < n; ++i) {\n\t if (filters[i]) {\n\t seenGroups[groupIndex[j] = groupIndex[i]] = 1;\n\t ++j;\n\t }\n\t }\n\n\t // Reassemble groups including only those groups that were referred\n\t // to by matching group index entries. Note the new group index in\n\t // seenGroups.\n\t groups = [], k = 0;\n\t for (i = 0; i < oldK; ++i) {\n\t if (seenGroups[i]) {\n\t seenGroups[i] = k++;\n\t groups.push(oldGroups[i]);\n\t }\n\t }\n\n\t if (k > 1) {\n\t // Reindex the group index using seenGroups to find the new index.\n\t for (var i = 0; i < j; ++i) groupIndex[i] = seenGroups[groupIndex[i]];\n\t } else {\n\t groupIndex = null;\n\t }\n\t filterListeners[filterListeners.indexOf(update)] = k > 1\n\t ? (reset = resetMany, update = updateMany)\n\t : k === 1 ? (reset = resetOne, update = updateOne)\n\t : reset = update = crossfilter_null;\n\t } else if (k === 1) {\n\t if (groupAll) return;\n\t for (var i = 0; i < n; ++i) if (filters[i]) return;\n\t groups = [], k = 0;\n\t filterListeners[filterListeners.indexOf(update)] =\n\t update = reset = crossfilter_null;\n\t }\n\t }\n\n\t // Reduces the specified selected or deselected records.\n\t // This function is only used when the cardinality is greater than 1.\n\t function updateMany(filterOne, added, removed) {\n\t if (filterOne === one || resetNeeded) return;\n\n\t var i,\n\t k,\n\t n,\n\t g;\n\n\t // Add the added values.\n\t for (i = 0, n = added.length; i < n; ++i) {\n\t if (!(filters[k = added[i]] & zero)) {\n\t g = groups[groupIndex[k]];\n\t g.value = reduceAdd(g.value, data[k]);\n\t }\n\t }\n\n\t // Remove the removed values.\n\t for (i = 0, n = removed.length; i < n; ++i) {\n\t if ((filters[k = removed[i]] & zero) === filterOne) {\n\t g = groups[groupIndex[k]];\n\t g.value = reduceRemove(g.value, data[k]);\n\t }\n\t }\n\t }\n\n\t // Reduces the specified selected or deselected records.\n\t // This function is only used when the cardinality is 1.\n\t function updateOne(filterOne, added, removed) {\n\t if (filterOne === one || resetNeeded) return;\n\n\t var i,\n\t k,\n\t n,\n\t g = groups[0];\n\n\t // Add the added values.\n\t for (i = 0, n = added.length; i < n; ++i) {\n\t if (!(filters[k = added[i]] & zero)) {\n\t g.value = reduceAdd(g.value, data[k]);\n\t }\n\t }\n\n\t // Remove the removed values.\n\t for (i = 0, n = removed.length; i < n; ++i) {\n\t if ((filters[k = removed[i]] & zero) === filterOne) {\n\t g.value = reduceRemove(g.value, data[k]);\n\t }\n\t }\n\t }\n\n\t // Recomputes the group reduce values from scratch.\n\t // This function is only used when the cardinality is greater than 1.\n\t function resetMany() {\n\t var i,\n\t g;\n\n\t // Reset all group values.\n\t for (i = 0; i < k; ++i) {\n\t groups[i].value = reduceInitial();\n\t }\n\n\t // Add any selected records.\n\t for (i = 0; i < n; ++i) {\n\t if (!(filters[i] & zero)) {\n\t g = groups[groupIndex[i]];\n\t g.value = reduceAdd(g.value, data[i]);\n\t }\n\t }\n\t }\n\n\t // Recomputes the group reduce values from scratch.\n\t // This function is only used when the cardinality is 1.\n\t function resetOne() {\n\t var i,\n\t g = groups[0];\n\n\t // Reset the singleton group values.\n\t g.value = reduceInitial();\n\n\t // Add any selected records.\n\t for (i = 0; i < n; ++i) {\n\t if (!(filters[i] & zero)) {\n\t g.value = reduceAdd(g.value, data[i]);\n\t }\n\t }\n\t }\n\n\t // Returns the array of group values, in the dimension's natural order.\n\t function all() {\n\t if (resetNeeded) reset(), resetNeeded = false;\n\t return groups;\n\t }\n\n\t // Returns a new array containing the top K group values, in reduce order.\n\t function top(k) {\n\t var top = select(all(), 0, groups.length, k);\n\t return heap.sort(top, 0, top.length);\n\t }\n\n\t // Sets the reduce behavior for this group to use the specified functions.\n\t // This method lazily recomputes the reduce values, waiting until needed.\n\t function reduce(add, remove, initial) {\n\t reduceAdd = add;\n\t reduceRemove = remove;\n\t reduceInitial = initial;\n\t resetNeeded = true;\n\t return group;\n\t }\n\n\t // A convenience method for reducing by count.\n\t function reduceCount() {\n\t return reduce(crossfilter_reduceIncrement, crossfilter_reduceDecrement, crossfilter_zero);\n\t }\n\n\t // A convenience method for reducing by sum(value).\n\t function reduceSum(value) {\n\t return reduce(crossfilter_reduceAdd(value), crossfilter_reduceSubtract(value), crossfilter_zero);\n\t }\n\n\t // Sets the reduce order, using the specified accessor.\n\t function order(value) {\n\t select = heapselect_by(valueOf);\n\t heap = heap_by(valueOf);\n\t function valueOf(d) { return value(d.value); }\n\t return group;\n\t }\n\n\t // A convenience method for natural ordering by reduce value.\n\t function orderNatural() {\n\t return order(crossfilter_identity);\n\t }\n\n\t // Returns the cardinality of this group, irrespective of any filters.\n\t function size() {\n\t return k;\n\t }\n\n\t // Removes this group and associated event listeners.\n\t function dispose() {\n\t var i = filterListeners.indexOf(update);\n\t if (i >= 0) filterListeners.splice(i, 1);\n\t i = indexListeners.indexOf(add);\n\t if (i >= 0) indexListeners.splice(i, 1);\n\t i = removeDataListeners.indexOf(removeData);\n\t if (i >= 0) removeDataListeners.splice(i, 1);\n\t return group;\n\t }\n\n\t return reduceCount().orderNatural();\n\t }\n\n\t // A convenience function for generating a singleton group.\n\t function groupAll() {\n\t var g = group(crossfilter_null), all = g.all;\n\t delete g.all;\n\t delete g.top;\n\t delete g.order;\n\t delete g.orderNatural;\n\t delete g.size;\n\t g.value = function() { return all()[0].value; };\n\t return g;\n\t }\n\n\t // Removes this dimension and associated groups and event listeners.\n\t function dispose() {\n\t dimensionGroups.forEach(function(group) { group.dispose(); });\n\t var i = dataListeners.indexOf(preAdd);\n\t if (i >= 0) dataListeners.splice(i, 1);\n\t i = dataListeners.indexOf(postAdd);\n\t if (i >= 0) dataListeners.splice(i, 1);\n\t i = removeDataListeners.indexOf(removeData);\n\t if (i >= 0) removeDataListeners.splice(i, 1);\n\t m &= zero;\n\t return filterAll();\n\t }\n\n\t return dimension;\n\t }", "removeDimension(propertyChangedHandler, changeValueDimensions) {\n const that = this,\n index = that._dimensions.length - 1;\n\n if (that._dimensions.length < 2) {\n return;\n }\n\n if (that._dimensions.length === 2) {\n const oldRowsCount = that.rows;\n\n that.rows = 1;\n that._changeRowsColumns('rows', oldRowsCount, 1, undefined, true);\n }\n\n that.$.indexerContainer.removeChild(that._dimensions[index].indexer);\n that._dimensions.pop();\n\n let indexerValue;\n\n if (that.arrayIndexingMode === 'LabVIEW') {\n indexerValue = that._coordinates[0];\n that._indexers.splice(0, 1);\n that._coordinates.splice(0, 1);\n }\n else {\n indexerValue = that._coordinates[index];\n that._indexers.pop();\n that._coordinates.pop();\n }\n\n if (that._suppressDimensionChange !== true) {\n that.dimensions -= 1;\n that.$.fireEvent('dimensionChange', { 'type': 'remove' });\n }\n\n if (changeValueDimensions !== false) {\n that._removeDimensionFromJSArray();\n\n if (that.arrayIndexingMode === 'LabVIEW') {\n that._filledUpTo.splice(0, 1);\n }\n else {\n that._filledUpTo.pop();\n }\n }\n\n if (that._absoluteSelectionStart !== undefined) {\n if (that.arrayIndexingMode === 'LabVIEW') {\n that._absoluteSelectionStart.splice(0, 1);\n }\n else {\n that._absoluteSelectionStart.pop();\n }\n }\n\n if (that._absoluteSelectionEnd !== undefined) {\n if (that.arrayIndexingMode === 'LabVIEW') {\n that._absoluteSelectionEnd.splice(0, 1);\n }\n else {\n that._absoluteSelectionEnd.pop();\n }\n }\n\n if (indexerValue > 0) {\n that._scroll();\n }\n\n if ((that.dimensions > 1 && that._suppressDimensionChange === false && that.showIndexDisplay === true && ((that.dimensions + 1) * (that.indexerHeight + 4) - 2 >= that._cachedHeight)) || that.dimensions === 1 && propertyChangedHandler !== true) {\n that._updateWidgetHeight('dimensions');\n if (that.dimensions === 1 && that.showVerticalScrollbar) {\n that._showVerticalScrollbar(false);\n }\n }\n }", "function DynamicDataView(arrayBufferOrSize)\r\n{\r\n var mySize;\r\n var myArrayBuffer;\r\n \r\n if (arrayBufferOrSize.constructor === ArrayBuffer)\r\n {\r\n mySize = arrayBufferOrSize.byteLength;\r\n myArrayBuffer = arrayBufferOrSize;\r\n }\r\n else\r\n {\r\n mySize = arrayBufferOrSize;\r\n myArrayBuffer = new ArrayBuffer(mySize);\r\n }\r\n \r\n var myDataView = new DataView(myArrayBuffer);\r\n\r\n \r\n this.getArrayBuffer = function()\r\n {\r\n return myArrayBuffer;\r\n }\r\n \r\n this.readBytes = function(idx, size)\r\n {\r\n var anArrayBuffer = myDataView.buffer;\r\n \r\n // Get bytes in ArrayBuffer.\r\n var aResult = anArrayBuffer.slice(idx, idx + size);\r\n return aResult;\r\n }\r\n \r\n this.writeBytes = function(idx, arrayBuffer)\r\n {\r\n var aMinimalSize = idx + arrayBuffer.byteLength;\r\n expand(aMinimalSize);\r\n \r\n // Copy incoming array buffer.\r\n new Uint8Array(myArrayBuffer, idx).set(new Uint8Array(arrayBuffer));\r\n }\r\n \r\n this.getInt32 = function(idx, isLittleEndian)\r\n {\r\n return myDataView.getInt32(idx, isLittleEndian);\r\n }\r\n \r\n this.setInt32 = function(idx, value, isLittleEndian)\r\n {\r\n expand(idx + 4);\r\n myDataView.setInt32(idx, value, isLittleEndian);\r\n }\r\n \r\n this.getUint16 = function(idx, isLittleEndian)\r\n {\r\n return myDataView.getUint16(idx, isLittleEndian);\r\n }\r\n \r\n this.setUint16 = function(idx, value, isLittleEndian)\r\n {\r\n expand(idx + 2);\r\n myDataView.setUint16(idx, value, isLittleEndian);\r\n }\r\n \r\n this.getUint8 = function(idx)\r\n {\r\n return myDataView.getUint8(idx);\r\n }\r\n \r\n this.setUint8 = function(idx, value)\r\n {\r\n expand(idx + 1);\r\n myDataView.setUint8(idx, value);\r\n }\r\n \r\n var expand = function(minimalSize)\r\n {\r\n if (minimalSize <= mySize)\r\n {\r\n // nothing to do.\r\n return;\r\n }\r\n \r\n // Create new\r\n var aNewSize = minimalSize + 50;\r\n var aNewArrayBuffer = new ArrayBuffer(aNewSize);\r\n \r\n // Copy\r\n new Uint8Array(aNewArrayBuffer).set(new Uint8Array(myArrayBuffer));\r\n \r\n // Set new\r\n mySize = aNewSize;\r\n myArrayBuffer = aNewArrayBuffer;\r\n myDataView = new DataView(myArrayBuffer);\r\n }\r\n}", "loadArrayIntoNdframe({ data, index, columns, dtypes }) {\n // this.$data = utils.replaceUndefinedWithNaN(data, this.$isSeries);\n this.$data = data;\n if (!this.$config.isLowMemoryMode) {\n //In NOT low memory mode, we transpose the array and save in column format.\n //This makes column data retrieval run in constant time\n this.$dataIncolumnFormat = utils.transposeArray(data);\n }\n this.$setIndex(index);\n this.$setDtypes(dtypes);\n this.$setColumnNames(columns);\n }", "_addRemoveMultipleDimensions(oldvalue, value, changeValueDimensions) {\n const that = this;\n\n if (value < 1 || value > 32) {\n that.dimensions = 1;\n\n if (that.dimensions === oldvalue) {\n return;\n }\n }\n\n let difference = that.dimensions - oldvalue;\n\n that._suppressDimensionChange = true;\n\n if (difference > 0) {\n do {\n that.addDimension(changeValueDimensions);\n difference -= 1;\n } while (difference > 0);\n\n that.$.fireEvent('dimensionChange', { 'type': 'add' });\n }\n else if (difference < 0) {\n if (value === 1) {\n const oldRowsCount = that.rows;\n\n that.rows = 1;\n that.dimensions = oldvalue;\n that._changeRowsColumns('rows', oldRowsCount, 1, undefined, true);\n that.dimensions = value;\n }\n do {\n that.removeDimension(true, changeValueDimensions);\n difference += 1;\n } while (difference < 0);\n\n that.$.fireEvent('dimensionChange', { 'type': 'remove' });\n\n if (value === 1 && that.showVerticalScrollbar) {\n that._showVerticalScrollbar(false);\n }\n }\n else {\n return;\n }\n\n that._suppressDimensionChange = false;\n\n if (that.showIndexDisplay === true &&\n !(value !== 1 &&\n ((value - oldvalue > 0 && value * (that.indexerHeight + 4) - 2 < that._cachedHeight) ||\n (value - oldvalue < 0 && oldvalue * (that.indexerHeight + 4) - 2 < that._cachedHeight))) ||\n value === 1) {\n that._updateWidgetHeight('dimensions');\n }\n }", "static dataArray (length = 0) {\n if (Uint8ClampedArray) {\n return new Uint8ClampedArray(length)\n }\n return new Array(length)\n }", "parseArrayDimension () {\n const dimToken = this.getToken();\n if(dimToken.type === this.lexerClass.INTEGER) {\n //parse as int literal\n this.pos++;\n return this.getIntLiteral(dimToken);\n } else if(dimToken.type === this.lexerClass.ID) {\n //parse as variable\n this.pos++;\n return this.parseVariable(dimToken);\n } else {\n throw SyntaxErrorFactory.invalid_array_dimension(this.lexer.literalNames[this.lexerClass.RK_INTEGER], dimToken);\n }\n }", "fillDataset (docs) {\n if (!docs) return\n\n const numFields = this.reactiveState.fieldNames.length\n const obj = this.plainState.dataset = this.plainState.dataset || {}\n\n docs.forEach(doc => {\n // Lookup field index in memory\n const index = this.plainState.datastreamIdsToFieldIndex[doc._id]\n if (typeof index !== 'number') return\n\n if (doc.datapoints && doc.datapoints.data && doc.datapoints.data.length > 0) {\n /*\n Iterate over datapoints; build-out pivot table with 'time' as the key\n */\n doc.datapoints.data.forEach(point => {\n const time = (new Date(point.t)).getTime() + (typeof point.o === 'number' ? point.o * 1000 : 0)\n if (!obj[time]) obj[time] = new Array(numFields).fill(null)\n obj[time][index] = point.v\n console.log('>>>', point.v)\n })\n }\n })\n }", "get arraySize() {}", "function dimension(value) {\n var dimension = {\n filter: filter,\n filterExact: filterExact,\n filterRange: filterRange,\n filterAll: filterAll,\n top: top,\n bottom: bottom,\n group: group,\n groupAll: groupAll,\n remove: remove\n };\n\n var one = ~m & -~m, // lowest unset bit as mask, e.g., 00001000\n zero = ~one, // inverted one, e.g., 11110111\n values, // sorted, cached array\n index, // value rank ↦ object id\n newValues, // temporary array storing newly-added values\n newIndex, // temporary array storing newly-added index\n sort = quicksort_by(function(i) { return newValues[i]; }),\n refilter = crossfilter_filterAll, // for recomputing filter\n indexListeners = [], // when data is added\n dimensionGroups = [],\n lo0 = 0,\n hi0 = 0;\n\n // Updating a dimension is a two-stage process. First, we must update the\n // associated filters for the newly-added records. Once all dimensions have\n // updated their filters, the groups are notified to update.\n dataListeners.unshift(preAdd);\n dataListeners.push(postAdd);\n\n // Incorporate any existing data into this dimension, and make sure that the\n // filter bitset is wide enough to handle the new dimension.\n m |= one;\n if (M >= 32 ? !one : m & (1 << M) - 1) {\n filters = crossfilter_arrayWiden(filters, M <<= 1);\n }\n preAdd(data, 0, n);\n postAdd(data, 0, n);\n\n // Incorporates the specified new records into this dimension.\n // This function is responsible for updating filters, values, and index.\n function preAdd(newData, n0, n1) {\n\n // Permute new values into natural order using a sorted index.\n newValues = newData.map(value);\n newIndex = sort(crossfilter_range(n1), 0, n1);\n newValues = permute(newValues, newIndex);\n\n // Bisect newValues to determine which new records are selected.\n var bounds = refilter(newValues), lo1 = bounds[0], hi1 = bounds[1], i;\n for (i = 0; i < lo1; ++i) filters[newIndex[i] + n0] |= one;\n for (i = hi1; i < n1; ++i) filters[newIndex[i] + n0] |= one;\n\n // If this dimension previously had no data, then we don't need to do the\n // more expensive merge operation; use the new values and index as-is.\n if (!n0) {\n values = newValues;\n index = newIndex;\n lo0 = lo1;\n hi0 = hi1;\n return;\n }\n\n var oldValues = values,\n oldIndex = index,\n i0 = 0,\n i1 = 0;\n\n // Otherwise, create new arrays into which to merge new and old.\n values = new Array(n);\n index = crossfilter_index(n, n);\n\n // Merge the old and new sorted values, and old and new index.\n for (i = 0; i0 < n0 && i1 < n1; ++i) {\n if (oldValues[i0] < newValues[i1]) {\n values[i] = oldValues[i0];\n index[i] = oldIndex[i0++];\n } else {\n values[i] = newValues[i1];\n index[i] = newIndex[i1++] + n0;\n }\n }\n\n // Add any remaining old values.\n for (; i0 < n0; ++i0, ++i) {\n values[i] = oldValues[i0];\n index[i] = oldIndex[i0];\n }\n\n // Add any remaining new values.\n for (; i1 < n1; ++i1, ++i) {\n values[i] = newValues[i1];\n index[i] = newIndex[i1] + n0;\n }\n\n // Bisect again to recompute lo0 and hi0.\n bounds = refilter(values), lo0 = bounds[0], hi0 = bounds[1];\n }\n\n // When all filters have updated, notify index listeners of the new values.\n function postAdd(newData, n0, n1) {\n indexListeners.forEach(function(l) { l(newValues, newIndex, n0, n1); });\n newValues = newIndex = null;\n }\n\n // Updates the selected values based on the specified bounds [lo, hi].\n // This implementation is used by all the public filter methods.\n function filterIndex(bounds) {\n var i,\n j,\n k,\n lo1 = bounds[0],\n hi1 = bounds[1],\n added = [],\n removed = [];\n\n // Fast incremental update based on previous lo index.\n if (lo1 < lo0) {\n for (i = lo1, j = Math.min(lo0, hi1); i < j; ++i) {\n filters[k = index[i]] ^= one;\n added.push(k);\n }\n } else if (lo1 > lo0) {\n for (i = lo0, j = Math.min(lo1, hi0); i < j; ++i) {\n filters[k = index[i]] ^= one;\n removed.push(k);\n }\n }\n\n // Fast incremental update based on previous hi index.\n if (hi1 > hi0) {\n for (i = Math.max(lo1, hi0), j = hi1; i < j; ++i) {\n filters[k = index[i]] ^= one;\n added.push(k);\n }\n } else if (hi1 < hi0) {\n for (i = Math.max(lo0, hi1), j = hi0; i < j; ++i) {\n filters[k = index[i]] ^= one;\n removed.push(k);\n }\n }\n\n lo0 = lo1;\n hi0 = hi1;\n filterListeners.forEach(function(l) { l(one, added, removed); });\n return dimension;\n }\n\n // Filters this dimension using the specified range, value, or null.\n // If the range is null, this is equivalent to filterAll.\n // If the range is an array, this is equivalent to filterRange.\n // Otherwise, this is equivalent to filterExact.\n function filter(range) {\n return range == null\n ? filterAll() : Array.isArray(range)\n ? filterRange(range)\n : filterExact(range);\n }\n\n // Filters this dimension to select the exact value.\n function filterExact(value) {\n return filterIndex((refilter = crossfilter_filterExact(bisect, value))(values));\n }\n\n // Filters this dimension to select the specified range [lo, hi].\n // The lower bound is inclusive, and the upper bound is exclusive.\n function filterRange(range) {\n return filterIndex((refilter = crossfilter_filterRange(bisect, range))(values));\n }\n\n // Clears any filters on this dimension.\n function filterAll() {\n return filterIndex((refilter = crossfilter_filterAll)(values));\n }\n\n // Returns the top K selected records based on this dimension's order.\n // Note: observes this dimension's filter, unlike group and groupAll.\n function top(k) {\n var array = [],\n i = hi0,\n j;\n\n while (--i >= lo0 && k > 0) {\n if (!filters[j = index[i]]) {\n array.push(data[j]);\n --k;\n }\n }\n\n return array;\n }\n\n // Returns the bottom K selected records based on this dimension's order.\n // Note: observes this dimension's filter, unlike group and groupAll.\n function bottom(k) {\n var array = [],\n i = lo0,\n j;\n\n while (i < hi0 && k > 0) {\n if (!filters[j = index[i]]) {\n array.push(data[j]);\n --k;\n }\n i++;\n }\n\n return array;\n }\n\n // Adds a new group to this dimension, using the specified key function.\n function group(key) {\n var group = {\n top: top,\n all: all,\n reduce: reduce,\n reduceCount: reduceCount,\n reduceSum: reduceSum,\n order: order,\n orderNatural: orderNatural,\n size: size,\n remove: remove\n };\n\n // Ensure that this group will be removed when the dimension is removed.\n dimensionGroups.push(group);\n\n var groups, // array of {key, value}\n groupIndex, // object id ↦ group id\n groupWidth = 8,\n groupCapacity = crossfilter_capacity(groupWidth),\n k = 0, // cardinality\n select,\n heap,\n reduceAdd,\n reduceRemove,\n reduceInitial,\n update = crossfilter_null,\n reset = crossfilter_null,\n resetNeeded = true;\n\n if (arguments.length < 1) key = crossfilter_identity;\n\n // The group listens to the crossfilter for when any dimension changes, so\n // that it can update the associated reduce values. It must also listen to\n // the parent dimension for when data is added, and compute new keys.\n filterListeners.push(update);\n indexListeners.push(add);\n\n // Incorporate any existing data into the grouping.\n add(values, index, 0, n);\n\n // Incorporates the specified new values into this group.\n // This function is responsible for updating groups and groupIndex.\n function add(newValues, newIndex, n0, n1) {\n var oldGroups = groups,\n reIndex = crossfilter_index(k, groupCapacity),\n add = reduceAdd,\n initial = reduceInitial,\n k0 = k, // old cardinality\n i0 = 0, // index of old group\n i1 = 0, // index of new record\n j, // object id\n g0, // old group\n x0, // old key\n x1, // new key\n g, // group to add\n x; // key of group to add\n\n // If a reset is needed, we don't need to update the reduce values.\n if (resetNeeded) add = initial = crossfilter_null;\n\n // Reset the new groups (k is a lower bound).\n // Also, make sure that groupIndex exists and is long enough.\n groups = new Array(k), k = 0;\n groupIndex = k0 > 1 ? crossfilter_arrayLengthen(groupIndex, n) : crossfilter_index(n, groupCapacity);\n\n // Get the first old key (x0 of g0), if it exists.\n if (k0) x0 = (g0 = oldGroups[0]).key;\n\n // Find the first new key (x1).\n x1 = key(newValues[i1]);\n\n // While new keys remain…\n while (i1 < n1) {\n\n // Determine the lesser of the two current keys; new and old.\n // If there are no old keys remaining, then always add the new key.\n if (g0 && x0 <= x1) {\n g = g0, x = x0;\n\n // Record the new index of the old group.\n reIndex[i0] = k;\n\n // Retrieve the next old key.\n if (g0 = oldGroups[++i0]) x0 = g0.key;\n } else {\n g = {key: x1, value: initial()}, x = x1;\n }\n\n // Add the lesser group.\n groups[k] = g;\n\n // Add any selected records belonging to the added group, while\n // advancing the new key and populating the associated group index.\n while (x1 <= x || !(x1 <= x1) && !(x <= x)) {\n groupIndex[j = newIndex[i1] + n0] = k;\n if (!(filters[j] & zero)) g.value = add(g.value, data[j]);\n if (++i1 >= n1) break;\n x1 = key(newValues[i1]);\n }\n\n groupIncrement();\n }\n\n // Add any remaining old groups that were greater than all new keys.\n // No incremental reduce is needed; these groups have no new records.\n // Also record the new index of the old group.\n while (i0 < k0) {\n groups[reIndex[i0] = k] = oldGroups[i0++];\n groupIncrement();\n }\n\n // If we added any new groups before any old groups,\n // update the group index of all the old records.\n if (k > i0) for (i0 = 0; i0 < n0; ++i0) {\n groupIndex[i0] = reIndex[groupIndex[i0]];\n }\n\n // Modify the update and reset behavior based on the cardinality.\n // If the cardinality is less than or equal to one, then the groupIndex\n // is not needed. If the cardinality is zero, then there are no records\n // and therefore no groups to update or reset. Note that we also must\n // change the registered listener to point to the new method.\n j = filterListeners.indexOf(update);\n if (k > 1) {\n update = updateMany;\n reset = resetMany;\n } else {\n if (k === 1) {\n update = updateOne;\n reset = resetOne;\n } else {\n update = crossfilter_null;\n reset = crossfilter_null;\n }\n groupIndex = null;\n }\n filterListeners[j] = update;\n\n // Count the number of added groups,\n // and widen the group index as needed.\n function groupIncrement() {\n if (++k === groupCapacity) {\n reIndex = crossfilter_arrayWiden(reIndex, groupWidth <<= 1);\n groupIndex = crossfilter_arrayWiden(groupIndex, groupWidth);\n groupCapacity = crossfilter_capacity(groupWidth);\n }\n }\n }\n\n // Reduces the specified selected or deselected records.\n // This function is only used when the cardinality is greater than 1.\n function updateMany(filterOne, added, removed) {\n if (filterOne === one || resetNeeded) return;\n\n if (!reduceRemove && removed.length) {\n resetNeeded = true;\n return;\n }\n\n var i,\n k,\n n,\n g;\n\n // Add the added values.\n for (i = 0, n = added.length; i < n; ++i) {\n if (!(filters[k = added[i]] & zero)) {\n g = groups[groupIndex[k]];\n g.value = reduceAdd(g.value, data[k]);\n }\n }\n\n // Remove the removed values.\n for (i = 0, n = removed.length; i < n; ++i) {\n if ((filters[k = removed[i]] & zero) === filterOne) {\n g = groups[groupIndex[k]];\n g.value = reduceRemove(g.value, data[k]);\n }\n }\n }\n\n // Reduces the specified selected or deselected records.\n // This function is only used when the cardinality is 1.\n function updateOne(filterOne, added, removed) {\n if (filterOne === one || resetNeeded) return;\n\n if (!reduceRemove && removed.length) {\n resetNeeded = true;\n return;\n }\n\n var i,\n k,\n n,\n g = groups[0];\n\n // Add the added values.\n for (i = 0, n = added.length; i < n; ++i) {\n if (!(filters[k = added[i]] & zero)) {\n g.value = reduceAdd(g.value, data[k]);\n }\n }\n\n // Remove the removed values.\n for (i = 0, n = removed.length; i < n; ++i) {\n if ((filters[k = removed[i]] & zero) === filterOne) {\n g.value = reduceRemove(g.value, data[k]);\n }\n }\n }\n\n // Recomputes the group reduce values from scratch.\n // This function is only used when the cardinality is greater than 1.\n function resetMany() {\n var i,\n g;\n\n // Reset all group values.\n for (i = 0; i < k; ++i) {\n groups[i].value = reduceInitial();\n }\n\n // Add any selected records.\n for (i = 0; i < n; ++i) {\n if (!(filters[i] & zero)) {\n g = groups[groupIndex[i]];\n g.value = reduceAdd(g.value, data[i]);\n }\n }\n }\n\n // Recomputes the group reduce values from scratch.\n // This function is only used when the cardinality is 1.\n function resetOne() {\n var i,\n g = groups[0];\n\n // Reset the singleton group values.\n g.value = reduceInitial();\n\n // Add any selected records.\n for (i = 0; i < n; ++i) {\n if (!(filters[i] & zero)) {\n g.value = reduceAdd(g.value, data[i]);\n }\n }\n }\n\n // Returns the array of group values, in the dimension's natural order.\n function all() {\n if (resetNeeded) reset(), resetNeeded = false;\n return groups;\n }\n\n // Returns a new array containing the top K group values, in reduce order.\n function top(k) {\n var top = select(all(), 0, groups.length, k);\n return heap.sort(top, 0, top.length);\n }\n\n // Sets the reduce behavior for this group to use the specified functions.\n // This method lazily recomputes the reduce values, waiting until needed.\n function reduce(add, remove, initial) {\n reduceAdd = add;\n reduceRemove = remove;\n reduceInitial = initial;\n resetNeeded = true;\n return group;\n }\n\n // A convenience method for reducing by count.\n function reduceCount() {\n return reduce(crossfilter_reduceIncrement, crossfilter_reduceDecrement, crossfilter_zero);\n }\n\n // A convenience method for reducing by sum(value).\n function reduceSum(value) {\n return reduce(crossfilter_reduceAdd(value), crossfilter_reduceSubtract(value), crossfilter_zero);\n }\n\n // Sets the reduce order, using the specified accessor.\n function order(value) {\n select = heapselect_by(valueOf);\n heap = heap_by(valueOf);\n function valueOf(d) { return value(d.value); }\n return group;\n }\n\n // A convenience method for natural ordering by reduce value.\n function orderNatural() {\n return order(crossfilter_identity);\n }\n\n // Returns the cardinality of this group, irrespective of any filters.\n function size() {\n return k;\n }\n\n // Removes this group and associated event listeners.\n function remove() {\n var i = filterListeners.indexOf(update);\n if (i >= 0) filterListeners.splice(i, 1);\n i = indexListeners.indexOf(add);\n if (i >= 0) indexListeners.splice(i, 1);\n return group;\n }\n\n return reduceCount().orderNatural();\n }\n\n // A convenience function for generating a singleton group.\n function groupAll() {\n var g = group(crossfilter_null), all = g.all;\n delete g.all;\n delete g.top;\n delete g.order;\n delete g.orderNatural;\n delete g.size;\n g.value = function() { return all()[0].value; };\n return g;\n }\n\n function remove() {\n dimensionGroups.forEach(function(group) { group.remove(); });\n var i = dataListeners.indexOf(preAdd);\n if (i >= 0) dataListeners.splice(i, 1);\n i = dataListeners.indexOf(postAdd);\n if (i >= 0) dataListeners.splice(i, 1);\n for (i = 0; i < n; ++i) filters[i] &= zero;\n m &= zero;\n return dimension;\n }\n\n return dimension;\n }", "function summarizeDimensions(data) {\n var summary = {};\n var encode = summary.encode = {};\n var notExtraCoordDimMap = Object(util[\"g\" /* createHashMap */])();\n var defaultedLabel = [];\n var defaultedTooltip = []; // See the comment of `List.js#userOutput`.\n\n var userOutput = summary.userOutput = {\n dimensionNames: data.dimensions.slice(),\n encode: {}\n };\n Object(util[\"k\" /* each */])(data.dimensions, function (dimName) {\n var dimItem = data.getDimensionInfo(dimName);\n var coordDim = dimItem.coordDim;\n\n if (coordDim) {\n if (false) {}\n\n var coordDimIndex = dimItem.coordDimIndex;\n getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName;\n\n if (!dimItem.isExtraCoord) {\n notExtraCoordDimMap.set(coordDim, 1); // Use the last coord dim (and label friendly) as default label,\n // because when dataset is used, it is hard to guess which dimension\n // can be value dimension. If both show x, y on label is not look good,\n // and conventionally y axis is focused more.\n\n if (mayLabelDimType(dimItem.type)) {\n defaultedLabel[0] = dimName;\n } // User output encode do not contain generated coords.\n // And it only has index. User can use index to retrieve value from the raw item array.\n\n\n getOrCreateEncodeArr(userOutput.encode, coordDim)[coordDimIndex] = dimItem.index;\n }\n\n if (dimItem.defaultTooltip) {\n defaultedTooltip.push(dimName);\n }\n }\n\n util_types[\"i\" /* VISUAL_DIMENSIONS */].each(function (v, otherDim) {\n var encodeArr = getOrCreateEncodeArr(encode, otherDim);\n var dimIndex = dimItem.otherDims[otherDim];\n\n if (dimIndex != null && dimIndex !== false) {\n encodeArr[dimIndex] = dimItem.name;\n }\n });\n });\n var dataDimsOnCoord = [];\n var encodeFirstDimNotExtra = {};\n notExtraCoordDimMap.each(function (v, coordDim) {\n var dimArr = encode[coordDim];\n encodeFirstDimNotExtra[coordDim] = dimArr[0]; // Not necessary to remove duplicate, because a data\n // dim canot on more than one coordDim.\n\n dataDimsOnCoord = dataDimsOnCoord.concat(dimArr);\n });\n summary.dataDimsOnCoord = dataDimsOnCoord;\n summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra;\n var encodeLabel = encode.label; // FIXME `encode.label` is not recommanded, because formatter can not be set\n // in this way. Use label.formatter instead. May be remove this approach someday.\n\n if (encodeLabel && encodeLabel.length) {\n defaultedLabel = encodeLabel.slice();\n }\n\n var encodeTooltip = encode.tooltip;\n\n if (encodeTooltip && encodeTooltip.length) {\n defaultedTooltip = encodeTooltip.slice();\n } else if (!defaultedTooltip.length) {\n defaultedTooltip = defaultedLabel.slice();\n }\n\n encode.defaultedLabel = defaultedLabel;\n encode.defaultedTooltip = defaultedTooltip;\n return summary;\n}", "getMetrics() {\n return {\n contentLength: this.scrollProperties.contentLength,\n totalRows: this.props.dataSource.getRowCount(),\n renderedRows: this.state.curRenderedRowsCount,\n visibleRows: Object.keys(this._visibleRows).length,\n };\n }", "_changeRowsColumns(key, oldvalue, value, reset, suppressHeightUpdate) {\n const that = this,\n functionName = '_addRemove' + key.charAt(0).toUpperCase() + key.slice(1, key.length - 1);\n\n if (value < 1) {\n that[key] = 1;\n\n if (that[key] === oldvalue) {\n return;\n }\n }\n\n if (that.dimensions === 1) {\n if (that._oneDimensionSpecialCase === true) {\n if (key === 'columns' && that[key] > 1) {\n if (that.rows > 1) {\n that.columns = 1;\n return;\n }\n\n that._oneDimensionSpecialCase = false;\n if (that.showVerticalScrollbar) {\n that._showVerticalScrollbar(false);\n that._showHorizontalScrollbar(true);\n }\n }\n }\n else {\n if (key === 'rows') {\n if (that.columns > 1) {\n that.rows = 1;\n return;\n }\n else if (that.rows > 1) {\n that._oneDimensionSpecialCase = true;\n if (that.showHorizontalScrollbar === true) {\n that._showHorizontalScrollbar(false);\n that._showVerticalScrollbar(true);\n }\n }\n }\n }\n }\n\n let difference = that[key] - oldvalue;\n\n that[key] = oldvalue;\n\n if (difference > 0) {\n that._suppressScroll = true;\n\n do {\n that[functionName]('add');\n difference -= 1;\n } while (difference > 0);\n\n that._suppressScroll = false;\n that._scroll();\n }\n else if (difference < 0) {\n do {\n that[functionName]('remove');\n difference += 1;\n } while (difference < 0);\n }\n\n that.$.fireEvent('arraySizeChange', { 'type': key, 'number': that[key], 'oldNumber': oldvalue });\n\n if (key === 'columns') {\n that._updateWidgetWidth();\n that._setMaxValuesOfScrollBars('horizontal');\n }\n else if (key === 'rows' && suppressHeightUpdate !== true) {\n that._updateWidgetHeight(reset === true ? 'dimensions' : undefined);\n that._setMaxValuesOfScrollBars('vertical');\n }\n }", "get getColumnData() {\n if (this.config.isLowMemoryMode) {\n return utils.transposeArray(this.values);\n } else {\n return this.$dataIncolumnFormat;\n }\n }", "set arraySize(value) {}", "get shape() {\n if (this.$data.length === 0) return [0, 0];\n if (this.$isSeries) {\n return [this.$data.length, 1];\n } else {\n const rowLen = (this.$data).length;\n const colLen = (this.$data[0]).length;\n return [rowLen, colLen];\n }\n\n }", "_fillValueArray(changedValueDimensions, skipOverride) {\n const that = this,\n dimensions = that.dimensions;\n\n if (that._filledUpTo !== undefined && skipOverride !== true) {\n let skipFill = true;\n\n for (let a = 0; a < changedValueDimensions.length; a++) {\n skipFill = skipFill && (that._filledUpTo[a] >= changedValueDimensions[a]);\n changedValueDimensions[a] = Math.max(changedValueDimensions[a], that._filledUpTo[a]);\n }\n\n if (skipFill === true) {\n that._scroll();\n return;\n }\n }\n\n that._filledUpTo = changedValueDimensions.slice(0);\n\n function recursion(arr, level) {\n for (let i = 0; i <= changedValueDimensions[level]; i++) {\n if (level !== dimensions - 1) {\n if (arr[i] === undefined) {\n arr[i] = [];\n }\n\n recursion(arr[i], level + 1);\n }\n else if (arr[i] === undefined) {\n arr[i] = that._getDefaultValue();\n }\n }\n }\n\n recursion(that.value, 0);\n\n that._scroll();\n that._setMaxValuesOfScrollBars();\n }", "get ndim() {\n if (this.$isSeries) {\n return 1;\n } else {\n return 2;\n }\n }", "function _default(seriesType) {\n return {\n seriesType: seriesType,\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeRender = pipelineContext.large;\n\n if (!coordSys) {\n return;\n }\n\n var dims = map(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }).slice(0, 2);\n var dimLen = dims.length;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n\n if (isDimensionStacked(data, dims[0]\n /*, dims[1]*/\n )) {\n dims[0] = stackResultDim;\n }\n\n if (isDimensionStacked(data, dims[1]\n /*, dims[0]*/\n )) {\n dims[1] = stackResultDim;\n }\n\n function progress(params, data) {\n var segCount = params.end - params.start;\n var points = isLargeRender && new Float32Array(segCount * dimLen);\n\n for (var i = params.start, offset = 0, tmpIn = [], tmpOut = []; i < params.end; i++) {\n var point;\n\n if (dimLen === 1) {\n var x = data.get(dims[0], i);\n point = !isNaN(x) && coordSys.dataToPoint(x, null, tmpOut);\n } else {\n var x = tmpIn[0] = data.get(dims[0], i);\n var y = tmpIn[1] = data.get(dims[1], i); // Also {Array.<number>}, not undefined to avoid if...else... statement\n\n point = !isNaN(x) && !isNaN(y) && coordSys.dataToPoint(tmpIn, null, tmpOut);\n }\n\n if (isLargeRender) {\n points[offset++] = point ? point[0] : NaN;\n points[offset++] = point ? point[1] : NaN;\n } else {\n data.setItemLayout(i, point && point.slice() || [NaN, NaN]);\n }\n }\n\n isLargeRender && data.setLayout('symbolPoints', points);\n }\n\n return dimLen && {\n progress: progress\n };\n }\n };\n}", "function _default(seriesType) {\n return {\n seriesType: seriesType,\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeRender = pipelineContext.large;\n\n if (!coordSys) {\n return;\n }\n\n var dims = map(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }).slice(0, 2);\n var dimLen = dims.length;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n\n if (isDimensionStacked(data, dims[0]\n /*, dims[1]*/\n )) {\n dims[0] = stackResultDim;\n }\n\n if (isDimensionStacked(data, dims[1]\n /*, dims[0]*/\n )) {\n dims[1] = stackResultDim;\n }\n\n function progress(params, data) {\n var segCount = params.end - params.start;\n var points = isLargeRender && new Float32Array(segCount * dimLen);\n\n for (var i = params.start, offset = 0, tmpIn = [], tmpOut = []; i < params.end; i++) {\n var point;\n\n if (dimLen === 1) {\n var x = data.get(dims[0], i);\n point = !isNaN(x) && coordSys.dataToPoint(x, null, tmpOut);\n } else {\n var x = tmpIn[0] = data.get(dims[0], i);\n var y = tmpIn[1] = data.get(dims[1], i); // Also {Array.<number>}, not undefined to avoid if...else... statement\n\n point = !isNaN(x) && !isNaN(y) && coordSys.dataToPoint(tmpIn, null, tmpOut);\n }\n\n if (isLargeRender) {\n points[offset++] = point ? point[0] : NaN;\n points[offset++] = point ? point[1] : NaN;\n } else {\n data.setItemLayout(i, point && point.slice() || [NaN, NaN]);\n }\n }\n\n isLargeRender && data.setLayout('symbolPoints', points);\n }\n\n return dimLen && {\n progress: progress\n };\n }\n };\n}", "function _default(seriesType) {\n return {\n seriesType: seriesType,\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeRender = pipelineContext.large;\n\n if (!coordSys) {\n return;\n }\n\n var dims = map(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }).slice(0, 2);\n var dimLen = dims.length;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n\n if (isDimensionStacked(data, dims[0]\n /*, dims[1]*/\n )) {\n dims[0] = stackResultDim;\n }\n\n if (isDimensionStacked(data, dims[1]\n /*, dims[0]*/\n )) {\n dims[1] = stackResultDim;\n }\n\n function progress(params, data) {\n var segCount = params.end - params.start;\n var points = isLargeRender && new Float32Array(segCount * dimLen);\n\n for (var i = params.start, offset = 0, tmpIn = [], tmpOut = []; i < params.end; i++) {\n var point;\n\n if (dimLen === 1) {\n var x = data.get(dims[0], i);\n point = !isNaN(x) && coordSys.dataToPoint(x, null, tmpOut);\n } else {\n var x = tmpIn[0] = data.get(dims[0], i);\n var y = tmpIn[1] = data.get(dims[1], i); // Also {Array.<number>}, not undefined to avoid if...else... statement\n\n point = !isNaN(x) && !isNaN(y) && coordSys.dataToPoint(tmpIn, null, tmpOut);\n }\n\n if (isLargeRender) {\n points[offset++] = point ? point[0] : NaN;\n points[offset++] = point ? point[1] : NaN;\n } else {\n data.setItemLayout(i, point && point.slice() || [NaN, NaN]);\n }\n }\n\n isLargeRender && data.setLayout('symbolPoints', points);\n }\n\n return dimLen && {\n progress: progress\n };\n }\n };\n}", "function _default(seriesType) {\n return {\n seriesType: seriesType,\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeRender = pipelineContext.large;\n\n if (!coordSys) {\n return;\n }\n\n var dims = map(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }).slice(0, 2);\n var dimLen = dims.length;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n\n if (isDimensionStacked(data, dims[0]\n /*, dims[1]*/\n )) {\n dims[0] = stackResultDim;\n }\n\n if (isDimensionStacked(data, dims[1]\n /*, dims[0]*/\n )) {\n dims[1] = stackResultDim;\n }\n\n function progress(params, data) {\n var segCount = params.end - params.start;\n var points = isLargeRender && new Float32Array(segCount * dimLen);\n\n for (var i = params.start, offset = 0, tmpIn = [], tmpOut = []; i < params.end; i++) {\n var point;\n\n if (dimLen === 1) {\n var x = data.get(dims[0], i);\n point = !isNaN(x) && coordSys.dataToPoint(x, null, tmpOut);\n } else {\n var x = tmpIn[0] = data.get(dims[0], i);\n var y = tmpIn[1] = data.get(dims[1], i); // Also {Array.<number>}, not undefined to avoid if...else... statement\n\n point = !isNaN(x) && !isNaN(y) && coordSys.dataToPoint(tmpIn, null, tmpOut);\n }\n\n if (isLargeRender) {\n points[offset++] = point ? point[0] : NaN;\n points[offset++] = point ? point[1] : NaN;\n } else {\n data.setItemLayout(i, point && point.slice() || [NaN, NaN]);\n }\n }\n\n isLargeRender && data.setLayout('symbolPoints', points);\n }\n\n return dimLen && {\n progress: progress\n };\n }\n };\n}", "function _default(seriesType) {\n return {\n seriesType: seriesType,\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeRender = pipelineContext.large;\n\n if (!coordSys) {\n return;\n }\n\n var dims = map(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }).slice(0, 2);\n var dimLen = dims.length;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n\n if (isDimensionStacked(data, dims[0]\n /*, dims[1]*/\n )) {\n dims[0] = stackResultDim;\n }\n\n if (isDimensionStacked(data, dims[1]\n /*, dims[0]*/\n )) {\n dims[1] = stackResultDim;\n }\n\n function progress(params, data) {\n var segCount = params.end - params.start;\n var points = isLargeRender && new Float32Array(segCount * dimLen);\n\n for (var i = params.start, offset = 0, tmpIn = [], tmpOut = []; i < params.end; i++) {\n var point;\n\n if (dimLen === 1) {\n var x = data.get(dims[0], i);\n point = !isNaN(x) && coordSys.dataToPoint(x, null, tmpOut);\n } else {\n var x = tmpIn[0] = data.get(dims[0], i);\n var y = tmpIn[1] = data.get(dims[1], i); // Also {Array.<number>}, not undefined to avoid if...else... statement\n\n point = !isNaN(x) && !isNaN(y) && coordSys.dataToPoint(tmpIn, null, tmpOut);\n }\n\n if (isLargeRender) {\n points[offset++] = point ? point[0] : NaN;\n points[offset++] = point ? point[1] : NaN;\n } else {\n data.setItemLayout(i, point && point.slice() || [NaN, NaN]);\n }\n }\n\n isLargeRender && data.setLayout('symbolPoints', points);\n }\n\n return dimLen && {\n progress: progress\n };\n }\n };\n}", "function _default(seriesType) {\n return {\n seriesType: seriesType,\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeRender = pipelineContext.large;\n\n if (!coordSys) {\n return;\n }\n\n var dims = map(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }).slice(0, 2);\n var dimLen = dims.length;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n\n if (isDimensionStacked(data, dims[0]\n /*, dims[1]*/\n )) {\n dims[0] = stackResultDim;\n }\n\n if (isDimensionStacked(data, dims[1]\n /*, dims[0]*/\n )) {\n dims[1] = stackResultDim;\n }\n\n function progress(params, data) {\n var segCount = params.end - params.start;\n var points = isLargeRender && new Float32Array(segCount * dimLen);\n\n for (var i = params.start, offset = 0, tmpIn = [], tmpOut = []; i < params.end; i++) {\n var point;\n\n if (dimLen === 1) {\n var x = data.get(dims[0], i);\n point = !isNaN(x) && coordSys.dataToPoint(x, null, tmpOut);\n } else {\n var x = tmpIn[0] = data.get(dims[0], i);\n var y = tmpIn[1] = data.get(dims[1], i); // Also {Array.<number>}, not undefined to avoid if...else... statement\n\n point = !isNaN(x) && !isNaN(y) && coordSys.dataToPoint(tmpIn, null, tmpOut);\n }\n\n if (isLargeRender) {\n points[offset++] = point ? point[0] : NaN;\n points[offset++] = point ? point[1] : NaN;\n } else {\n data.setItemLayout(i, point && point.slice() || [NaN, NaN]);\n }\n }\n\n isLargeRender && data.setLayout('symbolPoints', points);\n }\n\n return dimLen && {\n progress: progress\n };\n }\n };\n}", "_newDataSet(...params){\n const Type = this.options.DataSetType || DataSet;\n return new Type(...params); \n }", "getDimensions () {\n return this.properties.length\n }", "function defaultGetter() {\r\n return defaultUnidimensionalValue;\r\n }", "function defaultGetter() {\r\n return defaultUnidimensionalValue;\r\n }", "function fillArr(arr0,arr1,arrDim){var arr0Len=arr0.length;var arr1Len=arr1.length;if(arr0Len !== arr1Len){ // FIXME Not work for TypedArray\n var isPreviousLarger=arr0Len > arr1Len;if(isPreviousLarger){ // Cut the previous\n arr0.length = arr1Len;}else { // Fill the previous\n for(var i=arr0Len;i < arr1Len;i++) {arr0.push(arrDim === 1?arr1[i]:arraySlice.call(arr1[i]));}}} // Handling NaN value\n var len2=arr0[0] && arr0[0].length;for(var i=0;i < arr0.length;i++) {if(arrDim === 1){if(isNaN(arr0[i])){arr0[i] = arr1[i];}}else {for(var j=0;j < len2;j++) {if(isNaN(arr0[i][j])){arr0[i][j] = arr1[i][j];}}}}}", "function axisProvider(){\n\t/*\n\t * setAxisContainer(svg);\n\t * setXScale(makeLinearScale([0,width],[0,d3.max(data, function(d) { return d.x; })]));\n\t * setYScale(makeLinearScale([height,0],[0,d3.max(data, function(d) { return d.y; })]));\n\t * draw()\n\t * */\n\tvar axisProviderImpl = {\n\t\t\theight \t: 0,\n\t\t\twidth\t: 0,\n\t\t\tsvg\t\t: null,\n\t\t\txScale\t: null,\n\t\t\tyScale\t: null,\n\t\t\txAxis\t: null,\n\t\t\txGrid\t: null,\n\t\t\tyAxis\t: null,\n\t\t\tyGrid\t: null,\n\t\t\tdrawXGrid: true,\n\t\t\tdrawYGrid: true,\n\t\t\tdrawGrid: true,\n\t\t\txScaleOrient : \"bottom\",\n\t\t\tyScaleOrient : \"left\",\n\t\t\txTitle:\"\",\n\t\t\tyTitle:\"\",\n\t\t\ttitle:\"\",\n\t\t\tticks\t: 10,\n\t\t\tgridTicks : 10,\n\t\t\ttickFormat:\",r\",\n\t\t\tsetAxisContainer: function(svg){\n\t\t\t\tif(!isDefined(svg) || isNull(svg)){\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t\tthis.height = svg.attr(\"height\");\n\t\t\t\tthis.width = svg.attr(\"width\");\n\t\t\t\tthis.svg\t= svg;\n\t\t\t},\n\t\t\tmakeLinearScale : function(range,domain){\n\t\t\t\treturn d3.scale.linear().range(range).domain(domain).nice();\n\t\t\t},\n\t\t\tsetXScale\t: function(xScale){\n\t\t\t\tthis.xScale = xScale;\n\t\t\t\tthis.xAxis = d3.svg.axis().scale(xScale).orient(this.xScaleOrient).ticks(this.ticks, this.tickFormat);\n\t\t\t this.xGrid = d3.svg.axis().scale(xScale).orient(this.xScaleOrient).tickSize(-this.height, 0, 0).ticks(this.gridTicks).tickFormat(\"\");\n\t\t\t},\n\t\t\tsetYScale\t:function(yScale){\n\t\t\t\tthis.yScale = yScale;\n\t\t\t\tthis.yAxis = d3.svg.axis().scale(yScale).orient(this.yScaleOrient).ticks(this.ticks, this.tickFormat);\n\t\t\t this.yGrid = d3.svg.axis().scale(yScale).orient(this.yScaleOrient).tickSize(-this.width, 0, 0).ticks(this.gridTicks).tickFormat(\"\");\n\t\t\t},\n\t\t\tdraw\t: function(){\n\t\t\t\tconsole.log(\"Drawing Axis.\");\n\t\t\t\tthis.clear();\n\t\t\t\tif(this.drawGrid && this.drawYGrid){\n\t\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\", \"grid\").call(this.yGrid);\n\t\t\t\t}\n\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\",\"axis\").call(this.yAxis);\n\t\t\t\t//Y axis title\n\t\t\t\tthis.svg.append(\"g\")\n\t\t\t\t.attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .attr(\"transform\", \"rotate(-90)\")\n\t\t\t .text(this.yTitle)\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .attr(\"x\",-((this.height/2)))\n\t\t\t .attr(\"y\",-30);\n\t\t\t\t\n\t\t\t\tif(this.drawGrid && this.drawXGrid){\n\t\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\", \"grid\").attr(\"transform\", \"translate(0,\" + this.height + \")\").call(this.xGrid);\n\t\t\t\t}\n\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\",\"axis\").attr(\"transform\", \"translate(0,\" + this.height + \")\").call(this.xAxis);\n\t\t\t\t//X axis title\n\t\t\t this.svg.append(\"g\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"transform\", \"translate(0,\" + this.height + \")\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .text(this.xTitle)\n\t\t\t .attr(\"x\",(this.width/2))\n\t\t\t .attr(\"y\",30);\n\t\t\t //chart Title\n\t\t\t this.svg.append(\"g\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"class\",\"chartTitle\")\n\t\t\t .text(this.title)\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .attr(\"x\",(this.width/2))\n\t\t\t .attr(\"y\",0);\n\t\t\t},\n\t\t\tclear : function(){\n\t\t\t\tthis.svg.selectAll(\".grid\").remove();\n\t\t\t\tthis.svg.selectAll(\".axis\").remove();\n\t\t\t\tthis.svg.selectAll(\".axisLabel\").remove();\n\t\t\t}\n\t};\n\t\n\tthis.$get = function(){\n\t\treturn axisProviderImpl;\n\t};\n}", "getDataExtents(activeBrushes, includeDiscrete) {\n let dataExtents = {};\n for (let i = 0; i < this.activeDimensions.length; i++) {\n let dimension = this.activeDimensions[i];\n\n //invert not supported for categorical scales, so skip them\n if (this.dimensionMetadata[dimension].discrete && !includeDiscrete) continue;\n\n let activeBrush = activeBrushes.find(\n brush => brush.dimension === dimension\n );\n\n if (!activeBrush) {\n continue;\n }\n\n if (this.dimensionMetadata[dimension].discrete) {\n for (let j = 0; j < this.data.length; j++) {\n let pixelPosition = this.yScales[dimension](this.data[j][dimension]);\n if (pixelPosition >= d3.min(activeBrush.extent) && pixelPosition <= d3.max(activeBrush.extent)) {\n if (!dataExtents[dimension]) {\n dataExtents[dimension] = [];\n }\n\n if (!dataExtents[dimension].includes(this.data[j][dimension])) {\n dataExtents[dimension].push(this.data[j][dimension]);\n }\n }\n }\n } else {\n dataExtents[dimension] = [\n this.yScales[dimension].invert(activeBrush.extent[0]),\n this.yScales[dimension].invert(activeBrush.extent[1])\n ];\n }\n }\n\n return dataExtents;\n }", "_updateValue(row, column, newValue) {\n const that = this,\n oldValue = that._getValueInCell(row, column);\n\n if (!that._areDifferent(newValue, oldValue)) {\n return;\n }\n\n const dimensionValues = that._coordinates,\n actualIndexes = dimensionValues.slice(0),\n changedValueDimensions = [];\n\n if (that.arrayIndexingMode === 'LabVIEW') {\n actualIndexes[actualIndexes.length - 1] += column;\n actualIndexes[actualIndexes.length - 2] += row;\n }\n else {\n actualIndexes[0] += column;\n actualIndexes[1] += row;\n }\n\n for (let i = 0; i < that.dimensions; i++) {\n if (i === 0) { // x\n if (that._oneDimensionSpecialCase === false) {\n changedValueDimensions.push(actualIndexes[0]);\n }\n else {\n changedValueDimensions.push(row + dimensionValues[0]);\n }\n }\n else if (i === 1) { // y\n changedValueDimensions.push(actualIndexes[1]);\n }\n else { // other dimensions\n changedValueDimensions.push(actualIndexes[i]);\n }\n }\n\n let tempArr = that.value;\n\n for (let j = 0; j < changedValueDimensions.length; j++) {\n if (tempArr[changedValueDimensions[j]] === undefined || tempArr[changedValueDimensions[j]] === oldValue) {\n if (j !== changedValueDimensions.length - 1) {\n tempArr[changedValueDimensions[j]] = [];\n }\n else {\n tempArr[changedValueDimensions[j]] = newValue;\n }\n }\n tempArr = tempArr[changedValueDimensions[j]];\n }\n\n that._fillValueArray(changedValueDimensions.slice(0));\n\n that.$.fireEvent('change', { 'value': newValue, 'oldValue': oldValue, 'dimensionIndexes': changedValueDimensions });\n }", "function UltraGrid_GetData()\n{\n\t//create an array for the result\n\tvar result = [];\n\t//return it\n\treturn result;\n}", "function getDataArray(obj) {\n\t if (obj.rows) {\n\t return obj.rows;\n\t } else if (obj.columns) {\n\t return obj.columns;\n\t } else if (obj.series) {\n\t return [obj];\n\t }\n\t }", "_addDimensionToJSArray(dimensions) {\n const that = this;\n\n if (that.arrayIndexingMode === 'LabVIEW') {\n that.value = [that.value];\n }\n else {\n if (dimensions === undefined) {\n dimensions = that.dimensions - 1;\n }\n\n const recursion = function (arr, level) {\n for (let i = 0; i < arr.length; i++) {\n if (level !== dimensions) {\n recursion(arr[i], level + 1);\n }\n else {\n arr[i] = [arr[i]];\n }\n }\n };\n\n recursion(that.value, 1);\n }\n }", "function defaultGetter() {\n return defaultUnidimensionalValue;\n }", "function DataViewWriter(byteLength) {\nvar data, offset, that = this;\nfunction init(callback, onerror) {\ndata = getDataHelper(byteLength);\noffset = 0;\ncallback();\n}\nfunction writeUint8Array(array, callback, onerror) {\n//window.console.log(\"Adding byte range [\"+offset+\"..\"+(offset+array.byteLength)+\")\");\ndata.array.set(array, offset);\noffset += array.byteLength;\ncallback();\n}\nfunction getData(callback) {\ncallback(data.view);\n}\nthat.init = init;\nthat.writeUint8Array = writeUint8Array;\nthat.getData = getData;\n}", "function data(){\n return [1,2,3,4,5]; \n}", "function data(){\n return [1,2,3,4,5]; \n}", "__get_t(arr_val) {\n if (this.__is_1D_array(arr_val)) {\n const dtypes = []\n let int_tracker = []\n let float_tracker = []\n let string_tracker = []\n let bool_tracker = []\n let lim;\n\n //remove NaNs from array\n let arr = []\n arr_val.map(val => {\n if (!(isNaN(val) && typeof val != \"string\")) {\n arr.push(val)\n }\n })\n\n if (arr.length < config.get_dtype_test_lim) {\n lim = arr.length - 1\n } else {\n lim = config.get_dtype_test_lim - 1\n }\n arr.forEach((ele, indx) => {\n let count = indx\n if (typeof ele == 'boolean') {\n float_tracker.push(false)\n int_tracker.push(false)\n string_tracker.push(false)\n bool_tracker.push(true)\n } else if (!isNaN(Number(ele))) {\n\n if (ele.toString().includes(\".\")) {\n float_tracker.push(true)\n int_tracker.push(false)\n string_tracker.push(false)\n bool_tracker.push(false)\n } else {\n float_tracker.push(false)\n int_tracker.push(true)\n string_tracker.push(false)\n bool_tracker.push(false)\n\n }\n } else {\n float_tracker.push(false)\n int_tracker.push(false)\n string_tracker.push(true)\n bool_tracker.push(false)\n }\n\n if (count == lim) {\n //if atleast one string appears return string dtype\n const even = (element) => element == true;\n if (string_tracker.some(even)) {\n dtypes.push(\"string\")\n } else if (float_tracker.some(even)) {\n dtypes.push(\"float32\")\n } else if (int_tracker.some(even)) {\n dtypes.push(\"int32\")\n } else if (bool_tracker.some(even)) {\n dtypes.push(\"boolean\")\n } else {\n dtypes.push(\"undefined\")\n }\n }\n })\n\n return dtypes\n\n } else {\n const dtypes = []\n let lim;\n if (arr_val[0].length < config.get_dtype_test_lim) {\n lim = arr_val[0].length - 1\n } else {\n lim = config.get_dtype_test_lim - 1\n }\n arr_val.forEach((ele) => {\n let int_tracker = []\n let float_tracker = []\n let string_tracker = []\n let bool_tracker = []\n\n //remove NaNs from array before checking dtype\n let arr = []\n ele.map(val => {\n if (!(isNaN(val) && typeof val != \"string\")) {\n arr.push(val)\n } else {\n arr.push(\"NaN\") //set NaN to string and return dtype \"\"string\". The caller should explicitly convert the dtype\n }\n })\n\n arr.forEach((ele, indx) => {\n let count = indx\n if (typeof ele == 'boolean') {\n float_tracker.push(false)\n int_tracker.push(false)\n string_tracker.push(false)\n bool_tracker.push(true)\n\n } else if (!isNaN(Number(ele))) {\n\n if (ele.toString().includes(\".\")) {\n float_tracker.push(true)\n int_tracker.push(false)\n string_tracker.push(false)\n bool_tracker.push(false)\n } else {\n float_tracker.push(false)\n int_tracker.push(true)\n string_tracker.push(false)\n bool_tracker.push(false)\n\n }\n } else {\n float_tracker.push(false)\n int_tracker.push(false)\n string_tracker.push(true)\n bool_tracker.push(false)\n }\n\n if (count == lim) {\n //if atleast one string appears return string dtype\n const even = (element) => element == true;\n if (string_tracker.some(even)) {\n dtypes.push(\"string\")\n } else if (float_tracker.some(even)) {\n dtypes.push(\"float32\")\n } else if (int_tracker.some(even)) {\n dtypes.push(\"int32\")\n } else if (bool_tracker.some(even)) {\n dtypes.push(\"boolean\")\n } else {\n dtypes.push(\"undefined\")\n }\n }\n })\n\n });\n\n return dtypes\n }\n }", "function MemDataProvider() {\n\tthis._init();\n}", "gather(indices, dtype) {\n if (!!dtype && dtype !== this.dtype) {\n throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${dtype}`);\n }\n if (!indices) {\n indices = [];\n for (let i = 0; i < this.size(); i++) {\n indices.push(i);\n }\n }\n else {\n indices = indices.slice(0, this.size());\n }\n if (indices.length === 0) {\n return Object(_tensorflow_tfjs_core__WEBPACK_IMPORTED_MODULE_0__[\"tensor\"])([], [0].concat(this.elementShape));\n }\n // Read all the PersistentTensors into a vector to keep track of\n // their memory.\n const tensors = this.readMany(indices);\n Object(_tensor_utils__WEBPACK_IMPORTED_MODULE_1__[\"assertShapesMatchAllowUndefinedSize\"])(this.elementShape, tensors[0].shape, 'TensorArray shape mismatch: ');\n return Object(_tensorflow_tfjs_core__WEBPACK_IMPORTED_MODULE_0__[\"stack\"])(tensors, 0);\n }", "function calcMetaDataField_geoSubset(data,params,field)\n{\n var eventsField = normalizeField(field,'target','geoSubset')[0];\n var positionsField = normalizeField(field,'target','geoSubset')[1];\n var shape = normalizeField(field,'shape','geoSubset')[0];\n var x = normalizeField(field,'x','geoSubset')[0];\n var y = normalizeField(field,'y','geoSubset')[0];\n var width = normalizeField(field,'width','geoSubset')[0];\n var height = normalizeField(field,'height','geoSubset')[0];\n\n // normalizing will ensure we get an array for each, which may be empty\n var eventsArray = normalizeDataItem(data,eventsField);\n var positionsArray = normalizeDataItem(data,positionsField);\n\n return(geoSubsetOP(eventsArray,positionsArray,shape,x,y,width,height));\n}", "getData(numRecords = undefined) {\n return !numRecords ? this.data : this.data.slice(0, numRecords);\n }", "function dimensionConstructor(driver){\n var driver = driver;\n return $rootScope.dataMeta.crossFilterData.dimension(function(d) { return d[driver]; });\n }", "function getSlice(dimensionName) {\n if (typeof filters[dimensionName] != \"undefined\") {\n return filters[dimensionName];\n }\n else {\n return dimensions[dimensionName].members;\n }\n }", "get defaultValueSampledData() {\n\t\treturn this.__defaultValueSampledData;\n\t}", "function defaultGetter() {\n return defaultUnidimensionalValue;\n }", "function MultiCPUDataProvider() {\n\tthis._init();\n}", "function get_dataset(i) {\n var dataSet;\n if (subtypeIndex[1] === null) {\n dataSet = calculateGraphPoints(1, 100, parseFloat(ligandTableCell(subtypeIndex[0] + 1, i).value));\n } else {\n dataSet = calculateGraphPoints(2,\n subtypePercentage[0],parseFloat(ligandTableCell(subtypeIndex[0] + 1, i).value),\n subtypePercentage[1],parseFloat(ligandTableCell(subtypeIndex[1]+1, i).value));\n }\n return dataSet\n }", "function reconstructDataset(values) {\n // normalize array length to 1000, as precision isn't as important as speed here\n const divisor = state.dataset.attributes.recordCount / 1000;\n // const divisor = 1; // alternately, use the whole set\n let arr = [];\n for (let x = 0; x < values.length; x++) {\n for (let y = 0; y < Math.ceil(values[x].count/divisor); y++) {\n arr.push(values[x].value);\n };\n }\n return arr;\n }", "function aggregateData(data, params) {\n if (data.length == 0) {\n throw {\n fatal: 'Dataset is empty. Can not draw the graph.'\n }\n }\n\n var i, j, l;\n\n var dimHash = [];\n var keyHash = {};\n var dimValues = [];\n var rec, dim, key;\n var dl = params.dimensions.length;\n var dimensions = [];\n\n for (j = 0; j < dl; j++) {\n dimHash[j] = {};\n dimValues[j] = [];\n dimensions.push(params.dimensions[j].name);\n }\n var claimDataIndex = $('.claim-data-tab-container .tab li').index($('.claim-data-tab-container .tab li.active')[0]);\n for (i = 0, l = data.length; i < l; i++) {\n rec = data[i];\n key = [];\n for (j = 0; j < dl; j++) {\n dim = rec[dimensions[j]];\n key.push(dim);\n if (!dimHash[j][dim]) {\n dimHash[j][dim] = 1;\n dimValues[j].push(dim);\n }\n }\n key = key.join('|');\n\n if (!keyHash[key]) {\n keyHash[key] = (fieldTypesAll[claimDataIndex][params.measure] == 'integer' ? rec[params.measure] : 1);\n } else {\n keyHash[key] += (fieldTypesAll[claimDataIndex][params.measure] == 'integer' ? rec[params.measure] : 1);\n }\n }\n\n var res = {\n data: {\n lines: []\n }\n };\n\n // Available data is limited to prevent bad charts drawing\n if (dimValues[0].length > FIRST_DIMENSION_LIMIT) {\n dimValues[0] = dimValues[0].splice(-FIRST_DIMENSION_LIMIT);\n }\n if (dimValues[1] && dimValues[1].length > SECOND_DIMENSION_LIMIT) {\n dimValues[1] = dimValues[1].splice(-SECOND_DIMENSION_LIMIT);\n throw {\n fatal: 'Group dimension limit reached. Chart can not be displayed'\n }\n }\n\n for (i = 0; i < dimValues.length; i++) {\n dimValues[i].sort();\n }\n\n // Copy values to dimension axis\n res.xAxis = dimValues[0].slice();\n\n if (dimValues.length == 1) {\n res.data.lines[0] = {data: [], title: \"\"};\n for (i = 0; i < dimValues[0].length; i++){\n res.data.lines[0].data.push(keyHash[dimValues[0][i]]);\n }\n } else {\n for (j = 0; j < dimValues[1].length; j++) {\n var line = {\n data: [],\n title: dimValues[1][j]\n };\n res.data.lines.push(line);\n for (i = 0; i < dimValues[0].length; i++){\n res.data.lines[j].data.push(keyHash[dimValues[0][i] + '|' + dimValues[1][j]]);\n }\n }\n }\n\n return res;\n }", "get flexibleDimensions() { return this._flexibleDimensions; }", "$setValues(values, checkLength = true, checkColumnLength = true) {\n if (this.$isSeries) {\n if (checkLength && values.length != this.shape[0]) {\n ErrorThrower.throwRowLengthError(this, values.length);\n }\n\n this.$data = values;\n this.$dtypes = utils.inferDtype(values); //Dtype may change depeneding on the value set\n\n if (!this.$config.isLowMemoryMode) {\n this.$dataIncolumnFormat = values;\n }\n\n } else {\n if (checkLength && values.length != this.shape[0]) {\n ErrorThrower.throwRowLengthError(this, values.length);\n }\n\n if (checkColumnLength) {\n values.forEach((value) => {\n if ((value).length != this.shape[1]) {\n ErrorThrower.throwColumnLengthError(this, values.length);\n }\n });\n }\n\n this.$data = values;\n this.$dtypes = utils.inferDtype(values);\n\n if (!this.$config.isLowMemoryMode) {\n this.$dataIncolumnFormat = utils.transposeArray(values);\n }\n\n }\n\n }", "function GetDimension()\n{\n\treturn m_dimension;\n}", "get valueSampledData () {\r\n\t\treturn this._valueSampledData;\r\n\t}", "supportsDoubleArrayValues() {\n return true;\n }", "compute(data, splits) {\n // Validate that the splits are valid indices into data, only if there are\n // splits specified.\n const inputDataSize = data.length;\n const splitsSize = splits.length;\n if (splitsSize > 0) {\n let prevSplit = splits[0];\n if (prevSplit !== 0) {\n throw new Error(`First split value must be 0, got ${prevSplit}`);\n }\n for (let i = 1; i < splitsSize; ++i) {\n let validSplits = splits[i] >= prevSplit;\n validSplits = validSplits && (splits[i] <= inputDataSize);\n if (!validSplits) {\n throw new Error(`Invalid split value ${splits[i]}, must be in [${prevSplit}, ${inputDataSize}]`);\n }\n prevSplit = splits[i];\n }\n if (prevSplit !== inputDataSize) {\n throw new Error(`Last split value must be data size. Expected ${inputDataSize}, got ${prevSplit}`);\n }\n }\n const numBatchItems = splitsSize - 1;\n const nGramsSplits = util.getArrayFromDType('int32', splitsSize);\n // If there is no data or size, return an empty ragged tensor.\n if (inputDataSize === 0 || splitsSize === 0) {\n const empty = new Array(inputDataSize);\n for (let i = 0; i <= numBatchItems; ++i) {\n nGramsSplits[i] = 0;\n }\n return [empty, nGramsSplits];\n }\n nGramsSplits[0] = 0;\n for (let i = 1; i <= numBatchItems; ++i) {\n const length = splits[i] - splits[i - 1];\n let numNGrams = 0;\n this.nGramWidths.forEach((nGramWidth) => {\n numNGrams += this.getNumNGrams(length, nGramWidth);\n });\n if (this.preserveShort && length > 0 && numNGrams === 0) {\n numNGrams = 1;\n }\n nGramsSplits[i] = nGramsSplits[i - 1] + numNGrams;\n }\n const nGrams = new Array(nGramsSplits[numBatchItems]);\n for (let i = 0; i < numBatchItems; ++i) {\n const splitIndex = splits[i];\n let outputStartIdx = nGramsSplits[i];\n this.nGramWidths.forEach((nGramWidth) => {\n const length = splits[i + 1] - splits[i];\n const numNGrams = this.getNumNGrams(length, nGramWidth);\n this.createNGrams(data, splitIndex, nGrams, outputStartIdx, numNGrams, nGramWidth);\n outputStartIdx += numNGrams;\n });\n // If we're preserving short sequences, check to see if no sequence was\n // generated by comparing the current output start idx to the original\n // one (nGramSplitsdata). If no ngrams were generated, then they will\n // be equal (since we increment outputStartIdx by numNGrams every\n // time we create a set of ngrams.)\n if (this.preserveShort && outputStartIdx === nGramsSplits[i]) {\n const dataLength = splits[i + 1] - splits[i];\n // One legitimate reason to not have any ngrams when this.preserveShort\n // is true is if the sequence itself is empty. In that case, move on.\n if (dataLength === 0) {\n continue;\n }\n // We don't have to worry about dynamic padding sizes here: if padding\n // was dynamic, every sequence would have had sufficient padding to\n // generate at least one nGram.\n const nGramWidth = dataLength + 2 * this.padWidth;\n const numNGrams = 1;\n this.createNGrams(data, splitIndex, nGrams, outputStartIdx, numNGrams, nGramWidth);\n }\n }\n return [nGrams, nGramsSplits];\n }", "function DataSet(){\n\tthis.values = new Array();\n\t\n\t\n\tDataSet.prototype.size = function(){\n\t\treturn this.values.length;\n\t}\n\t\n\t\n\tDataSet.prototype.has = function(value){\n\t\tfor(var i=0;i< this.values.length;i++){\n\t\t\tif(this.values[i] == value){\n\t\t\t\treturn true;\n\t\t\t} \n\t\t}\n\t\treturn false;\n\t}\n\t\n\tDataSet.prototype.get = function(no){\n\t\tif(no < this.size() && no >=0){\n\t\t\treturn this.values[no]; \n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t}\n\t\n\tDataSet.prototype.remove = function(value){\n\t\tfor(var i=0;i< this.values.length;i++){\n\t\t\tif(this.values[i] == value){\n\t\t\t\tthis.values.splice(i,1);\n\t\t\t\treturn true;\n\t\t\t} \n\t\t}\n\t\treturn false;\n\t}\n\t\n\t\n\tDataSet.prototype.add = function(value){\n\t\t\n\t\tif(this.has(value)){\n\t\t\treturn false\n\t\t}else{\n\t\t\tthis.values.push(value);\n\t\t\treturn true;\n\t\t}\n\t}\n\t\n\tDataSet.prototype.clear = function(){\n\t\tfor(var i=0;i< this.values.length;i++){\n\t\t\tthis.remove(this.values[i]);\n\t\t}\n\t}\n\t\n}", "getDimensions() {\n return { x: 1, y: 1, z: 1 };\n }", "function getDimCount(source, sysDims, dimsDef, optDimCount) {\n\t // Note that the result dimCount should not small than columns count\n\t // of data, otherwise `dataDimNameMap` checking will be incorrect.\n\t var dimCount = Math.max(source.dimensionsDetectedCount || 1, sysDims.length, dimsDef.length, optDimCount || 0);\n\t each(sysDims, function (sysDimItem) {\n\t var sysDimItemDimsDef;\n\t\n\t if (isObject(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) {\n\t dimCount = Math.max(dimCount, sysDimItemDimsDef.length);\n\t }\n\t });\n\t return dimCount;\n\t }", "getLimitsValues(modelArr, lineValue){\n\t \t\t var arr = Array.apply(null, Array(modelArr.length))\n\t \t\t arr.splice(0, 1, lineValue)\n\t \t\t arr.splice(-1, 1, lineValue)\n\t \t\t return arr\n\t \t}", "getMetricsFromGrid() {\n const sampleArr = this.$parent.sampleArr;\n const gridData = this.$parent.state.gridData;\n const metricsDependingOnGrid = [];\n for (const metric of sampleArr) {\n for (const e of gridData) {\n if (metric.name === e.metric) {\n metricsDependingOnGrid.push(metric);\n }\n }\n }\n return metricsDependingOnGrid;\n }", "function TypedArray(arg1) {\nvar result;\n if (typeof arg1 === \"number\") {\n result = new Array(arg1);\n \n for (var i = 0; i < arg1; ++i)\n result[i] = 0;\n } else\n result = arg1.slice(0)\n\n result.subarray = subarray\n result.buffer = result\n result.byteLength = result.length\n result.set = set_\n\n if (typeof arg1 === \"object\" && arg1.buffer)\n result.buffer = arg1.buffer\n \n return result\n\n}", "get dimension() {\r\n return this.cpoints.shape[1];\r\n }", "get dimension() {\r\n return this.cpoints.shape[1];\r\n }", "function data(){\n return [1,2,3]; \n}", "function data(){\n return [1,2,3]; \n}", "function getAllData(dataService, dataSet) {\n\n}", "function getDataSubset() {\n const calculations = [{\n value: thirdParameter,\n method: \"Average\",\n },\n {\n value: \"Height\",\n method: \"Min\",\n },\n {\n value: \"Height\",\n method: \"Max\",\n },\n {\n value: \"Weight\",\n method: \"Min\",\n },\n {\n value: \"Weight\",\n method: \"Max\",\n },\n {\n value: \"Age\",\n method: \"Min\",\n },\n {\n value: \"Age\",\n method: \"Max\",\n },\n ];\n return gmynd.cumulateData(segmentedAthletes, [\"Sex\", ...currentFilters], calculations);\n}", "function X3domCreateArray(data, dim){\n if (dim ==1) return new x3dom.fields.MFFloat(data);\n let length = data.length/dim;\n let res = Array(length);\n let vectType = \"SFVec\"+String(dim)+\"f\";\n for (let i = 0; i < length ; i++) {\n // If dim == 2 , the third values are ignored\n res[i] = new x3dom.fields[vectType](data[dim*i],\n data[dim*i+1],\n data[dim*i+2]);\n }\n let arrayType = \"MFVec\"+String(dim)+\"f\";\n let out = new x3dom.fields[arrayType](res);\n return out;\n}", "function determineSourceDimensions(data, sourceFormat, seriesLayoutBy, sourceHeader, // standalone raw dimensions definition, like:\n// {\n// dimensions: ['aa', 'bb', { name: 'cc', type: 'time' }]\n// }\n// in `dataset` or `series`\ndimensionsDefine) {\n var dimensionsDetectedCount;\n var startIndex; // PEDING: could data be null/undefined here?\n // currently, if `dataset.source` not specified, error thrown.\n // if `series.data` not specified, nothing rendered without error thrown.\n // Should test these cases.\n\n if (!data) {\n return {\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\n startIndex: startIndex,\n dimensionsDetectedCount: dimensionsDetectedCount\n };\n }\n\n if (sourceFormat === _util_types__WEBPACK_IMPORTED_MODULE_1__[/* SOURCE_FORMAT_ARRAY_ROWS */ \"c\"]) {\n var dataArrayRows = data; // Rule: Most of the first line are string: it is header.\n // Caution: consider a line with 5 string and 1 number,\n // it still can not be sure it is a head, because the\n // 5 string may be 5 values of category columns.\n\n if (sourceHeader === 'auto' || sourceHeader == null) {\n arrayRowsTravelFirst(function (val) {\n // '-' is regarded as null/undefined.\n if (val != null && val !== '-') {\n if (Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_0__[/* isString */ \"C\"])(val)) {\n startIndex == null && (startIndex = 1);\n } else {\n startIndex = 0;\n }\n } // 10 is an experience number, avoid long loop.\n\n }, seriesLayoutBy, dataArrayRows, 10);\n } else {\n startIndex = Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_0__[/* isNumber */ \"y\"])(sourceHeader) ? sourceHeader : sourceHeader ? 1 : 0;\n }\n\n if (!dimensionsDefine && startIndex === 1) {\n dimensionsDefine = [];\n arrayRowsTravelFirst(function (val, index) {\n dimensionsDefine[index] = val != null ? val + '' : '';\n }, seriesLayoutBy, dataArrayRows, Infinity);\n }\n\n dimensionsDetectedCount = dimensionsDefine ? dimensionsDefine.length : seriesLayoutBy === _util_types__WEBPACK_IMPORTED_MODULE_1__[/* SERIES_LAYOUT_BY_ROW */ \"b\"] ? dataArrayRows.length : dataArrayRows[0] ? dataArrayRows[0].length : null;\n } else if (sourceFormat === _util_types__WEBPACK_IMPORTED_MODULE_1__[/* SOURCE_FORMAT_OBJECT_ROWS */ \"e\"]) {\n if (!dimensionsDefine) {\n dimensionsDefine = objectRowsCollectDimensions(data);\n }\n } else if (sourceFormat === _util_types__WEBPACK_IMPORTED_MODULE_1__[/* SOURCE_FORMAT_KEYED_COLUMNS */ \"d\"]) {\n if (!dimensionsDefine) {\n dimensionsDefine = [];\n Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_0__[/* each */ \"k\"])(data, function (colArr, key) {\n dimensionsDefine.push(key);\n });\n }\n } else if (sourceFormat === _util_types__WEBPACK_IMPORTED_MODULE_1__[/* SOURCE_FORMAT_ORIGINAL */ \"f\"]) {\n var value0 = Object(_util_model__WEBPACK_IMPORTED_MODULE_2__[/* getDataItemValue */ \"h\"])(data[0]);\n dimensionsDetectedCount = Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_0__[/* isArray */ \"t\"])(value0) && value0.length || 1;\n } else if (sourceFormat === _util_types__WEBPACK_IMPORTED_MODULE_1__[/* SOURCE_FORMAT_TYPED_ARRAY */ \"g\"]) {\n if (false) {}\n }\n\n return {\n startIndex: startIndex,\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\n dimensionsDetectedCount: dimensionsDetectedCount\n };\n}", "function SizeData() {\n\t\t// #### Y Axis ####\n\t\t// Y Axis Min & Max\n\n\t\t// Get the initial Min & Max\n\t\tvar max = Math.max.apply(null, me.g_data[1]);\n\t\tvar min = Math.min.apply(null, me.g_data[1]);\n\n\t\t// Find the other series max & min\n\t\tfor (var i = me.g_data.length; i > 1; i--) {\n\n\t\t\tvar max2 = Math.max.apply(null, me.g_data[i]);\n\t\t\tvar min2 = Math.min.apply(null, me.g_data[i]);\n\n\t\t\t// If the max or min are more significant, use them\n\t\t\tif (max < max2) {\n\t\t\t\tmax = max2;\n\t\t\t}\n\t\t\tif (min > min2) {\n\t\t\t\tmin = min2;\n\t\t\t}\n\t\t}\n\n\t\t// If the default min & max aren't more relevant, add our derived one in.\n\t\tif (me.maxY == null || me.maxY < max) {\n\t\t\tme.maxY = max;\n\t\t}\n\t\tif (me.minY == null || me.minY > min) {\n\t\t\tme.minY = min;\n\t\t}\n\n\t\t// X Axis\n\n\t\tif (typeof (me.g_data[0][0]) == \"number\") {\n\t\t\t// Get the initial Min & Max\n\t\t\tvar max = Math.max.apply(null, me.g_data[0]);\n\t\t\tvar min = Math.min.apply(null, me.g_data[0]);\n\n\t\t\tme.maxX = max;\n\t\t\tme.minX = min;\n\t\t}\n\t\telse if (typeof (me.g_data[0][0]) == \"object\") {\n\n\t\t\t// We are working with dates\n\t\t\tvar seconds = [];\n\t\t\tfor (var i = 0; i < me.g_data[0].length; i++) {\n\t\t\t\tvar d = new Date(me.g_data[0][i][0], me.g_data[0][i][1], me.g_data[0][i][2]);\n\n\t\t\t\tseconds[i] = d.valueOf();\n\t\t\t}\n\n\t\t\tvar max = Math.max.apply(null, seconds);\n\t\t\tvar min = Math.min.apply(null, seconds);\n\n\t\t\tme.maxX = max;\n\t\t\tme.minX = min;\n\n\t\t}\n\t\telse {\n\t\t\t// Standard string X Axis\n\t\t\tme.maxX = me.g_data[0].length;\n\t\t\tme.minX = 0;\n\t\t}\n\t}", "get axis() {\n return {\n index: this.$index,\n columns: this.$columns\n };\n }", "split(length, tensor) {\n if (tensor.dtype !== this.dtype) {\n throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${tensor.dtype}`);\n }\n let totalLength = 0;\n const cumulativeLengths = length.map(len => {\n totalLength += len;\n return totalLength;\n });\n if (totalLength !== tensor.shape[0]) {\n throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${totalLength}, and tensor's shape is: ${tensor.shape}`);\n }\n if (!this.dynamicSize && length.length !== this.maxSize) {\n throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${length.length}), ` +\n 'and the TensorArray is not marked as dynamically resizeable');\n }\n const elementPerRow = totalLength === 0 ? 0 : tensor.size / totalLength;\n const tensors = [];\n Object(_tensorflow_tfjs_core__WEBPACK_IMPORTED_MODULE_0__[\"tidy\"])(() => {\n tensor = Object(_tensorflow_tfjs_core__WEBPACK_IMPORTED_MODULE_0__[\"reshape\"])(tensor, [1, totalLength, elementPerRow]);\n for (let i = 0; i < length.length; ++i) {\n const previousLength = (i === 0) ? 0 : cumulativeLengths[i - 1];\n const indices = [0, previousLength, 0];\n const sizes = [1, length[i], elementPerRow];\n tensors[i] = Object(_tensorflow_tfjs_core__WEBPACK_IMPORTED_MODULE_0__[\"reshape\"])(Object(_tensorflow_tfjs_core__WEBPACK_IMPORTED_MODULE_0__[\"slice\"])(tensor, indices, sizes), this.elementShape);\n }\n return tensors;\n });\n const indices = [];\n for (let i = 0; i < length.length; i++) {\n indices[i] = i;\n }\n this.writeMany(indices, tensors);\n }", "function refreshDataFromBackend(d)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(d.depth ==999){\r\n\t\t\t\t \tapp.clearAll();\r\n\t\t\t\t\t//self.backendApi.selectValues(2,window.dimKeyArr,true);\r\n\t\t\t\t }\r\n\t\t\t\t\r\n\t\t\t\t //set node click to Qlik Sense to select dimension in app for only leaf node\r\n\t\t\t\t else if(d.dim_key !== 'undefined' && d.depth > 0){// maxDepthEx-(maxDepth -1){\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar dimValKey = parseInt(d.dim_key, 0);\r\n\t\t\t\t\tvar dimParentValKey = parseInt(d.parent.dim_key, 0);\r\n\t\t\t\t\t//var dimParentValKey = parseInt(d.parent.dim_key, 0);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Clear all selections before selecting clicked leaf node and its parent\r\n\t\t\t\t\tapp.clearAll();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//console.log((d.depth-1) + \" \" + d.dim_key);\r\n\t\t\t\t\tif(!isNaN(dimParentValKey))\r\n\t\t\t\t\tself.backendApi.selectValues(d.depth-2,[dimParentValKey],true);\r\n\t\t\t\t\tself.backendApi.selectValues(d.depth-1,[dimValKey],true);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//app.field('Brand').selectValues([globalAllBrands], true, true);\r\n\t\t\t\t }\r\n\t\t\t\t \r\n\t\t\t\t //else if(d.name == \"Global\" && d.parent.length < 1){\r\n\t\t\t\t else if(d.depth ==0){\r\n\t\t\t\t \tapp.clearAll();\r\n\t\t\t\t\tself.backendApi.selectValues(2,window.dimKeyArr,true);\r\n\t\t\t\t }\r\n\t\t\t\r\n}", "function all() {\n if (reduceMeasures.length > 0)\n return getData(dimensionName, true, reduceMeasures);\n else\n return getData(dimensionName, true);\n }", "function ApacheChartBuffer(size)\n{\n this.maxStreamLength = document.all?5000:100000;\t\n this.data = new Array(size?size:100);\n this.iStr = 0;\n}", "function setUpDataSet(){\n \t var DS = [];\n \t for(var i = 0 ; i < 5;i++){DS.push([{Priority:''}])}\t\n \t return DS;\n }", "getDashboardDataArray(properties, chartArrayTypeName, plantingDate, harvestDate) {\n\n\t\tlet chartDataArray = {};\n\t\tlet minTime = plantingDate.getTime();\n\t\tlet maxTime = harvestDate.getTime();\n\n\t\tlet chartOptions = {};\n\n\t\tif (properties.hasOwnProperty(chartArrayTypeName) && properties[chartArrayTypeName] !== null) {\n\t\t\tif(properties[chartArrayTypeName].hasOwnProperty(\"charts\")){\n\t\t\t\t// Iterate over each chart\n\t\t\t\tlet charts = properties[chartArrayTypeName].charts;\n\t\t\t\tfor (let dataIndex = 0; dataIndex < charts.length; dataIndex++) {\n\t\t\t\t\tlet chartRawData = charts[dataIndex];\n\n\t\t\t\t\tlet rawDatasets = chartRawData.datasets;\n\t\t\t\t\tlet parsedDatasets = [];\n\n\t\t\t\t\t// Iterate over each dataset in the chart\n\t\t\t\t\tfor (let datasetIndex = 0; datasetIndex < rawDatasets.length; datasetIndex++) {\n\n\t\t\t\t\t\tlet rawData = rawDatasets[datasetIndex].data;\n\t\t\t\t\t\tlet parsedData = [];\n\n\t\t\t\t\t\t// Generate data to be added to the dataset\n\t\t\t\t\t\tfor (let dataIndex = 0; dataIndex < rawData.length; dataIndex++) {\n\t\t\t\t\t\t\t// TODO: Remove the if condition. Temporary fix till server-side bug is fixed.\n\t\t\t\t\t\t\tif (!(chartRawData.title === \"Carbon : Nitrogen\" && dataIndex === 0)) {\n\t\t\t\t\t\t\t\tparsedData.push({\n\t\t\t\t\t\t\t\t\tx: new Date(rawData[dataIndex].YEAR, 0, rawData[dataIndex].DOY),\n\t\t\t\t\t\t\t\t\ty: rawData[dataIndex].value\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Create dataset object with appropriate options and data\n\t\t\t\t\t\tlet datasetLabel = (chartArrayTypeName === \"withCoverCropChartDataArray\") ? \"w/ Cover Crop\" : \"w/o Cover Crop\";\n\t\t\t\t\t\tlet dataset = {\n\t\t\t\t\t\t\tlabel: datasetLabel,\n\n\t\t\t\t\t\t\tdata: parsedData\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tparsedDatasets.push(dataset);\n\t\t\t\t\t}\n\n\t\t\t\t\tlet chartData = {\n\t\t\t\t\t\t// TODO: Check with team on this. Having fixed labels vs dynamic labels selected by chart.js based on input data\n\t\t\t\t\t\t// labels: labelArray,\n\t\t\t\t\t\tdatasets: parsedDatasets\n\t\t\t\t\t};\n\n\t\t\t\t\t// Chart for this variable has been already created\n\t\t\t\t\tif (chartDataArray.hasOwnProperty(chartRawData.variable)) {\n\t\t\t\t\t\tchartDataArray[chartRawData.variable].chartData.datasets = chartDataArray[chartRawData.variable].chartData.datasets.concat(parsedDatasets);\n\t\t\t\t\t}\n\t\t\t\t\t// Chart for this variable has to be created\n\t\t\t\t\telse {\n\t\t\t\t\t\tchartDataArray[chartRawData.variable] = {\n\t\t\t\t\t\t\tchartData: chartData,\n\t\t\t\t\t\t\tchartOptions: chartOptions\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn chartDataArray;\n\t}", "async function prepareData( param ) {\n\n // TODO check input format\n\n // make sure the hierarchy is an array\n if( !(param.hierarchy instanceof Array) ) {\n param.hierarchy = [ param.hierarchy ];\n }\n\n // get source data\n let source = DataStore.getDataset( param.data_id ),\n cols = source.getColumnMeta(),\n srcData = source.getData(),\n rowCount = source.getRowCount(),\n hierarchy = param.hierarchy,\n value = param.size;\n\n\n // init result data array\n const data = {\n 'name': 'root',\n 'map': new Map(),\n 'children': []\n };\n\n // walk through source data\n let hierarchyCount = hierarchy.length,\n runner,\n allEntries = [ data ],\n coloring;\n for( let row=0; row<rowCount; row++ ) {\n\n // reset runner\n runner = data;\n\n // label to determine coloring is given by name of innermost dimension\n coloring = '' + srcData[ hierarchy[0] ][ row ];\n\n // walk dimensions\n for( let dimIndex=0; dimIndex<hierarchyCount; dimIndex++ ) {\n\n // shortcut\n const el = srcData[ hierarchy[dimIndex] ][ row ];\n\n // if not present, add\n if( !runner.map.has( el ) ) {\n const newEntry = {\n 'name': '' + el,\n 'coloring': coloring,\n 'map': new Map(),\n 'children': []\n };\n runner.map.set( el, newEntry );\n runner.children.push( newEntry );\n allEntries.push( newEntry );\n }\n\n // keep on walking\n runner = runner.map.get( el );\n\n }\n\n // add the value\n runner.size = srcData[ value ][ row ];\n\n }\n\n // remove helper constructs\n allEntries.forEach( (el) => {\n\n // delete the map\n delete el.map;\n\n // if there are no children present, remove the property\n if( el.children.length < 1 ){\n delete el.children;\n }\n\n });\n\n // return result\n return data;\n\n }", "function ISDataSet(){ this._Type=\"ISDataSet\"; ISObject.call(this); this.Name=null; this.DataSetName=null; this.Tables=new ISArray(); }", "function createListFromArray(source, seriesModel, opt) {\n opt = opt || {};\n\n if (!Object(Source[\"e\" /* isSourceInstance */])(source)) {\n source = Object(Source[\"c\" /* createSourceFromSeriesDataOption */])(source);\n }\n\n var coordSysName = seriesModel.get('coordinateSystem');\n var registeredCoordSys = CoordinateSystem[\"a\" /* default */].get(coordSysName);\n var coordSysInfo = getCoordSysInfoBySeries(seriesModel);\n var coordSysDimDefs;\n\n if (coordSysInfo && coordSysInfo.coordSysDims) {\n coordSysDimDefs = util[\"H\" /* map */](coordSysInfo.coordSysDims, function (dim) {\n var dimInfo = {\n name: dim\n };\n var axisModel = coordSysInfo.axisMap.get(dim);\n\n if (axisModel) {\n var axisType = axisModel.get('type');\n dimInfo.type = getDimensionTypeByAxis(axisType); // dimInfo.stackable = isStackable(axisType);\n }\n\n return dimInfo;\n });\n }\n\n if (!coordSysDimDefs) {\n // Get dimensions from registered coordinate system\n coordSysDimDefs = registeredCoordSys && (registeredCoordSys.getDimensionsInfo ? registeredCoordSys.getDimensionsInfo() : registeredCoordSys.dimensions.slice()) || ['x', 'y'];\n }\n\n var useEncodeDefaulter = opt.useEncodeDefaulter;\n var dimInfoList = createDimensions(source, {\n coordDimensions: coordSysDimDefs,\n generateCoord: opt.generateCoord,\n encodeDefaulter: util[\"w\" /* isFunction */](useEncodeDefaulter) ? useEncodeDefaulter : useEncodeDefaulter ? util[\"i\" /* curry */](sourceHelper[\"c\" /* makeSeriesEncodeForAxisCoordSys */], coordSysDimDefs, seriesModel) : null\n });\n var firstCategoryDimIndex;\n var hasNameEncode;\n coordSysInfo && util[\"k\" /* each */](dimInfoList, function (dimInfo, dimIndex) {\n var coordDim = dimInfo.coordDim;\n var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim);\n\n if (categoryAxisModel) {\n if (firstCategoryDimIndex == null) {\n firstCategoryDimIndex = dimIndex;\n }\n\n dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta();\n\n if (opt.createInvertedIndices) {\n dimInfo.createInvertedIndices = true;\n }\n }\n\n if (dimInfo.otherDims.itemName != null) {\n hasNameEncode = true;\n }\n });\n\n if (!hasNameEncode && firstCategoryDimIndex != null) {\n dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0;\n }\n\n var stackCalculationInfo = enableDataStack(seriesModel, dimInfoList);\n var list = new data_List(dimInfoList, seriesModel);\n list.setCalculationInfo(stackCalculationInfo);\n var dimValueGetter = firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source) ? function (itemOpt, dimName, dataIndex, dimIndex) {\n // Use dataIndex as ordinal value in categoryAxis\n return dimIndex === firstCategoryDimIndex ? dataIndex : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex);\n } : null;\n list.hasItemOption = false;\n list.initData(source, null, dimValueGetter);\n return list;\n}", "scaleData(data, in_min, in_max, out_min, out_max) {\n let scaledData = new Array()\n for (let i = 0; i < data.length; i++) {\n scaledData[i] = new Array();\n for (let j = 0; j < data[i].length; j++) {\n scaledData[i][j] = this.mapDataPoint(data[i][j], in_min, in_max, out_min, out_max)\n }\n }\n return scaledData;\n }", "function recursiveConvert(value){if(Chartist.safeHasProperty(value,'value')){// We are dealing with value object notation so we need to recurse on value property\nreturn recursiveConvert(value.value);}else if(Chartist.safeHasProperty(value,'data')){// We are dealing with series object notation so we need to recurse on data property\nreturn recursiveConvert(value.data);}else if(value instanceof Array){// Data is of type array so we need to recurse on the series\nreturn value.map(recursiveConvert);}else if(Chartist.isDataHoleValue(value)){// We're dealing with a hole in the data and therefore need to return undefined\n// We're also returning undefined for multi value output\nreturn undefined;}else {// We need to prepare multi value output (x and y data)\nif(multi){var multiValue={};// Single series value arrays are assumed to specify the Y-Axis value\n// For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}]\n// If multi is a string then it's assumed that it specified which dimension should be filled as default\nif(typeof multi==='string'){multiValue[multi]=Chartist.getNumberOrUndefined(value);}else {multiValue.y=Chartist.getNumberOrUndefined(value);}multiValue.x=value.hasOwnProperty('x')?Chartist.getNumberOrUndefined(value.x):multiValue.x;multiValue.y=value.hasOwnProperty('y')?Chartist.getNumberOrUndefined(value.y):multiValue.y;return multiValue;}else {// We can return simple data\nreturn Chartist.getNumberOrUndefined(value);}}}", "static is_data_array_ok(data){\n return this.is_1d_array(data) ||\n this.is_2d_array(data) ||\n this.is_3d_array(data) ||\n this.is_heat_map_suitable_data(data)\n }", "function getMainDataMap() {\n return {\n conversionValue: {\n metric: 'conversionValue',\n getter: commonGetters.getChannelsSeparatelyGetter('breakdownValues')\n },\n conversionValueValue: {\n metric: 'conversionValue',\n getter: commonGetters.getOnlyFromChannelsGetter('totalValue')\n },\n conversionValueChangeValue: {\n metric: 'conversionValue',\n getter: commonGetters.getOnlyFromChannelsGetter('changeValue')\n },\n conversionValueChangePercent: {\n metric: 'conversionValue',\n getter: commonGetters.getOnlyFromChannelsGetter('changePercent'),\n formatters: [\n dataFormatters.decimalToPercent\n ]\n },\n\n numAdsValue: {\n metric: 'numAds',\n getter: commonGetters.getOnlyFromChannelsGetter('totalValue')\n },\n numAdsChangeValue: {\n metric: 'numAds',\n getter: commonGetters.getOnlyFromChannelsGetter('changeValue')\n },\n numAdsChangePercent: {\n metric: 'numAds',\n getter: commonGetters.getOnlyFromChannelsGetter('changePercent'),\n formatters: [\n dataFormatters.decimalToPercent\n ]\n }\n };\n} // end getMainDataMap" ]
[ "0.6300078", "0.5725563", "0.5681955", "0.5522123", "0.54491186", "0.5447694", "0.5333014", "0.53159463", "0.5303632", "0.5223298", "0.5185989", "0.5165324", "0.5075347", "0.5041912", "0.503744", "0.49829143", "0.49746037", "0.49515712", "0.49491763", "0.4922769", "0.49220964", "0.49060458", "0.48859388", "0.48788273", "0.48641807", "0.48599643", "0.4858467", "0.48357287", "0.48357287", "0.48357287", "0.48357287", "0.48357287", "0.48357287", "0.4820737", "0.48069224", "0.4802003", "0.4802003", "0.47949475", "0.47836694", "0.4778543", "0.47734755", "0.47489023", "0.47442734", "0.47433603", "0.47421557", "0.47370997", "0.47278", "0.47278", "0.47205627", "0.47159708", "0.47075173", "0.46992812", "0.46952233", "0.4692809", "0.46892896", "0.46842152", "0.46792474", "0.46716872", "0.46705663", "0.46701252", "0.46588886", "0.4655091", "0.4649304", "0.4648928", "0.46477053", "0.46471003", "0.46465623", "0.46456006", "0.4611732", "0.46105132", "0.46097097", "0.46084926", "0.460394", "0.4601973", "0.4601973", "0.46007755", "0.46007755", "0.45968914", "0.45934242", "0.45889968", "0.45880824", "0.45876712", "0.45855805", "0.45833504", "0.45791814", "0.45776892", "0.45698583", "0.45585597", "0.45582062", "0.45560113", "0.45510456", "0.4542787", "0.45410952", "0.45385227", "0.4538125", "0.4530417" ]
0.60197246
5
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Get axis scale extent before niced. Item of returned array can only be number (including Infinity and NaN).
function getScaleExtent(scale, model) { var scaleType = scale.type; var min = model.getMin(); var max = model.getMax(); var fixMin = min != null; var fixMax = max != null; var originalExtent = scale.getExtent(); var axisDataLen; var boundaryGap; var span; if (scaleType === 'ordinal') { axisDataLen = model.getCategories().length; } else { boundaryGap = model.get('boundaryGap'); if (!zrUtil.isArray(boundaryGap)) { boundaryGap = [boundaryGap || 0, boundaryGap || 0]; } if (typeof boundaryGap[0] === 'boolean') { boundaryGap = [0, 0]; } boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], 1); boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], 1); span = originalExtent[1] - originalExtent[0] || Math.abs(originalExtent[0]); } // Notice: When min/max is not set (that is, when there are null/undefined, // which is the most common case), these cases should be ensured: // (1) For 'ordinal', show all axis.data. // (2) For others: // + `boundaryGap` is applied (if min/max set, boundaryGap is // disabled). // + If `needCrossZero`, min/max should be zero, otherwise, min/max should // be the result that originalExtent enlarged by boundaryGap. // (3) If no data, it should be ensured that `scale.setBlank` is set. // FIXME // (1) When min/max is 'dataMin' or 'dataMax', should boundaryGap be able to used? // (2) When `needCrossZero` and all data is positive/negative, should it be ensured // that the results processed by boundaryGap are positive/negative? if (min == null) { min = scaleType === 'ordinal' ? axisDataLen ? 0 : NaN : originalExtent[0] - boundaryGap[0] * span; } if (max == null) { max = scaleType === 'ordinal' ? axisDataLen ? axisDataLen - 1 : NaN : originalExtent[1] + boundaryGap[1] * span; } if (min === 'dataMin') { min = originalExtent[0]; } else if (typeof min === 'function') { min = min({ min: originalExtent[0], max: originalExtent[1] }); } if (max === 'dataMax') { max = originalExtent[1]; } else if (typeof max === 'function') { max = max({ min: originalExtent[0], max: originalExtent[1] }); } (min == null || !isFinite(min)) && (min = NaN); (max == null || !isFinite(max)) && (max = NaN); scale.setBlank(zrUtil.eqNaN(min) || zrUtil.eqNaN(max) || scaleType === 'ordinal' && !scale.getOrdinalMeta().categories.length); // Evaluate if axis needs cross zero if (model.getNeedCrossZero()) { // Axis is over zero and min is not set if (min > 0 && max > 0 && !fixMin) { min = 0; } // Axis is under zero and max is not set if (min < 0 && max < 0 && !fixMax) { max = 0; } } // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis // is base axis // FIXME // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly. // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent? // Should not depend on series type `bar`? // (3) Fix that might overlap when using dataZoom. // (4) Consider other chart types using `barGrid`? // See #6728, #4862, `test/bar-overflow-time-plot.html` var ecModel = model.ecModel; if (ecModel && scaleType === 'time' /*|| scaleType === 'interval' */ ) { var barSeriesModels = prepareLayoutBarSeries('bar', ecModel); var isBaseAxisAndHasBarSeries; zrUtil.each(barSeriesModels, function (seriesModel) { isBaseAxisAndHasBarSeries |= seriesModel.getBaseAxis() === model.axis; }); if (isBaseAxisAndHasBarSeries) { // Calculate placement of bars on axis var barWidthAndOffset = makeColumnLayout(barSeriesModels); // Adjust axis min and max to account for overflow var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset); min = adjustedScale.min; max = adjustedScale.max; } } return [min, max]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getScaleExtent(scale, model) {\n var scaleType = scale.type;\n var min = model.getMin();\n var max = model.getMax();\n var originalExtent = scale.getExtent();\n var axisDataLen;\n var boundaryGap;\n var span;\n\n if (scaleType === 'ordinal') {\n axisDataLen = model.getCategories().length;\n } else {\n boundaryGap = model.get('boundaryGap');\n\n if (!zrUtil.isArray(boundaryGap)) {\n boundaryGap = [boundaryGap || 0, boundaryGap || 0];\n }\n\n if (typeof boundaryGap[0] === 'boolean') {\n boundaryGap = [0, 0];\n }\n\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], 1);\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], 1);\n span = originalExtent[1] - originalExtent[0] || Math.abs(originalExtent[0]);\n } // Notice: When min/max is not set (that is, when there are null/undefined,\n // which is the most common case), these cases should be ensured:\n // (1) For 'ordinal', show all axis.data.\n // (2) For others:\n // + `boundaryGap` is applied (if min/max set, boundaryGap is\n // disabled).\n // + If `needCrossZero`, min/max should be zero, otherwise, min/max should\n // be the result that originalExtent enlarged by boundaryGap.\n // (3) If no data, it should be ensured that `scale.setBlank` is set.\n // FIXME\n // (1) When min/max is 'dataMin' or 'dataMax', should boundaryGap be able to used?\n // (2) When `needCrossZero` and all data is positive/negative, should it be ensured\n // that the results processed by boundaryGap are positive/negative?\n\n\n if (min === 'dataMin') {\n min = originalExtent[0];\n } else if (typeof min === 'function') {\n min = min({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n if (max === 'dataMax') {\n max = originalExtent[1];\n } else if (typeof max === 'function') {\n max = max({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n var fixMin = min != null;\n var fixMax = max != null;\n\n if (min == null) {\n min = scaleType === 'ordinal' ? axisDataLen ? 0 : NaN : originalExtent[0] - boundaryGap[0] * span;\n }\n\n if (max == null) {\n max = scaleType === 'ordinal' ? axisDataLen ? axisDataLen - 1 : NaN : originalExtent[1] + boundaryGap[1] * span;\n }\n\n (min == null || !isFinite(min)) && (min = NaN);\n (max == null || !isFinite(max)) && (max = NaN);\n scale.setBlank(zrUtil.eqNaN(min) || zrUtil.eqNaN(max) || scaleType === 'ordinal' && !scale.getOrdinalMeta().categories.length); // Evaluate if axis needs cross zero\n\n if (model.getNeedCrossZero()) {\n // Axis is over zero and min is not set\n if (min > 0 && max > 0 && !fixMin) {\n min = 0;\n } // Axis is under zero and max is not set\n\n\n if (min < 0 && max < 0 && !fixMax) {\n max = 0;\n }\n } // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis\n // is base axis\n // FIXME\n // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly.\n // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent?\n // Should not depend on series type `bar`?\n // (3) Fix that might overlap when using dataZoom.\n // (4) Consider other chart types using `barGrid`?\n // See #6728, #4862, `test/bar-overflow-time-plot.html`\n\n\n var ecModel = model.ecModel;\n\n if (ecModel && scaleType === 'time'\n /*|| scaleType === 'interval' */\n ) {\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\n var isBaseAxisAndHasBarSeries;\n zrUtil.each(barSeriesModels, function (seriesModel) {\n isBaseAxisAndHasBarSeries |= seriesModel.getBaseAxis() === model.axis;\n });\n\n if (isBaseAxisAndHasBarSeries) {\n // Calculate placement of bars on axis\n var barWidthAndOffset = makeColumnLayout(barSeriesModels); // Adjust axis min and max to account for overflow\n\n var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\n min = adjustedScale.min;\n max = adjustedScale.max;\n }\n }\n\n return {\n extent: [min, max],\n // \"fix\" means \"fixed\", the value should not be\n // changed in the subsequent steps.\n fixMin: fixMin,\n fixMax: fixMax\n };\n}", "function getScaleExtent(scale, model) {\n var scaleType = scale.type;\n var min = model.getMin();\n var max = model.getMax();\n var originalExtent = scale.getExtent();\n var axisDataLen;\n var boundaryGap;\n var span;\n\n if (scaleType === 'ordinal') {\n axisDataLen = model.getCategories().length;\n } else {\n boundaryGap = model.get('boundaryGap');\n\n if (!zrUtil.isArray(boundaryGap)) {\n boundaryGap = [boundaryGap || 0, boundaryGap || 0];\n }\n\n if (typeof boundaryGap[0] === 'boolean') {\n boundaryGap = [0, 0];\n }\n\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], 1);\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], 1);\n span = originalExtent[1] - originalExtent[0] || Math.abs(originalExtent[0]);\n } // Notice: When min/max is not set (that is, when there are null/undefined,\n // which is the most common case), these cases should be ensured:\n // (1) For 'ordinal', show all axis.data.\n // (2) For others:\n // + `boundaryGap` is applied (if min/max set, boundaryGap is\n // disabled).\n // + If `needCrossZero`, min/max should be zero, otherwise, min/max should\n // be the result that originalExtent enlarged by boundaryGap.\n // (3) If no data, it should be ensured that `scale.setBlank` is set.\n // FIXME\n // (1) When min/max is 'dataMin' or 'dataMax', should boundaryGap be able to used?\n // (2) When `needCrossZero` and all data is positive/negative, should it be ensured\n // that the results processed by boundaryGap are positive/negative?\n\n\n if (min === 'dataMin') {\n min = originalExtent[0];\n } else if (typeof min === 'function') {\n min = min({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n if (max === 'dataMax') {\n max = originalExtent[1];\n } else if (typeof max === 'function') {\n max = max({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n var fixMin = min != null;\n var fixMax = max != null;\n\n if (min == null) {\n min = scaleType === 'ordinal' ? axisDataLen ? 0 : NaN : originalExtent[0] - boundaryGap[0] * span;\n }\n\n if (max == null) {\n max = scaleType === 'ordinal' ? axisDataLen ? axisDataLen - 1 : NaN : originalExtent[1] + boundaryGap[1] * span;\n }\n\n (min == null || !isFinite(min)) && (min = NaN);\n (max == null || !isFinite(max)) && (max = NaN);\n scale.setBlank(zrUtil.eqNaN(min) || zrUtil.eqNaN(max) || scaleType === 'ordinal' && !scale.getOrdinalMeta().categories.length); // Evaluate if axis needs cross zero\n\n if (model.getNeedCrossZero()) {\n // Axis is over zero and min is not set\n if (min > 0 && max > 0 && !fixMin) {\n min = 0;\n } // Axis is under zero and max is not set\n\n\n if (min < 0 && max < 0 && !fixMax) {\n max = 0;\n }\n } // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis\n // is base axis\n // FIXME\n // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly.\n // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent?\n // Should not depend on series type `bar`?\n // (3) Fix that might overlap when using dataZoom.\n // (4) Consider other chart types using `barGrid`?\n // See #6728, #4862, `test/bar-overflow-time-plot.html`\n\n\n var ecModel = model.ecModel;\n\n if (ecModel && scaleType === 'time'\n /*|| scaleType === 'interval' */\n ) {\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\n var isBaseAxisAndHasBarSeries;\n zrUtil.each(barSeriesModels, function (seriesModel) {\n isBaseAxisAndHasBarSeries |= seriesModel.getBaseAxis() === model.axis;\n });\n\n if (isBaseAxisAndHasBarSeries) {\n // Calculate placement of bars on axis\n var barWidthAndOffset = makeColumnLayout(barSeriesModels); // Adjust axis min and max to account for overflow\n\n var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\n min = adjustedScale.min;\n max = adjustedScale.max;\n }\n }\n\n return {\n extent: [min, max],\n // \"fix\" means \"fixed\", the value should not be\n // changed in the subsequent steps.\n fixMin: fixMin,\n fixMax: fixMax\n };\n}", "function getScaleExtent(scale, model) {\n var scaleType = scale.type;\n var min = model.getMin();\n var max = model.getMax();\n var fixMin = min != null;\n var fixMax = max != null;\n var originalExtent = scale.getExtent();\n var axisDataLen;\n var boundaryGap;\n var span;\n\n if (scaleType === 'ordinal') {\n axisDataLen = (model.get('data') || []).length;\n } else {\n boundaryGap = model.get('boundaryGap');\n\n if (!zrUtil.isArray(boundaryGap)) {\n boundaryGap = [boundaryGap || 0, boundaryGap || 0];\n }\n\n if (typeof boundaryGap[0] === 'boolean') {\n boundaryGap = [0, 0];\n }\n\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], 1);\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], 1);\n span = originalExtent[1] - originalExtent[0] || Math.abs(originalExtent[0]);\n } // Notice: When min/max is not set (that is, when there are null/undefined,\n // which is the most common case), these cases should be ensured:\n // (1) For 'ordinal', show all axis.data.\n // (2) For others:\n // + `boundaryGap` is applied (if min/max set, boundaryGap is\n // disabled).\n // + If `needCrossZero`, min/max should be zero, otherwise, min/max should\n // be the result that originalExtent enlarged by boundaryGap.\n // (3) If no data, it should be ensured that `scale.setBlank` is set.\n // FIXME\n // (1) When min/max is 'dataMin' or 'dataMax', should boundaryGap be able to used?\n // (2) When `needCrossZero` and all data is positive/negative, should it be ensured\n // that the results processed by boundaryGap are positive/negative?\n\n\n if (min == null) {\n min = scaleType === 'ordinal' ? axisDataLen ? 0 : NaN : originalExtent[0] - boundaryGap[0] * span;\n }\n\n if (max == null) {\n max = scaleType === 'ordinal' ? axisDataLen ? axisDataLen - 1 : NaN : originalExtent[1] + boundaryGap[1] * span;\n }\n\n if (min === 'dataMin') {\n min = originalExtent[0];\n } else if (typeof min === 'function') {\n min = min({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n if (max === 'dataMax') {\n max = originalExtent[1];\n } else if (typeof max === 'function') {\n max = max({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n (min == null || !isFinite(min)) && (min = NaN);\n (max == null || !isFinite(max)) && (max = NaN);\n scale.setBlank(zrUtil.eqNaN(min) || zrUtil.eqNaN(max)); // Evaluate if axis needs cross zero\n\n if (model.getNeedCrossZero()) {\n // Axis is over zero and min is not set\n if (min > 0 && max > 0 && !fixMin) {\n min = 0;\n } // Axis is under zero and max is not set\n\n\n if (min < 0 && max < 0 && !fixMax) {\n max = 0;\n }\n }\n\n return [min, max];\n}", "function getScaleExtent(scale, model) {\n var scaleType = scale.type;\n var min = model.getMin();\n var max = model.getMax();\n var fixMin = min != null;\n var fixMax = max != null;\n var originalExtent = scale.getExtent();\n var axisDataLen;\n var boundaryGap;\n var span;\n\n if (scaleType === 'ordinal') {\n axisDataLen = (model.get('data') || []).length;\n } else {\n boundaryGap = model.get('boundaryGap');\n\n if (!zrUtil.isArray(boundaryGap)) {\n boundaryGap = [boundaryGap || 0, boundaryGap || 0];\n }\n\n if (typeof boundaryGap[0] === 'boolean') {\n boundaryGap = [0, 0];\n }\n\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], 1);\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], 1);\n span = originalExtent[1] - originalExtent[0] || Math.abs(originalExtent[0]);\n } // Notice: When min/max is not set (that is, when there are null/undefined,\n // which is the most common case), these cases should be ensured:\n // (1) For 'ordinal', show all axis.data.\n // (2) For others:\n // + `boundaryGap` is applied (if min/max set, boundaryGap is\n // disabled).\n // + If `needCrossZero`, min/max should be zero, otherwise, min/max should\n // be the result that originalExtent enlarged by boundaryGap.\n // (3) If no data, it should be ensured that `scale.setBlank` is set.\n // FIXME\n // (1) When min/max is 'dataMin' or 'dataMax', should boundaryGap be able to used?\n // (2) When `needCrossZero` and all data is positive/negative, should it be ensured\n // that the results processed by boundaryGap are positive/negative?\n\n\n if (min == null) {\n min = scaleType === 'ordinal' ? axisDataLen ? 0 : NaN : originalExtent[0] - boundaryGap[0] * span;\n }\n\n if (max == null) {\n max = scaleType === 'ordinal' ? axisDataLen ? axisDataLen - 1 : NaN : originalExtent[1] + boundaryGap[1] * span;\n }\n\n if (min === 'dataMin') {\n min = originalExtent[0];\n } else if (typeof min === 'function') {\n min = min({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n if (max === 'dataMax') {\n max = originalExtent[1];\n } else if (typeof max === 'function') {\n max = max({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n (min == null || !isFinite(min)) && (min = NaN);\n (max == null || !isFinite(max)) && (max = NaN);\n scale.setBlank(zrUtil.eqNaN(min) || zrUtil.eqNaN(max)); // Evaluate if axis needs cross zero\n\n if (model.getNeedCrossZero()) {\n // Axis is over zero and min is not set\n if (min > 0 && max > 0 && !fixMin) {\n min = 0;\n } // Axis is under zero and max is not set\n\n\n if (min < 0 && max < 0 && !fixMax) {\n max = 0;\n }\n }\n\n return [min, max];\n}", "function getScaleExtent(scale, model) {\n var scaleType = scale.type;\n var min = model.getMin();\n var max = model.getMax();\n var fixMin = min != null;\n var fixMax = max != null;\n var originalExtent = scale.getExtent();\n var axisDataLen;\n var boundaryGap;\n var span;\n\n if (scaleType === 'ordinal') {\n axisDataLen = (model.get('data') || []).length;\n } else {\n boundaryGap = model.get('boundaryGap');\n\n if (!zrUtil.isArray(boundaryGap)) {\n boundaryGap = [boundaryGap || 0, boundaryGap || 0];\n }\n\n if (typeof boundaryGap[0] === 'boolean') {\n boundaryGap = [0, 0];\n }\n\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], 1);\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], 1);\n span = originalExtent[1] - originalExtent[0] || Math.abs(originalExtent[0]);\n } // Notice: When min/max is not set (that is, when there are null/undefined,\n // which is the most common case), these cases should be ensured:\n // (1) For 'ordinal', show all axis.data.\n // (2) For others:\n // + `boundaryGap` is applied (if min/max set, boundaryGap is\n // disabled).\n // + If `needCrossZero`, min/max should be zero, otherwise, min/max should\n // be the result that originalExtent enlarged by boundaryGap.\n // (3) If no data, it should be ensured that `scale.setBlank` is set.\n // FIXME\n // (1) When min/max is 'dataMin' or 'dataMax', should boundaryGap be able to used?\n // (2) When `needCrossZero` and all data is positive/negative, should it be ensured\n // that the results processed by boundaryGap are positive/negative?\n\n\n if (min == null) {\n min = scaleType === 'ordinal' ? axisDataLen ? 0 : NaN : originalExtent[0] - boundaryGap[0] * span;\n }\n\n if (max == null) {\n max = scaleType === 'ordinal' ? axisDataLen ? axisDataLen - 1 : NaN : originalExtent[1] + boundaryGap[1] * span;\n }\n\n if (min === 'dataMin') {\n min = originalExtent[0];\n } else if (typeof min === 'function') {\n min = min({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n if (max === 'dataMax') {\n max = originalExtent[1];\n } else if (typeof max === 'function') {\n max = max({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n (min == null || !isFinite(min)) && (min = NaN);\n (max == null || !isFinite(max)) && (max = NaN);\n scale.setBlank(zrUtil.eqNaN(min) || zrUtil.eqNaN(max)); // Evaluate if axis needs cross zero\n\n if (model.getNeedCrossZero()) {\n // Axis is over zero and min is not set\n if (min > 0 && max > 0 && !fixMin) {\n min = 0;\n } // Axis is under zero and max is not set\n\n\n if (min < 0 && max < 0 && !fixMax) {\n max = 0;\n }\n }\n\n return [min, max];\n}", "function d3_scaleExtent(domain) {\n var start = domain[0], stop = domain[domain.length - 1];\n return start < stop ? [start, stop] : [stop, start];\n}", "function getScaleExtent(scale, model) {\n\t var scaleType = scale.type;\n\t var rawExtentResult = ensureScaleRawExtentInfo(scale, model, scale.getExtent()).calculate();\n\t scale.setBlank(rawExtentResult.isBlank);\n\t var min = rawExtentResult.min;\n\t var max = rawExtentResult.max; // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis\n\t // is base axis\n\t // FIXME\n\t // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly.\n\t // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent?\n\t // Should not depend on series type `bar`?\n\t // (3) Fix that might overlap when using dataZoom.\n\t // (4) Consider other chart types using `barGrid`?\n\t // See #6728, #4862, `test/bar-overflow-time-plot.html`\n\t\n\t var ecModel = model.ecModel;\n\t\n\t if (ecModel && scaleType === 'time'\n\t /*|| scaleType === 'interval' */\n\t ) {\n\t var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\n\t var isBaseAxisAndHasBarSeries_1 = false;\n\t each(barSeriesModels, function (seriesModel) {\n\t isBaseAxisAndHasBarSeries_1 = isBaseAxisAndHasBarSeries_1 || seriesModel.getBaseAxis() === model.axis;\n\t });\n\t\n\t if (isBaseAxisAndHasBarSeries_1) {\n\t // Calculate placement of bars on axis. TODO should be decoupled\n\t // with barLayout\n\t var barWidthAndOffset = makeColumnLayout(barSeriesModels); // Adjust axis min and max to account for overflow\n\t\n\t var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\n\t min = adjustedScale.min;\n\t max = adjustedScale.max;\n\t }\n\t }\n\t\n\t return {\n\t extent: [min, max],\n\t // \"fix\" means \"fixed\", the value should not be\n\t // changed in the subsequent steps.\n\t fixMin: rawExtentResult.minFixed,\n\t fixMax: rawExtentResult.maxFixed\n\t };\n\t }", "function getScaleExtent(scale, model) {\n var scaleType = scale.type;\n var rawExtentResult = ensureScaleRawExtentInfo(scale, model, scale.getExtent()).calculate();\n scale.setBlank(rawExtentResult.isBlank);\n var min = rawExtentResult.min;\n var max = rawExtentResult.max; // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis\n // is base axis\n // FIXME\n // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly.\n // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent?\n // Should not depend on series type `bar`?\n // (3) Fix that might overlap when using dataZoom.\n // (4) Consider other chart types using `barGrid`?\n // See #6728, #4862, `test/bar-overflow-time-plot.html`\n\n var ecModel = model.ecModel;\n\n if (ecModel && scaleType === 'time'\n /*|| scaleType === 'interval' */\n ) {\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\n var isBaseAxisAndHasBarSeries_1 = false;\n util[\"k\" /* each */](barSeriesModels, function (seriesModel) {\n isBaseAxisAndHasBarSeries_1 = isBaseAxisAndHasBarSeries_1 || seriesModel.getBaseAxis() === model.axis;\n });\n\n if (isBaseAxisAndHasBarSeries_1) {\n // Calculate placement of bars on axis. TODO should be decoupled\n // with barLayout\n var barWidthAndOffset = makeColumnLayout(barSeriesModels); // Adjust axis min and max to account for overflow\n\n var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\n min = adjustedScale.min;\n max = adjustedScale.max;\n }\n }\n\n return {\n extent: [min, max],\n // \"fix\" means \"fixed\", the value should not be\n // changed in the subsequent steps.\n fixMin: rawExtentResult.minFixed,\n fixMax: rawExtentResult.maxFixed\n };\n}", "function extent(arr){\n return [min(arr), max(arr)];\n }", "function getBarExtent(){\n \t\tvar repExtent = getExtent(\"Representatives\"),\n \t\t\telectoralExtent = getExtent(\"Electoral Votes\");\n \t\treturn [d3.min([repExtent[0],electoralExtent[0]]), d3.max([repExtent[1],electoralExtent[1]])];\n\t\t}", "function d3_scaleRange(scale) {\n return scale.rangeExtent ? scale.rangeExtent() : d3_scaleExtent(scale.range());\n}", "function ensureScaleRawExtentInfo(scale, model, // Usually: data extent from all series on this axis.\noriginalExtent) {\n // Do not permit to recreate.\n var rawExtentInfo = scale.rawExtentInfo;\n\n if (rawExtentInfo) {\n return rawExtentInfo;\n }\n\n rawExtentInfo = new scaleRawExtentInfo_ScaleRawExtentInfo(scale, model, originalExtent); // @ts-ignore\n\n scale.rawExtentInfo = rawExtentInfo;\n return rawExtentInfo;\n}", "function onAxisAfterGetSeriesExtremes() {\n let dataMax, modMax;\n if (this.isXAxis) {\n dataMax = pick(this.dataMax, -Number.MAX_VALUE);\n for (const series of this.series) {\n if (series.x2Data) {\n for (const val of series.x2Data) {\n if (val && val > dataMax) {\n dataMax = val;\n modMax = true;\n }\n }\n }\n }\n if (modMax) {\n this.dataMax = dataMax;\n }\n }\n}", "function getDatasetExtent (dataset) {\n const extent = dataset.attributes.extent;\n return {\n xmin: extent.coordinates[0][0],\n ymin: extent.coordinates[0][1],\n xmax: extent.coordinates[1][0],\n ymax: extent.coordinates[1][1],\n spatialReference: extent.spatialReference\n };\n }", "function ensureScaleRawExtentInfo(scale, model, // Usually: data extent from all series on this axis.\n\t originalExtent) {\n\t // Do not permit to recreate.\n\t var rawExtentInfo = scale.rawExtentInfo;\n\t\n\t if (rawExtentInfo) {\n\t return rawExtentInfo;\n\t }\n\t\n\t rawExtentInfo = new ScaleRawExtentInfo(scale, model, originalExtent); // @ts-ignore\n\t\n\t scale.rawExtentInfo = rawExtentInfo;\n\t return rawExtentInfo;\n\t }", "function getExtent(index) {\n\t\t\tvar values = Object.keys(tooltipData).map(function (key) {\n \t\t\t\treturn tooltipData[key][index];\n \t\t\t});\n \t\t\treturn d3.extent(values, function(d){ return +d.replace(/[^\\d-\\.]/gi,''); });\n\t\t}", "function extent$2 () {\n\n var fields = [],\n extraPoints = [],\n padUnit = 'percent',\n pad = 0,\n symmetricalAbout = null;\n\n /**\n * @param {array} data an array of data points, or an array of arrays of data points\n */\n var extents = function extents(data) {\n\n // we need an array of arrays if we don't have one already\n if (!Array.isArray(data[0])) {\n data = [data];\n }\n\n // the fields can be a mixed array of property names or accessor functions\n var mutatedFields = fields.map(function (field) {\n if (typeof field !== 'string') {\n return field;\n }\n return function (d) {\n return d[field];\n };\n });\n\n var dataMin = d3.min(data, function (d0) {\n return d3.min(d0, function (d1) {\n return d3.min(mutatedFields.map(function (f) {\n return f(d1);\n }));\n });\n });\n\n var dataMax = d3.max(data, function (d0) {\n return d3.max(d0, function (d1) {\n return d3.max(mutatedFields.map(function (f) {\n return f(d1);\n }));\n });\n });\n\n var dateExtent = Object.prototype.toString.call(dataMin) === '[object Date]';\n\n var min = dateExtent ? dataMin.getTime() : dataMin;\n var max = dateExtent ? dataMax.getTime() : dataMax;\n\n // apply symmetry rules\n if (symmetricalAbout != null) {\n var symmetrical = dateExtent ? symmetricalAbout.getTime() : symmetricalAbout;\n var distanceFromMax = Math.abs(max - symmetrical),\n distanceFromMin = Math.abs(min - symmetrical),\n halfRange = Math.max(distanceFromMax, distanceFromMin);\n\n min = symmetrical - halfRange;\n max = symmetrical + halfRange;\n }\n\n if (padUnit === 'domain') {\n // pad absolutely\n if (Array.isArray(pad)) {\n min -= pad[0];\n max += pad[1];\n } else {\n min -= pad;\n max += pad;\n }\n } else if (padUnit === 'percent') {\n // pad percentagely\n if (Array.isArray(pad)) {\n var deltaArray = [pad[0] * (max - min), pad[1] * (max - min)];\n min -= deltaArray[0];\n max += deltaArray[1];\n } else {\n var delta = pad * (max - min) / 2;\n min -= delta;\n max += delta;\n }\n }\n\n if (extraPoints.length) {\n min = Math.min(min, d3.min(extraPoints));\n max = Math.max(max, d3.max(extraPoints));\n }\n\n if (dateExtent) {\n min = new Date(min);\n max = new Date(max);\n }\n\n // Return the smallest and largest\n return [min, max];\n };\n\n /*\n * @param {array} fields the names of object properties that represent field values, or accessor functions.\n */\n extents.fields = function (x) {\n if (!arguments.length) {\n return fields;\n }\n fields = x;\n return extents;\n };\n\n extents.include = function (x) {\n if (!arguments.length) {\n return extraPoints;\n }\n extraPoints = x;\n return extents;\n };\n\n extents.padUnit = function (x) {\n if (!arguments.length) {\n return padUnit;\n }\n padUnit = x;\n return extents;\n };\n\n extents.pad = function (x) {\n if (!arguments.length) {\n return pad;\n }\n pad = x;\n return extents;\n };\n\n extents.symmetricalAbout = function (x) {\n if (!arguments.length) {\n return symmetricalAbout;\n }\n symmetricalAbout = x;\n return extents;\n };\n\n return extents;\n }", "function houseDataExtent(x) {\n\tvar array = [];\n\tif (x != \"yr_renovated\") {\n\t\trawData.forEach(function(d) { array.push(Number(d[x])); });\n\t} else {\n\t\trawData.forEach(function(d) { if (Number(d[x]) != 0) array.push(Number(d[x])); });\n\t}\n\treturn d3.extent(array);\n}", "function niceScaleExtent(scale, model) {\n\t var extentInfo = getScaleExtent(scale, model);\n\t var extent = extentInfo.extent;\n\t var splitNumber = model.get('splitNumber');\n\t\n\t if (scale instanceof LogScale) {\n\t scale.base = model.get('logBase');\n\t }\n\t\n\t var scaleType = scale.type;\n\t scale.setExtent(extent[0], extent[1]);\n\t scale.niceExtent({\n\t splitNumber: splitNumber,\n\t fixMin: extentInfo.fixMin,\n\t fixMax: extentInfo.fixMax,\n\t minInterval: scaleType === 'interval' || scaleType === 'time' ? model.get('minInterval') : null,\n\t maxInterval: scaleType === 'interval' || scaleType === 'time' ? model.get('maxInterval') : null\n\t }); // If some one specified the min, max. And the default calculated interval\n\t // is not good enough. He can specify the interval. It is often appeared\n\t // in angle axis with angle 0 - 360. Interval calculated in interval scale is hard\n\t // to be 60.\n\t // FIXME\n\t\n\t var interval = model.get('interval');\n\t\n\t if (interval != null) {\n\t scale.setInterval && scale.setInterval(interval);\n\t }\n\t }", "function getScale(element) {\n var rect = element.getBoundingClientRect(); // Read-only in old browsers.\n\n return {\n x: rect.width / element.offsetWidth || 1,\n y: rect.height / element.offsetHeight || 1,\n boundingClientRect: rect\n };\n }", "function d3_svg_axisSubdivide(scale, ticks, m) {\n var subticks = [];\n if (m && ticks.length > 1) {\n var extent = d3_scaleExtent(scale.domain()),\n i = -1,\n n = ticks.length,\n d = (ticks[1] - ticks[0]) / ++m,\n j,\n v;\n while (++i < n) {\n for (j = m; --j > 0;) {\n if ((v = +ticks[i] - j * d) >= extent[0]) {\n subticks.push(v);\n }\n }\n }\n for (--i, j = 0; ++j < m && (v = +ticks[i] + j * d) < extent[1];) {\n subticks.push(v);\n }\n }\n return subticks;\n}", "function range(scale) {\n // for non ordinal, simply return the range\n if (!isOrdinal(scale)) {\n return scale.range();\n }\n\n // For ordinal, use the rangeExtent. However, rangeExtent always provides\n // a non inverted range (i.e. extent[0] < extent[1]) regardless of the\n // range set on the scale. The logic below detects the inverted case.\n //\n // The d3 code that tackles the same issue doesn't have to deal with the inverted case.\n var scaleRange = scale.range();\n var extent = scale.rangeExtent();\n if (scaleRange.length <= 1) {\n // we cannot detect the inverted case if the range (and domain) has\n // a single item in it.\n return extent;\n }\n\n var inverted = scaleRange[0] > scaleRange[1];\n return inverted ? [extent[1], extent[0]] : extent;\n }", "get_empirical_scale() {\n // Simple ratio of canvas width to image x-dimension\n return jquery_default()(\"#\" + this.config[\"imwrap_id\"]).width()/this.config[\"image_width\"];\n }", "function domain_extender(self, axis, ordinal) {\n var scalename = axis + 'scale',\n zero = axis + '0',\n zero_val = axis + '0_value';\n if (ordinal) return function () {\n var scale_prop = self[scalename],\n scale = scale_prop(),\n domain = self.data().map(self[axis]());\n if (scale_prop._has_domain) {\n var old_domain = scale.domain(),\n add_values = domain.filter(function (val) {\n return old_domain.indexOf(val) < 0;\n });\n scale.domain(old_domain.concat(add_values));\n } else {\n scale.domain(domain);\n scale_prop._has_domain = true;\n }\n return scale;\n };else return function () {\n var scale_prop = self[scalename],\n scale = scale_prop(),\n domain = d3.extent(self.data(), self[axis]());\n\n // Incorporate the zero value\n var z = self[zero]();\n if (typeof z != 'undefined') {\n if (domain[0] > z) domain[0] = z;\n if (domain[1] < z) domain[1] = z;\n } else {\n z = domain[0];\n }\n self[zero_val] = z;\n\n // Extend the domain\n if (scale_prop._has_domain) scale.domain(d3.extent([].concat(_toConsumableArray(scale.domain()), _toConsumableArray(domain))));else {\n scale.domain(domain);\n scale_prop._has_domain = true;\n }\n return scale;\n };\n}", "function getMinScale(inputScale) {\n\treturn Math.min(Math.abs((plot.xmax-plot.xmin)/inputScale),\n\t\t\tMath.abs((plot.ymax-plot.ymin)/inputScale));\n}", "setExtent() {\n\n var tl = this.props.map.containerPointToLatLng(this.tl);\n var br = this.props.map.containerPointToLatLng(this.br);\n\n tl = this.projection([tl.lng, tl.lat]);\n br = this.projection([br.lng, br.lat]);\n\n this.extent.attr({\n x: tl[0],\n y: tl[1],\n height: br[1]-tl[1],\n width: br[0]-tl[0],\n });\n\n }", "function scaleUnits(val, axis){\n if (axis === 'y') {\n return cells(graphScale.yUnit) * val;\n }\n if (axis === 'x') {\n return cells(graphScale.xUnit) * val;\n }\n return 0; //maybe throw error instead\n}", "function extent() { }", "get Axis() {\n let sampleData = this.chart.data[0];\n let size = sampleData.length;\n\n return d3.svg\n .axis()\n .scale(this.chart.xScale)\n .orient('bottom')\n .tickFormat(getDate().long)\n .tickValues(getBestTickValues(sampleData));\n }", "limity() { return (this.scale - 1) * this.sizey / 2; }", "function numericExtent(values) {\n var _a = extent(values), min = _a[0], max = _a[1];\n if (typeof min === 'number' && isFinite(min) && typeof max === 'number' && isFinite(max)) {\n return [min, max];\n }\n}", "function niceScaleExtent(scale, model) {\n var extentInfo = getScaleExtent(scale, model);\n var extent = extentInfo.extent;\n var splitNumber = model.get('splitNumber');\n\n if (scale instanceof Log) {\n scale.base = model.get('logBase');\n }\n\n var scaleType = scale.type;\n scale.setExtent(extent[0], extent[1]);\n scale.niceExtent({\n splitNumber: splitNumber,\n fixMin: extentInfo.fixMin,\n fixMax: extentInfo.fixMax,\n minInterval: scaleType === 'interval' || scaleType === 'time' ? model.get('minInterval') : null,\n maxInterval: scaleType === 'interval' || scaleType === 'time' ? model.get('maxInterval') : null\n }); // If some one specified the min, max. And the default calculated interval\n // is not good enough. He can specify the interval. It is often appeared\n // in angle axis with angle 0 - 360. Interval calculated in interval scale is hard\n // to be 60.\n // FIXME\n\n var interval = model.get('interval');\n\n if (interval != null) {\n scale.setInterval && scale.setInterval(interval);\n }\n}", "get scaleFactor() {}", "dpi () {\n return this.chart.width / this.interval.width * this.zoom.value;\n }", "function getXPixelAxis(val) {\n\t\treturn (getGraphWidth() / size * val) + ((width - xOffset) / size) / 2 + xOffset;\n\t}", "scale(num) {\n\n var NewValue = (((num - 0) * (this.svgW - 0)) / (this.maxXVal - 0)) + 0;\n return (NewValue);\n }", "function extentToBounds (extent) {\r\n // \"NaN\" coordinates from ArcGIS Server indicate a null geometry\r\n if (extent.xmin !== 'NaN' && extent.ymin !== 'NaN' && extent.xmax !== 'NaN' && extent.ymax !== 'NaN') {\r\n var sw = Object(leaflet__WEBPACK_IMPORTED_MODULE_0__[\"latLng\"])(extent.ymin, extent.xmin);\r\n var ne = Object(leaflet__WEBPACK_IMPORTED_MODULE_0__[\"latLng\"])(extent.ymax, extent.xmax);\r\n return Object(leaflet__WEBPACK_IMPORTED_MODULE_0__[\"latLngBounds\"])(sw, ne);\r\n } else {\r\n return null;\r\n }\r\n}", "getCurrentExtent() {\n var b = OlMap.map.getView().calculateExtent(OlMap.map.getSize());\n var pair1 = [b[0], b[1]]\n var pair2 = [b[2], b[3]];\n var cur_proj = OlMap.map.getView().getProjection().getCode();\n pair1 = transform(pair1, cur_proj, 'EPSG:4326');\n pair2 = transform(pair2, cur_proj, 'EPSG:4326');\n return [pair1[0].toFixed(2), pair1[1].toFixed(2), pair2[0].toFixed(2), pair2[1].toFixed(2)];\n }", "getMainAxisPoints() {\n\t\tconst size = this.getDataSize();\n\t\tconst points = [];\n\t\tconst fullDimension = this.isVertical() ? this.getHeight() : this.getWidth();\n\t\tfor (let i = 0; i <= size; i++) {\n\t\t\tpoints.push(roundPoint((fullDimension * i) / size));\n\t\t}\n\t\treturn points;\n\t}", "static extents(nodes) {\n return {x:d3.extent(nodes, d=>d.fx), y:d3.extent(nodes, d=>d.fy)}\n }", "getScale() {\n return this.scale;\n }", "function calculateRange(axis, axisOptions){\n\t\t\tvar min = axisOptions.min != null ? axisOptions.min : axis.datamin;\n\t\t\tvar max = axisOptions.max != null ? axisOptions.max : axis.datamax;\t\n\t\t\tif(max - min == 0.0){\n\t\t\t\tvar widen = (max == 0.0) ? 1.0 : 0.01;\n\t\t\t\tmin -= widen;\n\t\t\t\tmax += widen;\n\t\t\t}\t\t\t\n\t\t\taxis.tickSize = getTickSize(axisOptions.noTicks, min, max, axisOptions.tickDecimals);\n\t\t\t\t\n\t\t\t/**\n\t\t\t * Autoscaling.\n\t\t\t */\n\t\t\tvar margin;\n\t\t\tif(axisOptions.min == null){\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Add a margin.\n\t\t\t\t */\n\t\t\t\tmargin = axisOptions.autoscaleMargin;\n\t\t\t\tif(margin != 0){\n\t\t\t\t\tmin -= axis.tickSize * margin;\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t * Make sure we don't go below zero if all values are positive.\n\t\t\t\t\t */\n\t\t\t\t\tif(min < 0 && axis.datamin >= 0) min = 0;\t\t\t\t\n\t\t\t\t\tmin = axis.tickSize * Math.floor(min / axis.tickSize);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(axisOptions.max == null){\n\t\t\t\tmargin = axisOptions.autoscaleMargin;\n\t\t\t\tif(margin != 0){\n\t\t\t\t\tmax += axis.tickSize * margin;\n\t\t\t\t\tif(max > 0 && axis.datamax <= 0) max = 0;\t\t\t\t\n\t\t\t\t\tmax = axis.tickSize * Math.ceil(max / axis.tickSize);\n\t\t\t\t}\n\t\t\t}\n\t\t\taxis.min = min;\n\t\t\taxis.max = max;\n\t\t}", "function scale(data, range, axis) {\n var scale = d3.scale.linear()\n //extent returns min and max values of data\n .domain(d3.extent(data, function(d) {\n return d[axis];\n }))\n .range(range)\n \n //makes scale end at rounded values\n .nice();\n return scale;\n }", "getModuleWidth(){return this.module_base_face_dimensions_axes[0];}", "function calculateBase(groupItem){var extent;var baseAxis=groupItem.axis;var seriesModels=groupItem.seriesModels;var seriesCount=seriesModels.length;var boxWidthList=groupItem.boxWidthList = [];var boxOffsetList=groupItem.boxOffsetList = [];var boundList=[];var bandWidth;if(baseAxis.type === 'category'){bandWidth = baseAxis.getBandWidth();}else {var maxDataCount=0;each(seriesModels,function(seriesModel){maxDataCount = Math.max(maxDataCount,seriesModel.getData().count());});extent = baseAxis.getExtent(),Math.abs(extent[1] - extent[0]) / maxDataCount;}each(seriesModels,function(seriesModel){var boxWidthBound=seriesModel.get('boxWidth');if(!zrUtil.isArray(boxWidthBound)){boxWidthBound = [boxWidthBound,boxWidthBound];}boundList.push([parsePercent(boxWidthBound[0],bandWidth) || 0,parsePercent(boxWidthBound[1],bandWidth) || 0]);});var availableWidth=bandWidth * 0.8 - 2;var boxGap=availableWidth / seriesCount * 0.3;var boxWidth=(availableWidth - boxGap * (seriesCount - 1)) / seriesCount;var base=boxWidth / 2 - availableWidth / 2;each(seriesModels,function(seriesModel,idx){boxOffsetList.push(base);base += boxGap + boxWidth;boxWidthList.push(Math.min(Math.max(boxWidth,boundList[idx][0]),boundList[idx][1]));});}", "function getScale(xs,ys){\r\n var minX = getMin(xs);\r\n var maxX = getMax(xs);\r\n\r\n var minY = getMin(ys);\r\n var maxY = getMax(ys);\r\n\r\n //800 is canvas size - 100 for margin on each side (to center)\r\n var scalex = 600 / (maxX - minX);\r\n var scaley = 600 / (maxY - minY);\r\n\r\n //give smaller of 2 scale so it does not go out of bounds\r\n return Math.min(scalex, scaley);\r\n}", "niceScale (yMin, yMax, ticks = 10) {\n if ((yMin === Number.MIN_VALUE && yMax === 0) || (!Utils.isNumber(yMin) && !Utils.isNumber(yMax))) {\n // when all values are 0\n yMin = 0\n yMax = 1\n ticks = 1\n let justRange = this.justRange(yMin, yMax, ticks)\n return justRange\n }\n\n // Calculate Min amd Max graphical labels and graph\n // increments. The number of ticks defaults to\n // 10 which is the SUGGESTED value. Any tick value\n // entered is used as a suggested value which is\n // adjusted to be a 'pretty' value.\n //\n // Output will be an array of the Y axis values that\n // encompass the Y values.\n let result = []\n // If yMin and yMax are identical, then\n // adjust the yMin and yMax values to actually\n // make a graph. Also avoids division by zero errors.\n if (yMin === yMax) {\n yMin = yMin - 10 // some small value\n yMax = yMax + 10 // some small value\n }\n // Determine Range\n let range = yMax - yMin\n let tiks = ticks + 1\n // Adjust ticks if needed\n if (tiks < 2) {\n tiks = 2\n } else if (tiks > 2) {\n tiks -= 2\n }\n\n // Get raw step value\n let tempStep = range / tiks\n // Calculate pretty step value\n\n let mag = Math.floor(this.log10(tempStep))\n let magPow = Math.pow(10, mag)\n let magMsd = parseInt(tempStep / magPow)\n let stepSize = magMsd * magPow\n\n // build Y label array.\n // Lower and upper bounds calculations\n let lb = stepSize * Math.floor(yMin / stepSize)\n let ub = stepSize * Math.ceil((yMax / stepSize))\n // Build array\n let val = lb\n while (1) {\n result.push(val)\n val += stepSize\n if (val > ub) { break }\n }\n\n // TODO: need to remove this condition below which makes this function tightly coupled with w.\n if (this.w.config.yaxis[0].max === undefined &&\n this.w.config.yaxis[0].min === undefined) {\n return {\n result,\n niceMin: result[0],\n niceMax: result[result.length - 1]\n }\n } else {\n result = []\n let v = yMin\n result.push(v)\n let valuesDivider = Math.abs(yMax - yMin) / ticks\n for (let i = 0; i <= ticks - 1; i++) {\n v = v + valuesDivider\n result.push(v)\n }\n\n return {\n result,\n niceMin: result[0],\n niceMax: result[result.length - 1]\n }\n }\n }", "function xScale(data) {\n\n bound = calculate_minmax(data);\n let x = d3.scaleLinear()\n .domain([bound.min, bound.max])\n .range([25, w - 25])\n .nice();\n return x;\n\n}", "@computed\n get glyphScaleImportance() {\n if (isEmpty(this.annotationConfigPropertiesById)) {\n return undefined;\n }\n const property = this.annotationConfigPropertiesById['importance'];\n return scaleLinear()\n .domain([property.min, property.max])\n .range([5, 0]);\n }", "function extendScale(scale) {\n var extendedScale = function(y) {\n if (y === null) {\n return null;\n }\n return scale(y);\n };\n extendedScale.__proto__ = scale;\n return extendedScale;\n }", "function getChartDimensions() {\r\n var chartWidth = aleph.xMain.range()[1] - aleph.xMain.range()[0];\r\n var chartHeight = aleph.yMain.range()[0] - aleph.yMain.range()[1];\r\n\r\n return;\r\n}", "function zoomInOut(dir){\r\n var w = dg.xAxisRange();\r\n var scale = w[1] - w[0];\r\n //console.log(scale, dg.xAxisRange(), dg.xAxisExtremes());\r\n if (dir == \"out\") {\r\n var wholeW = dg.xAxisExtremes();\r\n var wholeScale = wholeW[1] - wholeW[0];\r\n if (scale == wholeScale) {\r\n alert('Already zoomed to full extent. Range \"Selected date range to see more data\".');\r\n } else if (scale >= (wholeScale/2)) {\r\n reset();\r\n } else {\r\n zoom(scale/1000*2);\r\n }\r\n } else {\r\n zoom(scale/1000/2);\r\n }\r\n}", "function single_prepareCustom_dataToCoordSize(dataSize, dataItem) {\n // dataItem is necessary in log axis.\n var axis = this.getAxis();\n var val = dataItem instanceof Array ? dataItem[0] : dataItem;\n var halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2;\n return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\n}", "setPlotScale()\n {\n var barData = new Array();\n var max_value = -99999999.0;\n var min_value = +99999999.0;\n\n if ( this.plotType == this.STACKED ) // Need to sum each X value\n {\n var maxBars = this.calcMaxBars();\n var tmpData = new Array(maxBars);\n for ( var indx=0; indx<maxBars; indx++ )\n tmpData[indx] = 0;\n\n for ( var indx=0; indx<this.plotData.length; indx++ )\n {\n barData = this.plotData[indx];\n for ( var jndx=0; jndx<barData.length; jndx++ )\n {\n tmpData[jndx] += barData[jndx];\n }\n }\n\n // Now calculate against summed bars...\n for ( var indx=0; indx<maxBars; indx++ )\n {\n if ( tmpData[indx] > max_value )\n max_value = tmpData[indx];\n }\n }\n else // Just find min/max value within data set\n {\n for ( var indx=0; indx<this.plotData.length; indx++ )\n {\n barData = this.plotData[indx];\n for ( var jndx=0; jndx<barData.length; jndx++ )\n {\n if ( barData[jndx] > max_value )\n max_value = barData[jndx];\n }\n }\n }\n\n //ZZZ What about supporting negative values?\n min_value = 0;\n\n // Needed? Rounds axes in the 0.0 to 1.0 to 1.0\n // Could check orders of magnitude... 0.001 or 1000\n\n if ( max_value > 0.0 && max_value < 1.0 )\n max_value = 1.0;\n if ( min_value < 1.0 && min_value > 0.0 )\n min_value = 0.0;\n\n this.plotYMin = min_value;\n this.plotYMax = max_value;\n }", "_getScaleX() {\n\t\t\t\treturn this.scale;\n\t\t\t}", "function getScale(bounds) {\n\t return Math.min(\n\t scale0 * geoWidth / (bounds[1][0] - bounds[0][0]),\n\t scale0 * geoHeight / (bounds[1][1] - bounds[0][1])\n\t );\n\t }", "function getScale(bounds) {\n\t return Math.min(\n\t scale0 * geoWidth / (bounds[1][0] - bounds[0][0]),\n\t scale0 * geoHeight / (bounds[1][1] - bounds[0][1])\n\t );\n\t }", "function extentToBounds (extent) {\n // \"NaN\" coordinates from ArcGIS Server indicate a null geometry\n if (extent.xmin !== 'NaN' && extent.ymin !== 'NaN' && extent.xmax !== 'NaN' && extent.ymax !== 'NaN') {\n var sw = leaflet.latLng(extent.ymin, extent.xmin);\n var ne = leaflet.latLng(extent.ymax, extent.xmax);\n return leaflet.latLngBounds(sw, ne);\n } else {\n return null;\n }\n}", "function getNormalizedValue(val, scale) {\n var scaled;\n\n switch (val) {\n case 'start':\n return 0;\n\n case 'end':\n return 1;\n\n case 'median':\n {\n scaled = scale.isCategory ? stat_1.getMedian(scale.values.map(function (_, idx) {\n return idx;\n })) : stat_1.getMedian(scale.values);\n break;\n }\n\n case 'mean':\n {\n scaled = scale.isCategory ? (scale.values.length - 1) / 2 : stat_1.getMean(scale.values);\n break;\n }\n\n case 'min':\n scaled = scale.isCategory ? 0 : scale[val];\n break;\n\n case 'max':\n scaled = scale.isCategory ? scale.values.length - 1 : scale[val];\n break;\n\n default:\n scaled = val;\n break;\n }\n\n return scale.scale(scaled);\n}", "function calcExtents(data, indicator) {\n\n // first find all the data points for a specific indicator across\n // all countries and join them into one array.\n var allValues = data.map(function(country) {\n return country[indicator];\n }).reduce(function(values, current) {\n return values.concat(_.compact(current));\n }, []);\n\n // now go through all the data points and find the extent using d3's\n // `extent` function.\n var extent = d3.extent(allValues, function(d) {\n return d.value;\n });\n\n return extent;\n}", "function dataToCoordSize(dataSize, dataItem) {\n // dataItem is necessary in log axis.\n var axis = this.getAxis();\n var val = dataItem instanceof Array ? dataItem[0] : dataItem;\n var halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2;\n return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\n}", "function dataToCoordSize(dataSize, dataItem) {\n // dataItem is necessary in log axis.\n var axis = this.getAxis();\n var val = dataItem instanceof Array ? dataItem[0] : dataItem;\n var halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2;\n return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\n}", "function dataToCoordSize(dataSize, dataItem) {\n // dataItem is necessary in log axis.\n var axis = this.getAxis();\n var val = dataItem instanceof Array ? dataItem[0] : dataItem;\n var halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2;\n return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\n}", "function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n\t var sizeCurr = getSize(xyMinMaxCurr);\n\t var sizeOrigin = getSize(xyMinMaxOrigin);\n\t var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n\t isNaN(scales[0]) && (scales[0] = 1);\n\t isNaN(scales[1]) && (scales[1] = 1);\n\t return scales;\n\t }", "get globalScale() {}", "function chart_scale(scale)\n {\n if( $(elm).length )\n {\n var width = $(elm).width() * scale;\n chart_resize(width);\n }\n }", "function getNormalizedValue(val, scale) {\n var scaled;\n switch (val) {\n case 'start':\n return 0;\n case 'end':\n return 1;\n case 'median': {\n scaled = scale.isCategory ? getMedian(scale.values.map(function (_, idx) { return idx; })) : getMedian(scale.values);\n break;\n }\n case 'mean': {\n scaled = scale.isCategory ? (scale.values.length - 1) / 2 : getMean(scale.values);\n break;\n }\n case 'min':\n scaled = scale.isCategory ? 0 : scale[val];\n break;\n case 'max':\n scaled = scale.isCategory ? scale.values.length - 1 : scale[val];\n break;\n default:\n scaled = val;\n break;\n }\n return scale.scale(scaled);\n}", "function tickWidthToPixels(scale, d, i) {\n var next = i == scale.ticks().length - 1 ? scale.range()[1] : scale(scale.ticks()[i + 1]);\n return next - scale(d)\n }", "updateDomainByBBox(b) {\n let x = this.xAxis.scale();\n x.domain([b[0], b[1]]);\n }", "function xLength ( nightsIn, xScale )\r\n {\r\n var startDate = new Date ( dateMin );\r\n var endDate = new Date ( dateMin );\r\n endDate.setDate( endDate.getDate() + parseInt(nightsIn));\r\n \r\n \tstartScale = xScale ( startDate );\r\n \tendScale = xScale ( endDate );\r\n \r\n \treturn endScale - startScale; \r\n }", "get timelineDayScale() {\n\t\treturn this.nativeElement ? this.nativeElement.timelineDayScale : undefined;\n\t}", "function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n\t var sizeCurr = getSize(xyMinMaxCurr);\n\t var sizeOrigin = getSize(xyMinMaxOrigin);\n\t var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n\t isNaN(scales[0]) && (scales[0] = 1);\n\t isNaN(scales[1]) && (scales[1] = 1);\n\t return scales;\n\t}", "function getViewportScale() {\r\n\t\treturn getInnerWidth() / document.documentElement.clientWidth;\r\n\t}", "function plot_get_x_max(plot_id) {\n\tif (! plot_is_showed(plot_id)) {\n\t\tconsole.log('Broken plot_get_x_max');\n\t\treturn;\n\t}\n\treturn plots[plot_id]['chart'].scales['x-axis-0'].max;\n}", "getXScale(width) {\n let domainValues = _.map(this.props.data, (d) => d[this.props.x]);\n let sortedVals = _.sortBy(domainValues, [(d) => {\n let rank = this.props.xRank[d];\n return (rank) ? rank : 8;\n \n }]);\n\n return scaleBand()\n .padding(this.props.padding)\n .domain(sortedVals)\n .range([this.props.margins.left, width - this.props.margins.left]);\n }", "function niceAxisNumbering(amin, amax, ntick) {\n var nfrac; // number of fractional digits to show\n var d; // tick mark spacing\n var graphmin, graphmax;\n var range, x;\n var axisValues = [];\n\n if (amin>0 && amin/amax < 0.5) amin = 0; // My fudge, to show origin when appropriate.\n\n range = niceNum(amax-amin, false);\n d = niceNum(range/(ntick-1), true);\n graphmin = Math.floor(amin/d)*d;\n graphmax = Math.ceil(amax/d)*d;\n nfrac = Math.max(-Math.floor(log10(d)),0);\n \n \n for (x=graphmin; x<=graphmax+0.5*d; x+=d) {\n axisValues.push(x);\n }\n return axisValues;\n}", "function getScaleFactor() { return Math.pow(2, Globals.scale * -1); }", "limitx() { return (this.scale - 1) * this.sizex / 2; }", "get timeScale() {\n\t\treturn this.__Internal__Dont__Modify__.timeScale;\n\t}", "function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n var sizeCurr = getSize(xyMinMaxCurr);\n var sizeOrigin = getSize(xyMinMaxOrigin);\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n isNaN(scales[0]) && (scales[0] = 1);\n isNaN(scales[1]) && (scales[1] = 1);\n return scales;\n}", "function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n var sizeCurr = getSize(xyMinMaxCurr);\n var sizeOrigin = getSize(xyMinMaxOrigin);\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n isNaN(scales[0]) && (scales[0] = 1);\n isNaN(scales[1]) && (scales[1] = 1);\n return scales;\n}", "function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n var sizeCurr = getSize(xyMinMaxCurr);\n var sizeOrigin = getSize(xyMinMaxOrigin);\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n isNaN(scales[0]) && (scales[0] = 1);\n isNaN(scales[1]) && (scales[1] = 1);\n return scales;\n}", "function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n var sizeCurr = getSize(xyMinMaxCurr);\n var sizeOrigin = getSize(xyMinMaxOrigin);\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n isNaN(scales[0]) && (scales[0] = 1);\n isNaN(scales[1]) && (scales[1] = 1);\n return scales;\n}", "function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n var sizeCurr = getSize(xyMinMaxCurr);\n var sizeOrigin = getSize(xyMinMaxOrigin);\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n isNaN(scales[0]) && (scales[0] = 1);\n isNaN(scales[1]) && (scales[1] = 1);\n return scales;\n}", "function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n var sizeCurr = getSize(xyMinMaxCurr);\n var sizeOrigin = getSize(xyMinMaxOrigin);\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n isNaN(scales[0]) && (scales[0] = 1);\n isNaN(scales[1]) && (scales[1] = 1);\n return scales;\n}", "function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n var sizeCurr = getSize(xyMinMaxCurr);\n var sizeOrigin = getSize(xyMinMaxOrigin);\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n isNaN(scales[0]) && (scales[0] = 1);\n isNaN(scales[1]) && (scales[1] = 1);\n return scales;\n}", "function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n var sizeCurr = getSize(xyMinMaxCurr);\n var sizeOrigin = getSize(xyMinMaxOrigin);\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n isNaN(scales[0]) && (scales[0] = 1);\n isNaN(scales[1]) && (scales[1] = 1);\n return scales;\n}", "function getMaxYAxis(data) {\n var max = 0;\n data.forEach(function(item) {\n max = Math.max(max, d3.max(item.values, function(d) {\n return d.value;\n }));\n\n });\n\n return Math.ceil(max / 500) * 500;\n }", "function getTickSize(noTicks, min, max, decimals){\n\t\tvar delta = (max - min) / noTicks;\n\t\tvar magn = getMagnitude(delta);\n\t\t/**\n\t\t * Norm is between 1.0 and 10.0.\n\t\t */\n\t\tvar norm = delta / magn;\n\n\t\tvar tickSize = 10;\n\t\tif(norm < 1.5) tickSize = 1;\n\t\telse if(norm < 2.25) tickSize = 2;\n\t\telse if(norm < 3) tickSize = 2.5;\n\t\telse if(norm < 7.5) tickSize = 5;\n\n\t\tif(tickSize == 2.5 && decimals == 0)\n\t\t\ttickSize = 2;\n\t\t\n\t\ttickSize *= magn;\n\t\treturn tickSize;\n\t}", "function yScale() {\n var scale,\n // find min/max value of each data series\n domain = [Number.MAX_VALUE, Number.MAX_VALUE * -1];\n _.each(axesDef.y1, function(col) {\n domain[0] = Math.min(domain[0], col.range()[0]);\n domain[1] = Math.max(domain[1], col.range()[1]);\n });\n y1Domain = domain; // store for later, replaces me.__domain\n if (vis.get('baseline-zero', false) || vis.get('fill-below', false)) {\n if (domain[0] > 0) domain[0] = 0;\n if (domain[1] < 0) domain[1] = 0;\n }\n scale = useLogScale ? 'log' : 'linear';\n if (scale == 'log' && domain[0] === 0) domain[0] = 0.03; // log scales don't like zero!\n return d3.scale[scale]().domain(domain);\n }", "ggh() {\n return this.cr.canvas.height / this.cr.options.scaleFactor;\n }", "function extendXRangeIfNeededByBar(){\n\t\t\tif(options.xaxis.max == null){\n\t\t\t\t/**\n\t\t\t\t * Autoscaling.\n\t\t\t\t */\n\t\t\t\tvar newmax = xaxis.max;\n\t\t\t\tfor(var i = 0; i < series.length; ++i){\n\t\t\t\t\tif(series[i].bars.show && series[i].bars.barWidth + xaxis.datamax > newmax){\n\t\t\t\t\t\tnewmax = xaxis.max + series[i].bars.barWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\txaxis.max = newmax;\n\t\t\t}\n\t\t}", "render(g) {\n let xStart = g.axesPadding+g.axesLineWidth;\n let xEnd = g.width - g.axesPadding;//*2 - g.dataMargin;\n let yStart = g.height-g.axesPadding-g.axesLineWidth/2+1;\n let yDist = g.yMax-g.yMin;\n\n let minYPerc = (this.minimum-g.yMin) / yDist;\n let avgYPerc = (this.average-g.yMin) / yDist;\n let maxYPerc = (this.maximum-g.yMin) / yDist;\n\n let minYPos = g.height * minYPerc - (g.axesPadding*2)-g.axesLineWidth/2;\n let avgYPos = g.height * avgYPerc - (g.axesPadding*2)-g.axesLineWidth/2;\n let maxYPos = g.height * maxYPerc - (g.axesPadding*2)-g.axesLineWidth/2;\n\n // max:\n g.drawLine(xStart, yStart-maxYPos-g.axesLineWidth+this.minLineWidth/2, \n xEnd, yStart-maxYPos-g.axesLineWidth+this.minLineWidth/2, this.maxLineColor, this.maxLineWidth);\n g.drawText(this.maximum, xEnd, yStart-maxYPos-g.textOffset, null, g.graphFont, this.maxLineColor);\n // avg:\n g.drawLine(xStart, yStart-avgYPos-g.axesLineWidth+this.avgLineWidth/2, \n xEnd, yStart-avgYPos-g.axesLineWidth+this.avgLineWidth/2, this.avgLineColor, this.avgLineWidth);\n g.drawText(this.average, xEnd, yStart-avgYPos-g.textOffset, null, g.graphFont, this.avgLineColor);\n // min:\n g.drawLine(xStart, yStart-minYPos-g.axesLineWidth+this.maxLineWidth/2, \n xEnd, yStart-minYPos-g.axesLineWidth+this.maxLineWidth/2, this.minLineColor, this.minLineWidth);\n g.drawText(this.minimum, xEnd, yStart-minYPos-g.textOffset, null, g.graphFont, this.minLineColor);\n }", "function axisBox() {\n return { x: { min: 0, max: 1 }, y: { min: 0, max: 1 } };\n}", "function axisBox() {\n return { x: { min: 0, max: 1 }, y: { min: 0, max: 1 } };\n}", "function axisBox() {\n return { x: { min: 0, max: 1 }, y: { min: 0, max: 1 } };\n}", "function axisBox() {\n return { x: { min: 0, max: 1 }, y: { min: 0, max: 1 } };\n}", "function f(val)\n\t {\n\t // Enforce limits\n\t val = Math.min(val, max);\n\t val = Math.max(val, min);\n\t return Math.round((val - min) * scale + axisMargin);\n\t }" ]
[ "0.66903776", "0.66903776", "0.6635214", "0.6635214", "0.6635214", "0.64821434", "0.6250071", "0.61511594", "0.59884244", "0.5891907", "0.57624054", "0.5707274", "0.56746405", "0.5660276", "0.56570685", "0.5629411", "0.5598804", "0.55947566", "0.556655", "0.55653775", "0.55576426", "0.55252177", "0.55186874", "0.54953116", "0.5495068", "0.54110813", "0.54070485", "0.53881764", "0.5387656", "0.53665286", "0.5358718", "0.5331849", "0.53282773", "0.5327221", "0.5312098", "0.52940303", "0.5273881", "0.52730644", "0.5257595", "0.52562547", "0.5247716", "0.52104586", "0.5201288", "0.5194242", "0.5190966", "0.51777196", "0.51664394", "0.51386243", "0.51157236", "0.5103564", "0.5091144", "0.50780046", "0.50658214", "0.5063266", "0.5057399", "0.50494295", "0.50494295", "0.50451076", "0.50342524", "0.50300896", "0.50287205", "0.50287205", "0.50287205", "0.5013773", "0.50089526", "0.5008835", "0.5001937", "0.49735904", "0.4957159", "0.4948061", "0.49473077", "0.49427363", "0.49425635", "0.4942518", "0.4941494", "0.49301285", "0.49295872", "0.4924057", "0.49191707", "0.49172086", "0.49172086", "0.49172086", "0.49172086", "0.49172086", "0.49172086", "0.49172086", "0.49172086", "0.49135986", "0.49066", "0.4900578", "0.48960102", "0.48950112", "0.48919278", "0.48840892", "0.48840892", "0.48840892", "0.48840892", "0.48727176" ]
0.6609556
7
Check if the axis corss 0
function ifAxisCrossZero(axis) { var dataExtent = axis.scale.getExtent(); var min = dataExtent[0]; var max = dataExtent[1]; return !(min > 0 && max > 0 || min < 0 && max < 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ifAxisCrossZero(axis) {\n\t var dataExtent = axis.scale.getExtent();\n\t var min = dataExtent[0];\n\t var max = dataExtent[1];\n\t return !(min > 0 && max > 0 || min < 0 && max < 0);\n\t }", "hasAxisOrientSignalRef() {\n return (this.component.axes.x?.some(a => a.hasOrientSignalRef()) ||\n this.component.axes.y?.some(a => a.hasOrientSignalRef()));\n }", "function checkNotZero(figure) {\n if (figure !== 0){\n return true;\n }else {return false;}\n }", "isZero() {\n return this.high === 0 && this.low === 0;\n }", "function chkAxes (mousePos) {\n\t\t\tif (chkCoord(mousePos, 'x') || chkCoord(mousePos, 'y')) {\n\t\t\t\tprevMousePos = mousePos;\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "masterAxis() {\n\t\tif (Math.abs(this._x) > Math.abs(this._y) && Math.abs(this._x) > Math.abs(this._z)) {\n\t\t\treturn (0);\n\t\t}\n\t\telse if (Math.abs(this._y) > Math.abs(this._x) && Math.abs(this._y) > Math.abs(this._z)) {\n\t\t\treturn (1);\n\t\t}\n\t\telse {\n\t\t\treturn (2);\n\t\t}\n\t}", "hasOrigin() {\n\t\treturn (this.origin.x < 0 && this.origin.x + this.width > 0)\n\t\t&& (this.origin.y < 0 && this.origin.y + this.height > 0);\n\t}", "get is_axis_aligned() {\n return !!(this.flags & PaintVolumeFlags.IS_AXIS_ALIGNED);\n }", "function chkCoord (mousePos, axis) {\n\t\t\tvar mp = mousePos,\n\t\t\t\tpmp = prevMousePos,\n\t\t\t\tinc = (axis === 'x') ? logXEvery : logYEvery;\n\n\t\t\tif (mp[axis] < (pmp[axis] - inc) || mp[axis] > (pmp[axis] + inc))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}", "isZero() {\n return this.value == 0;\n }", "warning () { return this._ignEllipse.backDist() < this.bounds().xSpacing() }", "function sc_isZero(x) {\n return (x === 0);\n}", "function isCanvasBlank(canvas) {\n return !canvas.getContext('2d')\n .getImageData(0, 0, canvas.width, canvas.height).data\n .some(channel => channel !== 0);\n }", "function domainDefinitelyIncludeZero(scale) {\n if (scale.get('zero') !== false) {\n return true;\n }\n var domains = scale.domains;\n if (isArray(domains)) {\n return some(domains, function (d) { return isArray(d) && d.length === 2 && d[0] <= 0 && d[1] >= 0; });\n }\n return false;\n }", "function checkValue(){\n\tif(xCord<0){\n\t\txCord=0;\n\t}\n\tif(xCord>=width){\n\t\txCord = width-1;\n\t}\n\n\tif(yCord<0){\n\t\tyCord=0;\n\t}\n\tif(yCord>=height){\n\t\tyCord=height-1;\n\t}\n}", "function displayAxis(p1, p2) {\n self.tmpVector.subVectors(p1, p2);\n self.tmpVector.normalize();\n\n return !MeasureCommon.isParallel(self.tmpVector, self.xAxis) && !MeasureCommon.isParallel(self.tmpVector, self.yAxis) && !MeasureCommon.isParallel(self.tmpVector, self.zAxis);\n }", "function zero (data) {\n return data === 0;\n }", "function isGridFull() {\n for (var x = 0; x < 4; x++) {\n\t\t\tfor (var y = 0; y < 4; y++) {\n\t\t\t\tif (mat[x][y]===0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n }", "function isCornerBlock(){\n return ((xCo == 0 || xCo == MAX_X - 1) && (yCo == 0 || yCo == MAX_Y - 1));\n }", "isNonZero(): boolean {\n return this.value !== 0;\n }", "function isCCW() {\n if (area2D(_model.points, _model.points.count) < 0) {\n return false;\n } else {\n return true;\n }\n}", "function axismissing(board, x, axis) {\n var bits = 0\n for (var y = 0; y < lib.N; y++) {\n var e = board[posfor(x, y, axis)];\n if (e !== null) bits |= 1 << e;\n }\n return lib.M ^ bits;\n}", "_hasExactPosition() {\n return !this._hasFlexibleDimensions || this._isPushed;\n }", "function isClear(e) {\n try {\n var x = parseInt(e.clientX / particleSize, 10);\n var y = parseInt(e.clientY / particleSize, 10);\n return particles[x][y].fresh=='empty';\n } catch(e) { return true; }\n }", "isZeroSet () {\n \n return (\n !this.isUniverse() &&\n this.toDisjunction().normalize().isZeroSet()\n );\n \n }", "function isAroundZero(val) {\n\t return val > -EPSILON && val < EPSILON;\n\t}", "hasTop() {return this.Y<=0 ? false : true;}", "isEmpty(x, y) {\n if (0 <= x && x < this.width && 0 <= y && y < this.height) {\n return !this.covered[x][y]\n }\n return false\n }", "function isAroundZero(val) {\n return val > -EPSILON && val < EPSILON;\n }", "function isAroundZero(val) {\n return val > -EPSILON && val < EPSILON;\n }", "function is_out_of_bounds()\n{\n\tif (frog.x < 0 || frog.x > 380) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}", "update(time) {\n\t\tsuper.update(time)\n\t\treturn (\n\t\t\tthis.x < 0 || this.x > ARENA_SIZE || this.y < 0 || this.y > ARENA_SIZE\n\t\t)\n\t}", "function isAroundZero(val){return val > -EPSILON && val < EPSILON;}", "function OutOfCanvas(a) {\n return (a.x< (-jaws.width/3));\n }", "sol() { return this.pos == 0; }", "function isCanvasBlank() {\n const canvas = document.getElementById(\"drawing\");\n const context = canvas.getContext(\"2d\");\n\n const pixelBuffer = new Uint32Array(\n context.getImageData(0, 0, canvas.width, canvas.height).data.buffer\n );\n\n return !pixelBuffer.some((color) => color !== 0);\n}", "function isAxisUsedInTheGrid(axisModel, gridModel) {\n\t return axisModel.getCoordSysModel() === gridModel;\n\t }", "function isAxisUsedInTheGrid(axisModel,gridModel,ecModel){return ecModel.getComponent('grid',axisModel.get('gridIndex')) === gridModel;}", "function zero (x) {\n\t return typeof x === 'number' && x === 0\n\t}", "function axismissing(board, x, axis) {\n var bits = 0\n for (var y = 0; y < 9; y++) {\n var e = board[posfor(x, y, axis)];\n if (e !== null) bits |= 1 << e;\n }\n return 511 ^ bits;\n}", "function axismissing(board, x, axis) {\n var bits = 0\n for (var y = 0; y < 9; y++) {\n var e = board[posfor(x, y, axis)];\n if (e !== null) bits |= 1 << e;\n }\n return 511 ^ bits;\n}", "function isZero(x) {\n var i;\n for (i = 0; i < x.length; i++)\n if (x[i])\n return 0;\n return 1;\n }", "isDependentConnection() {\n return !(this.drawToCenter === EConnectionCentered.NONE);\n }", "get hasValues() {\n return this.arrayWidth > 0 && this.arrayHeight > 0;\n }", "directionIsValide(){\n let max_x = window.innerWidth;\n let max_y = window.innerHeight;\n let new_x= this.dir.x*this.dir.vect+this.pos.x;\n let new_y= this.dir.y*this.dir.vect+this.pos.y;\n return (new_x>0 && new_y>0 && new_x<max_x && new_y<max_y );\n }", "isNonZero() {\r\n const s = new Uint8Array(32);\r\n this.toBytes(s);\r\n let x = 0;\r\n for (let i = 0; i < s.length; i++) {\r\n x |= s[i];\r\n }\r\n x |= x >> 4;\r\n x |= x >> 2;\r\n x |= x >> 1;\r\n return (x & 1);\r\n }", "function isFlipped()\n {\n return this.scale.x == -1;\n }", "podeMoverParaCima() {\n return this.getBird().getPosHeigth() > 0;\n }", "function isQcZero(color) {\n return (LCR_QC_VALID[color] && (LCR_QC_VALUE[color] == 0));\n}", "function isEdgeBlock(){\n return (xCo == 0 || xCo == MAX_X - 1 || yCo == 0 || yCo == MAX_Y - 1);\n }", "function isZero(x) {\n var i;\n for (i=0;i<x.length;i++)\n if (x[i])\n return 0;\n return 1;\n }", "function isInOrientationBox(x,y){\t\n return (x>orientX && y<windowHeight/orientMag && zoomFactor>0.5);\n}", "function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {\n\t return axisModel.getCoordSysModel() === gridModel;\n\t}", "offscreen() {\n if (this.x < -this.width) {\n return true;\n }\n return false;\n }", "function isAxisUsedInTheGrid(axisModel, gridModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}", "function o(e,r){return !e.visible||0!==e.minScale&&r>e.minScale||0!==e.maxScale&&r<e.maxScale}", "borders() {\n if ((this.pos.x < 0) || (this.pos.y < 0) || (this.pos.x > width) || (this.pos.y > height)) {\n return true;\n } else {\n return false;\n }\n }", "function isRotatedNormalProjection(P) {\n return isAxisAligned(P) && P.lam0 !== 0;\n }", "isDisplaced() { return this.displaced === true; }", "function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}", "function o(e,r){return!e.visible||0!==e.minScale&&r>e.minScale||0!==e.maxScale&&r<e.maxScale}", "function r(t) {\n if (!t) return !1;\n var e = t.verticalOffset;\n return !!e && !(e.screenLength <= 0 || e.maxWorldLength <= 0);\n }", "function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {\n return axisModel.getCoordSysModel() === gridModel;\n }", "function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {\n return axisModel.getCoordSysModel() === gridModel;\n }", "function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}", "function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}", "function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}", "function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}", "function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}", "function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}", "function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}", "function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}", "function canvasBoundary(axis, boundary) {\n if (axis >= boundary) {\n axis = boundary;\n }\n if (axis <= 0) {\n axis = 0;\n }\n return axis;\n }", "function isAroundZero(val) {\n return val > -EPSILON && val < EPSILON;\n}", "checkEmpty () {\n if (this.front === 0 && this.rear === 0) {\n return true\n }\n }", "isZero() { return (this.#val === BN_0); }", "isEmpty() {\n return this.vertexCount === 0;\n }", "function clipEnds(d) {\n\t var p = ax.l2p(d.x);\n\t return (p > 1 && p < ax._length - 1);\n\t }", "function clipEnds(d) {\n\t var p = ax.l2p(d.x);\n\t return (p > 1 && p < ax._length - 1);\n\t }", "function clipEnds(d) {\n var p = ax.l2p(d.x);\n return (p > 1 && p < ax._length - 1);\n }", "function clipEnds(d) {\n var p = ax.l2p(d.x);\n return (p > 1 && p < ax._length - 1);\n }", "calcAxis(axis) {\n\t\tlet r = {\n\t\t\tx : getRandomFloat(axis.x[0], axis.x[1], 1),\n\t\t\ty : getRandomFloat(axis.y[0], axis.y[1], 1)\n\t\t}\n\n\t\tlet sign = getRandom(0, 1)\n\t\tif (sign == 0) { r.x = -r.x }\n\n\t\tsign = getRandom(0, 1)\n\t\tif (sign == 0) { r.y = -r.y }\n\n\t\treturn r\n\t}", "offscreen() {\n if (this.xSky < -this.w) {\n return true;\n } else {\n return false;\n }\n }", "function is(x, y) {\n return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;\n }", "function showZeros() {\n\t\tctx.beginPath();\n\t\tctx.fillStyle = \"cornflowerblue\";\n\t\tctx.arc(0, 0, 5, 0, Math.PI * 2); // drawing circle around x/y - upper left corner\n\t\tctx.fill();\n\t\tctx.stroke();\n\t\tctx.closePath();\n\t}", "function isChanged() {\n var x = currentCircle.attr(\"cx\");\n var xBackup = currentCircle.attr(\"cx-backup\");\n return Math.round(parseFloat(x) / minSpace) != Math.round(parseFloat(xBackup) / minSpace);\n}", "function isVisibleAxis(axis) {\n return util_1.some(AXIS_PARTS, function (part) { return hasAxisPart(axis, part); });\n}", "_getCenter(o, dimension, axis) {\n if (o.anchor !== undefined) {\n if (o.anchor[axis] !== 0) {\n return 0;\n }\n else {\n //console.log(o.anchor[axis])\n return dimension / 2;\n }\n }\n else {\n return dimension;\n }\n }", "checkVerticalColision() {\n let absPos;\n\n // comprueba si ha tocado el fondo del tablero \n if (this._checkBottomColision()) return false;\n // \n for (let col = 0; col < 4; col++) {\n for (let row = 3; row >= 0; row--) {\n if (this[row][col] === 0) continue;\n\n absPos = this._getAbsolutePosition(row, col);\n\n if (this.board[absPos.row + 1][absPos.col] !== 0) return false;\n break;\n }\n }\n\n return true;\n }", "function isEmpty(x,y, grid)\n {\n if(math.subset(grid, math.index(x,y)) == 0) {\n return false;\n }\n else{\n return true;\n }\n }", "function isSliceContinous(shape, begin, size) {\n // Index of the first axis that has size > 1.\n var firstNonOneAxis = size.length;\n for (var i = 0; i < size.length; i++) {\n if (size[i] > 1) {\n firstNonOneAxis = i;\n break;\n }\n }\n for (var i = firstNonOneAxis + 1; i < size.length; i++) {\n if (begin[i] > 0 || size[i] !== shape[i]) {\n return false;\n }\n }\n return true;\n}", "isHide() {\n return this.x < 0\n }" ]
[ "0.79084367", "0.6435964", "0.64173824", "0.63664246", "0.6054823", "0.6044323", "0.6015769", "0.59150916", "0.5879838", "0.57272536", "0.5702873", "0.56943345", "0.56880975", "0.5687422", "0.56293803", "0.5625402", "0.56174374", "0.5593879", "0.5576341", "0.55748653", "0.55700034", "0.5559736", "0.55438197", "0.5531838", "0.54742485", "0.54522234", "0.5450835", "0.5444971", "0.5433806", "0.5433806", "0.54045665", "0.53946394", "0.53923935", "0.5375529", "0.53662515", "0.53587645", "0.53586537", "0.5358528", "0.5352516", "0.53480357", "0.53480357", "0.5337864", "0.53298515", "0.5310412", "0.53047776", "0.5299145", "0.52967453", "0.52857614", "0.5284749", "0.527892", "0.52632976", "0.52621156", "0.52541745", "0.5240284", "0.52383727", "0.5223251", "0.52196777", "0.52188694", "0.5190476", "0.51884896", "0.51841795", "0.5178426", "0.51745826", "0.51745826", "0.51515716", "0.51515716", "0.51515716", "0.51515716", "0.51515716", "0.51515716", "0.51515716", "0.51515716", "0.5146788", "0.51463336", "0.5143642", "0.51378214", "0.51357406", "0.5135451", "0.5135451", "0.5135008", "0.5135008", "0.5129058", "0.5111053", "0.51106316", "0.5107878", "0.51057875", "0.50914955", "0.5088019", "0.50854766", "0.5081955", "0.50799435", "0.5079419" ]
0.77958435
8
Find price that can fill order and buffer price by one order
function getBestOrderPrice(orderAmount,orderTotal,side,orderbook){if(side.toUpperCase()==='BUY'){var asks=orderbook.asks;// if orderTotal is provided for buy this means pre-fill was used if(orderTotal){var total=0;var _index2=asks.length-1;while(total<orderTotal&&_index2>=0){total+=parseFloat(asks[_index2].total);_index2--;}return _index2<0?asks[0].price:asks[_index2].price;}var _orderAmountNum=orderAmount?parseFloat(orderAmount):0;var _totalVolume=0;var _index=asks.length-1;while(_totalVolume<_orderAmountNum&&_index>=0){_totalVolume+=parseFloat(asks[_index].volume);_index--;}return _index<0?asks[0].price:asks[_index].price;}// SELL var bids=orderbook.bids;var orderAmountNum=orderAmount?parseFloat(orderAmount):0;var totalVolume=0;var index=0;while(totalVolume<orderAmountNum&&index<bids.length){totalVolume+=parseFloat(bids[index].volume);index++;}return index===bids.length?bids[bids.length-1].price:bids[index].price;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async findPriceList(code) {\n //\n // QUERY for exact DENOM\n const feasiblePacks = await CatalogDetail.query()\n .where(\"product_code\", code)\n .where(\"status\", \"ENABLE\")\n .orderBy(\"min\", \"asc\")\n .fetch();\n /// no records\n if (feasiblePacks.length === 0) {\n return null;\n }\n // console.log(feasiblePacks);\n // record exists\n const formattedSet = feasiblePacks.toJSON().map((val) => {\n // In DB, if val.min is NULL, then reference = denom in MY. Else, reference = kurs.\n let finalPrice = \"\";\n let reference = \"\";\n if (val.method === \"ABSOLUTE\") {\n if (!val.min) {\n finalPrice = parseFloat(val.value).toFixed(2);\n reference = parseFloat(val.reference).toFixed(2);\n } else {\n finalPrice = `${Number(val.min / val.reference) + Number(val.value)} - ${Number(\n\t\t\t\t\t\tval.denom / val.reference,\n\t\t\t\t\t) + Number(val.value)}`;\n reference = `${Number(val.min / val.reference)} - ${Number(val.denom / val.reference)}`;\n }\n } else {\n if (!val.min) {\n finalPrice = parseFloat(val.value * val.reference / 100).toFixed(2);\n reference = parseFloat(val.reference).toFixed(2);\n } else {\n const lower = val.value * (val.min / val.reference) / 100;\n const upper = val.value * (val.denom / val.reference) / 100;\n const lower_ref = val.min / val.reference;\n const upper_ref = val.denom / val.reference;\n finalPrice = `${lower.toFixed(2)} - ${upper.toFixed(2)}`;\n reference = `${lower_ref.toFixed(2)} - ${upper_ref.toFixed(2)}`;\n }\n }\n return {\n denomination: val.min ? `${val.min} - ${val.denom}` : val.denom,\n price: finalPrice,\n rrp: reference,\n };\n });\n formattedSet.sort(\n (a, b) =>\n Number(a.denomination) < Number(b.denomination) ?\n -1 :\n Number(b.denomination) < Number(a.denomination) ? 1 : 0,\n );\n return formattedSet;\n }", "match(order, priceLevel) {\n const matchingEventList = [];\n let volume = 0;\n\n while (true) {\n const tmpLLOE = this.orderMap.getFirstElementOfPriceLevel(priceLevel);\n if (!tmpLLOE) break; // all orders at this price level are matched\n\n const tradedQuantity = Math.min(order.remainingQuantity(), tmpLLOE.order.remainingQuantity());\n volume += tradedQuantity;\n logger.info(`orderbookside.js: match(): matches counter order id=${tmpLLOE.order._id} with trade quantity=${tradedQuantity}`);\n\n tmpLLOE.order.filledQuantity += tradedQuantity;\n order.filledQuantity += tradedQuantity;\n\n if (tmpLLOE.order.remainingQuantity() <= ZERO) tmpLLOE.order.filledQuantity = tmpLLOE.order.quantity;\n if (order.remainingQuantity() <= ZERO) order.filledQuantity = order.quantity;\n\n matchingEventList.push(OrderBookEvent.createNewMatchObject(tmpLLOE.order, tradedQuantity, tmpLLOE.order.remainingQuantity() <= ZERO));\n\n if (tmpLLOE.order.remainingQuantity() <= ZERO) this.orderMap.removeOrder(tmpLLOE.order);\n if (order.remainingQuantity() <= ZERO) break;\n }\n\n return {\n matchingEventList,\n volume,\n };\n }", "solve(price){\n let l = -1;\n let h = 1;\n let eps = 1e-10;\n let i = this.r.length-1;\n while(h-l > eps){\n let m = 0.5*(h+l);\n this.r[i] = m;\n let v = price();\n if(v > 0) l = m;\n else h = m;\n }\n }", "tryToMatch(order) {\n let matchingEventList = [];\n const ohlcvData = {};\n\n while (order.remainingQuantity() > ZERO) {\n const bestPriceLevel = this.bestPrice();\n if (bestPriceLevel && order.fulfill(bestPriceLevel)) {\n const tradingEvent = this.match(order, bestPriceLevel);\n logger.debug(`orderbookside.js: tryToMatch(): tradingEvent = ${JSON.stringify(tradingEvent)}`);\n\n matchingEventList = matchingEventList.concat(tradingEvent.matchingEventList);\n // update ohlcv data\n if (!ohlcvData.time) ohlcvData.time = tradingEvent.matchingEventList[0].matchedAt.getTime();\n if (!ohlcvData.open) ohlcvData.open = bestPriceLevel;\n ohlcvData.close = bestPriceLevel;\n ohlcvData.high = ohlcvData.high ? Math.max(bestPriceLevel, ohlcvData.high) : bestPriceLevel;\n ohlcvData.low = ohlcvData.low ? Math.min(bestPriceLevel, ohlcvData.low) : bestPriceLevel;\n ohlcvData.volume = ohlcvData.volume ? (ohlcvData.volume + tradingEvent.volume) : tradingEvent.volume;\n }\n else break;\n }\n logger.debug(`orderbookside.js: tryToMatch(): matchingEventList = ${JSON.stringify(matchingEventList)}`);\n logger.debug(`orderbookside.js: tryToMatch(): ohlcvData = ${JSON.stringify(ohlcvData)}`);\n\n return {\n matchList: matchingEventList,\n ohlcvData: ohlcvData,\n };\n }", "function searchProductsByPrice(price,difference){\n var promise = new Promise(function(resolve,reject){\n var i = 0;\n var priceArray = [];\n if(!isFinite(price)){\n reject(\"Invalid Price: \" + price)\n }\n else{\n setTimeout(function(){\n while (i < catalog.length){\n if (Math.abs(catalog[i].price - price) < difference){\n priceArray.push({id:catalog[i].id,price:catalog[i].price,type:catalog[i].type});\n }\n i++;\n }\n resolve(priceArray);\n },1000);\n }\n });\n return promise;\n }", "updateQuantity(order) {\n // check if new quantity is valid\n const oldOrder = this.getOrderByLimitPriceAndOrderId(order.limitPrice, order._id);\n if (oldOrder) {\n if (oldOrder.filledQuantity <= order.quantity) {\n return this.orderMap.updateOrderQuantity(order);\n }\n logger.error(`orderbookside.js updateQuantity(): ERROR: order id ${order._id} has new quantity ${order.quantity} < filled quantity ${oldOrder.filledQuantity}`);\n return null;\n }\n logger.error(`orderbookside.js updateQuantity(): ERROR: not found this order id ${order._id} at price ${order.limitPrice}`);\n return null;\n }", "function setBestAskAsPrice(){\n if($scope.parameters.type === constants.type.BUY && $scope.parameters.orderType === constants.orderType.LIMIT){\n if($scope.price === null || $scope.price === undefined || $scope.price === 0){\n if($scope.asks[0] != null || $scope.asks[0] != undefined){\n $scope.price = $scope.asks[0]['AskPrice'];\n }\n }\n else if($scope.price != 0){\n if($scope.bids != null && $scope.bids != undefined){\n if($scope.price === $scope.bids[0]['BidPrice']){\n if($scope.asks[0] != null || $scope.asks[0] != undefined){\n $scope.price = $scope.asks[0]['AskPrice'];\n }\n }\n }\n }\n }\n }", "get_latest_price(uom, product){\n var uom_by_category = this.get_units_by_category(this.env.pos.units_by_id, uom.category_id);\n var product_uom = this.env.pos.units_by_id[product.uom_id[0]];\n var ref_price = this.find_reference_unit_price(product, product_uom);\n var ref_price = product.lst_price;\n var ref_unit = null;\n for (var i in uom_by_category){\n if(uom_by_category[i].uom_type == 'reference'){\n ref_unit = uom_by_category[i];\n break;\n }\n }\n if(ref_unit){\n if(uom.uom_type == 'bigger'){\n console.log(\"bigggg\");\n console.log(\"ref_price * uom.factor_inv\",ref_price * uom.factor_inv);\n\n return (ref_price * uom.factor_inv);\n }\n else if(uom.uom_type == 'smaller'){\n console.log(\"smalll\");\n console.log(\"small\",(ref_price / uom.factor_inv));\n\n return (ref_price / uom.factor);\n }\n else if(uom.uom_type == 'reference'){\n console.log(\"refernce\");\n console.log(\"ref_price\",ref_price);\n return ref_price;\n }\n }\n return product.lst_price;\n }", "function getBufferedPrice(price) {\n return price.mul(110).div(100);\n}", "function setBestBidAsPrice(){\n if($scope.parameters.type === constants.type.SELL && $scope.parameters.orderType === constants.orderType.LIMIT){\n if($scope.price === null || $scope.price === undefined || $scope.price === 0){\n if($scope.bids[0] != null || $scope.bids[0] != undefined){\n $scope.price = $scope.bids[0]['BidPrice'];\n }\n }\n else if($scope.price != 0){\n if($scope.asks != null && $scope.asks != undefined){\n if($scope.price === $scope.asks[0]['AskPrice']){\n if($scope.bids[0] != null || $scope.bids[0] != undefined){\n $scope.price = $scope.bids[0]['BidPrice'];\n }\n }\n }\n }\n }\n }", "bestPrice() {\n if (this.side === 'ASK') {\n return this.orderMap.getMinPriceLevel();\n }\n // this.side === 'BID'\n return this.orderMap.getMaxPriceLevel();\n }", "function budgetFilter (price , ls) {\n\n const result = [];\n let count = 0;\n\n for (let i = 0; i < ls.length; i++) {\n if (price >= ls[i]) {\n result[count] = ls[i];\n count++\n }\n }\n\n return result\n}", "async futuresCalc(curr, d1, d2){\n d1 = d1 || 7.5;\n d2 = d2 || 15;\n // console.log(this.pair);\n let res = await this.client.futuresBook({ symbol: this.pair });\n \n let sellMass = 0;\n let sellMass2 = 0;\n let sellStops = [];\n\n let buyMass = 0;\n let buyMass2 = 0;\n let buyStops = [];\n \n for (let i = 0; i < res.asks.length; i++) {\n // if(Number(res.asks[i].quantity) >= Number(valByID('threshold'))){\n // sellStops.push({price: Number(res.asks[i].price), quantity: Number(res.asks[i].quantity)});\n // }\n sellMass += res.asks[i].price - curr < d1 ? Number(res.asks[i].quantity) : 0;\n sellMass2 += res.asks[i].price - curr < d2 ? Number(res.asks[i].quantity) : 0;\n }\n for (let i = 0; i < res.bids.length; i++) {\n // if(Number(res.bids[i].quantity) >= Number(valByID('threshold'))){\n // buyStops.push({price: Number(res.bids[i].price), quantity: Number(res.bids[i].quantity)});\n // }\n buyMass += curr - res.bids[i].price < d1 ? Number(res.bids[i].quantity) : 0;\n buyMass2 += curr - res.bids[i].price < d2 ? Number(res.bids[i].quantity) : 0;\n }\n\n return {sellMass, sellMass2, buyMass, buyMass2};\n }", "processOrders() {\r\n /*\r\n this.orders.forEach(order => {\r\n const isBuy = order.amount > 0;\r\n const amount = Math.abs(order.amount);\r\n const base = order.pair.split('-')[0];\r\n const quote = order.pair.split('-')[1];\r\n const quoteAmount = base * amount;\r\n // check price\r\n const orderBooks = this.cobinhood.orderBooks;\r\n\r\n // execute order\r\n if (isBuy) {\r\n if (this.wallet.withdraw(quote, quoteAmount)) {\r\n this.wallet.deposit(base, amount);\r\n }\r\n }\r\n else {\r\n if (this.wallet.withdraw(base, amount)) {\r\n this.wallet.deposit(quote, quoteAmount);\r\n }\r\n }\r\n console.log(order);\r\n });*/\r\n }", "function freeShipping(order){\n var sum = 0;\n for (const items in order){\n sum += order[items]\n }\n return sum > 50;\n}", "function getOrder(p) {\n return Promise.all(\n ccxt.exchanges.map(async e => {\n // NOTE: Checking if the markets are included in the supported list:\n if (exchanges.includes(e)) {\n let exchange = new ccxt[e](keys[e]);\n if (exchange.hasFetchOrderBook) {\n let now = Math.floor(new Date());\n // NOTE: Getting OrderBook info\n let order = await exchange\n .fetchOrderBook(p)\n .then(o => {\n return o;\n })\n .catch(err => {\n if (!_.isNull(err) || !_.isEmpty(err))\n logRecord(err, \"getOrder_Balance\");\n }); // SOMETHING IS WRONG WITH ERROR LOGGING HERE... NO IDEA WHY.\n // IT WOULD LOG SOME EMPTY OBJECTS EVEN WITH AN IF STATMENT BEFORE TRYING TO AVOID IT.\n // NOTE: Checking if order exists and is correctly returned (object)\n if (\n order &&\n _.isObject(order) &&\n !_.isEmpty(order.bids) &&\n !_.isEmpty(order.asks)\n ) {\n // NOTE: Checking the available balances for the corresponding market\n let balance = await exchange\n .fetchBalance()\n .then(b => {\n return b;\n })\n .catch(err => {\n if (!_.isNull(err) || !_.isEmpty(err))\n logRecord(err, \"getOrder_Balance\");\n }); // SOMETHING IS WRONG WITH ERROR LOGGING HERE... NO IDEA WHY.\n // IT WOULD LOG SOME EMPTY OBJECTS EVEN WITH AN IF STATMENT BEFORE TRYING TO AVOID IT.\n order.mkt = e;\n order.pair = p;\n order.ping = order.timestamp - now;\n order.mktvar = {};\n // NOTE: Checking if the balance info was correctly returned and adding the info to the orderbook\n if (_.isObject(balance)) {\n order.mktvar.balance = {\n free: balance.free,\n used: balance.used,\n total: balance.total\n };\n } else {\n order.mktvar.balance = {\n free: {\n EUR: 0,\n BTC: 0,\n LTC: 0,\n ETH: 0,\n XRP: 0,\n BCH: 0,\n USD: 0\n },\n used: 0,\n total: 0\n };\n }\n\n // NOTE: OK! Everything went well returning the order object in full.\n return order;\n } else {\n // NOTE: Goes with the check-up if order doesn't exists or isn't an Object.\n // Basically means there was either a timeout or the server is unreachable.\n return 3;\n }\n } else {\n // NOTE: The exchange doesn't support fetchOrderBook() function\n return 2;\n }\n } else {\n // NOTE: Market is not supported by the app. No need to get anyfurther\n return 1;\n }\n })\n );\n}", "setBestBidAndAsk() {\n if(!this.orderbook) {\n setTimeout(() => {\n this.setBestBidAndAsk();\n }, 100);\n return;\n }\n let bestBid = this.orderbook[0][0];\n if(this.orderbook[0][2] < 0) {\n bestBid = undefined;\n }\n let bestAsk;\n for(let i = 0 ; i < this.orderbook.length ; ++i) {\n let ask = this.orderbook[i][2] < 0 ? true : false;\n if(ask) {\n bestAsk = this.orderbook[i][0];\n break;\n }\n }\n this.bestBid = bestBid;\n this.bestAsk = bestAsk;\n setTimeout(() => {\n this.setBestBidAndAsk();\n }, this.getBookTimeout);\n }", "calculatePrice() {\n \t\tfor (let key in this.elementsCounted) {\n \t\t\tconst count = this.elementsCounted[key];\n \t\t\tconst elementConfig = this.config[key];\n \t\t\tvar price = 0;\n \t\t\tif (elementConfig === undefined) {\n \t\t\t\tthrow new Error('Element : ' + key + ', non existent in the store.');\n \t\t\t} else if (elementConfig.solded === undefined) {\n \t\t\t\tprice = count * elementConfig.unitPrice;\n \t\t\t} else {\n \t\t\t\tlet countSoldedLots = Math.floor(count / elementConfig.solded.FOR);\n \t\t\t\tlet priceSoldedLot = elementConfig.unitPrice * elementConfig.solded.AS;\n \t\t\t\tlet leftItems = count % elementConfig.solded.FOR;\n \t\t\t\tprice = countSoldedLots * priceSoldedLot + leftItems * elementConfig.unitPrice;\n \t\t\t}\n \t\t\tthis.ticket[key] = price\n \t\t}\n }", "async bidAll(asset, price) {\n let r = null;\n\n // the trader wants to bid at the specified price, but we know the book order\n // meaning that we may be able to do better than that\n // take the best bid on it, and see if it still matches our price\n let bestBidPrice = this.ws.getTopBiddingPrice(asset);\n if (bestBidPrice <= price) {\n console.log(`[*] Adjusting bidding price from ${price} to ${bestBidPrice} based on book updates`);\n price = bestBidPrice;\n }\n\n // reference that order, we never know\n let userref = Math.floor(Math.random() * 1000000000);\n let options = {\n pair: this.getPairKey(asset),\n type: 'buy',\n ordertype: 'limit',\n volume: this._getMaxAssetVolume(asset, price),\n expiretm: \"+55\", // expire in 50s,\n oflags: \"post\",\n price: price.toFixed(this.getPricePrecision(asset)),\n userref: userref, // reference for order, to be used internally\n }\n if (this.fake) {\n options.validate = true; // validate input only, do not submit order !\n }\n\n try {\n // get balance info\n r = await this.kraken.api('AddOrder', options);\n console.log(`[*] placed ${this.fake ? \"(FAKE)\": \"\"} BUY order: ${r.result.descr.order}`);\n this.placedOrders.push({ order: options, result: r.result });\n } catch (e) {\n let errorMsg = _.get(r, ['data', 'error', 0]);\n if (errorMsg) {\n console.error('Error while bidding: ' + errorMsg.red);\n } else {\n console.error('Error while bidding'.red);\n console.error(e);\n console.log(JSON.stringify(r));\n }\n //process.exit(-1);\n }\n }", "function searchProductsByPrice(price, difference) {\n\t\t\tvar promise = new Promise((resolve, reject) => {\n\t\t\t\tlet i = 0;\n\t\t\t\tlet priceArray = [];\n\t\t\t\t//Handle invalid price\n\t\t\t\tif (!isFinite(price)) reject('Invalid Price: ' + price);\n\t\t\t\t//Otherwise, search catalog\n\t\t\t\telse {\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\twhile (i < catalog.length) {\n\t\t\t\t\t\t\tif (Math.abs(catalog[i].price - price) <= difference) {\n\t\t\t\t\t\t\t\tpriceArray.push({\n\t\t\t\t\t\t\t\t\tid: catalog[i].id,\n\t\t\t\t\t\t\t\t\tprice: catalog[i].price,\n\t\t\t\t\t\t\t\t\ttype: catalog[i].type\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//After searching entire catalog, return matching products\n\t\t\t\t\t\tresolve(priceArray);\n\t\t\t\t\t}, 1000);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn promise;\n\t\t}", "checkPriceTarget(orderData) {\n console.log('In checkPriceTarget');\n console.log(orderData);\n\n if (this.model.get('symbol') === orderData.symbol) {\n if (orderData.buy) {\n if (this.model.get('price') <= orderData.targetPrice) {\n const errorMessage = {\n order: 'New order not created. You must plan to buy at a price that is less than the current price!',\n };\n this.bus.trigger('price_check_response', errorMessage)\n return false;\n } else {\n this.bus.trigger('price_check_response', orderData)\n return true;\n }\n } else {\n if (this.model.get('price') >= orderData.targetPrice) {\n const errorMessage = {\n order: `New order not created. You must plan to sell at a price that is greater than the current price!`\n };\n this.bus.trigger('price_check_response', errorMessage)\n return false;\n } else {\n this.bus.trigger('price_check_response', orderData)\n return true;\n }\n }\n }\n }", "function getMark() {\n const min_ask = Math.min(\n ...orders.filter((o) => o.side === \"sell\").map((o) => o.price)\n );\n const max_bid = Math.max(\n ...orders.filter((o) => o.side === \"buy\").map((o) => o.price)\n );\n\n if (isFinite(min_ask) && isFinite(max_bid)) {\n return (min_ask + max_bid) * 0.5;\n } else if (isFinite(min_ask)) {\n return min_ask;\n } else if (isFinite(max_bid)) {\n return max_bid;\n } else {\n return undefined;\n }\n}", "function autoBuySell(price) {\n if (price <= 44.6) {\n wallet.buy();\n cashFlow();\n } else if ( price >= 61.5) {\n wallet.sell();\n cashFlow();\n }\n }", "fillWithBestPrices(product, quantity) {\n throw Error(\"Not Implemented\");\n }", "async placeBuyLimitOrder(amount, price){\n return await this.exchange.placeBuyLimitOrder(amount, price);\n }", "async function buyFromWho(quadKeys, buyMode, userId) {\n\n const arrPM = await Promise.all(quadKeys.map(itemQK => checkExistQuadkey(itemQK.quadKey)));\n if (typeof buyMode !== 'undefined' && buyMode === 'forbid') {\n let result = quadKeys.reduce((splitLand, itemQK, i) => {\n if (arrPM[i]) {\n if (arrPM[i].forSaleStatus === true) {\n itemQK.seller = arrPM[i].user._id;\n itemQK.sellerNid = arrPM[i].user.nid;\n itemQK.userRole = arrPM[i].user.role;\n splitLand.buyFromOtherUserSale.push(itemQK);\n } else {\n splitLand.buyFromOtherUserNoSale.push(itemQK);\n }\n } else {\n splitLand.buyFromSystem.push(itemQK);\n }\n return splitLand;\n }, { buyFromSystem: [], buyFromOtherUserSale: [], buyFromOtherUserNoSale: [] });\n return result;\n }\n else {\n const qkeys = quadKeys.map(itemQk => itemQk.quadKey);\n const pendings = await LandPending.find({ 'quadKey': { $in: qkeys } });\n if (pendings.length !== qkeys.length) {\n return { buyFromSystem: [], buyFromOtherUserSale: [], buyFromOtherUserNoSale: [] };\n } else {\n let result = quadKeys.reduce((splitLand, itemQK, i) => {\n if (arrPM[i]) {\n if (arrPM[i].forSaleStatus === true) {\n itemQK.seller = arrPM[i].user._id;\n itemQK.sellerNid = arrPM[i].user.nid;\n itemQK.userRole = arrPM[i].user.role;\n splitLand.buyFromOtherUserSale.push(itemQK);\n } else {\n splitLand.buyFromOtherUserNoSale.push(itemQK);\n }\n } else {\n splitLand.buyFromSystem.push(itemQK);\n }\n return splitLand;\n }, { buyFromSystem: [], buyFromOtherUserSale: [], buyFromOtherUserNoSale: [] });\n //console.log('result', result);\n return result;\n }\n }\n}", "function price2(rentals)\n{\n for (var i = 0; i < rentals.length; i++)\n {\n var time = getDays(rentals[i].pickupDate, rentals[i].returnDate);\n\n if (time < 1)\n {\n rentals[i].price = (time * getPricePerDay(rentals[i].carId)) + (rentals[i].distance * getPricePerKm(rentals[i].carId));\n }\n if (time >= 1 && time < 4)\n {\n rentals[i].price = (time * getPricePerDay(rentals[i].carId) * 0.9) + (rentals[i].distance * getPricePerKm(rentals[i].carId));\n }\n if (time >= 4 && time < 10)\n {\n rentals[i].price = (time * getPricePerDay(rentals[i].carId) * 0.7) + (rentals[i].distance * getPricePerKm(rentals[i].carId));\n }\n if (time >= 10)\n {\n rentals[i].price = (time * getPricePerDay(rentals[i].carId) * 0.5) + (rentals[i].distance * getPricePerKm(rentals[i].carId));\n }\n }\n}", "async placeSellLimitOrder(amount, price){\n return await this.exchange.placeSellLimitOrder(amount, price);\n }", "_order_entered(event) {\n const order = event.detail;\n if (isNaN(order.price) || isNaN(order.volume)) {\n this.$.widget.setLimitText('Invalid order entered');\n return;\n }\n const bids = this.bids.filter(b => b.pcode === this.pcode);\n const asks = this.asks.filter(a => a.pcode === this.pcode);\n if (order.is_bid) {\n // cannot bid higher than previous ask price, if exists\n if (asks.length > 0 && asks[0].price <= order.price) {\n this.$.widget.setLimitText(`Order rejected: bid price (${order.price/100}) must be less than existing ask of ${asks[0].price/100}`);\n return;\n }\n this.$.trader_state.enter_order(order.price, order.volume, order.is_bid);\n this.$.widget.disableSubmit('bid');\n } else {\n // cannot ask lower than previous bid, if exists\n if (bids.length > 0 && bids[0].price >= order.price) {\n this.$.widget.setLimitText(`Order rejected: ask price (${order.price/100}) must be greater than existing bid of ${bids[0].price/100}`);\n return;\n }\n this.$.trader_state.enter_order(order.price, order.volume, order.is_bid);\n this.$.widget.disableSubmit('ask');\n }\n }", "function findProductByPriceRange(a, b, c) {\nvar result = a.filter(function(value){\n //return b <= value.price >= c;\n return value.price >= b && value.price <= c\n});\nreturn result;\n}", "function buyOrder(price) {\n\tvar amount = (fiat - keepFiat) / price;\n\t\n\tmtGoxPost(\"BTC\" + currency + \"/money/order/add\", \n\t\t\t['type=bid','amount_int=' + Math.round(amount*100000000).toString(), 'price_int=' + Math.round((price + 0.001)*100000).toString()],\n\t\t\tfunction(e) {\n\t\t\t\tlog(\"Error sending buy request. Retrying in 5 seconds...\");\n\t\t\t\tsetTimeout(buyOrder(price), 5000); // retry after 5 seconds\n\t\t\t}, onOrderProcessed);\n}", "function compareByPrice(prod1, prod2)\n{\n return prod1.price - prod2.price;\n}", "function getPrice(quantity) {\r\n \r\n quantity = parseInt(quantity);\r\n\r\n var price = 0; \r\n var span_price = document.getElementsByClassName('mod-detail-price-sku');\r\n if(span_price != null) {\r\n span_price = span_price[0];\r\n }\r\n // Một mức giá\r\n if(span_price != null)\r\n {\r\n //price=span_price.textContent;\r\n var e_num = document.getElementsByClassName('mod-detail-price-sku')[0].getElementsByTagName('span')[1].textContent;\r\n var p_num = document.getElementsByClassName('mod-detail-price-sku')[0].getElementsByTagName('span')[2].textContent;\r\n price = e_num + p_num;\r\n return processPrice(price);\r\n }\r\n\r\n // Nhiều mức giá\r\n var div_prices = document.getElementById(\"mod-detail-price\");\r\n\r\n if(div_prices == null) {\r\n return processPrice(price);\r\n }\r\n\r\n var span_prices = div_prices.getElementsByTagName(\"span\");\r\n if(span_prices==null) {\r\n return processPrice(price);\r\n }\r\n\r\n // Duyệt qua các mức giá\r\n var quan_compare = '';\r\n for (var i = 0; i < span_prices.length; i++) {\r\n var str = span_prices[i].textContent;\r\n if((str.indexOf('-')!=-1) || (str.indexOf('≥') != -1))\r\n {\t\t\t\r\n if(str.indexOf('-')!=-1)\r\n {\r\n quan_compare = str.split('-');\r\n price = span_prices[i+1].textContent + '' + span_prices[i+2].textContent;\r\n if(quantity >= quan_compare[0] & quantity <= quan_compare[1]) {\r\n break;\r\n }\r\n }\r\n if(str.indexOf('≥')!=-1)\r\n {\r\n price = span_prices[i+1].textContent + '' + span_prices[i+2].textContent;\r\n }\r\n }\r\n }\r\n return processPrice(price);\r\n }", "function greedyPoo(items) {\n var resultsGreed = [];\n let currentSize = 0;\n let currentValue = 0;\n \n sortedStuff(greedItems).forEach(item => {\n if(currentSize + item.size <= capacity) {\n resultsGreed.push(item.index);\n currentSize += item.size;\n currentValue += item.value;\n } \n })\n return {resultsGreed, currentSize, currentValue};\n }", "async function orderTest() {\n const order = await orderPut(\n userId,\n market,\n ORDER_SIDE_BID,\n ORDER_TYPE_LIMIT,\n /*amount*/ \"10\",\n /*price*/ \"1.1\",\n fee,\n fee\n );\n console.log(order);\n const balance3 = await balanceQuery(userId);\n floatEqual(balance3.BTC.available, \"89\");\n floatEqual(balance3.BTC.frozen, \"11\");\n\n const orderPending = await orderDetail(market, order.id);\n assert.deepEqual(orderPending, order);\n\n const summary = (await marketSummary(market))[0];\n floatEqual(summary.bid_amount, \"10\");\n assert.equal(summary.bid_count, 1);\n\n const depth = await orderDepth(market, 100, /*not merge*/ \"0\");\n assert.deepEqual(depth, { asks: [], bids: [{ price: \"1.1\", amount: \"10\" }] });\n\n await orderCancel(userId, market, 1);\n const balance4 = await balanceQuery(userId);\n floatEqual(balance4.BTC.available, \"100\");\n floatEqual(balance4.BTC.frozen, \"0\");\n\n console.log(\"orderTest passed\");\n}", "placeOrder() {\n var cartItems = this.state.itemList.filter((e)=> (e.isChecked == true))\n console.log('cartItems :', JSON.stringify(cartItems));\n\n if(cartItems.length) {\n var numOfPackage = this.findNumOfPackage(cartItems);\n console.log('numOfPackage :', numOfPackage);\n\n if(numOfPackage == 1) {\n this.createCartList(cartItems, numOfPackage);\n } else {\n cartItems.sort((a, b) => parseInt(b.Weight) - parseInt(a.Weight));\n console.log('cartItems :', JSON.stringify(cartItems));\n\n var Package = [];\n cartItems.forEach((val, index) => {\n if(index < numOfPackage) {\n for(var i=0; i<numOfPackage; i++) {\n if(i == index) {\n Package[i] = [];\n Package[i].push(val);\n return;\n }\n }\n } else {\n Package.sort(this.sortFunction);\n for(var i=0; i<numOfPackage; i++) {\n var TPRIZE = 0;\n for(var j=0; j<Package[i].length; j++) {\n TPRIZE += Package[i][j].Price;\n }\n\n if (TPRIZE + val['Price'] <= maxOrderPrice) {\n Package[i].push(val);\n return;\n }\n }\n }\n })\n\n this.createCartList(Package, numOfPackage);\n }\n } else {\n alert(\"choose any item to place order\");\n }\n }", "validateOrder(_givenOrder, _preparedOrder) {\n _preparedOrder = _preparedOrder.sort((n1, n2) => n1 - n2); // Sorts both orders\n _givenOrder.ingredients = _givenOrder.ingredients.sort((n1, n2) => n1 - n2);\n KebapHouse.soldOrders++;\n for (let i = 0; i < _givenOrder.ingredients.length; i++) { // Checks if ingredients match\n if (_givenOrder.ingredients[i] != _preparedOrder[i]) {\n return false;\n }\n }\n return true;\n }", "function price2(){\nfor(var i=0; i<rentals.length;i++)\n{\n\nfor(var j=0; j<cars.length;j++)\n {\n if (rentals.carId==cars.id)\n {\n\n var days = getRentDays(rentals[i].pickupDate,rentals[i].returnDate);\n\n\n if (days == 1 ) //nothing changes\n {\n rentals[i].price= rentals[i].getRentDays(rentals[i].pickupDate,rentals[i].returnDate) * cars[j].pricePerDay\n + rentals[i].distance * cars[j].pricePerKm;\n }\n \n if (days > 1 && days <3) //price per day decreases by 10% after 1 day\n //(days + 1) because the 1st day =0\n {\n rentals[i].price= (days +1) * (cars[j].pricePerDay * 0.9)\n + rentals[i].distance * cars[j].pricePerKm;\n }\n\n if (days >4 && days <10) //price per day decreases by 30% after 4 days\n //(days + 1) because the 1st day =0\n {\n rentals[i].price= (days +1) * (cars[j].pricePerDay * 0.7)\n + rentals[i].distance * cars[j].pricePerKm;\n }\n\n if (days >10) //price per day decreases by 50% after 10 days\n //(days + 1) because the 1st day =0\n {\n rentals[i].price= (days +1) * (cars[j].pricePerDay * 0.5)\n + rentals[i].distance * cars[j].pricePerKm;\n }\n\n }\n }\n}\n\n}", "function search(budget, prices) {\n // return array of prices that are within budget\n return prices\n .filter(price => price <= budget)\n .sort((a, b) => a - b)\n .join(',');\n}", "async function setOrderPrice(price, market){\n //let price = await network.executeBookOrder(market, 1, 1);\n if (market == 'PTA/USDT'){\n var priceLen = 6;\n } else if (market == 'PTA/BTC'){\n var priceLen = 10;\n }\n price = parseFloat(price).toFixed(priceLen);\n //console.log(\"refPrice: \" + price);\n let len = price.toString().length - 2;\n //console.log(\"len: \" + len)\n let ranNumber = Math.floor((Math.random()*7)+1);\n price = price - (ranNumber / Math.pow(10, (len)));\n price = price.toFixed(len);\n return price;\n}", "function deliverPrices(name, sort) {\n return new Promise(resolve => {\n var results = {};\n var prodIds = {};\n var numPrices = 0;\n\n searchName(name, sort)\n .then(function(search) {\n\n if(search.success == 'false' && search.errors); {\n if(search.errors.length > 0 && search.errors[0] == 'Missing or invalid bearer token.') {\n results.success = 'false';\n resolve(results);\n throw new Error(\"Invalid bearer token\");\n }\n }\n prodIds = search.results;\n return getPrices(search.results);\n })\n .then(function(resp) {\n var validPrices = {}, prices;\n validPrices[\"results\"] = [];\n\n if(resp.charAt(0) != '<'){\n prices = JSON.parse(resp);\n } else { throw new Error(\"unexpected HTTP response\"); }\n\n //filter nulls\n numPrices = prices.results.length;\n if(numPrices > 0) {\n for(i = 0; i < numPrices; i++) {\n if(prices.results[i].lowPrice != null){\n validPrices[\"results\"].push(prices.results[i]);\n }\n }\n }\n results.prices = validPrices.results;\n\n return getDetails(prodIds);\n })\n .then(function(resp) { //combined pricing results and product details results\n var cardIndex = {};\n var cardDetails = JSON.parse(resp);\n \n //index card details them first, each productID being the key\n cardDetails.results.forEach(function(card) {\n cardIndex[card.productId] = card;\n });\n\n results.prices.forEach(function(price, i) {\n var id = results.prices[i].productId;\n results.prices[i].name = cardIndex[id].name;\n results.prices[i].subTypeName = abbrvEd(price.subTypeName);\n //extended values\n cardIndex[id].extendedData.forEach(function(eData, j) {\n if(eData.name == \"Number\") { results.prices[i].series = eData.value; }\n if(eData.name == \"Rarity\") { results.prices[i].rarity = abbrvRarity(eData.value); }\n })\n });\n results.success = 'true';\n resolve(results);\n }).catch(function(err) {\n console.error(err);\n });\n });\n}", "function findVialPriceWithSize(arr, targetSize) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i].size === targetSize) {\n // console.log(arr[i])\n return arr[i].price;\n }\n }\n\n return 0;\n}", "function calculPrice () {\n for (var i = 0; i < deliveries.length; i++) {\n for (var j = 0; j < truckers.length; j++) {\n if (deliveries[i].truckerId == truckers[j].id) {\n var pricePerKm = truckers[j].pricePerKm;\n var pricePerVolume = truckers[j].pricePerVolume;\n break;\n }\n }\n deliveries[i].price = deliveries[i].distance * pricePerKm + deliveries[i].volume * pricePerVolume * decreazingPrice(deliveries[i].volume);\n }\n}", "function productPrice(args, done)\n {\n var product_id = args.productId;\n var bookPrice = null; \n for(var i=0; i < mockData.length; i++)\n {\n if (mockData[i].product_id == product_id)\n {\n bookPrice = mockData[i].product_price;\n }\n }\n done(null, { result: bookPrice });\n }", "function mySolution(arr1, arr2) {\r\n let newArr1 = [];\r\n arr1.map((item, index) => newArr1.push({\r\n 'price': item,\r\n 'index': index,\r\n 'isArr1': true\r\n }));\r\n let newArr2 = [];\r\n arr2.map((item, index) => newArr2.push({\r\n 'price': item,\r\n 'index': index,\r\n 'isArr1': false\r\n }));\r\n newArr1.push(...newArr2);\r\n let myArr = newArr1.slice(0);\r\n myArr.sort((a, b) => {\r\n return a.price - b.price;\r\n });\r\n console.log('sorted Arr: ', myArr);\r\n let minDiffPrice = 1000000;\r\n let tempItem;\r\n let newArr1Index = 0;\r\n let newArr2Index = 0;\r\n myArr.map(item => {\r\n // init\r\n if (minDiffPrice === 1000000) {\r\n tempItem = item;\r\n tempItem.isArr1 ? newArr1Index = tempItem.index : newArr2Index = tempItem.index;\r\n minDiffPrice--;\r\n } else {\r\n if ((item.price - tempItem.price) < minDiffPrice && item.isArr1 !== tempItem.isArr1) {\r\n // need to update\r\n tempItem.isArr1 ? newArr1Index = tempItem.index : newArr2Index = tempItem.index;\r\n minDiffPrice = item.price - tempItem.price;\r\n tempItem = item;\r\n console.log('diffPrice: ' + minDiffPrice);\r\n tempItem.isArr1 ? newArr1Index = tempItem.index : newArr2Index = tempItem.index;\r\n // console.log([newArr1Index, newArr2Index]);\r\n } else if (item.isArr1 === tempItem.isArr1) {\r\n tempItem = item;\r\n }\r\n }\r\n });\r\n return [newArr1Index, newArr2Index];\r\n}", "order (oid) {\n for (const xc of Object.values(this.user.exchanges)) {\n for (const market of Object.values(xc.markets)) {\n if (!market.orders) continue\n for (const ord of market.orders) {\n if (ord.id === oid) return ord\n }\n }\n }\n }", "function calcPrice(part) {\n var markup,\n cost = part.costPrice,\n quantity = part.quantity,\n matrix = part.matrix;\n if (matrix === 'tire' || part.tire) {\n markup = 1.25;\n } else if (matrix === 'dealer' || part.dealer) {\n if (cost <= 1) {\n markup = 3.5;\n } else if (cost > 1 && cost <= 5) {\n markup = 3.25;\n } else if (cost > 5 && cost < 50) {\n markup = 2.25;\n } else if (cost > 50 && cost <= 100) {\n markup = 1.82;\n } else if (cost > 100 && cost <= 175) {\n markup = 1.67;\n } else {\n markup = 1.54;\n }\n } else {\n if (cost <= 5) {\n markup = 3.25;\n } else if (cost > 5 && cost <= 10) {\n markup = 2.5;\n } else if (cost > 10 && cost <= 75) {\n markup = 2.25;\n } else if (cost > 75 && cost <= 150) {\n markup = 2;\n } else if (cost > 150 && cost <= 750) {\n markup = 1.85;\n } else {\n markup = 1.54;\n }\n }\n return markup * cost * quantity;\n }", "function search(budget, prices) {\n\n // return array of prices that are within budget\n const priceList = prices.filter(price => price <= budget)\n .sort((a,b) => a - b);\n \n return priceList.toString();\n \n }", "placeOrder(order) {\n //init empty return list\n this.returnList = [];\n //iterate over each pizza in the order\n for( let i = 0; i < order.itemList.length; i++){\n //console.log(order.itemList[i]);\n //if the store has enough ingredients to make the pizza\n if( this.haveEnough(order.itemList[i])){\n //console.log(order.itemList[i]);\n this.returnList.push(order.itemList[i]);\n }\n }\n return( this.returnList );\n }", "function placeBuyOrder (p) {\n\n}", "getBestPrice(product) {\n throw Error(\"Not Implemented\");\n }", "function query_sdPlus_priceSlab(item) {\n //console.log('query_sdPlus_priceSlab running. . .');\n var userDefined_priceSlab = parseInt(item.extraField2);\n var userDefined_sdPlus = item.extraField3;\n\n if (isLegit_vendorDTO_item(item)) {\n var price = item.commonMinProductDetailsDTO.priceInfo.finalPrice;\n var sdPlus = item.commonMinProductDetailsDTO.vendorDTO.sdPlus;\n if (userDefined_priceSlab && userDefined_sdPlus) {\n if (!sdPlus || price > userDefined_priceSlab) {\n return true;\n } else {\n return false;\n }\n } else if (userDefined_priceSlab) {\n if (price > userDefined_priceSlab) {\n return true;\n }\n } else if (userDefined_sdPlus) {\n //console.log('item pogId:', item.pogId);\n if (!sdPlus) {\n return true;\n }\n } else {\n return false;\n }\n }\n }", "marketOrder(symbol, amount, side, isEverything) {\n logger.info(`Null API market order - ${symbol}, amount:${amount}, side:${side}`);\n\n this.nextId += 1;\n return Promise.resolve({ id: this.nextId });\n }", "function renderContentByPrice1() {\n\twatch = [];\n\tif ($('#20m').prop('checked')) {\n\t\twatches.forEach(function(item, index) {\n\t\t\tif (formatString(item.price) < 20000000) {\n\t\t\t\twatch.push(item);\n\t\t\t}\n\t\t});\n\t\trenderContent(watch);\n\t} else {\n\t\trenderContent(watches);\n\t}\n}", "function shortSellUntilZero(tradeOrderId, matchingSortedBidIds, userTradeOrder) {\n var sharesLeft = new BigNumber(userTradeOrder.sharesToSell, 10);\n if (matchingSortedBidIds.length > 0) {\n // 4.2.1/ there is order to fill\n var firstBuyerTradeId = matchingSortedBidIds[0];\n self.short_sell({\n buyer_trade_id: firstBuyerTradeId,\n max_amount: sharesLeft,\n onTradeHash: function (data) {\n onTradeHash(tradeOrderId, data);\n },\n onCommitSent: function (data) {\n onCommitSent(tradeOrderId, data);\n },\n onCommitSuccess: function (data) {\n onCommitSuccess(tradeOrderId, data);\n },\n onCommitFailed: function (data) {\n onCommitFailed(tradeOrderId, data);\n },\n onNextBlock: function (data) {\n onNextBlock(tradeOrderId, data);\n },\n onTradeSent: function (data) {\n onTradeSent(tradeOrderId, data);\n },\n onTradeSuccess: function (data) {\n onTradeSuccess(tradeOrderId, data);\n var newSharesLeft = new BigNumber(data.callReturn[1], 10);\n if (newSharesLeft.gt(constants.ZERO)) {\n // not all user shares were shorted, recursively short\n userTradeOrder.sharesToSell = newSharesLeft.toFixed();\n shortSellUntilZero(tradeOrderId, matchingSortedBidIds.slice(1), userTradeOrder);\n }\n },\n onTradeFailed: function (data) {\n onTradeFailed(tradeOrderId, data);\n }\n });\n } else {\n // 4.2.2/ no order to fill\n self.buyCompleteSets({\n market: market,\n amount: userTradeOrder.sharesToSell,\n onSent: function (data) {\n onBuyCompleteSetsSent(requestId, data);\n },\n onSuccess: function (data) {\n onBuyCompleteSetsSuccess(requestId, data);\n self.sell({\n amount: sharesLeft.toFixed(),\n price: userTradeOrder.limitPrice,\n market: market,\n outcome: userTradeOrder.outcomeID,\n onSent: function (data) {\n onBuySellSent(requestId, data);\n },\n onSuccess: function (data) {\n onBuySellSuccess(requestId, data);\n },\n onFailed: function (data) {\n onBuySellFailed(requestId, data);\n }\n });\n },\n onFailed: function (data) {\n onBuyCompleteSetsFailed(requestId, data);\n }\n });\n }\n }", "constructor(snapshotData) {\n this.askUpdated = true;\n this.bidUpdated = true;\n\n this.askNewPriceLevels = new Set();\n this.bidNewPriceLevels = new Set();\n\n const splitter = snapshotData.length / 2;\n this.bid = [];\n this.ask = [];\n let sum = 0;\n for (let i = 0; i < splitter; i++) {\n\n let price = snapshotData[i][0];\n let size = snapshotData[i][2];\n let total = price * size;\n sum += total;\n\n this.bid.push([\n sum,\n total,\n size,\n price\n ]);\n }\n\n sum = 0;\n for (let i = splitter; i < snapshotData.length; i++) {\n\n let price = snapshotData[i][0];\n let size = Math.abs(snapshotData[i][2]);\n let total = Math.abs(price * size);\n sum += total;\n\n this.ask.push([\n sum,\n total,\n size,\n price\n ]);\n }\n }", "function generateSuggestions(currentPrices) {\n var newProfitList = []; //clear list before generating suggestions again\n var pairs = [\"XRPBTC\", \"XRPUSDT\", \"XRPUSD\", \"XRPETH\"];\n for (i in pairs) {\n var pair = pairs[i];\n for (var bidExchange in currentPrices) {\n for (var askExchange in currentPrices) {\n if (exchangeInfo[bidExchange] && exchangeInfo[askExchange] &&\n exchangeInfo[bidExchange][\"XRPwithdraw\"] && exchangeInfo[askExchange][\"XRPwithdraw\"]) {\n var bidPrice = currentPrices[bidExchange][pair];\n var askPrice = currentPrices[askExchange][pair];\n if (bidPrice && askPrice && (bidExchange != askExchange)) {\n if (bidPrice.prices && askPrice.prices) {\n var bid = bidPrice.prices[\"bid\"];\n var ask = askPrice.prices[\"ask\"];\n var bidFee = exchangeInfo[bidExchange].taker;\n var askFee = exchangeInfo[askExchange].taker;\n //convert to decimal for math\n bidFee /= 100\n askFee /= 100\n var profit = bid - ask;\n var profitPercent = (((bid - (bid * bidFee)) - (ask + (ask * askFee))) / (ask + (ask * askFee))) * 100;\n profitPercent = profitPercent.toFixed(4);\n\n //calculate minimum volume to break even with askExchange's XRP withdrawal fees\n // n is amount of initial secondard (non-ripple) currency like BTC, ETH, USDT, ...\n // beforeBidFee = ( ( ( n * (1/ask) ) - ( askFee * (n*1/ask) ) - exchangeInfo[askExchange][\"XRPwithdraw\"] ) * bid )\n // final = beforeBidFee - bidFee * beforeBidFee\n // so if final is to be profitable it must be higher than n, the initial non-xrp currency put into the trade\n // simplified: n = (bid (bidFee - 1) (ask * withdrawalFee + (askFee - 1)n)) / a\n // ... algebra, using a = ask, b = bid, f = askFee,, g = bidFee, w = withdraw:\n // na = abgw - abw + bfgn - bfn - bgn + bn\n // abw - abgw = bfgn + bn - bfn - bgn - na\n // abw - abgw = n (bfg + b - bf - bg - a)\n // n = (abw - abgw) / (bfg + b - bf - bg - a)\n // ....\n // n = ab(g-1)w / (a + b(-gf + f + g - 1)) if a + b(f + g) != bfg + b\n // var minXRPVolume = exchangeInfo[askExchange][\"XRPwithdraw\"] / (profitPercent / 100.00) //old wrong min volume\n // var minOtherVolume = minXRPVolume * ask;\n var minOtherVolume = 0.000000;\n if((ask + bid * (askFee+bidFee)) != ((bid * askFee * bidFee) + bid)){\n minOtherVolume = (ask * bid * (bidFee - 1.00) * exchangeInfo[askExchange][\"XRPwithdraw\"])\n / (ask + bid * ((-1 * bidFee * askFee) + askFee + bidFee - 1.00));\n }\n var minXRPVolume = minOtherVolume / ask;\n minXRPVolume = minXRPVolume.toFixed(6);\n if (pair.slice(3) === \"USD\" || pair.slice(3) === \"USDT\") {\n minOtherVolume = minOtherVolume.toFixed(2);\n } else {\n minOtherVolume = minOtherVolume.toFixed(6);\n }\n if (profitPercent > 0.0) {\n newProfitList.push({\n \"pair\": pair,\n \"bid\": {\n \"exchange\": bidExchange,\n \"price\": bid,\n \"taker fee\": bidFee * 100,\n \"withdraw fee\": {\n \"XRP\": exchangeInfo[bidExchange][\"XRPwithdraw\"],\n \"BTC\": exchangeInfo[bidExchange][\"BTCwithdraw\"],\n \"ETH\": exchangeInfo[bidExchange][\"ETHwithdraw\"],\n \"USDT\": exchangeInfo[bidExchange][\"USDTwithdraw\"]\n }\n },\n \"ask\": {\n \"exchange\": askExchange,\n \"price\": ask,\n \"taker fee\": askFee * 100,\n \"withdraw fee\": {\n \"XRP\": exchangeInfo[askExchange][\"XRPwithdraw\"],\n \"BTC\": exchangeInfo[askExchange][\"BTCwithdraw\"],\n \"ETH\": exchangeInfo[askExchange][\"ETHwithdraw\"],\n \"USDT\": exchangeInfo[askExchange][\"USDTwithdraw\"]\n }\n },\n \"profit\": profitPercent,\n \"minXRPVolume\": minXRPVolume,\n \"minOtherVolume\": minOtherVolume\n });\n }\n }\n }\n }\n }\n }\n }\n //sorts array by max profit\n newProfitList.sort(function (a, b) { return b.profit - a.profit });\n profitList = newProfitList;\n\n\n // console.log(\"Trade suggestions: \");\n // console.log(profitList);\n return profitList;\n}", "generateOrder() {\n let allOrders = [\n new KebapHouse.Order(\"Döner\", [KebapHouse.INGREDIENT.KEBAB, KebapHouse.INGREDIENT.MEAT, KebapHouse.INGREDIENT.SALAD, KebapHouse.INGREDIENT.TOMATO, KebapHouse.INGREDIENT.ONION, KebapHouse.INGREDIENT.CABBAGE]),\n new KebapHouse.Order(\"Döner ohne Zwiebeln\", [KebapHouse.INGREDIENT.KEBAB, KebapHouse.INGREDIENT.MEAT, KebapHouse.INGREDIENT.SALAD, KebapHouse.INGREDIENT.TOMATO, KebapHouse.INGREDIENT.CABBAGE]),\n new KebapHouse.Order(\"Döner mit scharf\", [KebapHouse.INGREDIENT.KEBAB, KebapHouse.INGREDIENT.MEAT, KebapHouse.INGREDIENT.SALAD, KebapHouse.INGREDIENT.TOMATO, KebapHouse.INGREDIENT.ONION, KebapHouse.INGREDIENT.CABBAGE, KebapHouse.INGREDIENT.SPICY]),\n new KebapHouse.Order(\"Yufka\", [KebapHouse.INGREDIENT.YUFKA, KebapHouse.INGREDIENT.MEAT, KebapHouse.INGREDIENT.SALAD, KebapHouse.INGREDIENT.TOMATO, KebapHouse.INGREDIENT.ONION, KebapHouse.INGREDIENT.CABBAGE]),\n new KebapHouse.Order(\"Yufka mit scharf\", [KebapHouse.INGREDIENT.KEBAB, KebapHouse.INGREDIENT.MEAT, KebapHouse.INGREDIENT.SALAD, KebapHouse.INGREDIENT.TOMATO, KebapHouse.INGREDIENT.ONION, KebapHouse.INGREDIENT.CABBAGE, KebapHouse.INGREDIENT.SPICY]),\n new KebapHouse.Order(\"Lahmacun\", [KebapHouse.INGREDIENT.LAHMACUN, KebapHouse.INGREDIENT.MEAT, KebapHouse.INGREDIENT.SALAD, KebapHouse.INGREDIENT.TOMATO, KebapHouse.INGREDIENT.ONION, KebapHouse.INGREDIENT.CABBAGE])\n ];\n let randomNumber = Math.round(Math.random() * allOrders.length);\n return allOrders[randomNumber];\n }", "function getRevenueWithCutsTwo(prices, element){\n let values = [0];\n\n for(let i = 0; i <= element.length; i++){\n let max = 0;\n for(let j = 0; j < i; j++){\n console.log(`i:${i}, j:${j}, (${prices[j]}) + (${values[i - j -1]})`);\n max = Math.max(max, prices[j] + values[i - j - 1]);\n }\n values[i] = max;\n }\n\n // if p and r are different this means we made a cut so we subtract 2 units from price (cost is 2 units per cut)\n if(values[element.length] !== element.price){\n values[element.length] = Math.max(values[element.length], element.price);\n }\n\n return values[element.length];\n}", "function placeSellOrder (p) {\n\n}", "_getOrder(prevOrder, nextOrder) {\n let order;\n\n if (isValidNumber(prevOrder) && isValidNumber(nextOrder)) {\n order = prevOrder + ((nextOrder - prevOrder) / 2.0);\n } else if (isValidNumber(prevOrder)) {\n order = prevOrder * 2.0;\n } else if (isValidNumber(nextOrder)) {\n order = nextOrder / 2.0;\n } else {\n order = 1.000;\n }\n\n return order;\n }", "function buyAndSell(arr) {\n let total = 0;\n let buyInPrice = null;\n\n for (let i = 0; i < arr.length; i++) {\n if (buyInPrice) {\n if (arr[i] > buyInPrice && arr[i] > arr[i + 1] || i === arr.length - 1) {\n total += arr[i] - buyInPrice;\n buyInPrice = null;\n }\n } else {\n if (arr[i + 1] > arr[i]) {\n buyInPrice = arr[i];\n }\n }\n }\n\n return total;\n}", "function getByID(option) {\n // apiService.get('api/positem/getbyid/' + id, null, function (result) {\n if (option.quantity <= 0) {\n notificationService.displayWarning(\"Sản phẩm tạm thời hết hàng!\");\n }\n else {\n var item = option;\n if ($scope.shoppingCart[$scope.tab].lsItem.length == 0) {\n item.quan = 1;\n item.stt = 1;\n item.display_discount = \"none\";\n item.txt_discount_item = '0';\n item.status_discount = true;\n item.chietkhau = 0;\n item.thue = 0;\n item.unit_price = item.saleprice;\n if ($scope.searchText !== null && $scope.searchText !== '') {\n if ($scope.shoppingCart[$scope.tab].customer.PricePolicyDefault.toString() === '3048ffe8-e2c8-4b43-a8a5-766ad6643a83') {\n item.unit_price = item.saleprice;\n } else {\n if ($scope.shoppingCart[$scope.tab].customer.PricePolicyDefault.toString() === 'f53cecc7-5a7b-44b9-894b-c6b18ac85d49') {\n item.unit_price = item.WholesalePrice;\n }\n if ($scope.shoppingCart[$scope.tab].customer.PricePolicyDefault.toString() === '155acc95-47be-4169-a73a-872aec588f54') {\n item.unit_price = item.PurchasePrice;\n }\n }\n item.thue = $scope.shoppingCart[$scope.tab].customer.TaxRateDefault;\n }\n item.unit_price = Currency(ConvertNumber(item.unit_price));\n item.thanhtien = (Number(ConvertNumber(item.unit_price)) * item.quan - item.chietkhau); \n $scope.shoppingCart[$scope.tab].lsItem.push(item);\n }\n else {\n var pos = -1;\n var STT = 1;\n for (var i in $scope.shoppingCart[$scope.tab].lsItem) {\n if ($scope.shoppingCart[$scope.tab].lsItem[i].ID == item.ID) {\n pos = i;\n }\n STT++;\n }\n if (pos == -1) {\n item.quan = 1;\n item.stt = STT;\n item.display_discount = \"none\";\n item.status_discount = true;\n item.txt_discount_item = '0';\n item.chietkhau = 0;\n item.thue = 0;\n item.unit_price = item.saleprice;\n if ($scope.searchText !== null && $scope.searchText !== '') {\n if ($scope.shoppingCart[$scope.tab].customer.PricePolicyDefault.toString() === '3048ffe8-e2c8-4b43-a8a5-766ad6643a83') {\n item.unit_price = item.saleprice;\n } else {\n if ($scope.shoppingCart[$scope.tab].customer.PricePolicyDefault.toString() === 'f53cecc7-5a7b-44b9-894b-c6b18ac85d49') {\n item.unit_price = item.WholesalePrice;\n }\n if ($scope.shoppingCart[$scope.tab].customer.PricePolicyDefault.toString() === '155acc95-47be-4169-a73a-872aec588f54') {\n item.unit_price = item.PurchasePrice;\n }\n }\n item.thue = $scope.shoppingCart[$scope.tab].customer.TaxRateDefault;\n }\n item.unit_price = Currency(ConvertNumber(item.unit_price));\n item.thanhtien = (Number(ConvertNumber(item.unit_price)) * item.quan - item.chietkhau); \n $scope.shoppingCart[$scope.tab].lsItem.push(item);\n }\n else {\n $scope.shoppingCart[$scope.tab].lsItem[pos].quan++;\n $scope.shoppingCart[$scope.tab].lsItem[pos].thanhtien = (Number(ConvertNumber($scope.shoppingCart[$scope.tab].lsItem[pos].unit_price)) * $scope.shoppingCart[$scope.tab].lsItem[pos].quan\n - $scope.shoppingCart[$scope.tab].lsItem[pos].chietkhau);\n }\n }\n $scope.saleOrders.DiscountAmountOC = Number(ConvertNumber($scope.saleOrders.DiscountAmountOC));\n if (Number(ConvertNumber($scope.saleOrders.DiscountAmountOC)) === 0) {\n $scope.TinhTong();\n } else {\n $scope.TinhTong2();\n }\n \n $scope.TienTraLai();\n stt = false;\n }\n //}, function (error) {\n // notificationService.displayError(error.data);\n //});\n }", "shelfSingleOrder(order) {\n let stored = false;\n const overflow = this.shelves[this.shelves.length - 1];\n\n for (let i = 0; i < this.shelves.length; ++i) {\n if (this.shelves[i].predicate(order) && this.shelves[i].items.length < this.shelves[i].capacity) {\n this.shelves[i].items.push(order);\n stored = true;\n break;\n }\n }\n if (!stored) {\n // both typed and overflow are full, try to scrumble\n // first, see if typed shelf has space we can use.\n for (let i = 0; i < overflow.length; ++i) {\n for (let j = 0; j < this.shelves.length - 1; ++j) {\n if (this.shelves[j].predicate(overflow[i])) {\n this.shelves[j].items.push(overflow[i]);\n overflow.items.splice(i, 1, order);\n stored = true;\n break;\n }\n }\n }\n }\n if (!stored) {\n // has to drop an overflow item to make space\n overflow.items.shift();\n overflow.items.push(order);\n }\n // console.log('order', order);\n // console.log('shelves', this.shelves);\n }", "function whatFlavors(cost, money) {\n let map = new Map();\n\n for (let i = 0; i < cost.length; i++) {\n map.set(cost[i], i);\n }\n\n for (let j = 0; j < cost.length; j++) {\n let first_price = cost[j];\n let second_price = money - first_price;\n if (map.has(second_price) && map.get(second_price) != j) {\n let first_index = j + 1;\n let second_index = map.get(second_price) + 1;\n console.log(first_index + \" \" + second_index);\n break;\n }\n }\n}", "function sol9(\n len = 5,\n prices = [\n [1, 2],\n [2, 5],\n [3, 7],\n [4, 8],\n ]\n) {\n // [len, price] = prices[i]\n const dp = Array(len + 1).fill(0);\n\n for (let i = 0; i <= len; i++) {\n for (let [cut, profit] of prices) {\n if (cut <= i) {\n dp[i] = Math.max(dp[i], profit + dp[i - cut]);\n }\n }\n }\n\n return dp[len];\n}", "function find_recommended_supplier(product_id)\n{\n\tfind_available_suppliers(product_id);\n\t//if available_suppliers are zero show no suppliers and put -1 in selected supplier \n\tif (order_list[product_id].available_suppliers.length==0)\n\t{\n\t\torder_list[product_id].selected_supplier = -1;\n\t\torder_list[product_id].selected_price = 0;\n\t\treturn;\n\t}\n\tvar temp_supplier_pricing = new Array();\n\tvar minimum_price = 10000000;\n\t//Create a temp list of supplier ids and prices (with premium adjustment) of available suppliers\n\t$.each(order_list[product_id].available_suppliers, function(supplier_id, value)\n\t{\n\t\ttemp_supplier_pricing[supplier_id] = order_list[product_id].pricing_list[supplier_id].price * (1-(order_list[product_id].supplier_settings[supplier_id].premium/100));\n\t\tif (temp_supplier_pricing[supplier_id]<minimum_price) minimum_price = temp_supplier_pricing[supplier_id];\n\t});\n\trecommended_supplier_id = temp_supplier_pricing.indexOf(minimum_price);\n\tchange_supplier(product_id, recommended_supplier_id);\n}", "getProductListPrice() {\n return cy.get('[data-cel-widget^=\"MAIN-SEARCH_RESULTS\"] .a-price:first');\n }", "function bestTradesFinder(tradingDay) {\n const bestTrades = [];\n\n\ntradingDay.forEach((coinData, i) => {\n const quotes = coinData.quotes;\n let buy = quotes[0]\n let sell = quotes[0]\n let profit = 0\n\n quotes.forEach((buyerQuote, x) => {\n quotes.slice(x+1, quotes.length).forEach(sellerQuote => {\n if(sellerQuote.price - buyerQuote.price > profit){\n buy = buyerQuote \n sell = sellerQuote\n profit = (Math.round((sellerQuote.price - buyerQuote.price)*100)) / 100\n }\n });\n });\n\n bestTrades[i] = {\n currency : coinData.currency,\n buy,\n sell,\n profit\n }\n\n });\n\n let winnerTrade = {...bestTrades[0]}\n\n bestTrades.forEach(trade => {\n if(trade.profit > winnerTrade.profit)\n winnerTrade = trade\n })\n\n return {\n winnerTrade , \n bestTrades\n }\n\n}", "function priceWithOff(price, off) { \n const priceOff = (price * (100 - off)) / 100 ;\n return priceOff;\n}", "function getPurchasePriceFromFundingMatrix(fundingMatrix, debtService) {\n // GONNA BE WONKY IF WE HAVE A PERCENT IN HERE\n // Not sure how I'm gonna solve it, though it is absolutely solvable. Probably time for some pencil and paper...\n \n //fundingOptions: [{ name: \"Cash on hand\", amortizationPeriod: \"\", interest: 0, amount: 100, amountType: AmountTypes.Percent, isCash: true }],\n let results = {\n purchasePrice: 0,\n debtService,\n amountCash: 0,\n optionUsages: [],\n };\n //TODO: There is the possibility that we can't reach our debtService target here, so may want to revisit that.\n // (for example, if there is no interest bearing or amortizing amounts in here)\n\n // Go through each option in the funding matrix\n // If it has no debt service, (interest == 0), and it is a DOLLAR AMOUNT, gobble it all up and continue on\n // If it has no debt service, (interest == 0), and it is a PERCENT AMOUNT, set it aside. We'll need to calculate it later when we have the rest of the info.\n // If it has debt service, and it is a DOLLAR AMOUNT\n // calculate the total debt service if we use all of the funding\n // if that does not meet our target debt service, gobble it all up and continue on\n // if that exceeds or meets our target debt service, find out what percentage of this we need to use\n // If it has debt service and it is a PERCENT AMOUNT\n\n // Now go back to all the previous percent amounts set aside and do something.\n // If we only have percent amounts, this should be pretty easy?\n let remainingDebtService = debtService;\n fundingMatrix.some(fundingOption => {\n let optionUsage = Object.assign({}, fundingOption);\n \n if (optionUsage.amountType === AmountTypes.Dollars) {\n if (optionUsage.amortizationPeriod) {\n // Dollar amount, amortized\n let moRate = optionUsage.interest / 12;\n let somePiece = Math.pow(1 + moRate, optionUsage.amortizationPeriod);\n let paymentAmount = optionUsage.amount * (moRate * somePiece) / (somePiece - 1);\n if (paymentAmount < remainingDebtService) {\n remainingDebtService -= paymentAmount;\n optionUsage.debtService = paymentAmount;\n //Let this get added to the results\n }\n } else if (optionUsage.interest) {\n // Dollar amount, interest only\n let paymentAmount = (optionUsage.amount * optionUsage.interest) / 12;\n if (paymentAmount < remainingDebtService) {\n remainingDebtService -= paymentAmount;\n optionUsage.debtService = paymentAmount;\n //Let this get added to the results\n }\n } else {\n // Dollar amount, no debt service\n optionUsage.debtService = 0;\n // Don't need to do anything. Just add it to the list.\n }\n } else if (optionUsage.amountType === AmountTypes.Percent) {\n if (optionUsage.amortizationPeriod) {\n // Percent amount, amortized\n\n } else if (optionUsage.interest) {\n // Percent amount, interest only\n } else {\n // Percent amount, no debt service\n // Don't do anything yet. Just add it to the list and we'll resolve it later.\n }\n }\n\n results.push(optionUsage);\n return remainingDebtService <= 0;\n });\n\n //TODO: Resolve any percentages left in the optionUsages\n // TODO: Do I need to take into account the possibility of having over 100%?\n // situations: at least one dollar value, some percents (this is easy. Total the dollars, find out what the remaining percent is)\n // all percents (this is fine as long as they add up to 100?)\n let totalDollars = results.optionUsages.reduce((dollarAmount, usage) => dollarAmount + (usage.amountType === AmountTypes.Dollars ? usage.amount : 0), 0);\n let totalPercent = results.optionUsages.reduce((percentAmount, usage) => percentAmount + (usage.amountType === AmountTypes.Percent ? usage.amount : 0), 0);\n if (totalDollars > 0) {\n let remainingPercent = 100 - totalPercent;\n let valueOfOnePercent = totalDollars / remainingPercent;\n results.optionUsages.forEach((_v, idx, arr) => { \n arr[idx].amount *= valueOfOnePercent;\n arr[idx].amountType = AmountTypes.Dollars;\n });\n } else if (totalPercent === 100) {\n results.optionUsages.forEach((usage, idx, arr) => { \n arr[idx].amountType = AmountTypes.Dollars;\n let moRate = usage.interest / 12;\n let somePiece = Math.pow(1 + moRate, usage.amortizationPeriod);\n // P = ((r * [1 + r]^n) / ([1 + r]^n - 1)) / paymentAmount\n arr[idx].amount = ((moRate * somePiece) / (somePiece - 1)) / usage.debtService;\n });\n }\n\n // Assume everything has been converted to dollar amount by this time\n results.amountCash = results.optionUsages.reduce((total, usage) => total + (usage.isCash ? usage.amount : 0), 0);\n results.purchasePrice = results.optionUsages.reduce((total, usage) => total + usage.amount, 0);\n return results;\n}", "function Order(priceString, amountString, dateString, type) {\n // orders on the order book will not have a date.\n //assert(priceString && amountString && type);\n this.price = parseFloat(priceString);\n this.amount = parseFloat(amountString);\n this.date = new Date(dateString);\n this.type = type;\n this.key = Util.priceToKey(this.price);\n this.orderNumber = undefined;\n this.tradeList = [];\n this.status = 'open';\n // this should have a more generic name, like toInteger\n // we keep remaining amount in integer units to prevent rounding errors\n this.remainingAmount = Util.priceToKey(this.amount);\n\n this.setPrice = (newPrice) => {\n this.price = parseFloat(newPrice);\n this.key = Util.priceToKey(this.price);\n };\n\n this.addTrade = (newTrade) => {\n this.tradeList.push(newTrade);\n this.remainingAmount -= Util.priceToKey(newTrade.amount);\n\n // Make sure the trade is for the same price as us\n Test.assertApprox(newTrade.price, this.price, Util.POLONIEX_TOLERANCE);\n assert(this.remainingAmount >= 0);\n if (this.remainingAmount === 0) {\n console.log(\"order \" + this.orderNumber + \" closed.\");\n this.close();\n }\n };\n\n this.isOpen = () => {\n return this.status === 'open';\n };\n\n this.isClosed = () => {\n return this.status === 'closed';\n };\n\n this.close = () => {\n this.status = 'closed';\n if (this.timeoutId) {\n clearTimeout(this.timeoutId);\n }\n };\n\n this.cancel = () => {\n this.status = 'cancel';\n this.close();\n };\n\n this.toString = () => {\n return this.key + \" \" + this.type + \" \" + this.amount + \" @ \" +\n this.price + \" on \" + this.date;\n };\n\n this.print = () => {\n console.log(this.toString());\n };\n\n return this;\n}", "_shouldAdjust(diffDecimal, quotes) {\n return quotes.find((_el, _i) => {\n if(_i === 0) {\n return false;\n }\n const prevClose = quotes[_i - 1].close;\n //console.log(`comparing ${_el.close} to ${prevClose}`);\n return Math.abs((_el.close - prevClose)) / prevClose >= diffDecimal;\n });\n }", "function findItemsOver(list, bar){\n var expensive = [];\n for(i in list){\n if(list[i].price > bar){\n expensive.push(list[i]);\n }\n }\n return expensive;\n}", "function reasonable_products(products){\n let res=[];\n products.forEach((product, i) => {\n if(product.price<=100){\n res.push(product);\n }\n });\n return res;\n}", "function getPriceRate() {\n var x = document.getElementById(\"do100\").value;\n x=document.getElementById(\"do100\").checked;\n var y = document.getElementById(\"od100do200\").value;\n y=document.getElementById(\"od100do200\").checked;\n var z = document.getElementById(\"preko200\").value;\n z = document.getElementById(\"preko200\").checked;\n\n console.log(x, y, z);\n ispisArtikla.innerHTML = '';\n for (var i=0; i<article.length; i++) {\n if (article[i].stanje == true) {\n for (j=0; j<articleCategory.length; j++) {\n for (var k=0; k<articleCategory[j].podCategory.length; k++) {\n if (article[i].type == articleCategory[j].podCategory[k].id) {\n if (x && article[i].pricePDV[0] < 100) {\n writeElement(i,j,k);\n } else if (y && article[i].pricePDV[0] >= 100 && article[i].pricePDV[0] < 200) {\n writeElement(i,j,k);\n } else if (z && article[i].pricePDV[0] >= 200) {\n writeElement(i,j,k);\n }\n }\n }\n }\n }\n }\n}", "calulatingChange(change, price, cost) {\n let amountOwned = cost - price;\n if (amountOwned === 0) {\n return 0;\n }\n const valueOfCoin = [\n { name: \"TOONIES\", value: 2.0 },\n { name: \"LOONIES\", value: 1.0 },\n { name: \"QUARTERS\", value: 0.25 }\n ];\n const changeReturned = change.reduce((received, currency) => {\n received[currency[0]] = currency[1]; //compare value received to current value\n return received;\n }, {});\n const amountOfCoin = valueOfCoin.reduce((received, currency) => {\n let amount = 0;\n\n while (currency.value <= amountOwned && amountOwned !== 0) {\n amountOwned -= currency.value;\n changeReturned[currency.name] -= currency.value;\n amount++;\n }\n if (amount > 0) {\n received.push([currency.name, amount]);\n }\n return received;\n }, []);\n change.forEach(asset => {\n asset[1] = changeReturned[asset[0]];\n return amountOfCoin;\n });\n }", "async function manageOrders(config) {\n const {common: {storage: {db, env}}, market} = config\n const gameTime = await env.get(env.keys.GAMETIME).then(data => parseInt(data))\n const nowTimestamp = new Date().getTime()\n let queued = []\n let terminals = await db['rooms.objects'].find({$and: [{type: 'terminal'}, {user: {$eq: null}}]})\n let ps = terminals.map(async terminal => {\n let orders = await db['market.orders'].find({roomName: terminal.room})\n orders = orders.reduce((l, v) => {\n l[v.type][v.resourceType] = v\n return l\n }, {buy: {}, sell: {}})\n let mineralOrders = arrayUnique(Object.keys(market.buyPrices).concat(Object.keys(market.sellPrices)))\n // Add mineral orders\n mineralOrders.forEach(mineral => {\n if (Object.keys(market.buyPrices).includes(mineral) && !orders.buy[mineral] && market.buyPrices[mineral] * 1000 > 0) {\n let buyPrice = market.buyPrices[mineral] * 1000\n let buy = {\n created: gameTime,\n createdTimestamp: nowTimestamp,\n active: true,\n type: 'buy',\n resourceType: mineral,\n roomName: terminal.room,\n remainingAmount: market.buyAmount,\n totalAmount: market.buyAmount,\n amount: market.buyAmount\n }\n // Handle pricing\n if (market.marketType === 'fixed') {\n buy.price = buyPrice\n } else {\n buy.price = buyPrice * (Math.random() * (+1.2 - +0.8) + +0.8)\n }\n delete buy._id\n // Add to queue\n queued.push(buy)\n } else if (orders.buy[mineral] && (!Object.keys(market.buyPrices).includes(mineral) || market.buyPrices[mineral] * 1000 <= 0)) {\n // Remove bad orders\n db['market.orders'].removeWhere({_id: orders.buy[mineral]._id})\n }\n if (Object.keys(market.sellPrices).includes(mineral) && !orders.sell[mineral] && market.sellPrices[mineral] * 1000 > 0) {\n let sellPrice = market.sellPrices[mineral] * 1000\n let sell = {\n created: gameTime,\n createdTimestamp: nowTimestamp,\n active: true,\n type: 'sell',\n resourceType: mineral,\n roomName: terminal.room,\n remainingAmount: market.sellAmount,\n totalAmount: market.sellAmount,\n amount: market.sellAmount\n }\n // Handle pricing\n if (market.marketType === 'fixed') {\n sell.price = sellPrice\n } else {\n sell.price = sellPrice * (Math.random() * (+1.2 - +0.8) + +0.8)\n }\n delete sell._id\n // Add to queue\n queued.push(sell)\n } else if (orders.sell[mineral] && (!Object.keys(market.sellPrices).includes(mineral) || market.sellPrices[mineral] * 1000 <= 0)) {\n // Remove bad orders\n db['market.orders'].removeWhere({_id: orders.sell[mineral]._id})\n }\n })\n // Handle random boost sales\n if (market.randomBoostSales) {\n if (!boosts[0].concat(boosts[1]).concat(boosts[2]).find((b) => orders.sell[b] && !Object.keys(market.sellPrices).includes(b))) {\n let randomBoost, amount, price;\n // Chance it's higher tier (10% for T3, 30% for T2, 60% for T1\n if (market.randomBoostPrices[2] > 0 && Math.random() > 0.9) {\n amount = (Math.random() * (+1000 - +150) + +150);\n price = market.randomBoostPrices[2];\n randomBoost = boosts[2][Math.floor(Math.random()*boosts[2].length)];\n } else if (market.randomBoostPrices[1] > 0 && Math.random() > 0.7) {\n amount = (Math.random() * (+1500 - +250) + +250);\n price = market.randomBoostPrices[1];\n randomBoost = boosts[1][Math.floor(Math.random()*boosts[1].length)];\n } else if (market.randomBoostPrices[0] > 0 && Math.random() > 0.4) {\n amount = (Math.random() * (+2500 - +450) + +450);\n price = market.randomBoostPrices[0];\n randomBoost = boosts[0][Math.floor(Math.random()*boosts[0].length)];\n }\n if (randomBoost) {\n let sell = {\n created: gameTime,\n createdTimestamp: nowTimestamp,\n active: true,\n type: 'sell',\n resourceType: randomBoost,\n roomName: terminal.room,\n remainingAmount: amount,\n totalAmount: amount,\n amount: amount,\n price: price\n }\n delete sell._id\n // Add to queue\n queued.push(sell)\n }\n } else {\n let onSale = boosts[0].find((b) => orders.sell[b] && !Object.keys(market.sellPrices).includes(b));\n if (orders.sell[onSale].created + 1000 < gameTime) {\n db['market.orders'].removeWhere({_id: orders.sell[onSale]._id})\n }\n }\n }\n // Input new orders\n queued.forEach(order => db['market.orders'].update({ type: order.type, roomName: order.roomName, resourceType: order.resourceType }, order, { upsert: true }))\n })\n return Promise.all(ps)\n}", "function partialFulfillment(matchingOrders, incomingOrder) {\n return matchingOrders.filter((currentItem) => { \n const {\n quantity\n } = currentItem\n return quantity < incomingOrder.quantity\n })\n}", "function handlePartialFulfillment(quantityLess, existingBook, incomingOrder) {\n if (quantityLess.length > 0) {\n for (var i = 0; i < existingBook.length; i++) {\n if (existingBook[i].quantity === quantityLess[0].quantity) {\n incomingOrder.quantity = incomingOrder.quantity - existingBook[i].quantity\n existingBook.splice(i, 1)\n existingBook.push(incomingOrder)\n i = existingBook.length\n }\n }\n return existingBook\n }\n}", "function FilterByPrice(price) {\n return products.filter(function (item) {\n return item.price <= price;\n });\n}", "isCheaperThan(other) {\n return this.price() < other.price();\n }", "async sendBatchOrder(quantity, stocks, side){\r\n var prom = new Promise(async (resolve, reject) => {\r\n var incomplete = [];\r\n var executed = [];\r\n var promOrders = [];\r\n stocks.forEach(async (stock) => {\r\n promOrders.push(new Promise(async (resolve, reject) => {\r\n if(!this.blacklist.has(stock)){ // Checks if the stock is not blacklisted, if it is not black listed create new order ticket\r\n var promSO = this.submitOrder(quantity, stock, side);\r\n await promSO.then((resp) => {\r\n if(resp) executed.push(stock);\r\n else incomplete.push(stock);\r\n resolve();\r\n });\r\n }\r\n else resolve();\r\n }));\r\n });\r\n await Promise.all(promOrders).then(() => {\r\n resolve([incomplete, executed]);\r\n });\r\n });\r\n return prom;\r\n }", "_notifyUpdates() {\n const bidWatchTargets = Object.keys(this.wallWatches[this.bidIdentifier]).sort()\n const askWatchTargets = Object.keys(this.wallWatches[this.bidIdentifier]).sort()\n \n const newWalls = {}\n\n let bidTotal = 0;\n if (bidWatchTargets.length > 0) {\n let currentWatchIdx = 0;\n this.bids.forEach((orders, price) => {\n let levelTotalSize = _.sumBy(orders, 'size');\n\n bidTotal += levelTotalSize;\n\n // If (while) current target size is met, push the price and move to the next target size\n while (bidTotal > bidWatchTargets[currentWatchIdx] && currentWatchIdx < bidWatchTargets.length) {\n let prevWatchPrice = this.wallWatches[this.bidIdentifier][bidWatchTargets[currentWatchIdx]]()\n if (prevWatchPrice != price) {\n newWalls['bid' + bidWatchTargets[currentWatchIdx]] = price\n this.wallWatches[this.bidIdentifier][bidWatchTargets[currentWatchIdx]](price);\n }\n \n currentWatchIdx++;\n }\n })\n }\n\n let askTotal = 0;\n if (askWatchTargets.length > 0) {\n let currentWatchIdx = 0;\n this.asks.forEach((orders, price) => {\n let levelTotalSize = _.sumBy(orders, 'size');\n\n askTotal += levelTotalSize;\n\n // If (while) current target size is met, push the price and move to the next target size\n while (askTotal > askWatchTargets[currentWatchIdx] && currentWatchIdx < askWatchTargets.length) {\n let prevWatchPrice = this.wallWatches[this.askIdentifier][askWatchTargets[currentWatchIdx]]()\n if (prevWatchPrice != price) {\n newWalls['ask' + askWatchTargets[currentWatchIdx]] = price\n this.wallWatches[this.askIdentifier][askWatchTargets[currentWatchIdx]](price);\n }\n currentWatchIdx++;\n }\n })\n }\n\n this.unnotifiedNewOrders = [];\n this.unnotifiedRemovedOrders = [];\n //console.log(this.bids.toArray())\n //console.log(this.asks.toArray())\n\n // Rounded just to avoid a few insignificant changes here and there\n newWalls['bidTotal'] = Math.round(bidTotal);\n newWalls['askTotal'] = Math.round(askTotal);\n\n const changedWalls = objectDifference(newWalls, this.walls())\n if (Object.keys(changedWalls).length > 0) {\n this.wallsUpdates(changedWalls)\n const updatedWalls = Object.assign({}, this.walls(), changedWalls)\n this.walls(updatedWalls)\n }\n }", "minPriceInBN(state, getters, _, rootGetters) {\n return (order) => {\n order = typeof order == \"object\" ? order : getters.orderById(id);\n if (!order) return;\n const token = order.erc20tokens;\n return toTokenAmount(order.min_price, token.decimal)\n }\n }", "function itemByPrice(){\n var init = [];\n for(var i=0; i<cart.length; i++){\n for(var j=i; j<cart.length-1; j++){\n if(cart[j].price<cart[j+1].price){\n init=cart[j];\n cart[j]=cart[j+1];\n cart[j+1]=init;\n }\n }\n }\n cart.sort(function(a, b){\n return (b.price)-(a.price);\n });\n return cart;\n}", "function brokerCalc (country, city) {\n let name = 'Услуги брокера ';\n let price;\n let val = 'uah';\n if (country === 'usa') {\n price = '700 USD'\n name = 'Услуги брокера и экспедитора'\n val = 'usd'\n }\n if (country === 'georgia' && city === 'odessa') {\n price = '7000 грн'\n name = 'Услуги брокера '\n }\n if (country === 'georgia' && city === 'zaporozhye') {\n price = '4000 грн'\n name = 'Услуги брокера '\n }\n if (country === 'europe' && city === 'odessa') {\n price = '7000 грн'\n name = 'Услуги брокера '\n }\n if (country === 'europe' && city === 'zaporozhye') {\n price = '4000 грн'\n name = 'Услуги брокера '\n }\n if (country === 'emirates') {\n price = '700 USD'\n name = 'Услуги брокера и экспедитора '\n val = 'usd'\n }\n let holder = [name, price, val]\n return holder;\n}", "calculateOrderPrice(additionalValue)\n {\n let comparisonValue = this.getApplet().getSignalsForOrder() + parseInt(additionalValue); //value including current + slider query.\n let pricePerUnit;\n if (comparisonValue >= 0 && comparisonValue <= 999){\n pricePerUnit = 50 / 500;\n } else if(comparisonValue >= 1000 && comparisonValue <= 1999) {\n pricePerUnit = 75 / 1000;\n } else {\n pricePerUnit = 100 / 2000; //minimum PPU is $0.05\n }\n\n return pricePerUnit * comparisonValue;\n }", "function price_desc(a,b){\nif (a.price<b.price){\n return 1;}\nif (a.price>b.price){\n return -1;}\nreturn 0\n}", "function orderpage_OptionGetPrice(opt) {\n var price = toLinq(opt.Price);\n var s_price = price.Where(function (x) { return x.CountryCode == countrycode });\n if (s_price.Count() == 0) {\n // can not find, then search the default country MY\n // s_price = price.Where(function (x) { return x.CurrencyCode == currency_sign; });\n orderpage_Error(\"There is no price for product option id \" + opt.Id + \" , Code = \" + opt.Code + \" , Name = \" + opt.InternalName + \", Country = \" + countrycode);\n return;\n }\n return s_price.FirstOrDefault();\n}", "function greedySelectUTXO( utxos, payment, fee ){\n\tif( !utxos || utxos.length == 0 ) return undefined;\n\tvar result = [];\n\tif( payment == \"all\" ){\n\t\tfor( var i in utxos ){\n\t\t\tresult.push(utxos[i]);\n\t\t}\n\t\tvar txInputs = new TransactionInputs( result, \"all\", 0 );\n\t\tif( txInputs.value > fee ) return txInputs;\n\t}\n\telse{ \n\t\t// pick smallest transaction whose value >= target\n\t\tvar target = payment + fee; \n\t\tutxos.sort(UTXO.compare);\n\t\tfor( var i in utxos ){\n\t\t\tif( utxos[i].value >= target ){\n\t\t\t\tresult.push(utxos[i]);\n\t\t\t\tvar change = utxos[i].value - target;\n\t\t\t\treturn new TransactionInputs( result, target, change );\n\t\t\t}\n\t\t}\n\n\t\t// no single utxo is large enough so sum smallest number of utxos\n\t\tutxos.sort(UTXO.compareInReverse);\n\t\tvar sum = 0;\n\t\tvar change = -target;\n\t\tfor( var i in utxos ){\n\t\t\tresult.push(utxos[i]);\n\t\t\tsum += utxos[i].value;\n\t\t\tchange += utxos[i].value;\n\t\t\tif( sum >= target ) return new TransactionInputs( result, target, change );\n\t\t}\n\t}\n\treturn undefined;\n}", "function appleStocks(arr) {\n\tlet minPrice = arr[0]; //O(1)\n\t//BUY THEN SELL\n\tlet maxProfit = arr[1] - arr[0]; //O(1)\n\n\t//START AT ONE - SO WE LOOP LENGTH - 1 ALREADY\n\tfor (let i = 1; i < arr.length; i++) {\n\t\t//CONSTANT MEMORY\n\t\tlet current = arr[i]; //Constant\n\t\tlet currentProfit = current - minPrice; //constant\n\t\tminPrice = Math.min(current, minPrice);\n\t\tmaxProfit = Math.max(currentProfit, maxProfit);\n\t}\n\treturn maxProfit;\n}", "async sellingPrice(product_code, denom) {\n\t\t// get product price list\n\t\tlet Price = await CatalogDetail.query()\n\t\t\t.with(\"catalog\")\n\t\t\t.where(\"product_code\", product_code)\n\t\t\t.where(\"status\", \"ENABLE\")\n\t\t\t.where(function() {\n\t\t\t\tthis.where(function() {\n\t\t\t\t\tthis.where(\"denom\", Number(denom)).whereNull(\"min\");\n\t\t\t\t}).orWhere(function() {\n\t\t\t\t\tthis.where(\"min\", \"<=\", Number(denom)).where(\"denom\", \">=\", Number(denom));\n\t\t\t\t});\n\t\t\t})\n\t\t\t.first();\n\t\tif (Price === null) {\n\t\t\treturn {\n\t\t\t\tstatus: \"FAIL\",\n\t\t\t\terror: \"Product is not available in catalog\",\n\t\t\t};\n\t\t}\n\n\t\t// denom validator\n\t\tconst schema = Price.toJSON().catalog.validator === null ? null : Price.toJSON().catalog.validator;\n\t\tif (schema !== null) {\n\t\t\tconst validate = ajv.compile(schema);\n\t\t\tif (\n\t\t\t\t!validate({\n\t\t\t\t\tdenom: denom,\n\t\t\t\t})\n\t\t\t) {\n\t\t\t\t// invalid denom, round up\n\t\t\t\tdenom = Math.ceil(denom);\n\t\t\t}\n\t\t}\n\n\t\tlet finalPrice = \"\";\n\t\tlet reference = denom;\n\t\tPrice = Price.toJSON();\n\t\t// calculate reference and final price\n\t\tif (Price.method === \"ABSOLUTE\") {\n\t\t\tif (!Price.min) {\n\t\t\t\tfinalPrice = parseFloat(Price.value).toFixed(2); //static\n\t\t\t\treference = parseFloat(Price.reference).toFixed(2);\n\t\t\t} else {\n\t\t\t\tfinalPrice = parseFloat(Number(denom) / Number(Price.reference) + Number(Price.value)).toFixed(2); // dynamic\n\t\t\t\treference = parseFloat(Number(denom) / Number(Price.reference)).toFixed(2);\n\t\t\t}\n\t\t} else {\n\t\t\t// PERCENT\n\t\t\tif (!Price.min) {\n\t\t\t\treference = parseFloat(Number(Price.reference)).toFixed(2);\n\t\t\t\tfinalPrice = parseFloat(Number(Price.reference) * Number(Price.value) / 100).toFixed(2);\n\t\t\t} else {\n\t\t\t\treference = parseFloat(Number(denom) / Number(Price.reference)).toFixed(2);\n\t\t\t\tfinalPrice = parseFloat(Number(denom) / Number(Price.reference) * Number(Price.value) / 100).toFixed(2);\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tstatus: \"OK\",\n\t\t\tfinalPrice: finalPrice,\n\t\t\treference: reference,\n\t\t\tvalid_denom: denom,\n\t\t};\n\t}", "function calcPrice(size, isPackage) {\n let rate = .35;\n let str = 'on mobile data';\n if (isPackage) {\n rate = .23;\n str = 'on data package';\n }\n let cost = (rate * size) / 1048576;\n\n return cost.toFixed(2) + ' Birr ' + str;\n\n}", "function lowestPriceBook(leastExpensiveBookHere){\n //takes in the above defined array of objects \"books\"\n //returns the object containing the title, price, and author of the book with the lowest priced book.\n var floating = Math.isinf;// tried this but isn't required\n var leastExpensive = {\n \"price\": Infinity, // float('inf') == Infinity\n }\n for (let i = 0; i < leastExpensiveBookHere.length; i++) {\n if (leastExpensiveBookHere[i].price < leastExpensive.price){\n leastExpensive = leastExpensiveBookHere[i];\n }\n }\n return leastExpensive;// shows us what is most expensive book\n}", "function price_asc(a,b){\nif (a.price<b.price){\n return -1;}\nif (a.price>b.price){\n return 1;}\nreturn 0\n}", "function get_shipment_recommendation(backlog, inventory, order) {\n\n // backlog\n if (backlog > 0) {\n // can deliver both backlog and order\n if (inventory >= (backlog + order)) {\n return backlog + order;\n }\n // can't deliver full backlog and order\n else {\n return inventory; \n }\n }\n // no backlog\n else {\n // order is more than inventory\n if (order > inventory) {\n return inventory; \n }\n // order is less than inventory\n else {\n return order;\n }\n }\n}", "function buildOrder(array) {\n var arrayOrdenado = [];\n $scope.totalPrice = 0;\n $scope.totalDiscount = 0;\n $scope.totalTax = 0;\n if (array.length > 0) {\n for (var i = 0; i < array.length; i++) {\n var found = false;\n if (i == 0) {\n array[i].quantity = 1;\n arrayOrdenado.push(array[i]);\n } else {\n for (var j = 0; j < arrayOrdenado.length; j++) {\n if (array[i].id == arrayOrdenado[j].id) {\n arrayOrdenado[j].quantity++;\n found = true;\n }\n }\n if (!found) {\n array[i].quantity = 1;\n arrayOrdenado.push(array[i]);\n }\n }\n $scope.totalPrice += parseInt(array[i].price);\n // $scope.totalDiscount += parseInt(array[i].discount);\n $scope.totalDiscount = 0;\n $scope.totalTax += (parseInt(array[i].price) * $scope.tax) - parseInt(array[i].price);\n }\n return arrayOrdenado;\n }\n }", "cheapestItem() {\n let minPrice = this.menu[0].price;\n // sukti cikla ir ziureti ar ciklo metu rasim pigesniu\n // jei rasim tai nustatysim minPrice is naujo\n console.log(\"minPrice\", minPrice);\n let minPriceObj;\n this.menu.forEach((menuItemObj) => {\n // console.log(\"menuItemObj.price\", menuItemObj.price);\n if (minPrice > menuItemObj.price) {\n // radom pigesne\n minPrice = menuItemObj.price;\n // kai tik randam pigesne preke issisaugom prekes objekta\n minPriceObj = menuItemObj;\n // console.log(\"minPriceObj tarpinis\", minPriceObj);\n } else {\n // neradom pigesnes\n }\n });\n console.log(\"minPrice po ciklo\", minPrice);\n console.log(\"minPriceObj\", minPriceObj);\n return minPriceObj;\n }", "function PricePerUnit() { \r\n // The PricePer function grabs all the prices and does calculations on them when Auction House pages load.\r\n var pricePer = function(descending)\r\n {\r\n // Get the listed sales.\r\n var sales = $('div[id^=\"sale\"]');\r\n var isFood = $($('#search_food')[0]).attr('style').indexOf('font-weight: bold') > -1;\r\n \r\n var pricesPer = [];\r\n \r\n for (var i = 0; i < sales.length; i++)\r\n {\r\n // For each sale, get the item counts and pricing - then divide!\r\n var sale = $(sales[i]);\r\n var count = $(sale.find('div span span')[0]).text().trim();\r\n if (isFood)\r\n {\r\n var id = $(sales.find('div > span > span')[0]).text();\r\n \r\n var foodRate = getFoodPointsById(id);\r\n if (foodRate)\r\n count *= foodRate;\r\n }\r\n var priceEl = $(sale.find('div[id^=\"buy_button\"]')[0]);\r\n var price = priceEl.text().trim();\r\n \r\n // Convert the treasure totals into friendly values (k, Mil, and various decimal counts)\r\n if (count > 1)\r\n {\r\n var pricePer = price/count;\r\n pricesPer.push(pricePer);\r\n \r\n if (pricePer > 1000000)\r\n {\r\n pricePer = Math.round(pricePer / 100000) / 10 + ' Mil';\r\n }\r\n else if (pricePer > 1000)\r\n {\r\n pricePer = Math.round(pricePer / 100) / 10 + 'k';\r\n }\r\n else if (pricePer > 10)\r\n {\r\n pricePer = Math.round(pricePer);\r\n }\r\n else if (pricePer > 3)\r\n {\r\n pricePer = Math.round((price/count) * 10) / 10;\r\n }\r\n else {\r\n pricePer = Math.round((price/count) * 100) / 100;\r\n }\r\n priceEl.html(priceEl.html().replace(price + '<br>', pricePer + ' <span style=\"color: #008000;\">x' + count + (isFood ? ' pt' : '') + '</span><br>'));\r\n }\r\n else\r\n {\r\n pricesPer.push(parseInt(price));\r\n }\r\n }\r\n \r\n // Sort the listings by price per (can't sort all items at once, but no reason not to sort each page).\r\n // This is basically an insertion sort - I don't know if this is poor or not, but I really don't care about performance when sorting ~10 items.\r\n for (var i = 0; i < sales.length; i++)\r\n {\r\n for (var j = i + 1; j < sales.length; j++)\r\n {\r\n if (!descending && pricesPer[j] < pricesPer[i] || descending && pricesPer[j] > pricesPer[i])\r\n {\r\n $(sales[i]).before($(sales[j]));\r\n \r\n // Reload my query since things moved.\r\n sales = $('div[id^=\"sale\"]');\r\n \r\n var pricePerToMove = pricesPer.splice(j, 1)[0];\r\n pricesPer.splice(i, 0, pricePerToMove);\r\n }\r\n }\r\n }\r\n }\r\n \r\n // Actually call the price per item function when the Auction House pages stop loading.\r\n $(document).ajaxSuccess(function(e, xhr, options) {\r\n if (options.url.indexOf('ah_buy_') > -1)\r\n {\r\n if (options.data.order == 'DESC')\r\n {\r\n pricePer(true);\r\n }\r\n else\r\n {\r\n pricePer(false);\r\n }\r\n }\r\n });\r\n}" ]
[ "0.61981004", "0.6109941", "0.58704454", "0.5869854", "0.58123153", "0.5700399", "0.5699231", "0.56761074", "0.5649617", "0.56363875", "0.56348705", "0.5618242", "0.55905616", "0.55744934", "0.55632436", "0.55405843", "0.5503424", "0.5493798", "0.54799175", "0.54581344", "0.5448661", "0.54334956", "0.54173684", "0.5412192", "0.5397685", "0.53723645", "0.5357631", "0.5354515", "0.53539985", "0.5347392", "0.5314394", "0.5312725", "0.5283162", "0.5275428", "0.52751195", "0.52684116", "0.5262906", "0.5251767", "0.5248464", "0.5244905", "0.52396023", "0.5239198", "0.5216254", "0.5216142", "0.52085584", "0.5184644", "0.5183022", "0.51767904", "0.5175274", "0.5169653", "0.51431906", "0.5142833", "0.51425093", "0.51351416", "0.5124465", "0.5123621", "0.51223725", "0.5115177", "0.5114948", "0.5101381", "0.5099616", "0.50884855", "0.50882894", "0.5085092", "0.5081098", "0.50793564", "0.5073266", "0.50716996", "0.50612223", "0.5057943", "0.50497234", "0.50495416", "0.5048327", "0.50471854", "0.5038506", "0.50276816", "0.5027448", "0.5022447", "0.50155276", "0.5013768", "0.50107056", "0.5009584", "0.5008973", "0.5006013", "0.5004699", "0.5000173", "0.49960837", "0.49905986", "0.49891764", "0.4983344", "0.49826834", "0.49750867", "0.49712995", "0.49704686", "0.49657694", "0.49641442", "0.49589768", "0.49539766", "0.49535105", "0.49489808" ]
0.651592
0
Fast path to cloning, since this is monomorphic
function cloneLayoutItem(layoutItem) { return { w: layoutItem.w, h: layoutItem.h, x: layoutItem.x, y: layoutItem.y, i: layoutItem.i, minW: layoutItem.minW, maxW: layoutItem.maxW, minH: layoutItem.minH, maxH: layoutItem.maxH, moved: Boolean(layoutItem.moved), static: Boolean(layoutItem.static), // These can be null isDraggable: layoutItem.isDraggable, isResizable: layoutItem.isResizable }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Clone() {}", "function Clone() {}", "function Clone() {}", "function Clone() {}", "function Clone() { }", "function Clone() { }", "function Clone() { }", "function clone(a) {if (!a) return a;var c, b = [Number, String, Boolean];if (b.forEach(function(b) { a instanceof b && (c = b(a)); }), \"undefined\" == typeof c) if (\"[object Array]\" === Object.prototype.toString.call(a)) c = [], a.forEach(function(a, b, d) { c[b] = clone(a); }); else if (\"object\" == typeof a) if (a.nodeType && \"function\" == typeof a.cloneNode) c = a.cloneNode(!0); else if (a.prototype) c = a; else if (a instanceof Date) c = new Date(a); else { c = {}; for (var d in a) c[d] = clone(a[d]); } else c = a; return c;}", "function getClone() {\n // Recursive function to clone Object + Array\n function recClone(oldObject, newObject) {\n Object.keys(oldObject).forEach(function forCurrentParam(key) {\n if (typeof oldObject[key] !== 'function') {\n if (Array.isArray(oldObject[key])) {\n newObject[key] = [];\n recClone(oldObject[key], newObject[key]);\n } else {\n newObject[key] = oldObject[key];\n }\n }\n });\n\n return newObject;\n }\n \n return recClone(state, {});\n }", "clone() {\n let dupe = new this.constructor();\n dupe.reset(this);\n return dupe;\n }", "function Clone(){\n }", "clone() {\n const cloner = new Cloner();\n return cloner.clone(this);\n }", "clone() {\n return new this.constructor(this);\n }", "clone(noodle, obj, clone, flatList = [], flatClone = []) {\n cloneCounter++;\n //flatClone.push(clone);\n if (obj == undefined)\n return obj;\n\n if (typeof obj == 'object') {\n //If clone is undefined, make it an empty array or object\n if (clone == undefined) {\n if (obj.constructor == Array) {\n clone = new Array(obj.length);\n }\n else {\n clone = {};\n }\n }\n flatList.push(obj);\n flatClone.push(clone);\n //Go through obj to clone all its properties\n for (var i in obj) {\n var flatInd = flatList.indexOf(obj[i]);\n //If we've found a new object, add it to flatList and clone it to clone and flatClone\n if (flatInd == -1) {\n //clone[i] = clone[i] || {};\n clone[i] = noodle.object.clone(noodle, obj[i], clone[i], flatList, flatClone); //This works because flatList gets updated\n }\n //If we've seen obj[i] before, add the clone of it to clone\n else {\n clone[i] = flatClone[flatInd];\n }\n }\n return clone;\n }\n return obj;\n }", "function bnClone(){var a=nbi();this.copyTo(a);return a}", "function bnClone(){var a=nbi();this.copyTo(a);return a}", "function bnClone(){var a=nbi();this.copyTo(a);return a}", "function bnClone(){var a=nbi();this.copyTo(a);return a}", "function bnClone(){var a=nbi();this.copyTo(a);return a}", "Clone() {\n\n }", "Clone() {\n\n }", "Clone() {\n\n }", "Clone() {\n\n }", "function clone(orig) {\n return Object.assign({}, orig);\n}", "function clone()\n{\n\tvar mat = new Matrix(this.size.x, this.size.y);\n\tvar i, j;\n\n\tfor(i = 0; i < this.size.x; i++)\n\t{\n\t\tfor(j = 0; j < this.size.y; j++)\n\t\t{\n\t\t\tmat.matrix[i][j] = this.matrix[i][j];\n\t\t}\n\t}\n\n\treturn mat;\n}", "clone() {\n\t\tlet data = JSON.parse(JSON.stringify(this.Serialize()));\n\t\treturn new this.constructor(data);\n\t}", "function clone (buffer) {\n return copy(buffer, shallow(buffer));\n}", "function clone(original) {\n return merge(true, {}, original);\n }", "binClonePlus(noodle, obj, clone, map = {}, flatList = noodle.sList.new(noodle), flatClone = noodle.sList.new(noodle), flatMap = noodle.sList.new(noodle), path = [], func = function () { }, cond = function () { return true; }) {\n //Add unpassed parameters to arguments{\n [arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], arguments[8], arguments[9]] = [clone, map, flatList, flatClone, flatMap, path, func, cond];\n if (arguments.length < 10) //This condition is necessary since arguments might be longer than 8\n arguments.length = 10;\n //}\n\n var args = Array.from(arguments);\n args.splice(7, 2);\n if (!cond.apply(undefined, args)) {\n return obj;\n }\n func.apply(undefined, args);\n\n //flatClone.push(clone);\n if (obj == null || obj == undefined)\n return obj;\n\n if (typeof obj == 'object') {\n //If clone is undefined, make it an empty array or object\n if (clone == undefined) {\n if (obj.constructor === Array) {\n clone = [];\n }\n else {\n clone = {};\n }\n }\n noodle.sList.add(noodle, flatList, obj);\n noodle.sList.add(noodle, flatClone, clone);\n noodle.sList.add(noodle, flatMap, path);\n\n var flatInd;\n //TODO: Find indices before loop\n //Go through obj to clone all its properties\n for (var i in obj) {\n [...path] = path; //Shallow clone path\n path.push(i);\n flatInd = noodle.sList.indexOf(noodle, flatList, obj[i]);\n //If we've found a new object, add it to flatList and clone it to clone and flatClone\n if (flatInd == -1) {\n //Set up map[i]{\n var mapVal;\n var isObj = true;\n //If obj[i] is not null or undefined, let mapVal be of the same type{\n if (obj[i] != undefined) {\n if (obj[i].constructor === Array)\n mapVal = [];\n else if (typeof obj[i] === 'object')\n mapVal = {};\n else {\n mapVal = obj[i];\n isObj = false;\n }\n }\n else {\n mapVal = obj[i];\n isObj = false;\n }\n //}\n map[i] = { recog: false, val: mapVal, isObj: isObj };\n //}\n //clone[i] = clone[i] || {};\n [...args] = arguments; //TODO: Guess I could place this line outside the loop?\n\n args[1] = obj[i];\n args[2] = clone[i];\n args[3] = map[i].val;\n clone[i] = noodle.object.binClonePlus.apply(undefined, args); //This works because flatList gets updated\n\n }\n //If we've seen obj[i] before, add the clone of it to clone\n else {\n clone[i] = noodle.sList.get(noodle, flatClone, flatInd);\n map[i] = { recog: true, path: noodle.sList.get(noodle, flatMap, flatInd) };\n }\n }\n return clone;\n }\n return obj;\n }", "clone() {\n return Object.assign(Object.create(this), this)\n }", "clone(obj) {\n return Object.assign({}, obj);\n }", "function clone(a) {\n if (isArray$5(a)) {\n return map$2(a).call(a, function (value) {\n return clone(value);\n });\n } else if (_typeof_1(a) === \"object\" && a !== null) {\n return deepObjectAssignNonentry({}, a);\n } else {\n return a;\n }\n}", "function clone(a) {\n if (isArray$5(a)) {\n return map$2(a).call(a, function (value) {\n return clone(value);\n });\n } else if (_typeof_1(a) === \"object\" && a !== null) {\n return deepObjectAssignNonentry({}, a);\n } else {\n return a;\n }\n}", "function clone(a) {\n if (isArray$3(a)) {\n return map$2(a).call(a, function (value) {\n return clone(value);\n });\n } else if (_typeof_1(a) === \"object\" && a !== null) {\n return deepObjectAssignNonentry({}, a);\n } else {\n return a;\n }\n}", "static clone(obj) {\r\n if (obj === null || obj === undefined || typeof (obj) !== 'object') {\r\n return obj;\r\n }\r\n // return Object.assign({}, obj);\r\n if (obj instanceof Array) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return [...obj];\r\n }\r\n return Object.assign({}, obj);\r\n }", "clone() { \n\t let clone = new CircleNode()\n\t return clone\n\t}", "function clone(original){\n var result = {};\n deepCopyInto(original, result);\n return result;\n}", "function deepClone(state) {\n var new_state = [];\n for(var idx1 = 0; idx1 < state.length; idx1++) {\n new_state.push(state[idx1].slice(0));\n }\n return new_state;\n}", "function clone(a) {\r\n return [...a];\r\n}", "function clone(object) { return JSON.parse(JSON.stringify(object))}", "function clone1(obj) {\r\n var newObj = obj;\r\n return newObj;\r\n}", "clone() { return new node(this.v, this.hi, this.lo); }", "function flatClone(obj) {\n return Object.assign({}, obj);\n}", "function deepCopy(source){\n return JSON.parse(JSON.stringify(source));\n}", "function clone(o) {\n\treturn JSON.parse(JSON.stringify(o));\n}", "function deepClone(arr) {\n var arrCopy = [];\n for (var i = 0; i < arr.length; i++) arrCopy.push(arr[i]);\n return arrCopy;\n}", "function clone(input) {\n var output = input,\n type = typeOf(input),\n index, size;\n\n if (type === 'array') {\n output = [];\n size = input.length;\n for (index = 0; index < size; ++index)\n output[index] = clone(input[index]);\n } else if (type === 'object') {\n output = {};\n for (index in input)\n output[index] = clone(input[index]);\n\n }\n\n return output;\n\n}", "function clone(obj) {\n var copy = Array.isArray(obj) ? [] : {};\n for (var i in obj) {\n if (Array.isArray(obj[i])) {\n copy[i] = obj[i].slice(0);\n } else if (obj[i] instanceof Buffer) {\n copy[i] = obj[i].slice(0);\n } else if (typeof obj[i] != 'function') {\n copy[i] = obj[i] instanceof Object ? clone(obj[i]) : obj[i];\n } else if (typeof obj[i] === 'function') {\n copy[i] = obj[i];\n }\n }\n return copy;\n}", "function clone (obj) {\n // return JSON.parse(JSON.stringify(obj))\n return Object.assign({}, obj)\n}", "_copy () {\n return new this.constructor()\n }", "_copy () {\n return new this.constructor()\n }", "clone() { \n\t let clone = new DiamondNode\n\t return clone\n\t}", "function clone(obj, modifiers) {\r\n\tvar sermat = this,\r\n\t\tvisited = [],\r\n\t\tcloned = [],\r\n\t\tuseConstructions = _modifier(modifiers, 'useConstructions', this.modifiers.useConstructions),\r\n\t\tautoInclude = _modifier(modifiers, 'autoInclude', this.modifiers.autoInclude),\r\n\t\tclimbPrototypes = _modifier(modifiers, 'climbPrototypes', this.modifiers.climbPrototypes);\r\n\r\n\tfunction cloneObject(obj) {\r\n\t\tvisited.push(obj);\r\n\t\tvar isArray = Array.isArray(obj),\r\n\t\t\tclonedObj;\r\n\t\tif (isArray || obj.constructor === Object || !useConstructions) {\r\n\t\t\tclonedObj = isArray ? [] : {};\r\n\t\t\tif (climbPrototypes) {\r\n\t\t\t\tvar objProto = _getProto(obj);\r\n\t\t\t\tif (!objProto.hasOwnProperty('constructor')) {\r\n\t\t\t\t\t_setProto(clonedObj, cloneObject(objProto));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcloned.push(clonedObj);\r\n\t\t\tObject.keys(obj).forEach(function (k) {\r\n\t\t\t\tclonedObj[k] = cloneValue(obj[k]);\r\n\t\t\t});\r\n\t\t} else { // Constructions.\r\n\t\t\tvar record = sermat.record(obj.constructor)\r\n\t\t\t\t|| autoInclude && sermat.include(obj.constructor);\r\n\t\t\tif (!record) {\r\n\t\t\t\tthrow new TypeError(\"Sermat.clone: Unknown type \\\"\"+\r\n\t\t\t\t\tsermat.identifier(obj.constructor) +\"\\\"!\");\r\n\t\t\t}\r\n\t\t\tclonedObj = record.materializer.call(sermat, null, null);\r\n\t\t\tcloned.push(clonedObj);\r\n\t\t\tvar clonedIdx = cloned.length - 1,\r\n\t\t\t\tclonedArgs = record.serializer.call(sermat, obj).map(cloneValue);\r\n\t\t\tclonedObj = record.materializer.call(sermat, clonedObj, clonedArgs);\r\n\t\t\t// In case the materializer does not support empty initialization.\r\n\t\t\tcloned[clonedIdx] = clonedObj;\r\n\t\t}\r\n\t\treturn clonedObj;\r\n\t}\r\n\r\n\tfunction cloneValue(value) {\r\n\t\tswitch (typeof value) {\r\n\t\t\tcase 'undefined':\r\n\t\t\tcase 'boolean':\r\n\t\t\tcase 'number':\r\n\t\t\tcase 'string':\r\n\t\t\tcase 'function':\r\n\t\t\t\treturn value;\r\n\t\t\tcase 'object':\r\n\t\t\t\tif (value === null) {\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t\tvar i = visited.indexOf(value);\r\n\t\t\t\treturn i >= 0 ? cloned[i] : cloneObject(value);\r\n\t\t\tdefault:\r\n\t\t\t\tthrow new Error('Unsupported type '+ typeof value +'!');\r\n\t\t}\r\n\t}\r\n\r\n\treturn cloneValue(obj);\r\n}", "function clone(obj) { \n\n return JSON.parse(JSON.stringify(obj));\n}", "function cloneIt(o) {\n return ( $.extend(true, {}, o) );\n}", "copy()\n\t{\n\t\treturn this.constructor.createNewInstance(this);\n\t}", "function _clone (parent, depth) {\n // cloning null always returns null\n if (parent === null) { return null }\n\n if (depth === 0) {\n return parent\n }\n\n let child\n let proto\n if (typeof parent !== 'object') {\n return parent\n }\n\n if (parent instanceof NativeMap) {\n child = new NativeMap()\n } else if (parent instanceof NativeSet) {\n child = new NativeSet()\n } else if (parent instanceof NativePromise) {\n child = new NativePromise(function (resolve, reject) {\n parent.then(function (value) {\n resolve(_clone(value, depth - 1))\n }, function (err) {\n reject(_clone(err, depth - 1))\n })\n })\n } else if (clone.__isArray(parent)) {\n child = []\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent))\n if (parent.lastIndex) child.lastIndex = parent.lastIndex\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime())\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = Buffer.alloc(parent.length)\n parent.copy(child)\n return child\n } else if (parent instanceof Error) {\n child = Object.create(parent)\n } else {\n if (typeof prototype === 'undefined') {\n proto = Object.getPrototypeOf(parent)\n child = Object.create(proto)\n } else {\n child = Object.create(prototype)\n proto = prototype\n }\n }\n\n if (circular) {\n let index = allParents.indexOf(parent)\n\n if (index !== -1) {\n return allChildren[index]\n }\n allParents.push(parent)\n allChildren.push(child)\n }\n\n if (parent instanceof NativeMap) {\n let keyIterator = parent.keys()\n while (true) {\n let next = keyIterator.next()\n if (next.done) {\n break\n }\n let keyChild = _clone(next.value, depth - 1)\n let valueChild = _clone(parent.get(next.value), depth - 1)\n child.set(keyChild, valueChild)\n }\n }\n if (parent instanceof NativeSet) {\n let iterator = parent.keys()\n while (true) {\n let next = iterator.next()\n if (next.done) {\n break\n }\n let entryChild = _clone(next.value, depth - 1)\n child.add(entryChild)\n }\n }\n\n for (let i in parent) {\n let attrs\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i)\n }\n\n if (attrs && attrs.set == null) {\n continue\n }\n child[i] = _clone(parent[i], depth - 1)\n }\n\n if (Object.getOwnPropertySymbols) {\n let symbols = Object.getOwnPropertySymbols(parent)\n for (let i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n let symbol = symbols[i]\n let descriptor = Object.getOwnPropertyDescriptor(parent, symbol)\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue\n }\n child[symbol] = _clone(parent[symbol], depth - 1)\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n })\n }\n }\n }\n\n if (includeNonEnumerable) {\n let allPropertyNames = Object.getOwnPropertyNames(parent)\n for (let i = 0; i < allPropertyNames.length; i++) {\n let propertyName = allPropertyNames[i]\n let descriptor = Object.getOwnPropertyDescriptor(parent, propertyName)\n if (descriptor && descriptor.enumerable) {\n continue\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1)\n Object.defineProperty(child, propertyName, {\n enumerable: false\n })\n }\n }\n\n return child\n }", "flatClone(noodle, flatList = noodle.object.flatList(obj), newList = new Array(flatList.length)) { //Kinda stupid to check lists for each recursion?\n for (var i in flatList) {\n var obj = flatList[i];\n if (typeof obj == 'object') {\n //Go through obj to find its properties in flatList and clone them to newList\n for (var j in obj) {\n var ind = flatList.indexOf(obj[i]);//Find obj[i] in flatList\n if (ind != -1) {\n if (newList[i] == undefined) {//If this object hasn't been found before\n newList[i] = shallowClone(); //TODO\n }\n }\n }\n }\n return $.extend(null, obj);\n }\n }", "function clone(object) {\n const obj2 =Object.assign({}, object)\n return obj2;\n}", "function clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n }", "function bnClone$1(){var a=nbi$1();this.copyTo(a);return a}", "function clone(obj) {\n return Object.assign({}, obj);\n}", "function deepCopy(src) {\n if (!src) return src;\n if (Array.isArray(src)) {\n var c = new Array(src.length);\n src.forEach(function (v, i) {\n c[i] = deepCopy(v);\n });\n return c;\n }\n if (typeof src === 'object') {\n var c = {};\n Object.keys(src).forEach(function (k) {\n c[k] = deepCopy(src[k]);\n });\n return c;\n }\n return src;\n}", "function clone(obj) {\n\t\treturn JSON.parse(JSON.stringify(obj));\n\t}", "function clone(input) {\n\treturn JSON.parse(JSON.stringify(input));\n}", "function clone()\r\n{\r\n\tvar clone = create2dArray(gridSize);\r\n\tfor (var i=0;i<gridSize;i++)\r\n\t{\r\n\t\tfor (var j=0;j<gridSize;j++)\r\n\t\t{\r\n\t\t\tclone[i][j] = grid[i][j];\r\n\t\t}\t\t\r\n\t}\r\n\treturn clone;\r\n}", "function clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "function clone(source) {\n\t\tif (helpers.isArray(source)) {\n\t\t\treturn source.map(clone);\n\t\t}\n\n\t\tif (isObject(source)) {\n\t\t\tvar target = {};\n\t\t\tvar keys = Object.keys(source);\n\t\t\tvar klen = keys.length;\n\t\t\tvar k = 0;\n\n\t\t\tfor (; k < klen; ++k) {\n\t\t\t\ttarget[keys[k]] = clone(source[keys[k]]);\n\t\t\t}\n\n\t\t\treturn target;\n\t\t}\n\n\t\treturn source;\n\t}", "function clone(array) {\n return array.clone ? array.clone() : new Array(array);\n}", "function clone(array) {\n return array.clone ? array.clone() : new Array(array);\n}", "copy() {\n return new this.constructor(\n this.power,\n this.value,\n (this.next != null) ? this.next.copy() : null,\n );\n }", "copy() {\n return Object.assign(Object.create(this), JSON.parse(JSON.stringify(this)))\n }", "function deepclone(thing) {\n\t\treturn JSON.parse(JSON.stringify(thing));\n\t}", "function _clone(parent, depth) {\n\t // cloning null always returns null\n\t if (parent === null)\n\t return null;\n\n\t if (depth === 0)\n\t return parent;\n\n\t var child;\n\t var proto;\n\t if (typeof parent != 'object') {\n\t return parent;\n\t }\n\n\t if (parent instanceof nativeMap) {\n\t child = new nativeMap();\n\t } else if (parent instanceof nativeSet) {\n\t child = new nativeSet();\n\t } else if (parent instanceof nativePromise) {\n\t child = new nativePromise(function (resolve, reject) {\n\t parent.then(function(value) {\n\t resolve(_clone(value, depth - 1));\n\t }, function(err) {\n\t reject(_clone(err, depth - 1));\n\t });\n\t });\n\t } else if (clone.__isArray(parent)) {\n\t child = [];\n\t } else if (clone.__isRegExp(parent)) {\n\t child = new RegExp(parent.source, __getRegExpFlags(parent));\n\t if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n\t } else if (clone.__isDate(parent)) {\n\t child = new Date(parent.getTime());\n\t } else if (useBuffer && Buffer.isBuffer(parent)) {\n\t child = new Buffer(parent.length);\n\t parent.copy(child);\n\t return child;\n\t } else {\n\t if (typeof prototype == 'undefined') {\n\t proto = Object.getPrototypeOf(parent);\n\t child = Object.create(proto);\n\t }\n\t else {\n\t child = Object.create(prototype);\n\t proto = prototype;\n\t }\n\t }\n\n\t if (circular) {\n\t var index = allParents.indexOf(parent);\n\n\t if (index != -1) {\n\t return allChildren[index];\n\t }\n\t allParents.push(parent);\n\t allChildren.push(child);\n\t }\n\n\t if (parent instanceof nativeMap) {\n\t var keyIterator = parent.keys();\n\t while(true) {\n\t var next = keyIterator.next();\n\t if (next.done) {\n\t break;\n\t }\n\t var keyChild = _clone(next.value, depth - 1);\n\t var valueChild = _clone(parent.get(next.value), depth - 1);\n\t child.set(keyChild, valueChild);\n\t }\n\t }\n\t if (parent instanceof nativeSet) {\n\t var iterator = parent.keys();\n\t while(true) {\n\t var next = iterator.next();\n\t if (next.done) {\n\t break;\n\t }\n\t var entryChild = _clone(next.value, depth - 1);\n\t child.add(entryChild);\n\t }\n\t }\n\n\t for (var i in parent) {\n\t var attrs;\n\t if (proto) {\n\t attrs = Object.getOwnPropertyDescriptor(proto, i);\n\t }\n\n\t if (attrs && attrs.set == null) {\n\t continue;\n\t }\n\t child[i] = _clone(parent[i], depth - 1);\n\t }\n\n\t if (Object.getOwnPropertySymbols) {\n\t var symbols = Object.getOwnPropertySymbols(parent);\n\t for (var i = 0; i < symbols.length; i++) {\n\t // Don't need to worry about cloning a symbol because it is a primitive,\n\t // like a number or string.\n\t var symbol = symbols[i];\n\t child[symbol] = _clone(parent[symbol], depth - 1);\n\t }\n\t }\n\n\t return child;\n\t }", "function clone(orig) {\n\tif (typeof orig !== \"object\" || orig == null) { // use lazy equality on null check\n\t\treturn orig;\n\t}\n\n\t// honor native clone methods\n\tif (typeof orig.clone === \"function\") {\n\t\treturn orig.clone(true);\n\t} else if (orig.nodeType && typeof orig.cloneNode === \"function\") {\n\t\treturn orig.cloneNode(true);\n\t}\n\n\t// create a copy of the original\n\tvar\ttype = Object.prototype.toString.call(orig),\n\t\tcopy;\n\tif (type === \"[object Date]\") {\n\t\tcopy = new Date(orig.getTime());\n\t} else if (type === \"[object RegExp]\") {\n\t\tcopy = new RegExp(orig);\n\t} else if (Array.isArray(orig)) {\n\t\tcopy = [];\n\t} else {\n\t\t// try to ensure that the returned object has the same prototype as the original\n\t\tvar proto = Object.getPrototypeOf(orig);\n\t\tcopy = proto ? Object.create(proto) : orig.constructor.prototype;\n\t}\n\n\t// duplicate the original's own properties; this also handles expando properties on non-generic objects\n\tObject.keys(orig).forEach(function (name) {\n\t\t// this does not preserve ES5 property attributes, however, neither does the delta coding and serialization\n\t\t// code, so it's not really an issue\n\t\tcopy[name] = clone(orig[name]);\n\t});\n\n\treturn copy;\n}", "function clone2(orig) {\n const origProto = Object.getPrototypeOf(orig);\n return Object.assign(Object.create(origProto), orig);\n}", "function _clone(parent, depth) {\n\t // cloning null always returns null\n\t if (parent === null)\n\t return null;\n\n\t if (depth === 0)\n\t return parent;\n\n\t var child;\n\t var proto;\n\t if (typeof parent != 'object') {\n\t return parent;\n\t }\n\n\t if (parent instanceof nativeMap) {\n\t child = new nativeMap();\n\t } else if (parent instanceof nativeSet) {\n\t child = new nativeSet();\n\t } else if (parent instanceof nativePromise) {\n\t child = new nativePromise(function (resolve, reject) {\n\t parent.then(function(value) {\n\t resolve(_clone(value, depth - 1));\n\t }, function(err) {\n\t reject(_clone(err, depth - 1));\n\t });\n\t });\n\t } else if (clone.__isArray(parent)) {\n\t child = [];\n\t } else if (clone.__isRegExp(parent)) {\n\t child = new RegExp(parent.source, __getRegExpFlags(parent));\n\t if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n\t } else if (clone.__isDate(parent)) {\n\t child = new Date(parent.getTime());\n\t } else if (useBuffer && Buffer.isBuffer(parent)) {\n\t child = new Buffer(parent.length);\n\t parent.copy(child);\n\t return child;\n\t } else if (parent instanceof Error) {\n\t child = Object.create(parent);\n\t } else {\n\t if (typeof prototype == 'undefined') {\n\t proto = Object.getPrototypeOf(parent);\n\t child = Object.create(proto);\n\t }\n\t else {\n\t child = Object.create(prototype);\n\t proto = prototype;\n\t }\n\t }\n\n\t if (circular) {\n\t var index = allParents.indexOf(parent);\n\n\t if (index != -1) {\n\t return allChildren[index];\n\t }\n\t allParents.push(parent);\n\t allChildren.push(child);\n\t }\n\n\t if (parent instanceof nativeMap) {\n\t var keyIterator = parent.keys();\n\t while(true) {\n\t var next = keyIterator.next();\n\t if (next.done) {\n\t break;\n\t }\n\t var keyChild = _clone(next.value, depth - 1);\n\t var valueChild = _clone(parent.get(next.value), depth - 1);\n\t child.set(keyChild, valueChild);\n\t }\n\t }\n\t if (parent instanceof nativeSet) {\n\t var iterator = parent.keys();\n\t while(true) {\n\t var next = iterator.next();\n\t if (next.done) {\n\t break;\n\t }\n\t var entryChild = _clone(next.value, depth - 1);\n\t child.add(entryChild);\n\t }\n\t }\n\n\t for (var i in parent) {\n\t var attrs;\n\t if (proto) {\n\t attrs = Object.getOwnPropertyDescriptor(proto, i);\n\t }\n\n\t if (attrs && attrs.set == null) {\n\t continue;\n\t }\n\t child[i] = _clone(parent[i], depth - 1);\n\t }\n\n\t if (Object.getOwnPropertySymbols) {\n\t var symbols = Object.getOwnPropertySymbols(parent);\n\t for (var i = 0; i < symbols.length; i++) {\n\t // Don't need to worry about cloning a symbol because it is a primitive,\n\t // like a number or string.\n\t var symbol = symbols[i];\n\t var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n\t if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n\t continue;\n\t }\n\t child[symbol] = _clone(parent[symbol], depth - 1);\n\t if (!descriptor.enumerable) {\n\t Object.defineProperty(child, symbol, {\n\t enumerable: false\n\t });\n\t }\n\t }\n\t }\n\n\t if (includeNonEnumerable) {\n\t var allPropertyNames = Object.getOwnPropertyNames(parent);\n\t for (var i = 0; i < allPropertyNames.length; i++) {\n\t var propertyName = allPropertyNames[i];\n\t var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n\t if (descriptor && descriptor.enumerable) {\n\t continue;\n\t }\n\t child[propertyName] = _clone(parent[propertyName], depth - 1);\n\t Object.defineProperty(child, propertyName, {\n\t enumerable: false\n\t });\n\t }\n\t }\n\n\t return child;\n\t }", "function clone2(obj) {\n if ((typeof obj) !== 'object') return obj;\n var Ctor = obj.constructor;\n var copy = new Ctor();\n for (var key in obj) {\n\tcopy[key] = obj[key];\n }\n return copy;\n}", "function deepClone(obj) {\n switch (typeof obj) {\n case 'object':\n return JSON.parse(JSON.stringify(obj)); //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case 'undefined':\n return null; //this is how JSON.stringify behaves for array items\n default:\n return obj; //no need to clone primitives\n }\n }", "copy() {\n\t\tlet copy = new Matrix(this.height, this.width);\n\t\tlet position = {y:null, x:null};\n\t\tfor (position.y = 0; position.y < copy.height; position.y++)\n\t\t\tfor (position.x = 0; position.x < copy.width; position.x++)\n\t\t\t\tcopy.setBlock(position, this.getBlock(position));\n\t\treturn copy;\n\t}", "function clone(obj){\n\treturn JSON.parse( JSON.stringify( obj ) );\n}", "function clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "function clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "function clone(entity) {\n return Object.assign({}, entity);\n}", "function deepClone(thing) {\n return JSON.parse(JSON.stringify(thing));\n }", "clone() {\n var clone = new IdMap(this._idStringify, this._idParse);\n this.forEach(function (value, id) {\n clone.set(id, EJSON.clone(value));\n });\n return clone;\n }", "function bnClone()\n{\n var r = nbi();\n this.copyTo(r);\n return r;\n}", "function DeepClone(obj) {\n return Deserialize(Serialize(obj));\n}", "clone() {\n return new TileTree(this.root.clone(), this.next_id);\n }", "clone() {\n const clone = new Polygon()\n const numCoords = this._coords.length\n\n for (let i = 0; i < numCoords; ++i) clone._coords[i] = this._coords[i]\n\n return clone\n }", "function cloneData(data) {\n return data;\n //return JSON.parse(JSON.stringify(data));\n}", "function _clone(parent, depth) {\n\t\t // cloning null always returns null\n\t\t if (parent === null)\n\t\t return null;\n\n\t\t if (depth == 0)\n\t\t return parent;\n\n\t\t var child;\n\t\t if (typeof parent != 'object') {\n\t\t return parent;\n\t\t }\n\n\t\t if (util.isArray(parent)) {\n\t\t child = [];\n\t\t } else if (util.isRegExp(parent)) {\n\t\t child = new RegExp(parent.source, util.getRegExpFlags(parent));\n\t\t if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n\t\t } else if (util.isDate(parent)) {\n\t\t child = new Date(parent.getTime());\n\t\t } else if (useBuffer && Buffer.isBuffer(parent)) {\n\t\t child = new Buffer(parent.length);\n\t\t parent.copy(child);\n\t\t } else {\n\t\t if (typeof prototype == 'undefined') child = Object.create(Object.getPrototypeOf(parent));\n\t\t else child = Object.create(prototype);\n\t\t }\n\n\t\t if (circular) {\n\t\t var index = allParents.indexOf(parent);\n\n\t\t if (index != -1) {\n\t\t return allChildren[index];\n\t\t }\n\t\t allParents.push(parent);\n\t\t allChildren.push(child);\n\t\t }\n\n\t\t for (var i in parent) {\n\t\t child[i] = _clone(parent[i], depth - 1);\n\t\t }\n\n\t\t return child;\n\t\t }", "function deepCopy (x) {\n return JSON.parse(JSON.stringify(x))\n}", "function _clone(parent, depth) {\n\t // cloning null always returns null\n\t if (parent === null)\n\t return null;\n\n\t if (depth === 0)\n\t return parent;\n\n\t var child;\n\t var proto;\n\t if (typeof parent != 'object') {\n\t return parent;\n\t }\n\n\t if (_instanceof(parent, nativeMap)) {\n\t child = new nativeMap();\n\t } else if (_instanceof(parent, nativeSet)) {\n\t child = new nativeSet();\n\t } else if (_instanceof(parent, nativePromise)) {\n\t child = new nativePromise(function (resolve, reject) {\n\t parent.then(function(value) {\n\t resolve(_clone(value, depth - 1));\n\t }, function(err) {\n\t reject(_clone(err, depth - 1));\n\t });\n\t });\n\t } else if (clone.__isArray(parent)) {\n\t child = [];\n\t } else if (clone.__isRegExp(parent)) {\n\t child = new RegExp(parent.source, __getRegExpFlags(parent));\n\t if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n\t } else if (clone.__isDate(parent)) {\n\t child = new Date(parent.getTime());\n\t } else if (useBuffer && Buffer.isBuffer(parent)) {\n\t child = new Buffer(parent.length);\n\t parent.copy(child);\n\t return child;\n\t } else if (_instanceof(parent, Error)) {\n\t child = Object.create(parent);\n\t } else {\n\t if (typeof prototype == 'undefined') {\n\t proto = Object.getPrototypeOf(parent);\n\t child = Object.create(proto);\n\t }\n\t else {\n\t child = Object.create(prototype);\n\t proto = prototype;\n\t }\n\t }\n\n\t if (circular) {\n\t var index = allParents.indexOf(parent);\n\n\t if (index != -1) {\n\t return allChildren[index];\n\t }\n\t allParents.push(parent);\n\t allChildren.push(child);\n\t }\n\n\t if (_instanceof(parent, nativeMap)) {\n\t parent.forEach(function(value, key) {\n\t var keyChild = _clone(key, depth - 1);\n\t var valueChild = _clone(value, depth - 1);\n\t child.set(keyChild, valueChild);\n\t });\n\t }\n\t if (_instanceof(parent, nativeSet)) {\n\t parent.forEach(function(value) {\n\t var entryChild = _clone(value, depth - 1);\n\t child.add(entryChild);\n\t });\n\t }\n\n\t for (var i in parent) {\n\t var attrs;\n\t if (proto) {\n\t attrs = Object.getOwnPropertyDescriptor(proto, i);\n\t }\n\n\t if (attrs && attrs.set == null) {\n\t continue;\n\t }\n\t child[i] = _clone(parent[i], depth - 1);\n\t }\n\n\t if (Object.getOwnPropertySymbols) {\n\t var symbols = Object.getOwnPropertySymbols(parent);\n\t for (var i = 0; i < symbols.length; i++) {\n\t // Don't need to worry about cloning a symbol because it is a primitive,\n\t // like a number or string.\n\t var symbol = symbols[i];\n\t var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n\t if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n\t continue;\n\t }\n\t child[symbol] = _clone(parent[symbol], depth - 1);\n\t if (!descriptor.enumerable) {\n\t Object.defineProperty(child, symbol, {\n\t enumerable: false\n\t });\n\t }\n\t }\n\t }\n\n\t if (includeNonEnumerable) {\n\t var allPropertyNames = Object.getOwnPropertyNames(parent);\n\t for (var i = 0; i < allPropertyNames.length; i++) {\n\t var propertyName = allPropertyNames[i];\n\t var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n\t if (descriptor && descriptor.enumerable) {\n\t continue;\n\t }\n\t child[propertyName] = _clone(parent[propertyName], depth - 1);\n\t Object.defineProperty(child, propertyName, {\n\t enumerable: false\n\t });\n\t }\n\t }\n\n\t return child;\n\t }", "function deepCopy(obj){\n return JSON.parse(JSON.stringify(obj));\n}", "clone() {\n var clone = new TraversalState(this.root);\n clone._currentNode = this._currentNode;\n clone._containers = this._containers.clone();\n clone._indexes = this._indexes.clone();\n clone._ancestors = this._ancestors.clone();\n return clone;\n }", "function deepClone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "function deepClone(obj) {\n switch (typeof obj) {\n case 'object':\n return JSON.parse(JSON.stringify(obj)); //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case 'undefined':\n return null; //this is how JSON.stringify behaves for array items\n default:\n return obj; //no need to clone primitives\n }\n }", "function clone(object){\n return JSON.parse(JSON.stringify(object));\n}", "function clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "function clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}" ]
[ "0.76937884", "0.76937884", "0.76937884", "0.76937884", "0.73716086", "0.73716086", "0.73716086", "0.72560656", "0.7109731", "0.7065125", "0.7061807", "0.7017915", "0.700856", "0.69749796", "0.69529814", "0.69529814", "0.69529814", "0.69529814", "0.69529814", "0.69224864", "0.69224864", "0.69224864", "0.69224864", "0.6897782", "0.6895017", "0.688439", "0.6876825", "0.6869119", "0.68403035", "0.6834303", "0.6779705", "0.6742593", "0.6742593", "0.6735253", "0.6726069", "0.6721454", "0.67164797", "0.6714506", "0.67109036", "0.67084914", "0.67079777", "0.669148", "0.6650987", "0.6643114", "0.66260976", "0.66226816", "0.6604011", "0.6585349", "0.6572148", "0.65599436", "0.65599436", "0.6559196", "0.6554527", "0.6550303", "0.65491825", "0.65475017", "0.6536978", "0.65223557", "0.65142983", "0.65082353", "0.65003836", "0.6498047", "0.649119", "0.6489196", "0.64841914", "0.6456607", "0.6453383", "0.64509284", "0.6447778", "0.6447778", "0.644321", "0.64298403", "0.642455", "0.64190936", "0.6417685", "0.64160043", "0.6413777", "0.64137137", "0.640108", "0.639446", "0.6392192", "0.6391408", "0.6391408", "0.6391212", "0.6386105", "0.63858473", "0.6381432", "0.6377652", "0.63743633", "0.6364866", "0.63645923", "0.63633174", "0.63610023", "0.63589317", "0.6356842", "0.63557595", "0.63547486", "0.6353938", "0.63529354", "0.63525826", "0.63525826" ]
0.0
-1
Comparing React `children` is a bit difficult. This is a good way to compare them. This will catch differences in keys, order, and length.
function childrenEqual(a, b) { return (0, _lodash2.default)(_react2.default.Children.map(a, function (c) { return c.key; }), _react2.default.Children.map(b, function (c) { return c.key; })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function childrenEqual(a\n/*: ReactChildren*/\n, b\n/*: ReactChildren*/\n)\n/*: boolean*/\n{\n return (0, _lodash.default)(_react.default.Children.map(a, function (c) {\n return c.key;\n }), _react.default.Children.map(b, function (c) {\n return c.key;\n }));\n}", "function childrenEqual(a, b) {\n // $FlowIgnore: Appears to think map calls back w/array\n return (0, _lodash2.default)(_react2.default.Children.map(a, function (c) {\n return c.key;\n }), _react2.default.Children.map(b, function (c) {\n return c.key;\n }));\n}", "function deepCompare(a, b) {\n var count = React.Children.count(a);\n\n if (count !== React.Children.count(b)) {\n return false;\n }\n\n // check if single item\n if (count === 1) {\n // if react element, continue recursion\n if (a.props && b.props) {\n // tag type and keys\n if (a.type === b.type && a.key === b.key) {\n var usedSet = new Set();\n for (var key in a.props) {\n if (!(key in b.props) || !deepCompare(a.props[key], b.props[key])) {\n return false;\n }\n usedSet.add(key);\n }\n for (var _key in b.props) {\n if (!usedSet.has(_key)) {\n if (!(_key in a.props) || !deepCompare(a.props[_key], b.props[_key])) {\n return false;\n }\n }\n }\n return true;\n }\n return false;\n }\n // primitive data type\n else if (!a.props && !b.props) {\n return a === b;\n }\n return false;\n }\n // if multiple, compare all\n for (var i = 0; i < count; i++) {\n if (!deepCompare(a[i], b[i])) {\n return false;\n }\n }\n return true;\n}", "understandChildren() {\n const { children, content: contentProp, target: targetProp } = this.props;\n // #validateProps asserts that 1 <= children.length <= 2 so content is optional\n const [targetChild, contentChild] = React.Children.toArray(children);\n return {\n content: contentChild == null ? contentProp : contentChild,\n target: targetChild == null ? targetProp : targetChild\n };\n }", "matches(element, props) {\n for (var key in props) {\n if (key === 'children') {\n continue;\n }\n\n if (element[key] !== props[key]) {\n return false;\n }\n }\n\n return true;\n }", "matches(element, props) {\n for (var key in props) {\n if (key === 'children') {\n continue;\n }\n\n if (element[key] !== props[key]) {\n return false;\n }\n }\n\n return true;\n }", "function childrenEquivalent(expected, given) {\n var children1 = expected.childNodes;\n var children2 = given.childNodes;\n if (children1.length !== children2.length) {\n return false;\n }\n for (var i = 0; i < children1.length; i++) {\n if (!elementsEquivalent(children1[i], children2[i])) {\n return false;\n }\n }\n return true;\n}", "function diffChildren (path, entityId, prev, next, el) {\n\t var positions = []\n\t var hasKeys = false\n\t var childNodes = Array.prototype.slice.apply(el.childNodes)\n\t var leftKeys = reduce(prev.children, keyMapReducer, {})\n\t var rightKeys = reduce(next.children, keyMapReducer, {})\n\t var currentChildren = assign({}, children[entityId])\n\n\t function keyMapReducer (acc, child, i) {\n\t if (child && child.attributes && child.attributes.key != null) {\n\t acc[child.attributes.key] = {\n\t element: child,\n\t index: i\n\t }\n\t hasKeys = true\n\t }\n\t return acc\n\t }\n\n\t // Diff all of the nodes that have keys. This lets us re-used elements\n\t // instead of overriding them and lets us move them around.\n\t if (hasKeys) {\n\n\t // Removals\n\t forEach(leftKeys, function (leftNode, key) {\n\t if (rightKeys[key] == null) {\n\t var leftPath = path + '.' + leftNode.index\n\t removeElement(\n\t entityId,\n\t leftPath,\n\t childNodes[leftNode.index]\n\t )\n\t }\n\t })\n\n\t // Update nodes\n\t forEach(rightKeys, function (rightNode, key) {\n\t var leftNode = leftKeys[key]\n\n\t // We only want updates for now\n\t if (leftNode == null) return\n\n\t var leftPath = path + '.' + leftNode.index\n\n\t // Updated\n\t positions[rightNode.index] = diffNode(\n\t leftPath,\n\t entityId,\n\t leftNode.element,\n\t rightNode.element,\n\t childNodes[leftNode.index]\n\t )\n\t })\n\n\t // Update the positions of all child components and event handlers\n\t forEach(rightKeys, function (rightNode, key) {\n\t var leftNode = leftKeys[key]\n\n\t // We just want elements that have moved around\n\t if (leftNode == null || leftNode.index === rightNode.index) return\n\n\t var rightPath = path + '.' + rightNode.index\n\t var leftPath = path + '.' + leftNode.index\n\n\t // Update all the child component path positions to match\n\t // the latest positions if they've changed. This is a bit hacky.\n\t forEach(currentChildren, function (childId, childPath) {\n\t if (leftPath === childPath) {\n\t delete children[entityId][childPath]\n\t children[entityId][rightPath] = childId\n\t }\n\t })\n\t })\n\n\t // Now add all of the new nodes last in case their path\n\t // would have conflicted with one of the previous paths.\n\t forEach(rightKeys, function (rightNode, key) {\n\t var rightPath = path + '.' + rightNode.index\n\t if (leftKeys[key] == null) {\n\t positions[rightNode.index] = toNative(\n\t entityId,\n\t rightPath,\n\t rightNode.element\n\t )\n\t }\n\t })\n\n\t } else {\n\t var maxLength = Math.max(prev.children.length, next.children.length)\n\n\t // Now diff all of the nodes that don't have keys\n\t for (var i = 0; i < maxLength; i++) {\n\t var leftNode = prev.children[i]\n\t var rightNode = next.children[i]\n\n\t // Removals\n\t if (rightNode === undefined) {\n\t removeElement(\n\t entityId,\n\t path + '.' + i,\n\t childNodes[i]\n\t )\n\t continue\n\t }\n\n\t // New Node\n\t if (leftNode === undefined) {\n\t positions[i] = toNative(\n\t entityId,\n\t path + '.' + i,\n\t rightNode\n\t )\n\t continue\n\t }\n\n\t // Updated\n\t positions[i] = diffNode(\n\t path + '.' + i,\n\t entityId,\n\t leftNode,\n\t rightNode,\n\t childNodes[i]\n\t )\n\t }\n\t }\n\n\t // Reposition all the elements\n\t forEach(positions, function (childEl, newPosition) {\n\t var target = el.childNodes[newPosition]\n\t if (childEl && childEl !== target) {\n\t if (target) {\n\t el.insertBefore(childEl, target)\n\t } else {\n\t el.appendChild(childEl)\n\t }\n\t }\n\t })\n\t }", "function diffChildren (path, entityId, prev, next, el) {\n var positions = []\n var hasKeys = false\n var childNodes = Array.prototype.slice.apply(el.childNodes)\n var leftKeys = reduce(prev.children, keyMapReducer, {})\n var rightKeys = reduce(next.children, keyMapReducer, {})\n var currentChildren = assign({}, children[entityId])\n\n function keyMapReducer (acc, child) {\n if (child.key != null) {\n acc[child.key] = child\n hasKeys = true\n }\n return acc\n }\n\n // Diff all of the nodes that have keys. This lets us re-used elements\n // instead of overriding them and lets us move them around.\n if (hasKeys) {\n\n // Removals\n forEach(leftKeys, function (leftNode, key) {\n if (rightKeys[key] == null) {\n var leftPath = path + '.' + leftNode.index\n removeElement(\n entityId,\n leftPath,\n childNodes[leftNode.index]\n )\n }\n })\n\n // Update nodes\n forEach(rightKeys, function (rightNode, key) {\n var leftNode = leftKeys[key]\n\n // We only want updates for now\n if (leftNode == null) return\n\n var leftPath = path + '.' + leftNode.index\n\n // Updated\n positions[rightNode.index] = diffNode(\n leftPath,\n entityId,\n leftNode,\n rightNode,\n childNodes[leftNode.index]\n )\n })\n\n // Update the positions of all child components and event handlers\n forEach(rightKeys, function (rightNode, key) {\n var leftNode = leftKeys[key]\n\n // We just want elements that have moved around\n if (leftNode == null || leftNode.index === rightNode.index) return\n\n var rightPath = path + '.' + rightNode.index\n var leftPath = path + '.' + leftNode.index\n\n // Update all the child component path positions to match\n // the latest positions if they've changed. This is a bit hacky.\n forEach(currentChildren, function (childId, childPath) {\n if (leftPath === childPath) {\n delete children[entityId][childPath]\n children[entityId][rightPath] = childId\n }\n })\n })\n\n // Now add all of the new nodes last in case their path\n // would have conflicted with one of the previous paths.\n forEach(rightKeys, function (rightNode, key) {\n var rightPath = path + '.' + rightNode.index\n if (leftKeys[key] == null) {\n positions[rightNode.index] = toNative(\n entityId,\n rightPath,\n rightNode\n )\n }\n })\n\n } else {\n var maxLength = Math.max(prev.children.length, next.children.length)\n\n // Now diff all of the nodes that don't have keys\n for (var i = 0; i < maxLength; i++) {\n var leftNode = prev.children[i]\n var rightNode = next.children[i]\n\n // Removals\n if (rightNode == null) {\n removeElement(\n entityId,\n path + '.' + leftNode.index,\n childNodes[leftNode.index]\n )\n }\n\n // New Node\n if (leftNode == null) {\n positions[rightNode.index] = toNative(\n entityId,\n path + '.' + rightNode.index,\n rightNode\n )\n }\n\n // Updated\n if (leftNode && rightNode) {\n positions[leftNode.index] = diffNode(\n path + '.' + leftNode.index,\n entityId,\n leftNode,\n rightNode,\n childNodes[leftNode.index]\n )\n }\n }\n }\n\n // Reposition all the elements\n forEach(positions, function (childEl, newPosition) {\n var target = el.childNodes[newPosition]\n if (childEl !== target) {\n if (target) {\n el.insertBefore(childEl, target)\n } else {\n el.appendChild(childEl)\n }\n }\n })\n }", "shouldComponentUpdate(nextProps){\n return nextProps.show !== this.props.show || this.props.children !== nextProps.children\n }", "compareChildTreeElements(a, b)\n {\n if (a === b)\n return 0;\n\n var aIsResource = a instanceof WebInspector.ResourceTreeElement;\n var bIsResource = b instanceof WebInspector.ResourceTreeElement;\n\n if (aIsResource && bIsResource)\n return WebInspector.ResourceTreeElement.compareResourceTreeElements(a, b);\n\n if (!aIsResource && !bIsResource) {\n // When both components are not resources then default to base class comparison.\n return super.compareChildTreeElements(a, b);\n }\n\n // Non-resources should appear before the resources.\n // FIXME: There should be a better way to group the elements by their type.\n return aIsResource ? 1 : -1;\n }", "shouldComponentUpdate(nextProps, nextState){\n return nextProps.show !== this.props.show || nextProps.children !== this.props.children\n }", "function warnOnInvalidKey(child,knownKeys,returnFiber){{if(_typeof(child)!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child,returnFiber);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}error('Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.',key);break;}}return knownKeys;}", "isElementProps(props) {\n return props.children !== undefined;\n }", "function warnOnInvalidKey(child,knownKeys,returnFiber){{if(typeof child!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child,returnFiber);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}error('Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.',key);break;}}return knownKeys;}", "function _childrenEdited(prevChildrenKeys, nextChildrenKeys) {\r\n var prevLength = prevChildrenKeys ? prevChildrenKeys.length : 0;\r\n var nextLength = nextChildrenKeys ? nextChildrenKeys.length : 0;\r\n // Were new items added?\r\n if (nextLength > prevLength) {\r\n return true;\r\n }\r\n // See if changes were limited to removals. Any additions or moves should return true.\r\n var prevIndex = 0;\r\n for (var nextIndex = 0; nextIndex < nextLength; nextIndex++) {\r\n if (prevChildrenKeys[prevIndex] === nextChildrenKeys[nextIndex]) {\r\n prevIndex++;\r\n }\r\n else {\r\n // If there are more \"next\" items left than there are \"prev\" items left,\r\n // then we know that something has been added or moved.\r\n if (nextLength - nextIndex > prevLength - prevIndex) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n}", "wrapChildren(){\n const { children, title } = this.props;\n if (!children) return null;\n\n function wrap(child, idx = 0){\n return (\n <div className=\"indicator-item\" title={title || null} key={child.key || idx}>\n { child }\n </div>\n );\n }\n\n if (Array.isArray(children)){\n return React.Children.map(children, wrap);\n } else {\n return wrap(children);\n }\n }", "childrenValidation() {\n const isChildren = Array.isArray(this.props.children);\n if (isChildren) {\n throw new Error('<Hello> component doen not support multiple children');\n } else if (!this.props.children) {\n throw new Error('<Hello> component cannot ben empty');\n }\n }", "shouldComponentUpdate(nextProps, nextState) {\n if (this.props.color !== nextProps.color) {\n return true;\n }\n if (this.props.hp !== nextProps.hp) {\n return true;\n }\n if (this.props.children !== nextProps.children) {\n return true;\n }\n return false;\n }", "function warnOnInvalidKey(child,knownKeys){{if(_typeof(child)!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}warning$1(false,'Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.',key);break;default:break;}}return knownKeys;}", "function warnOnInvalidKey(child,knownKeys){{if(typeof child!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}warning$1(false,'Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.',key);break;default:break;}}return knownKeys;}", "function warnOnInvalidKey(child,knownKeys){{if(_typeof(child)!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}error('Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.',key);break;}}return knownKeys;}", "function warnOnInvalidKey(child,knownKeys){{if(typeof child!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}error('Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.',key);break;}}return knownKeys;}", "function warnOnInvalidKey(child,knownKeys){{if(typeof child!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}error('Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.',key);break;}}return knownKeys;}", "function precacheChildNodes(inst,node){if(inst._flags&Flags.hasCachedChildNodes){return;}var children=inst._renderedChildren;var childNode=node.firstChild;outer: for(var name in children){if(!children.hasOwnProperty(name)){continue;}var childInst=children[name];var childID=getRenderedNativeOrTextFromComponent(childInst)._domID;if(childID==null){ // We're currently unmounting this child in ReactMultiChild; skip it.\n\tcontinue;} // We assume the child nodes are in the same order as the child instances.\n\tfor(;childNode!==null;childNode=childNode.nextSibling){if(childNode.nodeType===1&&childNode.getAttribute(ATTR_NAME)===String(childID)||childNode.nodeType===8&&childNode.nodeValue===' react-text: '+childID+' '||childNode.nodeType===8&&childNode.nodeValue===' react-empty: '+childID+' '){precacheNode(childInst,childNode);continue outer;}} // We reached the end of the DOM children without finding an ID match.\n\ttrue?process.env.NODE_ENV!=='production'?invariant(false,'Unable to find element with ID %s.',childID):invariant(false):void 0;}inst._flags|=Flags.hasCachedChildNodes;}", "function precacheChildNodes(inst,node){if(inst._flags&Flags.hasCachedChildNodes){return;}var children=inst._renderedChildren;var childNode=node.firstChild;outer: for(var name in children){if(!children.hasOwnProperty(name)){continue;}var childInst=children[name];var childID=getRenderedNativeOrTextFromComponent(childInst)._domID;if(childID==null){ // We're currently unmounting this child in ReactMultiChild; skip it.\n\tcontinue;} // We assume the child nodes are in the same order as the child instances.\n\tfor(;childNode!==null;childNode=childNode.nextSibling){if(childNode.nodeType===1&&childNode.getAttribute(ATTR_NAME)===String(childID)||childNode.nodeType===8&&childNode.nodeValue===' react-text: '+childID+' '||childNode.nodeType===8&&childNode.nodeValue===' react-empty: '+childID+' '){precacheNode(childInst,childNode);continue outer;}} // We reached the end of the DOM children without finding an ID match.\n\ttrue?process.env.NODE_ENV!=='production'?invariant(false,'Unable to find element with ID %s.',childID):invariant(false):void 0;}inst._flags|=Flags.hasCachedChildNodes;}", "function warnOnInvalidKey(child,knownKeys){{if((typeof child==='undefined'?'undefined':_typeof(child))!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}warning$1(false,'Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.',key);break;default:break;}}return knownKeys;}", "function warnOnInvalidKey(child,knownKeys){{if(typeof child!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}warning(false,'Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.%s',key,getCurrentFiberStackAddendum$7());break;default:break;}}return knownKeys;}", "if (React.Children.only(props.children) && props.component) {\n console.warn(\n 'Field expects the component to be passed as a child OR component. Both have been passed and child is being used.',\n );\n }", "function warnOnInvalidKey(child,knownKeys){{if((typeof child==='undefined'?'undefined':_typeof(child))!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}warning(false,'Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.%s',key,getCurrentFiberStackAddendum$7());break;default:break;}}return knownKeys;}", "get children() {\n return compact(React.Children.toArray(this.props.children));\n }", "componentWillReceiveProps(nextProps) {\n if (\n typeof nextProps.isValid !== \"undefined\" &&\n nextProps.isValid !== this.state.isValid\n ) {\n this.setState({ \"isValid\": nextProps.isValid });\n }\n if (nextProps.children !== this.state.children) {\n this.setState({ \"children\": nextProps.children }, function() {\n this.updateChildrenState();\n });\n }\n }", "adjustChildren(){\n var { context, href, schemas, children, windowWidth } = this.props;\n if (!context) return children;\n // We shouldn't ever receive a single Child.\n return React.Children.map(children, (child)=>\n React.cloneElement(child, { context, href, windowWidth, schemas })\n );\n }", "shouldComponentUpdate(nextProps, nextState){\n\t\treturn nextProps.show !== this.props.show || nextProps.children !== this.props.children;\n\t}", "function warnOnInvalidKey(child,knownKeys){{if((typeof child==='undefined'?'undefined':_typeof(child))!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_CALL_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}warning(false,'Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.%s',key,getCurrentFiberStackAddendum$1());break;default:break;}}return knownKeys;}", "function warnOnInvalidKey(child,knownKeys){{if((typeof child==='undefined'?'undefined':_typeof(child))!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_CALL_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}warning(false,'Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.%s',key,getCurrentFiberStackAddendum$1());break;default:break;}}return knownKeys;}", "function warnOnInvalidKey(child,knownKeys){{if((typeof child==='undefined'?'undefined':_typeof(child))!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_CALL_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}warning(false,'Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.%s',key,getCurrentFiberStackAddendum$1());break;default:break;}}return knownKeys;}", "function normalizeChildren(children){return isPrimitive(children)?[createTextVNode(children)]:Array.isArray(children)?normalizeArrayChildren(children):undefined;}", "function normalizeChildren(children){return isPrimitive(children)?[createTextVNode(children)]:Array.isArray(children)?normalizeArrayChildren(children):undefined;}", "function normalizeChildren(children){return isPrimitive(children)?[createTextVNode(children)]:Array.isArray(children)?normalizeArrayChildren(children):undefined;}", "function warnOnInvalidKey(child, knownKeys) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error(\n 'Encountered two children with the same key, `%s`. ' +\n 'Keys should be unique so that components maintain their identity ' +\n 'across updates. Non-unique keys may cause children to be ' +\n 'duplicated and/or omitted — the behavior is unsupported and ' +\n 'could change in a future version.',\n key,\n );\n\n break;\n }\n }\n\n return knownKeys;\n }", "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID == null) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "function elementChildren(children, predicate = () => true) {\n return react__WEBPACK_IMPORTED_MODULE_0__[\"Children\"].toArray(children).filter(child => /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__[\"isValidElement\"])(child) && predicate(child));\n}", "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedNativeOrTextFromComponent(childInst)._domID;\n if (childID == null) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : invariant(false) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? \"development\" !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "function precacheChildNodes(inst,node){if(inst._flags&Flags.hasCachedChildNodes){return;}var children=inst._renderedChildren;var childNode=node.firstChild;outer:for(var name in children){if(!children.hasOwnProperty(name)){continue;}var childInst=children[name];var childID=getRenderedHostOrTextFromComponent(childInst)._domID;if(childID===0){// We're currently unmounting this child in ReactMultiChild; skip it.\ncontinue;}// We assume the child nodes are in the same order as the child instances.\nfor(;childNode!==null;childNode=childNode.nextSibling){if(shouldPrecacheNode(childNode,childID)){precacheNode(childInst,childNode);continue outer;}}// We reached the end of the DOM children without finding an ID match.\ntrue?process.env.NODE_ENV!=='production'?invariant(false,'Unable to find element with ID %s.',childID):_prodInvariant('32',childID):void 0;}inst._flags|=Flags.hasCachedChildNodes;}", "function assertEquivalentNodes(previousNodes, nodes) {\n if (previousNodes.length !== nodes.length) {\n throw new Error('The number of i18n message children changed between first and second pass.');\n }\n\n if (previousNodes.some(function (node, i) {\n return nodes[i].constructor !== node.constructor;\n })) {\n throw new Error('The types of the i18n message children changed between first and second pass.');\n }\n}", "function warnOnInvalidKey(child, knownKeys) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child);\n var key = child.key;\n if (typeof key !== 'string') {\n break;\n }\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n warning(false, 'Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.%s', key, getCurrentFiberStackAddendum$2());\n break;\n default:\n break;\n }\n }\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n break;\n }\n }\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n break;\n }\n }\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n break;\n }\n }\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n break;\n }\n }\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n if (typeof key !== 'string') {\n break;\n }\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n break;\n }\n }\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child);\n var key = child.key;\n if (typeof key !== 'string') {\n break;\n }\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n warning(false, 'Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.%s', key, getCurrentFiberStackAddendum$7());\n break;\n default:\n break;\n }\n }\n return knownKeys;\n }", "function assertEquivalentNodes(previousNodes, nodes) {\n if (previousNodes.length !== nodes.length) {\n throw new Error('The number of i18n message children changed between first and second pass.');\n }\n if (previousNodes.some((node, i) => nodes[i].constructor !== node.constructor)) {\n throw new Error('The types of the i18n message children changed between first and second pass.');\n }\n}", "function assertEquivalentNodes(previousNodes, nodes) {\n if (previousNodes.length !== nodes.length) {\n throw new Error('The number of i18n message children changed between first and second pass.');\n }\n if (previousNodes.some((node, i) => nodes[i].constructor !== node.constructor)) {\n throw new Error('The types of the i18n message children changed between first and second pass.');\n }\n}", "countActiveChildren(props) {\n let count = 0;\n React.Children.forEach(props.children,\n (child) => {\n if (child) {\n if (child.props.hide === undefined || child.props.hide !== false) count++;\n }\n });\n return count;\n }", "function warnOnInvalidKey(child, knownKeys) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n warning$1(false, 'Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n break;\n\n default:\n break;\n }\n }\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n warning$1(false, 'Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n break;\n\n default:\n break;\n }\n }\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n warning$1(false, 'Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n break;\n\n default:\n break;\n }\n }\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n warning$1(false, 'Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n break;\n\n default:\n break;\n }\n }\n return knownKeys;\n }", "function precacheChildNodes(inst, node) {\r\n\t if (inst._flags & Flags.hasCachedChildNodes) {\r\n\t return;\r\n\t }\r\n\t var children = inst._renderedChildren;\r\n\t var childNode = node.firstChild;\r\n\t outer: for (var name in children) {\r\n\t if (!children.hasOwnProperty(name)) {\r\n\t continue;\r\n\t }\r\n\t var childInst = children[name];\r\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\r\n\t if (childID === 0) {\r\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\r\n\t continue;\r\n\t }\r\n\t // We assume the child nodes are in the same order as the child instances.\r\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\r\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\r\n\t precacheNode(childInst, childNode);\r\n\t continue outer;\r\n\t }\r\n\t }\r\n\t // We reached the end of the DOM children without finding an ID match.\r\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\r\n\t }\r\n\t inst._flags |= Flags.hasCachedChildNodes;\r\n\t}", "function warnOnInvalidKey(child, knownKeys) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n break;\n }\n }\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n break;\n }\n }\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n break;\n }\n }\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n break;\n }\n }\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n break;\n }\n }\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n break;\n }\n }\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys, returnFiber) {\n if (typeof child !== 'object' || child === null) return knownKeys;\n switch(child.$$typeof){\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n if (typeof key !== 'string') break;\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n error(\"Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \\u2014 the behavior is unsupported and could change in a future version.\", key);\n break;\n }\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n\n break;\n }\n }\n\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n\n break;\n }\n }\n\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n\n break;\n }\n }\n\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n\n break;\n }\n }\n\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n\n break;\n }\n }\n\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n\n break;\n }\n }\n\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n\n break;\n }\n }\n\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n\n break;\n }\n }\n\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n\n break;\n }\n }\n\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n\n break;\n }\n }\n\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n\n break;\n }\n }\n\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n\n break;\n }\n }\n\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n\n break;\n }\n }\n\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n\n break;\n }\n }\n\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n\n break;\n }\n }\n\n return knownKeys;\n }", "function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n\n break;\n }\n }\n\n return knownKeys;\n }", "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "function warnOnInvalidKey(child, knownKeys) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n warning$1(false, 'Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n break;\n\n default:\n break;\n }\n }\n\n return knownKeys;\n }" ]
[ "0.7850615", "0.75196177", "0.6728879", "0.6320843", "0.62723505", "0.62723505", "0.6058709", "0.6019686", "0.5841167", "0.5829393", "0.5829356", "0.5801001", "0.5706948", "0.56959206", "0.56754225", "0.56680614", "0.56672454", "0.5648948", "0.56467366", "0.5623756", "0.5622641", "0.5611545", "0.56106865", "0.56106865", "0.5609646", "0.5609646", "0.5604176", "0.55813664", "0.55555797", "0.55534446", "0.55426335", "0.55187595", "0.5516386", "0.55069214", "0.5486834", "0.5486834", "0.5486834", "0.5468576", "0.5468576", "0.5468576", "0.5449831", "0.54445636", "0.54332495", "0.54332495", "0.54332495", "0.54332495", "0.54218394", "0.5402415", "0.5400272", "0.5397174", "0.53943056", "0.5358712", "0.5352067", "0.53465396", "0.53465396", "0.53465396", "0.53465396", "0.53404343", "0.5335991", "0.5328299", "0.5328299", "0.5325853", "0.5322953", "0.5322953", "0.5322953", "0.5322953", "0.53214353", "0.5313356", "0.5313356", "0.5313356", "0.5313356", "0.5313356", "0.5313356", "0.53078604", "0.53007025", "0.53007025", "0.53007025", "0.53007025", "0.53007025", "0.53007025", "0.53007025", "0.53007025", "0.53007025", "0.53007025", "0.53007025", "0.53007025", "0.53007025", "0.53007025", "0.53007025", "0.53007025", "0.5300332", "0.5300332", "0.5300332", "0.5300332", "0.5300332", "0.5300332", "0.5300332", "0.5300332", "0.5297704" ]
0.75979424
2
Given two layoutitems, check if they collide.
function collides(l1, l2) { if (l1 === l2) return false; // same element if (l1.x + l1.w <= l2.x) return false; // l1 is left of l2 if (l1.x >= l2.x + l2.w) return false; // l1 is right of l2 if (l1.y + l1.h <= l2.y) return false; // l1 is above l2 if (l1.y >= l2.y + l2.h) return false; // l1 is below l2 return true; // boxes overlap }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function collides(l1\n/*: LayoutItem*/\n, l2\n/*: LayoutItem*/\n)\n/*: boolean*/\n{\n if (l1.i === l2.i) return false; // same element\n\n if (l1.x + l1.w <= l2.x) return false; // l1 is left of l2\n\n if (l1.x >= l2.x + l2.w) return false; // l1 is right of l2\n\n if (l1.y + l1.h <= l2.y) return false; // l1 is above l2\n\n if (l1.y >= l2.y + l2.h) return false; // l1 is below l2\n\n return true; // boxes overlap\n}", "function checkCollisionTwoItemsForSwaping(item, item2) {\n // if the cols or rows of the items are 1 , doesnt make any sense to set a boundary. Only if the item is bigger we set a boundary\n const horizontalBoundaryItem1 = item.cols === 1 ? 0 : 1;\n const horizontalBoundaryItem2 = item2.cols === 1 ? 0 : 1;\n const verticalBoundaryItem1 = item.rows === 1 ? 0 : 1;\n const verticalBoundaryItem2 = item2.rows === 1 ? 0 : 1;\n return item.x + horizontalBoundaryItem1 < item2.x + item2.cols\n && item.x + item.cols > item2.x + horizontalBoundaryItem2\n && item.y + verticalBoundaryItem1 < item2.y + item2.rows\n && item.y + item.rows > item2.y + verticalBoundaryItem2;\n }", "function collides(a, b) {\n \treturn \ta.getx() < b.getx() + b.getwidth() &&\n \ta.getx() + a.getwidth() > b.getx() &&\n \ta.gety() < b.gety() + b.getheight() &&\n \ta.gety() + a.getheight() > b.gety();\n }", "function collisionDetection(first, second) {\n var firstBounds = first.getBounds();\n var secondBounds = second.getBounds();\n\n return firstBounds.x + firstBounds.width > secondBounds.x\n && firstBounds.x < secondBounds.x + secondBounds.width \n && firstBounds.y + firstBounds.height > secondBounds.y\n && firstBounds.y < secondBounds.y + secondBounds.height;\n}", "static didCollide(obj1, obj2){\n // since we have getBoundingBox it should be easy\n if (!obj1.getBoundingBox && !obj2.getBoundingBox) return false;\n\n // get boxes\n const box1 = obj1.getBoundingBox();\n const box2 = obj2.getBoundingBox();\n\n // check for intersections based on the vertices from bounding box\n return (box1.topLeft.x < (box2.bottomRight.x) && \n (box1.bottomRight.x) > box2.topLeft.x) && \n (box1.topLeft.y < (box2.bottomRight.y) && \n (box1.bottomRight.y) > box2.topLeft.y);\n }", "function hitboxIntersectCheck (a, b) {\n\n //If error, ensure items have this.height / this.width.\n if (a.bottom() > b.top() && a.top() < b.bottom() && a.left() < b.right() && a.right() > b.left()) {\n\n return true;\n }\n\n return false;\n}", "checkCollide(obj1, obj2) {\n\t\tif(\tobj1.x < obj2.x + obj2.width &&\n\t\t\tobj1.x + obj1.width > obj2.x) {\n\t\t\t\tif(\tobj1.y < obj2.y + obj2.height &&\n\t\t\t\t\tobj1.y + obj1.height > obj2.y) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\t\t\n\t\t}\n\t\treturn false;\n\t}", "function collidesWith( a, b )\n{\n return a.bottom > b.top && a.top < b.bottom;\n}", "function collision_detector(first, second) {\r\n var x1 = first.get(\"X\");\r\n var y1 = first.get(\"Y\");\r\n var width1 = first.get(\"width\");\r\n var height1 = first.get(\"height\");\r\n var x2 = second.get(\"X\");\r\n var y2 = second.get(\"Y\");\r\n var width2 = second.get(\"width\");\r\n var height2 = second.get(\"height\");\r\n\r\n if (x2 > x1 && x2 < x1 + width1 || x1 > x2 && x1 < x2 + width2) {\r\n if (y2 > y1 && y2 < y1 + height1 || y1 > y2 && y1 < y2 + height2) {\r\n return true;\r\n }\r\n } else {\r\n return false;\r\n }\r\n}", "function collides(a, b) {\n return (\n a.x < b.x + pipeWidth &&\n a.x + a.width > b.x &&\n a.y < b.y + b.height &&\n a.y + a.height > b.y\n );\n}", "function have_collided(object1,object2){\n return !(\n ((object1.y + object1.height) < (object2.y)) || //\n (object1.y > (object2.y + object2.height)) ||\n ((object1.x + object1.width) < object2.x) ||\n (object1.x > (object2.x + object2.width))\n );\n }", "function collides(a, b) {\n\n\treturn a.x < b.x + b.width &&\n\t\t\t\t a.x + a.width > b.x &&\n\t\t\t\t a.y < b.y + b.height &&\n\t\t\t\t a.y + a.height > b.y;\n\n}", "function doCollide(obj1, obj2) {\n var left1 = { \"x\": obj1.x, \"y\": obj1.y };\n var right1 = { \"x\": obj1.x + obj1.width, \"y\": obj1.y + obj1.height};\n var left2 = { \"x\": obj2.x, \"y\": obj2.y };\n var right2 = { \"x\": obj2.x + obj2.width, \"y\": obj2.y + obj2.height};\n \n // If one rectangle is on left side of other they do not overlap\n if (left2.x > right1.x || left1.x > right2.x) {\n return false; \n }\n \n // If one rectangle is above other they do not overlap\n if (right2.y < left1.y || right1.y < left2.y) {\n return false; \n }\n \n return true;\n }", "function collides(a, b) {\n if(a.x == b.x && a.y == b.y) return true;\n return false;\n }", "spriteOverlap(a, b) {\n let ab = a.getBounds();\n let bb = b.getBounds();\n return ab.x + ab.width > bb.x && ab.x < bb.x + bb.width && ab.y + ab.height > bb.y && ab.y < bb.y + bb.height;\n }", "spriteOverlap(a, b) {\n let ab = a.getBounds();\n let bb = b.getBounds();\n return ab.x + ab.width > bb.x && ab.x < bb.x + bb.width && ab.y + ab.height > bb.y && ab.y < bb.y + bb.height;\n }", "function overlap(actor1,actor2){\n return actor1.pos.x+actor1.size.x > actor2.pos.x &&\n actor1.pos.x < actor2.pos.x + actor2.size.x &&\n actor1.pos.y + actor1.size.y > actor2.pos.y &&\n actor1.pos.y<actor2.pos.y + actor2.size.y;\n }", "function collision(first, second) {\n\treturn !(first.x > second.x + second.width ||\n\t\tfirst.x + first.width < second.x ||\n\t\tfirst.y > second.y + second.height ||\n\t\tfirst.y + first.height < second.y);\n}", "function checkCollision(entA, entB)\n{\n var colBoxA = entA.colBox;\n var colBoxB = entB.colBox;\n return !(colBoxB.left > colBoxA.right ||\n colBoxB.right < colBoxA.left ||\n colBoxB.top > colBoxA.bottom ||\n colBoxB.bottom < colBoxA.top);\n}", "function collision($div1, $div2) {\n var x1 = $div1.offset().left;\n var y1 = $div1.offset().top;\n var h1 = $div1.outerHeight(true);\n var w1 = $div1.outerWidth(true);\n var b1 = y1 + h1;\n var r1 = x1 + w1;\n var x2 = $div2.offset().left;\n var y2 = $div2.offset().top;\n var h2 = $div2.outerHeight(true);\n var w2 = $div2.outerWidth(true);\n var b2 = y2 + h2;\n var r2 = x2 + w2;\n\n if (b1 < y2 || y1 > b2 || r1 < x2 || x1 > r2) return false;\n return true;\n }", "function collision($div1, $div2) {\n var x1 = $div1.offset().left;\n var y1 = $div1.offset().top;\n var h1 = $div1.outerHeight(true);\n var w1 = $div1.outerWidth(true);\n var b1 = y1 + h1;\n var r1 = x1 + w1;\n var x2 = $div2.offset().left;\n var y2 = $div2.offset().top;\n var h2 = $div2.outerHeight(true);\n var w2 = $div2.outerWidth(true);\n var b2 = y2 + h2;\n var r2 = x2 + w2;\n \n if (b1 < y2 || y1 > b2 || r1 < x2 || x1 > r2) return false;\n return true;\n}", "function overlap(obj1, obj2) {\n var right1 = obj1.x + obj1.width;\n var right2 = obj2.x + obj2.width;\n var left1 = obj1.x;\n var left2 = obj2.x;\n var top1 = obj1.y;\n var top2 = obj2.y;\n var bottom1 = obj1.y + obj1.height;\n var bottom2 = obj2.y + obj2.height;\n\n if (left1 < right2 && left2 < right1 && top1 < bottom2 && top2 < bottom1) {\n return true;\n }\n return false;\n }", "function isColliding(a, b) {\n return a.left < b.right && a.right > b.left && a.top < b.bottom && a.bottom > b.top;\n}", "function ElementCollide(ElementA, ElementB) \n\t{\n\t//to detect height,width and top/left of an object for collision\n\t\tif (ElementA.offsetTop < ElementB.offsetTop + ElementB.offsetHeight)\n\t\t{\n\t\t\tif( ElementA.offsetTop + ElementA.offsetHeight > ElementB.offsetTop)\n\t\t\t{\n\t\t \t\tif(ElementA.offsetLeft < ElementB.offsetLeft + ElementB.offsetWidth)\n\t\t \t\t{\n\t\t \t\t\tif(ElementA.offsetLeft + ElementA.offsetWidth > ElementB.offsetLeft)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t\treturn false;\n\t}", "function collision($div1, $div2){\n var x1 = $div1.offset().left;\n var y1 = $div1.offset().top;\n var h1 = $div1.outerHeight(true);\n var w1 = $div1.outerWidth(true);\n var b1 = y1 + h1;\n var r1 = x1 + w1;\n var x2 = $div2.offset().left;\n var y2 = $div2.offset().top;\n var h2 = $div2.outerHeight(true);\n var w2 = $div2.outerWidth(true);\n var b2 = y2 + h2;\n var r2 = x2 + w2;\n\n if (b1 < y2 || y1 > b2 || r1 < x2 || x1 > r2) return false;\n return true;\n }", "function overlapTest(a, b) {\n return a.x < b.x + b.w && a.x + a.w > b.x &&\n\t\t a.y < b.y + b.h && a.y + a.h > b.y\n}", "function collide(a, b) {\n\tif (a == undefined || b == undefined)\n\t\treturn false;\n\n\tif(typeof a.w === \"undefined\" || typeof a.h === \"undefined\" || typeof b.w === \"undefined\" || typeof b.h === \"undefined\")\n\t\treturn false;\n\n\treturn !(b.x >= a.x + a.w // Trop à droite\n\t\t\t|| b.x + b.w <= a.x // Trop à gauche\n\t\t\t|| b.y >= a.y + a.h // Trop en bas\n\t\t\t|| b.y + b.h <= a.y) // Trop en haut\n}", "function overlapTest(a, b) {\n return a.x < b.x + b.w && a.x + a.w > b.x &&\n a.y < b.y + b.h && a.y + a.h > b.y\n}", "function overlapTest(a, b) {\n return a.x < b.x + b.w && a.x + a.w > b.x &&\n a.y < b.y + b.h && a.y + a.h > b.y\n}", "function boundingBoxCollide(object1, object2)\n {\n Debugger.log(\"boundingBoxCollide\");\n var left1 = object1.x;\n var left2 = object2.x;\n var right1 = object1.x + object1.width;\n var right2 = object2.x + object2.width;\n var top1 = object1.y;\n var top2 = object2.y;\n var bottom1 = object1.y + object1.height;\n var bottom2 = object2.y + object2.height;\n if (bottom1 < top2) return (false);\n if (top1 > bottom2) return (false);\n if (right1 < left2) return (false);\n if (left1 > right2) return (false);\n return true;\n}", "function overlaps(a, b) {\r\n\t// no horizontal overlap\r\n\tif (a.x1 >= b.x2 || b.x1 >= a.x2) return false;\r\n\t// no vertical overlap\r\n\tif (a.y1 >= b.y2 || b.y1 >= a.y2) return false;\r\n\treturn true;\r\n}", "function checkOverlap(rect1, rect2) {\n\tlet rightBottom1 = {x: rect1.x + rect1.width, y: rect1.y - rect1.width};\n\tlet rightBottom2 = {x: rect2.x + rect2.width, y: rect2.y - rect2.width};\n\tif (rect1.x > rightBottom2.x || rect2.x > rightBottom1.x) return false;\n\tif (rect1.y < rightBottom2.y || rect2.y < rightBottom1.y) return false;\n\treturn true;\n}", "function elementsOverlap(pos) {\n if (snake.x == pos.x && snake.y == pos.y)\n return true;\n if(food){\n if(food.x == pos.x && food.y == pos.y)\n return true;\n }\n if(barriers && barriers.length>0 && food){\n for(var i = 0; i < barriers.length; i++){\n for(var j = 0; j < barriers[i].positions.length; j++){\n if(barriers[i].positions[j].pos.x == pos.x && barriers[i].positions[j].pos.y == pos.y){\n return true;\n }\n if(barriers[i].positions[j].pos.x == food.x && barriers[i].positions[j].pos.y == food.y){\n return true;\n }\n }\n }\n }\n for (var i = 0; i < snake.tail.length; i++) {\n if (snake.tail[i].x == pos.x && snake.tail[i].y == pos.y)\n return true;\n }\n return false;\n}", "hitCheck(a, b){ // colision\n var ab = a._boundsRect;\n var bb = b._boundsRect;\n return ab.x + ab.width > bb.x && ab.x < bb.x + bb.width && ab.y + ab.height > bb.y && ab.y < bb.y + bb.height;\n }", "function collide(l1, l2) {\n\t \tvar r1 = { left: l1.x, top: l1.y, right: l1.x+l1.width, bottom: l1.y+l1.height };\n\t \tvar r2 = { left: l2.x, top: l2.y, right: l2.x+l2.width, bottom: l2.y+l2.height };\n \t\t\t \n \t\t\t return !(r2.left > r1.right || \n\t\t\t r2.right < r1.left || \n\t\t\t r2.top > r1.bottom ||\n\t\t\t r2.bottom < r1.top);\n\t }", "function isVerticalOverlap(element1, element2) {\n return element2.y < element1.y + element1.height && element2.y + element2.height > element1.y;\n}", "function checkOverlap(spriteA, spriteB) {\r\n var boundsA = spriteA.getBounds();\r\n var boundsB = spriteB.getBounds();\r\n return Phaser.Geom.Intersects.RectangleToRectangle(boundsA, boundsB);\r\n}", "function testCollision(rect1, rect2) {\n return ((rect1.x < rect2.x + food.width) &&\n (rect2.x < rect1.x + snakeBody.width) &&\n (rect1.y < rect2.y + food.height) &&\n (rect2.y < rect1.y + snakeBody.height));\n }", "function checkOverlap(spriteA, spriteB) {\n\n var overlapping = 0;\n try {\n\n for (var i = 0; i < spriteB.children.entries.length; i++) {\n var boundsA = spriteA.getBounds();\n var boundsB = spriteB.children.entries[i].getBounds();\n\n if (Phaser.Geom.Rectangle.Intersection(boundsA, boundsB).width > 0) {\n overlapping = 1;\n break;\n }\n }\n\n return overlapping;\n }\n catch (e) {\n console.log(e);\n return false;\n }\n\n}", "function checkCollision(A, B) {\n const PADDING = 5;\n let A_Left_X = A.x - HALF_OBJ_PIXEL + PADDING;\n let A_Right_X = A.x + HALF_OBJ_PIXEL + PADDING;\n let A_Top_Y = A.y - HALF_OBJ_PIXEL + PADDING;\n let A_Bottom_Y = A.y + HALF_OBJ_PIXEL + PADDING;\n\n return (A_Left_X < B.x && B.x < A_Right_X) && (A_Top_Y < B.y && B.y < A_Bottom_Y);\n}", "function checkOverlap(spriteA, spriteB) {\n\tvar boundsA = spriteA.getBounds();\n \tvar boundsB = spriteB.getBounds();\n\treturn Phaser.Rectangle.intersects(boundsA, boundsB);\n}", "function checkCollision (obj1,obj2){\n return obj1.y + obj1.height - 10 >= obj2.y\n && obj1.y <= obj2.y + obj2.height\n && obj1.x + obj1.width - 10 >= obj2.x\n && obj1.x <= obj2.x + obj2.width\n }", "function checkOverlap(spriteA, spriteB) {\n var boundsA = spriteA.getBounds();\n var boundsB = spriteB.getBounds();\n return Phaser.Rectangle.intersects(boundsA, boundsB);\n}", "function isCollision(entity1, entity2) {\n window.entity1 = entity1;\n window.entity2 = entity2;\n var entity1Left = entity1.x;\n var entity1Right = entity1.x + entity1.w;\n var entity1Top = entity1.y;\n var entity1Bottom = entity1.y + entity1.h;\n var entity2Left = entity2.x;\n var entity2Right = entity2.x + entity2.w;\n var entity2Top = entity2.y;\n var entity2Bottom = entity2.y + entity2.h;\n\n var sameVerticalSpace =\n (entity1Left < entity2Right && entity1Right > entity2Left) ||\n (entity2Left < entity1Right && entity2Right > entity1Left);\n var sameHorizontalSpace =\n (entity1Top < entity2Bottom && entity1Bottom > entity2Top) ||\n (entity2Top < entity1Bottom && entity2Bottom > entity1Top);\n\n if (sameVerticalSpace && sameHorizontalSpace) return true;\n else return false;\n}", "function checkCollision(rect1, rect2) {\n first = rect1.getBoundingClientRect();\n second = rect2.getBoundingClientRect();\n\n if (\n first.left < second.left + $(rect2).width() &&\n first.left + $(rect1).width() > second.left &&\n first.top < second.top + $(rect2).height() &&\n first.top + $(rect1).height() > second.top\n ) {\n return true;\n } else {\n return false;\n }\n}", "function checkOverlap() {\n let d = dist(circle1.x, circle1.y, circle2.x, circle2.y);\n if (d < circle1.size/3 + circle2.size/3) {\n state = `love`;\n }\n }", "collide(other) {\n\t\tlet al = this.x + this.hitbox.x \n\t\tlet au = this.y + this.hitbox.y\n\t\tlet ar = al + this.hitbox.w\n\t\tlet ad = au + this.hitbox.h\n\t\tlet bl = other.x + other.hitbox.x \n\t\tlet bu = other.y + other.hitbox.y\n\t\tlet br = bl + other.hitbox.w\n\t\tlet bd = bu + other.hitbox.h\n\t\treturn ar > bl && al < br && ad > bu && au < bd\n\t}", "function collision (first, second){\n const w = (first.width + second.width) / 2;\n const h = (first.height + second.height) / 2;\n const dx = Math.abs(first.x - second.x);\n const dy = Math.abs(first.y - second.y);\n if (dx <= w && dy <= h){\n const wy = w * (first.y - second.y);\n const hx = h * (first.x - second.x);\n if (wy > hx){\n if (wy > -hx){\n stopUp = true;\n // console.log('collision: up');\n return true;\n } else {\n stopRight = true;\n // console.log('collision: right');\n return true;\n }\n }else{\n if (wy > -hx){\n stopLeft = true;\n // console.log('collision: left');\n return true;\n } else {\n stopDown = true;\n // console.log('collision: down');\n return true;\n };\n };\n }else{\n stopUp = false;\n stopRight = false;\n stopDown = false;\n stopLeft = false;\n return false;\n };\n}", "function check_collision( objects_to_check )\n\t{\n\t\treturn false;\n\t}", "function isColliding(o1, o2, offset) {\n // Define input direction mappings for easier referencing\n o1D = { 'left': parseInt(o1.css('left')),\n 'right': parseInt(o1.css('left')) + o1.width(),\n 'top': parseInt(o1.css('top')),\n 'bottom': parseInt(o1.css('top')) + o1.height()\n };\n o2D = { 'left': parseInt(o2.css('left')) + offset,\n 'right': parseInt(o2.css('left')) + o2.width() - offset,\n 'top': parseInt(o2.css('top')),\n 'bottom': parseInt(o2.css('top')) + o2.height()\n };\n\n // If horizontally overlapping...\n if (o1D.left <= o2D.right &&\n o1D.right >= o2D.left &&\n o1D.top <= o2D.bottom &&\n o1D.bottom >= o2D.top) {\n // collision detected!\n return true;\n }\n return false;\n}", "function isColliding(o1, o2) {\n // Define input direction mappings for easier referencing\n o1D = { 'left': parseInt(o1.css('left')),\n 'right': parseInt(o1.css('left')) + o1.width(),\n 'top': parseInt(o1.css('top')),\n 'bottom': parseInt(o1.css('top')) + o1.height()\n };\n o2D = { 'left': parseInt(o2.css('left')),\n 'right': parseInt(o2.css('left')) + o2.width(),\n 'top': parseInt(o2.css('top')),\n 'bottom': parseInt(o2.css('top')) + o1.height()\n };\n\n // If horizontally overlapping...\n if ( (o1D.left < o2D.left && o1D.right > o2D.left) ||\n (o1D.left < o2D.right && o1D.right > o2D.right) ||\n (o1D.left < o2D.right && o1D.right > o2D.left) ) {\n\n if ( (o1D.top > o2D.top && o1D.top < o2D.bottom) ||\n (o1D.top < o2D.top && o1D.top > o2D.bottom) ||\n (o1D.top > o2D.top && o1D.bottom < o2D.bottom) ) {\n\n // Collision!\n return true;\n }\n }\n return false;\n}", "function isColliding(o1, o2) {\n // Define input direction mappings for easier referencing\n o1D = { 'left': parseInt(o1.css('left')),\n 'right': parseInt(o1.css('left')) + o1.width(),\n 'top': parseInt(o1.css('top')),\n 'bottom': parseInt(o1.css('top')) + o1.height()\n };\n o2D = { 'left': parseInt(o2.css('left')),\n 'right': parseInt(o2.css('left')) + o2.width(),\n 'top': parseInt(o2.css('top')),\n 'bottom': parseInt(o2.css('top')) + o1.height()\n };\n\n // If horizontally overlapping...\n if ( (o1D.left < o2D.left && o1D.right > o2D.left) ||\n (o1D.left < o2D.right && o1D.right > o2D.right) ||\n (o1D.left < o2D.right && o1D.right > o2D.left) ) {\n\n if ( (o1D.top > o2D.top && o1D.top < o2D.bottom) ||\n (o1D.top < o2D.top && o1D.top > o2D.bottom) ||\n (o1D.top > o2D.top && o1D.bottom < o2D.bottom) ) {\n\n // Collision!\n return true;\n }\n }\n return false;\n}", "function isColliding(o1, o2) {\n // Define input direction mappings for easier referencing\n o1D = { 'left': parseInt(o1.css('left')),\n 'right': parseInt(o1.css('left')) + o1.width(),\n 'top': parseInt(o1.css('top')),\n 'bottom': parseInt(o1.css('top')) + o1.height()\n };\n o2D = { 'left': parseInt(o2.css('left')),\n 'right': parseInt(o2.css('left')) + o2.width(),\n 'top': parseInt(o2.css('top')),\n 'bottom': parseInt(o2.css('top')) + o1.height()\n };\n\n // If horizontally overlapping...\n if ( (o1D.left < o2D.left && o1D.right > o2D.left) ||\n (o1D.left < o2D.right && o1D.right > o2D.right) ||\n (o1D.left < o2D.right && o1D.right > o2D.left) ) {\n\n if ( (o1D.top > o2D.top && o1D.top < o2D.bottom) ||\n (o1D.top < o2D.top && o1D.top > o2D.bottom) ||\n (o1D.top > o2D.top && o1D.bottom < o2D.bottom) ) {\n\n // Collision!\n return true;\n }\n }\n return false;\n}", "function collision(item1, item2){\r\n let vx = (item1.position.x - item2.position.x);\r\n let vy = (item1.position.y - item2.position.y);\r\n let length = Math.sqrt(vx * vx + vy * vy);\r\n if (length < item1.radius + item2.radius){\r\n return true;\r\n };\r\n return false;\r\n}", "function checkOverlap(spriteA, spriteB) {\n\t\t\n\t\tvar boundsA = spriteA.getBounds();\n\t\tvar boundsB = spriteB.getBounds();\n\t\n\t\treturn Phaser.Rectangle.intersects(boundsA, boundsB);\n\t\n\t}", "function isCollideTop(a, b) {\n return !(\n ((a.y + a.height) < (b.y)) ||\n (a.y > (b.y + b.height/2)) ||\n ((a.x + a.width) < b.x) ||\n (a.x > (b.x + b.width))\n );\n}", "function checkCollision( spriteA, spriteB )\n{\n var a = spriteA.getBounds();\n var b = spriteB.getBounds();\n return a.x + a.width > b.x && a.x < b.x + b.width && a.y + a.height > b.y && a.y < b.y + b.height;\n}", "function check_collision(obj1, obj2) {\n let hit = false;\n obj1 = obj1.getBounds();\n obj2 = obj2.getBounds();\n if(obj1.bottom > obj2.top\n && obj1.top < obj2.bottom\n && obj1.left < obj2.right\n && obj1.right > obj2.left) {\n hit = true;\n }\n return hit;\n }", "_isOverlappingExisting(x, y, w, h) {\n if(!this._positions.length) return false;\n let over = false;\n this._positions.forEach((item) => {\n if (!(item.x > x + w ||\n item.x + item.width < x ||\n item.y > y + h ||\n item.y + item.height < y)) over = true;\n });\n\n return over;\n }", "checkCollide(pos1, pos2){\n if (Math.abs(pos1[0] - pos2[0]) < 50 &&\n pos1[1] === pos2[1]){\n\n return true;\n } else {\n return false;\n }\n }", "checkCollide(pos1, pos2){\n\t if (Math.abs(pos1[0] - pos2[0]) < 50 &&\n\t pos1[1] === pos2[1]){\n\t\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t }", "function check_overlap(x,y)\n{\n var detect=0;\n \n for (var i=0;i<no_of_elements;i++)\n {\n if (cli===i)\n break;\n \n if((Math.abs(x-elems[i].start)<elems[cli].width) &&(Math.abs(y-elems[i].end)<elems[cli].height))\n detect=1;\n \n }\n writeMessage(canvas,detect);\n \n return detect;\n \n }", "function isOverlap(element1, element2, direction) {\n if (direction === Direction.Right)\n return element2.y < element1.y + element1.height && element2.y + element2.height > element1.y;\n else if (direction === Direction.Down)\n return element2.x < element1.x + element1.width && element2.x + element2.width > element1.x;\n return false;\n}", "overlap (ob) {\n\t\treturn (dist(this.position, ob.position) < 50);\n\t}", "isOverlap(other) {\n var rects = [this, other];\n for (var r in rects) {\n var rect = rects[r];\n for (var i = 0; i < 4; i++) {\n var _i = (i + 1) % 4;\n var p1 = rect.points[i];\n var p2 = rect.points[_i];\n var norm = new Vector2D(p2.y - p1.y, p1.x - p2.x);\n var minA = 0, maxA = 0;\n for (var j in this.points) {\n var p = this.points[j];\n var proj = norm.x * p.x + norm.y * p.y;\n if (minA == 0 || proj < minA)\n minA = proj;\n if (maxA == 0 || proj > maxA)\n maxA = proj;\n }\n var minB = 0, maxB = 0;\n for (var j in other.points) {\n var p = other.points[j];\n var proj = norm.x * p.x + norm.y * p.y;\n if (minB == 0 || proj < minB)\n minB = proj;\n if (maxB == 0 || proj > maxB)\n maxB = proj;\n }\n if (maxA < minB || maxB < minA)\n return false;\n }\n }\n return true;\n }", "function isSlotSegCollision(seg1, seg2) {\n\treturn seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "function isSlotSegCollision(seg1, seg2) {\n\treturn seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "function isSlotSegCollision(seg1, seg2) {\n\treturn seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "function isSlotSegCollision(seg1, seg2) {\n\treturn seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "function isSlotSegCollision(seg1, seg2) {\n\treturn seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "function isSlotSegCollision(seg1, seg2) {\n\treturn seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "function isSlotSegCollision(seg1, seg2) {\n\treturn seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "function isSlotSegCollision(seg1, seg2) {\n\treturn seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "isOverlap(other) {\n return !this.gameObject.noClip && this.getRect().isOverlap(other.getRect());\n }", "function checkCollision() {\n snake1.checkCollision();\n if(snake2) {\n snake2.checkCollision();\n if(snake1.collidesWith(snake2)) {\n $('#ouch_girl').trigger('play');\n }\n if(snake2.collidesWith(snake1)) {\n $('#ouch_boy').trigger('play');\n }\n }\n }", "collide(rect1, rect2, dt) {\n\t\tif (rect1.left + rect1.velocity.x * dt < rect2.right + rect2.velocity.x * dt && rect1.right + rect1.velocity.x * dt > rect2.left + rect2.velocity.x * dt && rect1.top + rect1.velocity.y * dt < rect2.bottom + rect2.velocity.y * dt && rect1.bottom + rect1.velocity.y * dt > rect2.top + rect2.velocity.y * dt) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function isSlotSegCollision(seg1, seg2) {\n return seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "function isSlotSegCollision(seg1, seg2) {\n return seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "function isSlotSegCollision(seg1, seg2) {\n return seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "function isSlotSegCollision(seg1, seg2) {\n return seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "function isSlotSegCollision(seg1, seg2) {\n return seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "function blockCollision(rectOne, rectTwo) {\n \n // Check whether there is a collision on the x and y\n return Math.abs((rectOne.x + rectOne.width / 2) - (rectTwo.x + rectTwo.width / 2)) < rectOne.width / 2 + rectTwo.width / 2 && Math.abs((rectOne.y + rectOne.height / 2) - (rectTwo.y + rectTwo.height / 2)) < rectOne.height / 2 + rectTwo.height / 2;\n \n}", "function isSlotSegCollision(seg1, seg2) {\n\t\treturn seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n\t}", "function testCollision(A,B )//compare 2 rectangles/boxes if they intersecting\n{\n //The contradictory logic because it is simpler.\n return !(A.bottom< B.top ||\n A.top >B.bottom||\n A.left > B.right||\n A.right<B.left);\n}", "function colCheck (shapeA, shapeB) {\r\n\r\n\t// Get the vectors to check against\r\n\t// Vector X : Horizontal distance between center of shapeA and center of shapeB\r\n\t// Vector Y : Vertical distance between center of shapeA and center of shapeB\r\n\tvar vX = ( shapeA.x + (shapeA.width / 2) ) - ( shapeB.x + (shapeB.width / 2) );\r\n\tvar vY = (shapeA.y + (shapeA.height / 2)) - (shapeB.y + (shapeB.height / 2));\r\n\t\r\n\t// Add the half widths and half heights of the objects\r\n\tvar hWidths = (shapeA.width / 2) + (shapeB.width / 2);\r\n\tvar hHeights = (shapeA.height / 2) + (shapeB.height / 2);\r\n\t\t\r\n\t// Variable under which the collision direction is stored\r\n\tvar colDir = null;\r\n\t\t\r\n\t// If x and y vector are less than the half width or half height,\r\n\t// then the objects must be colliding\r\n\tif (Math.abs(vX) < hWidths && Math.abs(vY) < hHeights) {\r\n\t\r\n\t\t// If the shape collided with has a collectible property\r\n\t\tif (shapeB.collectible) {\r\n\t\t\tcolDir = \"c\";\r\n\t\t\treturn colDir;\r\n\t\t}\r\n\t\t// Figures out which side the collision is from\r\n\t\t// Offset X - Y : This figures out how far into the object\r\n\t\t// we currently are\r\n\t\tvar oX = hWidths - Math.abs(vX);\r\n\t\tvar oY = hHeights - Math.abs(vY);\r\n\t\t\t\r\n\t\t// If the X offset is larger than the Y offset, we can assume the collision\r\n\t\t// is either from the top or the bottom. The greater penetration cannot be *in* the\r\n\t\t// object, because it would have been caught much sooner\r\n\t\t\r\n\t\tif (oX >= oY) {\r\n\t\t\tif (vY > 0) {\r\n\t\t\t\r\n\t\t\t\t// If the shape collided with has a bouncy property\r\n\t\t\t\tif (shapeB.bouncy) {\r\n\t\t\t\t\t// Bounce up with the obstacle's bounce force property\r\n\t\t\t\t\tshapeA.velY = -shapeA.speed * shapeB.bounceForce;\r\n\t\t\t\t\tcolDir = \"bb\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolDir = \"t\";\r\n\t\t\t\t\tshapeA.y += oY;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\tif (shapeB.bouncy) {\r\n\t\t\t\t\tshapeA.velY = -shapeA.speed * shapeB.bounceForce;\r\n\t\t\t\t\tcolDir = \"bb\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolDir = \"b\";\r\n\t\t\t\t\tif (shapeA.velY < 13) {\r\n\t\t\t\t\t\tshapeA.y -= oY;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif (vX > 0) {\r\n\t\t\t\tcolDir = \"l\";\r\n\t\t\t\tshapeA.x += oX;\r\n\t\t\t}else{\r\n\t\t\t\tcolDir = \"r\";\r\n\t\t\t\tshapeA.x -= oX;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn colDir;\t\r\n}", "function isCollisionVertical() {\n var bartop = $(\"#small\").offset().top;\n var animaltop = $(\"#animal\").offset().top;\n var animalbottom = animaltop + $(\"#animal\").height();\n\n if(animalbottom > bartop) {\n return true;\n }\n else {\n return false;\n \n }\n}", "collision(item) {\n let itemWidth;\n let itemHeight;\n\n // Gets the width and height of the collectible\n Object.keys(collectibleSprites).forEach((key) => {\n if (collectibleSprites[key].src == item.src) {\n itemWidth = collectibleSprites[key].width;\n itemHeight = collectibleSprites[key].height;\n }\n });\n\n if (this.x == item.x && this.y == item.y) return true;\n\n // Contains all sides (from top left to bottom right) of the avatar\n const avatarSides = {\n left: {\n x: this.x,\n y: this.y,\n },\n right: {\n x: this.x + playerSprites.width,\n y: this.y + playerSprites.height,\n },\n };\n\n // Contains all sides (from top left to bottom right) of the collectible sprite\n const itemSides = {\n left: {\n x: item.x,\n y: item.y,\n },\n right: {\n x: item.x + itemWidth,\n y: item.y + itemHeight,\n },\n };\n\n // Checks if the player sprite intersected with the item\n if (\n avatarSides.left.x < itemSides.right.x &&\n itemSides.left.x < avatarSides.right.x &&\n avatarSides.right.y > itemSides.left.y &&\n itemSides.right.y > avatarSides.left.y\n ) {\n return true;\n }\n\n return false;\n }", "function areCollide(r1, r2) {\n //Define the variables we'll need to calculate\n var hit, combinedHalfWidths, combinedHalfHeights, vx, vy;\n\n //hit will determine whether there's a collision\n hit = false;\n\n //Find the center points of each sprite\n r1.centerX = r1.x + r1.width / 2;\n r1.centerY = r1.y + r1.height / 2;\n r2.centerX = r2.x + r2.width / 2;\n r2.centerY = r2.y + r2.height / 2;\n\n //Find the half-widths and half-heights of each sprite\n r1.halfWidth = r1.width / 2;\n r1.halfHeight = r1.height / 2;\n r2.halfWidth = r2.width / 2;\n r2.halfHeight = r2.height / 2;\n\n //Calculate the distance vector between the sprites\n vx = r1.centerX - r2.centerX;\n vy = r1.centerY - r2.centerY;\n\n //Figure out the combined half-widths and half-heights\n combinedHalfWidths = r1.halfWidth + r2.halfWidth;\n combinedHalfHeights = r1.halfHeight + r2.halfHeight;\n\n //Check for a collision on the x axis\n if (Math.abs(vx) < combinedHalfWidths) {\n\n //A collision might be occuring. Check for a collision on the y axis\n if (Math.abs(vy) < combinedHalfHeights) {\n\n //There's definitely a collision happening\n hit = true;\n } else {\n\n //There's no collision on the y axis\n hit = false;\n }\n } else {\n\n //There's no collision on the x axis\n hit = false;\n }\n\n //`hit` will be either `true` or `false`\n return hit;\n}", "function collisionCheck(a) {\n let aRect = a.getBoundingClientRect();\n let bRect = bin.getBoundingClientRect();\n return !(\n (aRect.bottom < bRect.top) || (aRect.top > bRect.bottom) || (aRect.right < bRect.left) || (aRect.left > bRect.right)\n )\n}", "function isSlotSegCollision(seg1, seg2) {\n return seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n }", "function isSlotSegCollision(seg1, seg2) {\n return seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n }", "function isSlotSegCollision(seg1, seg2) {\n return seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n }", "function isSlotSegCollision(seg1, seg2) {\n return seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n }", "function isSlotSegCollision(seg1, seg2) {\n return seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n }", "function checkCollision(i1, i2, result) {\n\n var p1 = i1.position;\n var b1 = i1.body;\n var p2 = i2.position;\n var b2 = i2.body;\n\n if ((b1.type & 1) && (b2.type & 1)) {\n // this check is pointless for 2 circles as it's the same as the full test\n if (b1.type !== T.BODY_CIRCLE || b2.type !== T.BODY_CIRCLE) {\n vec2.add(p1, b1.boundOffset, tv1);\n vec2.add(p2, b2.boundOffset, tv2);\n var rss = b1.boundRadius + b2.boundRadius;\n if (tv1.distancesq(tv2) > rss*rss) {\n return false;\n }\n }\n }\n\n var colliding = null;\n var flipped = false;\n\n if (b1.type > b2.type) {\n \n var tmp = b2;\n b2 = b1;\n b1 = tmp;\n\n tmp = i2;\n i2 = i1;\n i1 = tmp;\n\n tmp = p2;\n p2 = p1;\n p1 = tmp;\n\n flipped = true;\n\n }\n\n if (b1.type === T.BODY_AABB) {\n if (b2.type === T.BODY_AABB) {\n colliding = AABB_AABB(i1, i2, result);\n } else if (b2.type === T.BODY_CIRCLE) {\n colliding = AABB_circle(p1, b1, p2, b2, result);\n } else if (b2.type === T.BODY_LINE_SEGMENT) {\n colliding = AABB_lineSegment(p1, b1, p2, b2, result);\n }\n } else if (b1.type === T.BODY_CIRCLE) {\n if (b2.type === T.BODY_CIRCLE) {\n colliding = circle_circle(p1, b1, p2, b2, result);\n } else if (b2.type === T.BODY_LINE_SEGMENT) {\n colliding = circle_lineSegment(i1, i2, result);\n }\n } else if (b1.type === T.BODY_LINE_SEGMENT) {\n if (b2.type === T.BODY_LINE_SEGMENT) {\n colliding = lineSegment_lineSegment(p1, b1.size, p2, b2.size, result);\n }\n }\n\n if (colliding === null) {\n console.error(\"warning: unsupported arguments to collision detection\");\n return false; \n } else {\n if (flipped) {\n result.mtv.x *= -1;\n result.mtv.y *= -1;\n }\n return colliding;\n }\n\n}", "collide(oth) {\n return this.right > oth.left && this.left < oth.right && this.top < oth.bottom && this.bottom > oth.top\n }", "static bodyOnBody(body1, body2){\n const b1 = body1.bounds;\n const b2 = body2.bounds;\n return !(b1.b < b2.t || b1.t > b2.b || b1.r < b2.l || b1.l > b2.r);\n }", "function collide(o1T, o1B, o1L, o1R, o2T, o2B, o2L, o2R) {\n\tif ((o1L <= o2R && o1L >= o2L) || (o1R >= o2L && o1R <= o2R)) {\n\t\tif ((o1T >= o2T && o1T <= o2B) || (o1B >= o2T && o1B <= o2B)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}" ]
[ "0.80237585", "0.70319617", "0.69711435", "0.67970145", "0.6730727", "0.6716791", "0.67025715", "0.669219", "0.6678458", "0.6618596", "0.659672", "0.6590639", "0.65876585", "0.654835", "0.65261537", "0.65261537", "0.6508175", "0.65019", "0.64876187", "0.6457678", "0.64284253", "0.6399393", "0.6394064", "0.63578284", "0.6356511", "0.6354032", "0.63452625", "0.6340742", "0.6340742", "0.63139534", "0.63097554", "0.6306979", "0.62701565", "0.6266845", "0.62663096", "0.6259964", "0.6227094", "0.622583", "0.6221899", "0.6218284", "0.6202975", "0.61984116", "0.6191228", "0.61910015", "0.6190237", "0.6154854", "0.6153547", "0.61443895", "0.61412567", "0.6136391", "0.6134941", "0.6134941", "0.6134941", "0.612864", "0.6110378", "0.610454", "0.61025065", "0.6099777", "0.608508", "0.6079457", "0.6077787", "0.60685277", "0.6063386", "0.60501647", "0.6046508", "0.6046127", "0.6046127", "0.6046127", "0.6046127", "0.6046127", "0.6046127", "0.6046127", "0.6046127", "0.6044778", "0.60378134", "0.60312366", "0.6025967", "0.6025967", "0.6025967", "0.6025967", "0.6025967", "0.6009875", "0.6006584", "0.59963334", "0.59937674", "0.59909785", "0.598645", "0.5974319", "0.5968731", "0.59568155", "0.59568155", "0.59568155", "0.59568155", "0.59568155", "0.5955428", "0.59505236", "0.5920888", "0.5911394" ]
0.67554885
6
Before moving item down, it will check if the movement will cause collisions and move those items down before.
function resolveCompactionCollision(layout, item, moveToCoord, axis) { var sizeProp = heightWidth[axis]; item[axis] += 1; var itemIndex = layout.indexOf(item); // Go through each item we collide with. for (var _i4 = itemIndex + 1; _i4 < layout.length; _i4++) { var otherItem = layout[_i4]; // Ignore static items if (otherItem.static) continue; // Optimization: we can break early if we know we're past this el // We can do this b/c it's a sorted layout if (otherItem.y > item.y + item.h) break; if (collides(item, otherItem)) { resolveCompactionCollision(layout, otherItem, moveToCoord + item[sizeProp], axis); } } item[axis] = moveToCoord; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function move_down() {\n\t check_pos(); \n\t blob_pos_y = blob_pos_y + move_speed;\n\t}", "moveActualBlockDown () {\n // If any collision occurs - add the block to the landed blocks array\n if (this.checkBlockCollision('down')) {\n this.landBlock()\n this.checkFullRow()\n this.createBlock()\n if (this.checkBlockCollision('down')) {\n this.gameOver = true\n }\n } else {\n this.actualBlock.y -= 1\n }\n }", "function moveDown(){\n undraw()\n currentPosition += width\n // gameOver()\n draw()\n freeze()\n }", "moveDown() {\n this.y<332?this.y+=83:false;\n }", "moveDown() {\n if (!this.collides(0, 1, this.shape)) this.pos.y++\n else {\n this.lock()\n block = field.newBlock()\n shadow = new Shadow(block)\n }\n }", "function checkDownMovementOutOfArray () {\r\n let notAnyToolCanMoveCheck = false;\r\n if (((parseInt(oldPositionY) + 2) <=7) && ((parseInt(oldPositionX) +2) <=7))\r\n {\r\n newPositionY = parseInt(oldPositionY) + 2;\r\n newPositionX = parseInt(oldPositionX) + 2;\r\n if((canPawnOrKingMove(notAnyToolCanMoveCheck, oldPositionX, oldPositionY, newPositionX, newPositionY)) == true) {\r\n isForcedJump = true;\r\n } \r\n }\r\n if (((parseInt(oldPositionY) + 2) <=7) && ((oldPositionX -2) >=0))\r\n {\r\n newPositionY = parseInt(oldPositionY) + 2;\r\n newPositionX = oldPositionX -2;\r\n if((canPawnOrKingMove(notAnyToolCanMoveCheck, oldPositionX, oldPositionY, newPositionX, newPositionY)) == true) {\r\n isForcedJump = true;\r\n }\r\n }\r\n }", "moveDown() {\n dataMap.get(this).moveY = 5;\n }", "function checkUpMovementOutOfArray() {\r\n let notAnyToolCanMoveCheck = false;\r\n if (((oldPositionY -2) >=0) && ((oldPositionX -2) >=0))\r\n {\r\n newPositionY = oldPositionY -2;\r\n newPositionX = oldPositionX -2;\r\n if((canPawnOrKingMove(notAnyToolCanMoveCheck, oldPositionX, oldPositionY, newPositionX, newPositionY)) == true) {\r\n isForcedJump = true;\r\n }\r\n }\r\n if (((oldPositionY - 2) >=0) && (((oldPositionX) +2) <=7))\r\n {\r\n newPositionY = oldPositionY -2;\r\n newPositionX = parseInt(oldPositionX) +2;\r\n if((canPawnOrKingMove(notAnyToolCanMoveCheck, oldPositionX, oldPositionY, newPositionX, newPositionY)) == true) {\r\n isForcedJump = true;\r\n }\r\n }\r\n }", "function moveDown()\r\n {\r\n undraw()\r\n currentPosition += width\r\n draw()\r\n freeze()\r\n addScore()\r\n gameOver()\r\n }", "function moveDown(){\n undraw();\n currentPosition += width;\n draw();\n freeze();\n }", "moveItemDown(itemId){\n let index = -1;\n for(let i = 0; i < this.items.length; i++){\n if(this.items[i].id === Number(itemId)){\n index = i;\n break;\n }\n }\n let tempItem = this.items[index + 1];\n this.items[index + 1] = this.items[index];\n this.items[index] = tempItem;\n }", "function quickDrop(){\r\n while( !(collision(arena, piece)) ){\r\n piece.pos.y++;\r\n }\r\n piece.pos.y--;\r\n }", "function moveDown() {\n undraw()\n currentPosition += width\n draw()\n freeze()\n}", "move()\n {\n //contain logic within borders\n if (this.xPos + this.sprite.width > width)\n {\n this.xSpeed = 0;\n this.collided = true;\n this.xPos = width - this.sprite.width\n }\n if (this.xPos < 0)\n {\n this.xSpeed = 0;\n this.collided = true;\n this.xPos = 0;\n }\n if (this.yPos > height-238-this.sprite.height)\n {\n this.ySpeed = 0;\n this.collided = true;\n this.yPos = height-238 - this.sprite.height;\n }\n if (this.yPos < 0)\n {\n this.ySpeed = 0;\n this.collided = true;\n this.yPos = 0;\n }\n //kapp notes helpful as always\n // move left?\n if (keyIsDown(LEFT_ARROW) || keyIsDown(65))\n {\n // subtract from character's xSpeed\n this.xSpeed -= this.accel;\n this.left = true;\n this.right = false;\n }\n // move right?\n if (keyIsDown(RIGHT_ARROW) || keyIsDown(68))\n {\n // add to character's xSpeed\n this.xSpeed += this.accel;\n this.right = true;\n this.left = false;\n }\n //reload, basic\n if (keyIsDown(82))\n {\n this.ammoCapacity = 8;\n }\n // fuel!!\n if (keyIsDown(32))\n {\n if (this.fuel > 0)\n {\n //if you still have fuel, then use it\n this.ySpeed -= this.accel;\n }\n if (this.fuel > -250)\n {\n //250 is the threshold under 0 to simulate a \"delay\" since idk how millis() works\n this.fuel -= 15;\n }\n }\n //look at this sad commented out failure of a feature... maybe one day\n /*\n if (keyCode == SHIFT)\n {\n if (cooldown)\n {\n let yDistance = this.yPos - this.jumpSize;\n this.yPos -= this.jumpSpeed * yDistance;\n jumping = true;\n }\n }*/\n //this I felt I wanted to do so that the left and right speeds\n //would naturally slow down over time. Felt unnatural otherwise.\n if (this.right)\n {\n this.xSpeed -= this.gravity;\n if (this.xSpeed < 0)\n {\n this.right = false;\n this.left = true;\n }\n }\n else if (this.left)\n {\n this.xSpeed += this.gravity;\n if (this.xSpeed > 0)\n {\n this.right = true;\n this.left = false;\n }\n }\n\n //the standard movement. Add gravity, speed to position\n this.ySpeed += this.gravity;\n this.xPos += this.xSpeed;\n this.yPos += this.ySpeed;\n\n //gradually grow your fuel overtime. A counter would've been great but I couldn't learn it in time...\n //no pun intended.\n if (this.fuel < this.fuelCapacity)\n {\n this.fuel += 5;\n }\n\n // speed limit! prevent the user from moving too fast\n this.xSpeed = constrain(this.xSpeed, -this.xLimit, this.xLimit);\n this.ySpeed = constrain(this.ySpeed, -25, 25);\n }", "function moveDown() {\r\n undraw();\r\n currentPosition += width;\r\n draw();\r\n freeze();\r\n }", "moveUp() {\n this.y>0?this.y-=83:false;\n }", "bonanza() {\n while (!this.collides(0, 1, this.shape)) {\n this.moveDown()\n }\n }", "onKeyDown(event){\r\n let movable = 1;\r\n\tswitch(event.keyCode){\r\n\t\tcase cc.macro.KEY.down:\r\n\t\t\tthis.node.anchorX = 0;\r\n\t\t\t// 如果前进的方向上有障碍物,则不移动\r\n\t\t\tfor (var i=0;i < this.size;i++){\r\n if( (this.Grass.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y + this.rate) != 0 ) ||\r\n\t\t\t (this.Wall.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y + this.rate) != 0 ) ||\r\n\t\t\t (this.Ornament.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y + this.rate) != 0 ) ||\r\n\t\t\t (this.Shelf.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y + this.rate) != 0 ) )\r\n movable = 0;\r\n }\r\n\t\t\tthis.tiledTile.y += this.rate * movable;\r\n\t\t\tbreak;\r\n\t\tcase cc.macro.KEY.up:\r\n\t\t\tthis.node.anchorX = 0;\r\n\t\t\t// 如果前进的方向上有障碍物,则不移动\r\n\t\t\tfor (var i=0;i < this.size;i++){\r\n if( (this.Grass.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y - this.rate - this.size + 1) != 0 ) ||\r\n\t\t\t (this.Wall.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y - this.rate - this.size + 1) != 0 ) ||\r\n\t\t\t (this.Ornament.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y - this.rate - this.size + 1) != 0 ) ||\r\n\t\t\t (this.Shelf.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y - this.rate - this.size + 1) != 0 ) )\r\n movable = 0;\r\n } \r\n\t\t\tthis.tiledTile.y += -this.rate * movable;\r\n\t\t\tbreak;\r\n\t\tcase cc.macro.KEY.left:\r\n\t\t\tthis.node.anchorX = -0.5;\r\n\t\t\t// 如果前进的方向上有障碍物,则不移动\r\n\t\t\tfor (var i=0;i < this.size;i++){\r\n if( (this.Grass.tiledLayer.getTileGIDAt(this.tiledTile.x - this.rate, this.tiledTile.y - i) != 0 ) ||\r\n\t\t (this.Wall.tiledLayer.getTileGIDAt(this.tiledTile.x - this.rate, this.tiledTile.y - i) != 0 ) ||\r\n\t\t (this.Ornament.tiledLayer.getTileGIDAt(this.tiledTile.x - this.rate, this.tiledTile.y - i) != 0 ) ||\r\n\t\t (this.Shelf.tiledLayer.getTileGIDAt(this.tiledTile.x - this.rate, this.tiledTile.y - i) != 0 ) )\r\n movable = 0;\r\n }\r\n\t\t\tthis.tiledTile.x += -this.rate * movable;\r\n\t\t\tbreak;\r\n\t\tcase cc.macro.KEY.right:\r\n\t\t\tthis.node.anchorX = -0.5;\r\n\t\t\t// 如果前进的方向上有障碍物,则不移动\r\n\t\t\tfor (var i=0;i < this.size;i++){\r\n if( (this.Grass.tiledLayer.getTileGIDAt(this.tiledTile.x + this.rate + this.size - 1, this.tiledTile.y - i) != 0 ) ||\r\n\t\t\t (this.Wall.tiledLayer.getTileGIDAt(this.tiledTile.x + this.rate + this.size - 1, this.tiledTile.y - i) != 0 ) ||\r\n\t\t\t (this.Ornament.tiledLayer.getTileGIDAt(this.tiledTile.x + this.rate + this.size - 1, this.tiledTile.y - i) != 0 ) ||\r\n\t\t\t (this.Shelf.tiledLayer.getTileGIDAt(this.tiledTile.x + this.rate + this.size - 1, this.tiledTile.y - i) != 0 ) )\r\n movable = 0;\r\n }\r\n\t\t\tthis.tiledTile.x += this.rate * movable;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\t\t\t\r\n\t}\r\n}", "function moveDown() {\n undraw()\n curPos += width\n draw()\n freeze()\n }", "moveUpNext() {\r\n this.movement.y = -this.speed;\r\n this.move();\r\n }", "moveUp() {\n dataMap.get(this).moveY = -5;\n }", "up () {\n let first = this.props.game.getTileList();\n this.props.game.board.moveTileUp();\n let second = this.props.game.getTileList();\n if (this.moveWasLegal(first, second) === false) {\n this.updateBoard();\n return;\n } else {\n this.props.game.placeTile();\n this.updateBoard();\n }\n }", "function move() {\r\n if (downPressed) {\r\n if (playerYposition != 3) {\r\n playerYposition += 1;\r\n }\r\n setDownPressed(false);\r\n }\r\n if (upPressed) {\r\n if (playerYposition != 1) {\r\n playerYposition -= 1;\r\n }\r\n setUpPressed(false);\r\n }\r\n}", "function updateItems() {\n\n\tif (!moving) {\n\t\treturn;\n\t}\n\t\n\tif (item1) {\n\t\titem1.x += dx;\n\t\titem1.y += dy;\n\t\titem1.scale -= dScale;\n\t\t\t\t\n\t\tif (((dx > dy) && Math.abs(item1.x - locations[item1.targetLocID].x) < Math.abs(dx)) \n\t\t\t\t|| Math.abs(item1.y - locations[item1.targetLocID].y) < Math.abs(dy)) {\n\t\t\titem1.x = locations[item1.targetLocID].x;\n\t\t\titem1.y = locations[item1.targetLocID].y;\n\t\t\titem1.currLocID = item1.targetLocID;\n\t\t\titem1.targetLocID = null;\n\t\t\t//item1.scale = scaleNormal;\n\t\t\titem1 = null;\n\t\t} \n\t}\n\t\n\tif (item2) {\n\t\titem2.x -= dx;\n\t\titem2.y -= dy;\n\t\titem2.scale -= dScale;\n\t\t\n\t\tif (((dx > dy) && Math.abs(item2.x - locations[item2.targetLocID].x) < Math.abs(dx)) \n\t\t\t\t|| Math.abs(item2.y - locations[item2.targetLocID].y) < Math.abs(dy)) {\n\t\t\titem2.x = locations[item2.targetLocID].x;\n\t\t\titem2.y = locations[item2.targetLocID].y;\n\t\t\titem2.currLocID = item2.targetLocID;\n\t\t\titem2.targetLocID = null;\n\t\t\t//item2.scale = scaleNormal;\n\t\t\titem2 = null;\n\t\t} \n\t}\n\t\n\t\n\tif (item1 == null && item2 == null) {\n\t\tmoving = false;\n\t\ttestLines();\n\t}\n\t\n}", "function moveDown(){\n if(keyEnabled == true){\n undraw();\n currentPosition = currentPosition + width;\n draw();\n freeze();\n }\n }", "function moveGameItem(obj) {\n obj.x += obj.velocityX;\n obj.y += obj.velocityY;\n obj.$element.css('left', obj.x);\n obj.$element.css('top', obj.y);\n\n if (obj.y > BOARD_HEIGHT - obj.height) {\n obj.y = BOARD_HEIGHT - obj.height;\n\n }\n if (obj.y < 0) {\n obj.y = 0;\n }\n }", "shift() {\n if (this.isDropping) {\n for (var i = 0; i < this.enemies.length; i++) {\n this.enemies[i].position.y += this.speed;\n }\n //reverses direction\n this.dir *= -1;\n this.isDropping = false;\n } else {\n for (var i = 0; i < this.enemies.length; i++) {\n if (this.dir === -1) {\n this.enemies[i].position.x -= this.speed;\n }\n if (this.dir === 1) {\n this.enemies[i].position.x += this.speed;\n }\n }\n }\n }", "function move_up() {\n\t check_pos();\n\t blob_pos_y = blob_pos_y - move_speed;\n\t}", "function drop() {\r\n if (! collide()) {\r\n playerPos.y++;\r\n }\r\n\r\n}", "function moveItemDown(evt) {\n\tvar button = evt.target;\n\tvar row = button.parentNode.parentNode;\n\tvar cells = row.getElementsByTagName(\"td\");\n\tif (row.id.slice(0, row.id.indexOf(\"-\")) === \"base\") {\n\t\tmoveType(baseItems.types, cells[2].innerHTML, \"-\");\n\t} else {\n\t\tmoveType(optionalItems.types, cells[2].innerHTML, \"-\");\n\t}\n\tpopulateInventory();\n\tsyncToStorage();\n}", "function spacebarFunctionality() {\n if (mySprite.x > items[count].x - 50 && mySprite.x < items[count].x + items[count].width + 50) {\n spacebar.onDown.add(interact);\n }\n else {\n spacebar.onDown.removeAll();\n }\n}", "movePieceDown() {\n\t\t/* If the piece is not able to move down, replace the current piece. */\n\t\tif (!this.piece.move(DIR_DOWN, this.grid)) {\n\t\t\t/* The piece was not able to move down, so drop it in the grid. */\n\t\t\tthis.grid.receive(this.piece);\n\t\t\tthis.piece = undefined;\n\n\t\t\t/* Get the number of lines that are full and also clear them. */\n\t\t\tlet numFullLines = this.grid.getNumFullLinesAndClear();\n\n\t\t\t/* Calculate the new score and lines. */\n\t\t\tthis._assignScoreLinesLevel(numFullLines);\n\n\t\t\t/* Check if this player has lost. */\n\t\t\tthis.checkLose();\n\n\t\t\t/* Mark all movement keys as not pressed. */\n\t\t\tthis.keysPressed[KEY_LEFT] = false;\n\t\t\tthis.keysPressed[KEY_RIGHT] = false;\n\t\t\tthis.keysPressed[KEY_DOWN] = false;\n\n\t\t\treturn false;\n\t\t}\n\n\t\t/* The piece was able to move down, restart the stopwatch for a new animation frame. */\n\t\tthis.stopwatch.start();\n\t\treturn true;\n\t}", "function moveDown() {\r\n var max = 0;\r\n for(index of shipArray) {\r\n if(max < index) {\r\n max = index;\r\n }\r\n }\r\n if(max < 90) {\r\n for(i in shipArray) {\r\n shipArray[i] = shipArray[i] + 10;\r\n }\r\n }\r\n //If it is possible to move the ship here, then do so\r\n if(checkPlacement() == true) {\r\n updatePosColor();\r\n }\r\n}", "bubbleDown() {\n let index = 0;\n while(this.leftChild(index) && (this.leftChild(index) > this.items[index]) || this.rightChild(index) > this.items[index]) {\n let biggerIndex = this.leftChildIndex(index);\n if (this.rightChild(index) && this.rightChild(index) > this.items[biggerIndex]) {\n // if right is smaller, right swaps\n biggerIndex = this.rightChildIndex(index);\n }\n this.swap(biggerIndex, index);\n index = biggerIndex;\n }\n }", "updateMovement(){\n if(this.y < 1){\n this.speedY += this.maxSpeed\n }else if(this.y > 500){\n this.speedY -= this.maxSpeed\n } \n //collision detection, if hit a block, turn around\n if(this.x % 50===0 && this.y % 50 === 0){\n this.arrayLocation = (this.x/50 + this.y/50) + this.y/50 * 16\n }\n //only checks above and below as baddie only goes up or down\n for(let i = 0; i < this.game.brick.length; i++){\n if(this.game.brick[this.arrayLocation + 17]){\n if(this.game.brick[this.arrayLocation + 17].status && this.speedY > 0 || this.x % 50 !== 0){\n this.speedY = -this.maxSpeed\n }\n }\n if(this.game.brick[this.arrayLocation - 17]){\n if(this.game.brick[this.arrayLocation - 17].status && this.speedY < 0 || this.x % 50 !== 0){\n this.speedY = this.maxSpeed\n }\n }\n }\n \n this.y += this.speedY\n \n }", "update() {\n //since frameRate is set to 30 frames per second I use modulus\n // to check if a second has passed\n if (frameCount % 30 == 0) { //millis()-this.startTime>1000){\n for (var i = 0; i < this.enemies.length; i++) {\n var currentEnemy = this.enemies[i];\n\n //if conoly direction right check for boundary at width\n if (this.dir === 1) {\n if (currentEnemy.position.x + currentEnemy.size.x + this.speed >= width) {\n this.isDropping = true;\n }\n }\n\n //if conoly direction left check for boundary at 0\n if (this.dir === -1) {\n if (currentEnemy.position.x - this.speed <= 0) {\n this.isDropping = true;\n }\n }\n\n }\n this.shift();\n //TODO: check correct image on move based on boolean this.shift(this.direct ? 1 : 0); \n }\n }", "update(timeStep, screen, enemies, jump, moveLeft, moveRight) {\n\t\t// TODO need to special case out of bonds\n\n\t\tif (jump) { \n\t\t\tthis.jumpPressed() \n\t\t}\n\t\t//console.log(\"a \" +screen)\n\t\t//console.log(\"b \" +screen[this.y])\n\t\t//console.log(this.y + \",\" + this.x+3)\n\t\t//console.log(\"c \" + screen[this.y][this.x+3])\n\t\tif(screen[this.y][this.x+2] != true && screen[this.y][this.x+3] != true && screen[this.y][this.x+4] != true && screen[this.y][this.x+5] != true &&\n\t\t\tscreen[this.y][this.x+6] != true) {\n\t\t\t//this.y+=1\n\t\t\tthis.vy += this.gravity * timeStep\n\t\t}\n\t\tconsole.log(\"timestep: \" + timeStep)\n\t\tif (this.vy != 0) {\n\t\t\tthis.jumpTime += 1\n\t\t}\n\t\tif (this.y_speed != 0) {\n\n\t\t\tlet y_prev = this.y\n\t\t\tthis.y_pos += this.vy * timeStep\n\t\t\tthis.y = Math.floor(this.y_pos)\n\t\t\tif (this.vy > 0) {\n\n\t\t\t}\n\t\t\tif (!screen[this.y][this.x+3]) {\n\t\t\t\t//this.y+=1\n\t\t\t}\n\t\t\tlet y_delta = this.y\n\t\t\tconsole.log(\"up: \" + y_delta + \" / \" + y_prev)\n\t\t\tif (y_prev < this.y) {\n\t\t\t\tfor(y_delta; y_delta > y_prev; y_delta--) {\n\t\t\t\t\tif(screen[y_delta][this.x+3]) {\n\t\t\t\t\t\tthis.y = y_delta\n\t\t\t\t\t\tthis.vy = 0\n\t\t\t\t\t\tthis.jumpTime = 0\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse { // going up, e.g. old pos > new\n\t\t\t\tconsole.log(\"jump\")\n\t\t\t\t//delta is smaller\n\t\t\t\tfor(y_delta; y_delta <= y_prev; y_delta++) {\n\t\t\t\t\tif(screen[y_delta-12][this.x+3]) {\n\t\t\t\t\t\tthis.y = y_delta\n\t\t\t\t\t\tthis.vy = 0\n//\t\t\t\t\t\tthis.jumpTime = 0\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(screen[y_delta][this.x+3]) {\n\t\t\t\tthis.y = y_delta\n\t\t\t}\n\n\t\t\t// x\n\t\t\tif (moveLeft) {\n\t\t\t\tconsole.log(screen[this.y-1][this.x] + \" screen\")\n\t\t\t\tif (screen[this.y-1][this.x] == true && screen[this.y-2][this.x] != true && screen[this.y-3][this.x] != true) {\n\t\t\t\t\tthis.x-=1\n\t\t\t\t\tthis.y-=3\n\t\t\t\t}\n\t\t\t\telse if (screen[this.y-1][this.x] != true && screen[this.y-2][this.x] != true) {\n\t\t\t\t\tthis.x--\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (moveRight) {\n\t\t\t\tthis.x++\n\t\t\t}\n\n\n\t\t}\n\n\t\tif (this.triggerCountdown == 1) {\n\t\t\tthis.triggerCountdown = 0\t\n\t\t}\n\t\telse if (this.triggerCountdown > 1) {\n\t\t\tthis.triggerCountdown -= 1\n\t\t}\n\n\n\t\tif (this.dead == false && enemies != null) {\n\t\t\tthis.step++\n\t\t\tthis.x += this.speed\n\t\t\tif (this.hurtCountdown == 1) {\n\t\t\t\tthis.hurtCountdown -= 1\n\t\t\t}\n\t\t\tif (this.hurtCountdown > 1) {\n\t\t\t\tthis.hurtCountdown -= 1\n\t\t\t}\n\n\t\t\tfor(let i=0; i<enemies.length; i++) {\n\n\t\t\t\tlet dx = this.x - enemies[i].x\n\t\t\t\tlet dy = this.y - enemies[i].y\n\t\t\t\tlet distance = Math.sqrt(dx * dx + dy * dy)\n\t\t\t\tif (distance < (this.radius + enemies[i].radius)\n\t\t\t\t\t&& enemies[i].dead == false) {\n\t\t\t\t\t//enemies[i].damage(this.attack)\n\t\t\t\t\t//this.damage(1)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "moveItemUp(itemId){\n let index = -1;\n for(let i = 0; i < this.items.length; i++){\n if(this.items[i].id === Number(itemId)){\n index = i;\n break;\n }\n }\n let tempItem = this.items[index - 1];\n this.items[index - 1] = this.items[index];\n this.items[index] = tempItem;\n }", "moveItem(item) {\n var suit = item.suit;\n var value = item.value;\n var column;\n\n // Sets up local variables for the arrays for all the cards on the board\n var columns = [\n this.state.col_1,\n this.state.col_2,\n this.state.col_3,\n this.state.col_4,\n this.state.col_5,\n this.state.col_6,\n this.state.col_7\n ];\n // Sets up local variables for the arrays for all the cards on the upper dropzones\n var upColumns = {\n up_1: this.state.up_1,\n up_2: this.state.up_2,\n up_3: this.state.up_3,\n up_4: this.state.up_4\n };\n // Local variables for cards in the draw pile\n var upDrawCards = this.state.upDrawCards;\n var usedDrawCards = this.state.usedDrawCards;\n\n // Boolean variables that are true if the dragged card is in that collumn\n var inCol_1 = this.checkIfExists(columns[0], suit, value);\n var inCol_2 = this.checkIfExists(columns[1], suit, value);\n var inCol_3 = this.checkIfExists(columns[2], suit, value);\n var inCol_4 = this.checkIfExists(columns[3], suit, value);\n var inCol_5 = this.checkIfExists(columns[4], suit, value);\n var inCol_6 = this.checkIfExists(columns[5], suit, value);\n var inCol_7 = this.checkIfExists(columns[6], suit, value);\n\n // Boolean variables that are true if the dragged card is in that collumn of the upper dropzones\n var inUp_1 = this.checkIfExists(upColumns['up_1'], suit, value);\n var inUp_2 = this.checkIfExists(upColumns['up_2'], suit, value);\n var inUp_3 = this.checkIfExists(upColumns['up_3'], suit, value);\n var inUp_4 = this.checkIfExists(upColumns['up_4'], suit, value);\n\n // Boolean variable that are true if the dragged card is in the draw pile\n var inUsedDrawCards = this.checkIfExists(usedDrawCards, suit, value);\n\n // Checks that the move is valid\n if (item.column !== undefined && this.validMove(item)) {\n var index = item.index;\n column = item.column;\n var itemsToMove;\n\n // Removes the dropzones from all the stacks\n columns.map((_column, _index) => {\n return _column.map((item) => {\n return item.column !== undefined ? _column.length = (_column.length - 1) : null;\n });\n });\n\n // Standard move from one of the 7 columns on the main board\n if (!item.upperDrop && !inUp_1 && !inUp_2 && !inUp_3 && !inUp_4 && !inUsedDrawCards) {\n // Checks which column the dragged card came from\n if (inCol_1) {\n // Removes the card(s) from the column\n itemsToMove = columns[0].slice(index);\n columns[0].length = index;\n // If there's a card under the dragged card flips it over to be used\n if (columns[0][columns[0].length - 1] !== undefined) {\n columns[0][columns[0].length - 1].showBack = false;\n }\n // Follows same pattern as above \n } else if (inCol_2) {\n itemsToMove = columns[1].slice(index);\n columns[1].length = index;\n if (columns[1][columns[1].length - 1] !== undefined) {\n columns[1][columns[1].length - 1].showBack = false;\n }\n } else if (inCol_3) {\n itemsToMove = columns[2].slice(index);\n columns[2].length = index;\n if (columns[2][columns[2].length - 1] !== undefined) {\n columns[2][columns[2].length - 1].showBack = false;\n }\n } else if (inCol_4) {\n itemsToMove = columns[3].slice(index);\n columns[3].length = index;\n if (columns[3][columns[3].length - 1] !== undefined) {\n columns[3][columns[3].length - 1].showBack = false;\n }\n } else if (inCol_5) {\n itemsToMove = columns[4].slice(index);\n columns[4].length = index;\n if (columns[4][columns[4].length - 1] !== undefined) {\n columns[4][columns[4].length - 1].showBack = false;\n }\n } else if (inCol_6) {\n itemsToMove = columns[5].slice(index);\n columns[5].length = index;\n if (columns[5][columns[5].length - 1] !== undefined) {\n columns[5][columns[5].length - 1].showBack = false;\n }\n } else if (inCol_7) {\n itemsToMove = columns[6].slice(index);\n columns[6].length = index;\n if (columns[6][columns[6].length - 1] !== undefined) {\n columns[6][columns[6].length - 1].showBack = false;\n }\n } else {\n // If dragged card came from the draw pile instead of a standard pile\n itemsToMove = upDrawCards.slice(upDrawCards.length - 1);\n upDrawCards.length = upDrawCards.length - 1;\n }\n\n // Puts the dragged card into the new column to be rendered\n itemsToMove.map((_item) => {\n return columns[column - 1].push(_item);\n });\n // If dragged card came from one of the upper dropzones\n } else if (inUp_1 || inUp_2 || inUp_3 || inUp_4) {\n // Follows same logic pattern as above, just with a different set of columns\n if (inUp_1) {\n itemsToMove = upColumns['up_1'].slice(index);\n upColumns['up_1'].length = index;\n } else if (inUp_2) {\n itemsToMove = upColumns['up_2'].slice(index);\n upColumns['up_2'].length = index;\n } else if (inUp_3) {\n itemsToMove = upColumns['up_3'].slice(index);\n upColumns['up_3'].length = index;\n } else if (inUp_4) {\n itemsToMove = upColumns['up_4'].slice(index);\n upColumns['up_4'].length = index;\n }\n\n // Puts the dragged card into the new column to be rendered \n if (item.upperDrop) {\n itemsToMove.map((_item) => {\n _item.upperCard = false;\n return upColumns[column].push(_item);\n });\n } else {\n itemsToMove.map((_item) => {\n _item.upperCard = false;\n return columns[column - 1].push(_item);\n });\n }\n // If the card came from the pile of already overturned draw cards when depleting the 3 flipped cards\n } else if (inUsedDrawCards) {\n // Again, follows same logic as above just with different columns\n itemsToMove = usedDrawCards.slice(index);\n usedDrawCards.length = index;\n\n // If card is being dropped in upper dropzones\n if (item.upperDrop) {\n // Puts the dragged card into the new column to be rendered\n itemsToMove.map((_item) => {\n _item.usedDrawCard = false;\n _item.drawCard = false;\n _item.upperCard = true;\n return upColumns[column].push(_item);\n });\n // If card is going to 1 of the 7 standard columns\n } else {\n // Puts the dragged card into the new column to be rendered\n itemsToMove.map((_item) => {\n _item.usedDrawCard = false;\n _item.drawCard = false;\n return columns[column - 1].push(_item);\n });\n }\n // If the card is being dropped into one of the upper dropzones\n } else {\n // Follows same logic pattern as above, just with different columns\n if (inCol_1 && columns[0].slice(index).length === 1) {\n itemsToMove = columns[0].slice(index);\n columns[0].length = index;\n if (columns[0][columns[0].length - 1] !== undefined) {\n columns[0][columns[0].length - 1].showBack = false;\n }\n } else if (inCol_2 && columns[1].slice(index).length === 1) {\n itemsToMove = columns[1].slice(index);\n columns[1].length = index;\n if (columns[1][columns[1].length - 1] !== undefined) {\n columns[1][columns[1].length - 1].showBack = false;\n }\n } else if (inCol_3 && columns[2].slice(index).length === 1) {\n itemsToMove = columns[2].slice(index);\n columns[2].length = index;\n if (columns[2][columns[2].length - 1] !== undefined) {\n columns[2][columns[2].length - 1].showBack = false;\n }\n } else if (inCol_4 && columns[3].slice(index).length === 1) {\n itemsToMove = columns[3].slice(index);\n columns[3].length = index;\n if (columns[3][columns[3].length - 1] !== undefined) {\n columns[3][columns[3].length - 1].showBack = false;\n }\n } else if (inCol_5 && columns[4].slice(index).length === 1) {\n itemsToMove = columns[4].slice(index);\n columns[4].length = index;\n if (columns[4][columns[4].length - 1] !== undefined) {\n columns[4][columns[4].length - 1].showBack = false;\n }\n } else if (inCol_6 && columns[5].slice(index).length === 1) {\n itemsToMove = columns[5].slice(index);\n columns[5].length = index;\n if (columns[5][columns[5].length - 1] !== undefined) {\n columns[5][columns[5].length - 1].showBack = false;\n }\n } else if (inCol_7 && columns[6].slice(index).length === 1) {\n itemsToMove = columns[6].slice(index);\n columns[6].length = index;\n if (columns[6][columns[6].length - 1] !== undefined) {\n columns[6][columns[6].length - 1].showBack = false;\n }\n } else {\n // If it came from the draw cards\n if (upDrawCards.slice(upDrawCards.length - 1).length === 1) {\n itemsToMove = upDrawCards.slice(upDrawCards.length - 1);\n upDrawCards.length = upDrawCards.length - 1;\n }\n }\n\n // Puts the dragged card into the new column to be rendered\n itemsToMove.map((_item) => {\n _item.upperCard = true;\n return upColumns[column].push(_item);\n });\n }\n // If the move isn't valid\n } else {\n // Checks if there's a dropzone in that column\n if (inCol_1) { column = 1 }\n if (inCol_2) { column = 2 }\n if (inCol_3) { column = 3 }\n if (inCol_4) { column = 4 }\n if (inCol_5) { column = 5 }\n if (inCol_6) { column = 6 }\n if (inCol_7) { column = 7 }\n\n // Removes all dropzones\n columns.map((_column, _index) => {\n return _column.map((item) => {\n return item.column !== undefined ? _column.length = (_column.length - 1) : null;\n });\n });\n }\n\n this.setState({\n col_1: columns[0],\n col_2: columns[1],\n col_3: columns[2],\n col_4: columns[3],\n col_5: columns[4],\n col_6: columns[5],\n col_7: columns[6],\n up_1: upColumns['up_1'],\n up_2: upColumns['up_2'],\n up_3: upColumns['up_3'],\n up_4: upColumns['up_4'],\n usedDrawCards: usedDrawCards,\n showUpperDrops: false\n });\n\n if (this.state.up_1.length === 13 && this.state.up_2.length === 13 && this.state.up_3.length === 13 && this.state.up_4.length === 13) {\n this.finishWinningGame();\n }\n }", "function movePlayerDown(playerPiece){\n\tlet change = 1;\n\tfor(let i = 0; i < playerPiece.piece.piece.length; i++){\n\t\tfor(let j = 0; j < playerPiece.piece.piece[i].length; j++){\n\t\t\tif(!playerPiece.piece.piece[i][j].isEmpty()){\n\t\t\t\tif(playerPiece.y-(change)-i-playerPiece.piece.centerY >= 0 && b.board[playerPiece.y-(change)-i-playerPiece.piece.centerY]===undefined){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\twhile(playerPiece.y-(change)-i-playerPiece.piece.centerY < 0 || playerPiece.y-(change)-i-playerPiece.piece.centerY >= b.HEIGHT || !b.board[playerPiece.y-(change)-i-playerPiece.piece.centerY][playerPiece.x-j-playerPiece.piece.centerX].isEmpty()){\n\t\t\t\t\tchange -= 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tplayerPiece.y -= change;\n\n\t//place piece down\n\tif(change !== 1){\n\t\tif(framesUntilPlace === 0){\n\t\t\tfor(let i = 0; i < playerPiece.piece.piece.length; i++){\n\t\t\t\tfor(let j = 0; j < playerPiece.piece.piece[i].length; j++){\n\t\t\t\t\tif(!playerPiece.piece.piece[i][j].isEmpty()){\n\t\t\t\t\t\tif(playerPiece.y-i-playerPiece.piece.centerY >= b.HEIGHT){\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tb.board[playerPiece.y-i-playerPiece.piece.centerY][playerPiece.x-j-playerPiece.piece.centerX] = playerPiece.piece.piece[i][j];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcanSwap = true;\n\t\t\tsetPlayerPiece(playerQueue('pop'));\n\t\t\tupdateQueueVisual();\n\n\t\t\tscore += 1;\n\t\t\tlet badPieceCounter = 0;\n\t\t\tfor(let i = 0; i < playerPiece.piece.piece.length; i++){\n\t\t\t\tfor(let j = 0; j < playerPiece.piece.piece[i].length; j++){\n\t\t\t\t\tif(!playerPiece.piece.piece[i][j].isEmpty()){\n\t\t\t\t\t\tif (playerPiece.y-i-playerPiece.piece.centerY >= b.HEIGHT){\n\t\t\t\t\t\t\tif(!b.board[b.HEIGHT - 1][playerPiece.x-j-playerPiece.piece.centerX].isEmpty()){\n\t\t\t\t\t\t\t\tbadPieceCounter += 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(playerPiece.y-i-playerPiece.piece.centerY < b.HEIGHT && !b.board[playerPiece.y-i-playerPiece.piece.centerY][playerPiece.x-j-playerPiece.piece.centerX].isEmpty()){\n\t\t\t\t\t\t\tbadPieceCounter += 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(badPieceCounter >= 1){\n\t\t\t\tfor(let i = 0; i < playerPiece.piece.piece.length; i++){\n\t\t\t\t\tfor(let j = 0; j < playerPiece.piece.piece[i].length; j++){\n\t\t\t\t\t\twhile(playerPiece.y-i-playerPiece.piece.centerY < b.HEIGHT && !b.board[playerPiece.y-i-playerPiece.piece.centerY][playerPiece.x-j-playerPiece.piece.centerX].isEmpty()){\n\t\t\t\t\t\t\tplayerPiece.y += 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\tframesUntilPlace--;\n\t\t}\n\t} else {\n\t\tframesUntilPlace = 1;\n\t}\n\treturn false;\n}", "function movement() {\r\n if (cursors.left.isDown) {\r\n player.body.velocity.x = -150;\r\n keyLeftPressed.animations.play(\"leftArrow\");\r\n }\r\n if (cursors.right.isDown) {\r\n player.body.velocity.x = 150;\r\n keyRightPressed.animations.play(\"rightArrow\");\r\n }\r\n\r\n if (player.body.velocity.x > 0) {\r\n player.animations.play(\"right\");\r\n } else if (player.body.velocity.x < 0) {\r\n player.animations.play(\"left\");\r\n } else {\r\n player.animations.play(\"turn\");\r\n }\r\n if (cursors.up.isDown && player.body.onFloor()) {\r\n player.body.velocity.y = -290;\r\n keyUpPressed.animations.play(\"upArrow\");\r\n jumpSound.play();\r\n jumpSound.volume = 0.15;\r\n }\r\n }", "update(dt) {\n if (this.alive)\n {\n if (this.walkLeft === true) {\n if (this.pos.x <= this.startX) {\n // if reach start position\n this.walkLeft = false;\n this.flipX(false);\n } else {\n this.body.force.x = -this.body.maxVel.x;\n }\n }\n\n if (this.walkLeft === false) {\n if (this.pos.x >= this.endX) {\n // if reach the end position\n this.walkLeft = true;\n this.flipX(true);\n } else {\n this.body.force.x = this.body.maxVel.x;\n }\n }\n }\n\n // return true if we moved or if the renderable was updated\n return (super.update(dt) || this.body.vel.x !== 0 || this.body.vel.y !== 0);\n }", "function moveItem () {\n if (birdsTapped === 0) {\n timerControl.play(1, 0.0);\n timeoutEvent.reset(10);\n }\n script.item.getTransform().setWorldPosition(randomPosition());\n birdsTapped++;\n counterControl.pauseAtFrame(birdsTapped);\n}", "canMoveDown() {\n if(!this.downKey.isDown || this.verticalLock) {\n return false;\n }\n else if(this.pairIsVertical) {\n if(this.puyo1y > this.puyo2y) {\n if(this.puyo1y < this.rows-1\n && this.grid[this.puyo1y+1][this.puyo1x] === 0) {\n return true;\n }\n else if(this.puyo1y < this.rows-1\n && this.grid[this.puyo1y+1][this.puyo1x] != 0) {\n this.prepareSpawn();\n return false;\n }\n else if(this.puyo1y == this.rows-1) {\n this.prepareSpawn();\n return false;\n }\n }\n else {\n if(this.puyo2y < this.rows-1\n && this.grid[this.puyo2y+1][this.puyo2x] === 0) {\n return true;\n }\n else if(this.puyo2y < this.rows-1\n && this.grid[this.puyo2y+1][this.puyo2x] != 0) {\n this.prepareSpawn();\n return false;\n }\n else if(this.puyo2y == this.rows-1) {\n this.prepareSpawn();\n return false;\n }\n }\n }\n else {\n if(this.puyo1y < this.rows-1\n && this.grid[this.puyo1y+1][this.puyo1x] === 0\n && this.grid[this.puyo2y+1][this.puyo2x] === 0) {\n return true;\n }\n else if(this.puyo1y < this.rows-1\n && (this.grid[this.puyo1y+1][this.puyo1x] != 0\n || this.grid[this.puyo2y+1][this.puyo2x] != 0)) {\n //If a block is hanging, drop it\n if(this.grid[this.puyo1y+1][this.puyo1x] === 0) {\n this.dropBlock(this.puyo1x, this.puyo1y);\n }\n else if(this.grid[this.puyo2y+1][this.puyo2x] === 0) {\n this.dropBlock(this.puyo2x, this.puyo2y);\n }\n this.prepareSpawn();\n return false;\n }\n else if(this.puyo1y == this.rows-1) {\n this.prepareSpawn();\n return false;\n }\n }\n }", "function moveUp() {\n if (images.bird.yPos > 25) {\n images.bird.yPos -= 25;\n }\n sounds.fly.play();\n }", "preUpdate(time, deltaTime){\n super.preUpdate(time, deltaTime);\n\n //moves based on directionTracker parent class property\n this.manageMovement(\"demon-big-idle\", \"demon-big-run\"); \n }", "_survivalMove() {\n for (let i=0; i<3; i++) {\n if (!this.cells[i+3].isDead && this.cells[i].isDead) {\n if (!this.cells[i+6].isDead) this._survivalMove_rotCells(i,i+3,i+6);\n else this._survivalMove_swapCells(i, i+3);\n } else\n if (!this.cells[i+6].isDead && this.cells[i+3].isDead) {\n if (this.cells[i].isDead) this._survivalMove_swapCells(i, i+6);\n else this._survivalMove_swapCells(i+3, i+6);\n }\n }\n }", "handleKeys() {\n this.xMove = 0;\n\t\tthis.yMove = 0;\n if (keyIsDown(65)) this.xMove += -this.speed;\n if (keyIsDown(68)) this.xMove += this.speed;\n //s\n if (keyIsDown(83)) this.yMove += this.speed;\n //w\n if (keyIsDown(87)) this.yMove += -this.speed;\n\n if (keyIsDown(32)) {\n this.placeBomb();\n }\n\n }", "function playerDrop(){\n player.pos.y++;\n //if block has reached bottom send it back up\n if(collide(arena, player)){\n player.pos.y--;\n merge(arena, player);\n playerReset();\n arenaSweep();\n updateScore();\n }\n dropCounter = 0;\n}", "function newFrame() {\n //update position of game item for animation \nrepositionGameItem();\n//check for collision \n \n }", "function downPropogate(){\n newPosition = ghostPosition + options[3]\n newGhostDirection = directions[3]\n if (!canMove()) {\n let randomIndex = Math.floor(Math.random()*2)+1\n newPosition = ghostPosition + options[randomIndex]\n newGhostDirection = directions[randomIndex]\n if (!canMove()){\n randomIndex = (randomIndex===1) ? 2:1\n newPosition = ghostPosition + options[randomIndex]\n newGhostDirection = directions[randomIndex]\n if (!canMove()){\n newPosition = ghostPosition + options[0]\n newGhostDirection = directions[0]\n }\n }\n }\n }", "function movedown(){\n undraw();\n currentposition+=GRID_WIDTH;\n draw();\n freeze();\n console.log(down);\n }", "function moveDown() {\n\n}", "update() {\n if (this.health <= 0) {\n this.game.addEntity(this.game.makeDeathMenu());\n\n\n return;\n }\n\n if (!this.stopMoving) {\n let totalDistance = this.speed;\n\n if (this.game.cast && !this.casting) {\n if (!this.chargingSpellSound.playing(this.chargingSpellSoundId)) {\n this.chargingSpellSound.play();\n }\n this.casting = true;\n }\n\n if (!this.casting && !this.game.cast) {\n if (this.game.keys[\"KeyD\"].pressed && this.blockedDirection[4] !== true) {\n facingDirection = \"right\";\n this.walkingRight = true;\n } else {\n this.walkRightAnimation.elapsedTime = 0;\n this.walkingRight = false;\n }\n\n if (this.game.keys[\"KeyA\"].pressed && this.blockedDirection[3] !== true) {\n facingDirection = \"left\";\n this.walkingLeft = true;\n } else {\n this.walkLeftAnimation.elapsedTime = 0;\n this.walkingLeft = false;\n }\n\n if (this.game.keys[\"KeyW\"].pressed && this.blockedDirection[1] !== true) {\n facingDirection = \"up\";\n this.walkingForward = true;\n } else {\n this.walkForwardAnimation.elapsedTime = 0;\n this.walkingForward = false;\n }\n\n if (this.game.keys[\"KeyS\"].pressed && this.blockedDirection[2] !== true) {\n facingDirection = \"down\";\n this.walkingDownward = true;\n } else {\n this.walkDownwardAnimation.elapsedTime = 0;\n this.walkingDownward = false;\n }\n\n if (this.game.keys[\"Space\"].pressed && !this.swinging) {\n this.swinging = true;\n }\n\n if (this.game.keys[\"KeyE\"].pressed) {\n this.raising = true;\n } else {\n this.raising = false;\n }\n }\n\n\n if (this.casting && !this.game.cast) {\n if (this.chargingSpellSound.playing(this.chargingSpellSoundId)) {\n this.chargingSpellSound.stop();\n }\n this.castSpellDownwardAnimation.elapsedTime = 0;\n this.castSpellForwardAnimation.elapsedTime = 0;\n this.castSpellLeftAnimation.elapsedTime = 0;\n this.castSpellRightAnimation.elapsedTime = 0;\n this.casting = false;\n }\n\n if (castSuccessful) {\n castSuccessful = false;\n this.newX = this.x;\n this.newY = this.y;\n\n\n if(this.spellsRemaining[this.spellCombo] !== 0) {\n switch (this.spellCombo) {\n case \"WWAD\":\n let newPos = this.chooseFireballDirection();\n this.newX = newPos.newX;\n this.newY = newPos.newY;\n ASSET_MANAGER.playSound(\"../snd/fireball.mp3\");\n let spell = new Projectile(this.game, this.currentSpellAnimation, facingDirection, this.newX, this.newY, this, this);\n spell.setProjectileSpeed = 2;\n this.game.addEntity(spell);\n this.currentSpellAnimation.elapsedTime = 0;\n break;\n case \"SADW\":\n let light = new LightSpell(this.game, this.newX, this.newY - 60);\n this.game.addEntity(light);\n this.lightSpellsRemaining--;\n break;\n case \"WDAD\":\n let freeze = new FreezeSpell(this.game, this.newX - 256 / 2 + 30, this.newY - 256 / 2 + 20);\n this.game.addEntity(freeze);\n break;\n case \"ADSW\":\n let heal = new HealSpell(this.game, this.newX, this.newY - 20);\n this.game.addEntity(heal);\n break;\n }\n //Subtract the number of spells remaining by 1. Spells that can be used infinitely are -1 already.\n this.spellsRemaining[this.spellCombo]--;\n }\n this.spellCombo = \"\";\n }\n\n if (this.walkingRight) {\n //Stop player from moving off screen right\n if (!this.offRight) {\n let distance = totalDistance;\n this.x += distance;\n playerStartX = this.x - distance;\n }\n }\n\n if (this.walkingLeft) {\n //Stop player from going off left side of the screen\n if (!this.offLeft) {\n let distance = totalDistance;\n this.x -= distance;\n playerStartX = this.x + distance;\n }\n }\n\n if (this.walkingForward) {\n //Stop player from moving off screen from the top\n if(!this.offTop) {\n let distance = totalDistance;\n this.y -= distance;\n playerStartY = this.y + distance;\n }\n }\n\n if (this.walkingDownward) {\n //Stop player from going off screen from the bottom\n if (!this.offBottom) {\n let distance = totalDistance;\n this.y += distance;\n playerStartY = this.y - distance;\n }\n }\n\n\n if ((this.walkingForward || this.walkingDownward\n || this.walkingLeft || this.walkingRight)\n && !this.walkingSound.playing(this.walkingSoundId)) {\n this.walkingSound.play()\n } else {\n if (this.walkingSound.playing(this.walkingSoundId))\n this.walkingSound.pause()\n }\n\n\n //shooting bolt\n if (this.shooting) {\n ASSET_MANAGER.getAsset(\"../snd/crossbow.wav\").play();\n if (this.shootBoltDownwardAnimation.isDone()) {\n this.shootBoltDownwardAnimation.elapsedTime = 0;\n this.shooting = false;\n shoot = false;\n }\n if (this.shootBoltForwardAnimation.isDone()) {\n this.shootBoltForwardAnimation.elapsedTime = 0;\n this.shooting = false;\n shoot = false;\n }\n if (this.shootBoltLeftAnimation.isDone()) {\n this.shootBoltLeftAnimation.elapsedTime = 0;\n this.shooting = false;\n shoot = false;\n }\n if (this.shootBoltRightAnimation.isDone()) {\n this.shootBoltRightAnimation.elapsedTime = 0;\n this.shooting = false;\n shoot = false;\n }\n }\n\n\n //swinging sword\n if (this.swinging) {\n ASSET_MANAGER.getAsset(\"../snd/sword_woosh.wav\").play();\n\n if (this.swingDownwardAnimation.isDone() || this.swingForwardAnimation.isDone() || this.swingLeftAnimation.isDone()\n || this.swingRightAnimation.isDone()) {\n\n this.swingDownwardAnimation.elapsedTime = 0;\n this.swingForwardAnimation.elapsedTime = 0;\n this.swingLeftAnimation.elapsedTime = 0;\n this.swingRightAnimation.elapsedTime = 0;\n this.swinging = false;\n\n let collisions = this.getCollisions({collisionBounds: this.swingBox}, this.game.enemies);\n\n if(!this.hasCollided({collisionBounds: this.swingBox}, this.game.walls)) {\n for(let i = 0; i < collisions.length; i++) {\n let enemy = collisions[i];\n if(!(enemy instanceof GraveWraith)) {\n enemy.smack(this.swordDamage, 15, facingDirection, 1);\n }\n\n }\n }\n }\n }\n\n //swinging sword\n if (this.raising) {\n let hasBlocked = false;\n let enemyCollisions = this.getCollisions({collisionBounds: this.blockBox}, this.game.enemies);\n for(let i = 0; i < enemyCollisions.length; i++) {\n let enemy = enemyCollisions[i];\n if (enemy instanceof Projectile) {\n enemy.removal = true;\n }\n hasBlocked = true;\n }\n\n let projectileCollisions = this.getCollisions({collisionBounds: this.blockBox}, this.game.projectiles);\n for(let i = 0; i < projectileCollisions.length; i++) {\n let projectile = projectileCollisions[i];\n projectile.removal = true;\n hasBlocked = true;\n }\n\n if (hasBlocked) {\n ASSET_MANAGER.getAsset(\"../snd/shield_block.wav\").play();\n }\n }\n\n\n //Control Bounds\n let bounds = 394.5;\n\n this.offRight = this.x > $(\"#gameWorld\").width() - bounds && this.walkingRight;\n\n this.offLeft = this.x < bounds && this.walkingLeft;\n\n this.offTop = this.y < bounds && this.walkingForward;\n\n this.offBottom = this.y > $(\"#gameWorld\").height() - bounds && this.walkingDownward;\n\n //Update the swing box if not swinging\n if (!this.swinging) {\n this.swingBox.x = this.x + 30;\n this.swingBox.y = this.y + 30;\n this.swingBox.height = 5;\n this.swingBox.width = 5;\n }\n\n //Update the swing box if not swinging\n if (!this.raising) {\n this.blockBox.x = this.x + 30;\n this.blockBox.y = this.y + 30;\n this.blockBox.height = 5;\n this.blockBox.width = 5;\n }\n\n if(this.hasCollidedWithWalls()) {\n this.x = this.lastX;\n this.y = this.lastY;\n this.offLeft = false;\n this.offRight = false;\n this.offBottom = false;\n this.offTop = false;\n } else {\n this.lastX = this.x;\n this.lastY = this.y;\n }\n\n bounds = {\n collisionBounds: {\n x: this.collisionBounds.x,\n y: this.collisionBounds.y,\n width: this.collisionBounds.width,\n height: this.collisionBounds.height\n }\n };\n if(this.hasCollided(bounds, this.game.enemies)) {\n if (this.y <= this.collidedObject.y && this.pos > this.collidedObject.pos) {\n this.game.swap(this, this.collidedObject);\n } else if (this.y > this.collidedObject.y && this.pos < this.collidedObject.pos) {\n this.game.swap(this, this.collidedObject);\n }\n }\n\n super.update();\n }\n\n }", "update(dt) {\n\t\t// if we go just off canvas on right edge\n\t\tif (this.x >= (gameBoard.rightEdge + gameBoard.cellWidth)) {\n\t\t\t// move back to the left edge of the board\n\t\t\tthis.x = gameBoard.leftEdge;\n\t\t} else {\n\t\t\t// move the bug along\n\t\t\tthis.x = this.x + (this.speed * dt);\n\n\t\t\t//check for collisions\n\t\t\tconst playerCords = player.getCords();\n\t\t\t(this.y - 12) === playerCords.y ? this.checkCollisions(playerCords) : null\n\t\t}\n\t}", "function moveUp() {\r\n var min = 99;\r\n for(index of shipArray) {\r\n if(min > index) {\r\n min = index;\r\n }\r\n }\r\n if(min > 9) {\r\n for(i in shipArray) {\r\n shipArray[i] = shipArray[i] - 10;\r\n }\r\n }\r\n //If it is possible to move the ship here, then do so\r\n if(checkPlacement() == true) {\r\n updatePosColor();\r\n }\r\n}", "function moveDownPlacingPiece(){\n \n var blockBelow = false;\n \n \n for(var i = 0; i < placingPiece.length && !blockBelow; i++){\n \n if(placingPiece[i].ypos + 1 >= GAME_BOARD_HEIGHT){\n \n //we're going to hit the floor!\n blockBelow = true;\n break;\n }else{\n //let's check if there's another block below us that is placed already\n for(var j = 0; j < placedPieces.length; j++){\n if(placedPieces[j].xpos == placingPiece[i].xpos && placedPieces[j].ypos == placingPiece[i].ypos + 1){\n //there's a block below us\n blockBelow = true;\n break;\n }\n }\n }\n }\n \n if(!blockBelow){\n for(var i = 0; i < placingPiece.length; i++){\n //move the placing piece down by one\n placingPiece[i].ypos += 1;\n if(placingPiece[i].ypos >= GAME_BOARD_HEIGHT) placingPiece[i].ypos = GAME_BOARD_HEIGHT;\n }\n redrawAllBlocks()\n }else{\n //place the piece and get us another one\n //addPiece() will take care of unloading the current piece\n addPiece();\n }\n \n \n \n return true;\n}", "move(){\n if (keyIsDown (LEFT_ARROW) ) {\n this.pos.x -= this.speed;\n } \n if (keyIsDown(RIGHT_ARROW) ) {\n this.pos.x += this.speed;\n } \n if (keyIsDown (UP_ARROW) ) {\n this.pos.y -= this.speed;\n } \n if (keyIsDown (DOWN_ARROW) ) {\n this.pos.y += this.speed;\n }\n }", "function moveup() {\r\n player.dy = -player.speed;\r\n}", "function playerDrop(){\n player.pos.y++;\n //check if it collide agains any other \n //already set piece or again the bottom wall\n if(collide(arena, player)){\n player.pos.y--;\n merge(arena, player);\n playerReset();\n arenaSweep();\n updateScore();\n player.pos.y = 0;\n }\n dropCounter = 0;\n}", "function checkExtraForcedJumpAndReact(){\r\n expectedOldPositionX = newPositionX;\r\n expectedOldPositionY = newPositionY;\r\n if(ExtraForcedJump(parseInt(expectedOldPositionX), parseInt(expectedOldPositionY))) {\r\n isExtraForcedJump = true;\r\n announcePlayerExtraForcedJump();\r\n document.getElementById(\"chessBoard\").removeEventListener(\"dragover\", destinationEvent);\r\n document.getElementById(\"chessBoard\").addEventListener(\"drag\", originalLocationEvent);\r\n }\r\n}", "processMoveItemUp(itemArgs) {\n // stop propagation\n event.stopPropagation();\n\n if (itemArgs == 0 ) {\n\n } else {\n // itemArgs is the item card index\n let listBeingEdited = window.todo.model.listToEdit;\n let itemsArray = listBeingEdited.items;\n // swap\n // A is item at itemArgs\n // B, A. temp = B\n // A, A\n // A, temp = B\n let prevIndex = Number(itemArgs) - 1;\n let temp = listBeingEdited.getItemAtIndex(prevIndex);\n itemsArray[prevIndex] = listBeingEdited.getItemAtIndex(itemArgs);\n itemsArray[itemArgs] = temp;\n // update list\n window.todo.model.loadList(listBeingEdited.getName());\n }\n }", "function updateSnakeMovement() {\n let newPos = {x: snake.history[0].x, y: snake.history[0].y};\n toBeClearedFields.push(snake.history.pop());\n if (command !== null) {\n switch (command) {\n case \"LEFT\":\n newPos.x--;\n break;\n case \"UP\":\n newPos.y--;\n break;\n case \"RIGHT\":\n newPos.x++;\n break;\n case \"DOWN\":\n newPos.y++;\n break;\n }\n }\n snake.history.unshift(newPos);\n }", "function checkHeldKeys() {\n\n if (downIsHeld) {\n ship.moveDown();\n }\n if (upIsHeld) {\n ship.moveUp();\n }\n if (rightIsHeld) {\n ship.moveRight();\n }\n if (leftIsHeld) {\n ship.moveLeft();\n }\n\n}", "function move(e) {\n switch (e.event.code) {\n case 'Numpad1':\n if (\n player.detectCollision(\n player.sprite.x - player.tile_size.w,\n player.sprite.y + player.tile_size.w\n ) == 2 &&\n !player.disableControl\n ) {\n player.sprite.x -= player.tile_size.w;\n player.sprite.y += player.tile_size.w;\n player.doStep();\n }\n break;\n case 'ArrowDown':\n if (\n player.detectCollision(\n player.sprite.x,\n player.sprite.y + player.tile_size.w\n ) == 2 &&\n !player.disableControl\n ) {\n player.sprite.y += player.tile_size.w;\n player.doStep();\n }\n break;\n case 'Numpad3':\n if (\n player.detectCollision(\n player.sprite.x + player.tile_size.w,\n player.sprite.y + player.tile_size.w\n ) == 2 &&\n !player.disableControl\n ) {\n player.sprite.x += player.tile_size.w;\n player.sprite.y += player.tile_size.w;\n player.doStep();\n }\n break;\n case 'ArrowLeft':\n if (\n player.detectCollision(\n player.sprite.x - player.tile_size.w,\n player.sprite.y\n ) == 2 &&\n !player.disableControl\n ) {\n player.sprite.x -= player.tile_size.w;\n player.doStep();\n }\n break;\n case 'ArrowRight':\n if (\n player.detectCollision(\n player.sprite.x + player.tile_size.w,\n player.sprite.y\n ) == 2 &&\n !player.disableControl\n ) {\n player.sprite.x += player.tile_size.w;\n player.doStep();\n }\n break;\n case 'Numpad7':\n if (\n player.detectCollision(\n player.sprite.x - player.tile_size.w,\n player.sprite.y - player.tile_size.w\n ) == 2 &&\n !player.disableControl\n ) {\n player.sprite.x -= player.tile_size.w;\n player.sprite.y -= player.tile_size.w;\n player.doStep();\n }\n break;\n case 'ArrowUp':\n if (\n player.detectCollision(\n player.sprite.x,\n player.sprite.y - player.tile_size.w\n ) == 2 &&\n !player.disableControl\n ) {\n player.sprite.y -= player.tile_size.w;\n player.doStep();\n }\n break;\n case 'Numpad9':\n if (\n player.detectCollision(\n player.sprite.x + player.tile_size.w,\n player.sprite.y - player.tile_size.w\n ) == 2 &&\n !player.disableControl\n ) {\n player.sprite.x += player.tile_size.w;\n player.sprite.y -= player.tile_size.w;\n player.doStep();\n }\n break;\n }\n }", "autoMovement(du) {\n if (this.isDead) return;\n\n const diffX = this.knight.x - this.x;\n\n let collidesWithKnight = this.collidesWithKnight();\n\n //Follow\n if(Math.abs(diffX) > this.walkSpeed * du && !collidesWithKnight) {\n //Move x direction\n if( diffX > 0) {\n this.isIdle = false;\n this.dirX = 1;\n this.x += this.walkSpeed*du;\n }else {\n this.isIdle = false;\n this.dirX = -1;\n this.x -= this.walkSpeed*du;\n }\n }\n // If knight is hit\n if(collidesWithKnight) {\n this.isIdle = false;\n this.isAttacking = true;\n this.knight.health.depleteLifePoints();\n }\n }", "moveDown() {\n if (this.y === this.tape.length - 1) {\n this.y = 0;\n } else {\n this.y++;\n }\n }", "function modMoveUp(evt){\n //update steamAnswer,\n //update launcherConfig\n //update table view\n steamid = $(this).attr('data-steamid')\n for(i in launcherConfig['WorkshopItems']){\n if(launcherConfig['WorkshopItems'][i][0] == steamid){\n //cant move the item up if its the first one\n if(i == 0) return\n\n //swap items it steamAnswer\n tmpSAItem = steamAnswer['publishedfiledetails'][i]\n steamAnswer['publishedfiledetails'][i] = steamAnswer['publishedfiledetails'][i-1]\n steamAnswer['publishedfiledetails'][i-1] = tmpSAItem\n\n //swap items in launcherConfig\n tmpLCItem = launcherConfig['WorkshopItems'][i]\n launcherConfig['WorkshopItems'][i] = launcherConfig['WorkshopItems'][i-1]\n launcherConfig['WorkshopItems'][i-1] = tmpLCItem\n\n $table = $('#mods-table')\n\n var tableRow = JSON.parse(JSON.stringify($table.bootstrapTable('getData', {\"unfiltered\": true} )[i]))\n var tableRowPrev = JSON.parse(JSON.stringify($table.bootstrapTable('getData', {\"unfiltered\": true})[i-1]))\n tableRow['id'] = (i-1).toString()\n tableRowPrev['id'] = i\n $table.bootstrapTable('updateRow', {index: i, row: tableRowPrev})\n $table.bootstrapTable('updateRow', {index: i-1, row: tableRow})\n $table.bootstrapTable('toggleDetailView', i-1)\n var offset = $('.mod-move-down').offset()\n var height = $('.mod-move-down').height()\n y = evt.pageY - (offset.top + height/2)\n console.log(y)\n window.scrollBy(0, -y)\n SaveConfig()\n return\n }\n }\n}", "downer(velocity = 0) {\n this.jumping = false;\n this.velocityY = velocity;\n }", "function CheckIfBoundary ()\r\n{\r\n\r\n\t// If we are moving to the right\r\n\tif (isRight)\r\n\t{\r\n\t\t\r\n\t\t// translate the DeLorean so that it is pushed to left (blocked)\r\n\t\t// left = 0.1 to the left \r\n\t\ttransform.Translate (Vector3 (-0.1f, 0f, 0f));\r\n\t\t\r\n\t}\r\n\t// If we are moving to the right\r\n\telse if (isLeft)\r\n\t{\r\n\t\t\r\n\t\t// translate the DeLorean so that it is pushed to right (blocked)\r\n\t\t// right = 0.1 to the right (-0.1)\r\n\t\ttransform.Translate (Vector3 (0.1f, 0f, 0f));\r\n\t\t\t\r\n\t}\r\n\t// IF we are moving upwards\r\n\telse if (isUp)\r\n\t{\r\n\t\t\r\n\t\t// translate the DeLorean so that it is pushed down (blocked)\r\n\t\t// down = 0.1 downwards (0.1)\r\n\t\ttransform.Translate (Vector3 (0f, -0.1f, 0f));\r\n\t\t\r\n\t}\r\n\t// If we are moving downwards\r\n\telse if (isDown)\r\n\t{\r\n\t\t\t\r\n\t\t// translate the DeLorean so that it is pushed to up (blocked)\r\n\t\t// up = 0.1 upwards\r\n\t\ttransform.Translate (Vector3 (0f, 0.1f, 0f));\r\n\t\t\r\n\t}\r\n\r\n}", "function moveMario(me) {\n // Not jumping\n if(!me.keys.up) me.keys.jump = 0;\n \n // Jumping\n else if(me.keys.jump > 0 && (me.yvel <= 0 || map.underwater) ) {\n if(map.underwater) marioPaddles(me);\n if(me.resting) {\n if(me.resting.xvel) me.xvel += me.resting.xvel;\n me.resting = false;\n }\n // Jumping, not resting\n else {\n if(!me.jumping && !map.underwater) {\n switchClass(me, \"running skidding\", \"jumping\");\n }\n me.jumping = true;\n }\n if(!map.underwater) {\n var dy = unitsize / (pow(++me.keys.jumplev, map.jumpmod - .0014 * me.xvel));\n me.yvel = max(me.yvel - dy, map.maxyvelinv);\n }\n }\n \n // Crouching\n if(me.keys.crouch && !me.crouching && me.resting) {\n if(me.power != 1) {\n me.crouching = true;\n addClass(me, \"crouching\");\n me.height = 11;\n me.tolyold = me.toly;\n me.toly = unitsizet4;\n updateBottom(me, 0);\n updateSize(me);\n }\n // Pipe movement\n if(me.resting.actionTop)\n me.resting.actionTop(me, me.resting, me.resting.transport);\n }\n \n // Running\n var decel = 0 ; // (how much to decrease)\n // If a button is pressed, hold/increase speed\n if(me.keys.run != 0 && !me.crouching) {\n var dir = me.keys.run,\n // No sprinting underwater\n sprinting = (me.keys.sprint && !map.underwater) || 0,\n adder = dir * (.098 * (sprinting + 1));\n // Reduce the speed, both by subtracting and dividing a little\n me.xvel += adder || 0;\n me.xvel *= .98;\n decel = .0007;\n // If you're accelerating in the opposite direction from your current velocity, that's a skid\n if(/*sprinting && */signBool(me.keys.run) == me.moveleft) {\n if(!me.skidding) {\n addClass(me, \"skidding\");\n me.skidding = true;\n }\n }\n // Otherwise make sure you're not skidding\n else if(me.skidding) {\n removeClass(me, \"skidding\");\n me.skidding = false;\n }\n }\n // Otherwise slow down a bit/*, with a little more if crouching*/\n else {\n me.xvel *= (.98/* - Boolean(me.crouching) * .07*/);\n decel = .035;\n }\n\n if(me.xvel > decel) me.xvel-=decel;\n else if(me.xvel < -decel) me.xvel+=decel;\n else if(me.xvel!=0) {\n\tme.xvel = 0;\n\tif(!window.nokeys && me.keys.run==0) {\n if(me.keys.left_down)me.keys.run=-1;\n else if(me.keys.right_down)me.keys.run=1;\n } \n }\n \n // Movement mods\n // Slowing down\n if(Math.abs(me.xvel) < .14) {\n if(me.running) {\n me.running = false;\n if(mario.power == 1) setMarioSizeSmall(me);\n removeClasses(me, \"running skidding one two three\");\n addClass(me, \"still\");\n TimeHandler.clearClassCycle(me, \"running\");\n }\n }\n // Not moving slowly\n else if(!me.running) {\n me.running = true;\n switchClass(me, \"still\", \"running\");\n marioStartRunningCycle(me);\n if(me.power == 1) setMarioSizeSmall(me);\n }\n if(me.xvel > 0) {\n me.xvel = min(me.xvel, me.maxspeed);\n if(me.moveleft && (me.resting || map.underwater)) {\n unflipHoriz(me);\n me.moveleft = false;\n }\n }\n else if(me.xvel < 0) {\n me.xvel = max(me.xvel, me.maxspeed * -1);\n if(!me.moveleft && (me.resting || map.underwater)) {\n flipHoriz(me);\n me.moveleft = true;\n }\n }\n \n // Resting stops a bunch of other stuff\n if(me.resting) {\n // Hopping\n if(me.hopping) {\n removeClass(me, \"hopping\");\n if(me.xvel) addClass(me, \"running\");\n me.hopping = false;\n }\n // Jumping\n me.keys.jumplev = me.yvel = me.jumpcount = 0;\n if(me.jumping) {\n me.jumping = false;\n removeClass(me, \"jumping\");\n if(me.power == 1) setMarioSizeSmall(me);\n addClass(me, abs(me.xvel) < .14 ? \"still\" : \"running\");\n }\n // Paddling\n if(me.paddling) {\n me.paddling = me.swimming = false;\n removeClasses(me, \"paddling swim1 swim2\");\n TimeHandler.clearClassCycle(me, \"paddling\");\n addClass(me, \"running\");\n }\n }\n if(isNaN(me.xvel)) debugger;\n}", "function playerMovement() {\n if(game.input.activePointer.justDown){\n //used as attack mapping\n if(currentWeapon === 'sword') {\n if (!playerSwingSword && !playerSwungSword) {\n playerSword();\n //If the player's sword has been swung and the player isn't currently in a swing, allow the player to swing their sword again.\n } else if (!playerSwingSword && playerSwungSword) {\n playerSwungSword = false;\n }\n }else if(currentWeapon === 'ranged'){\n if (numberArrows > 0 && !isShooting &&blocking==false) {\n //only shoot an arrow if the player is carrying some.\n playerShoot();\n numberArrows -= 1;\n }\n }\n game.input.activePointer.justDown = false;\n }\n\n //Cap the player's Y velocity. \n if (player.body.velocity.y > playerVelocityYMax) {\n player.body.velocity.y = playerVelocityYMax; \n }\n\n //Horizontal movement. tempVelocityX is modified and then used as the horizontal velocity of the player. \n var tempVelocityX = 0; \n if (leftMoveKey.isDown) {\n if(sprintKey.isDown && player.body.blocked.down){\n //todo:if player is sprinting the animation should be different from walking\n tempVelocityX -= playerWalkVelocity * 1.5;\n }else {\n tempVelocityX -= playerWalkVelocity;\n }\n playerFacingRight = false; \n }\n if (rightMoveKey.isDown) {\n if(sprintKey.isDown && player.body.blocked.down){\n //todo:if player is sprinting the animation should be different from walking\n tempVelocityX += playerWalkVelocity * 1.5;\n }else {\n tempVelocityX += playerWalkVelocity;\n }\n playerFacingRight = true;\n }\n player.setVelocityX(tempVelocityX);\n \n //Flip the player if they are facing left. \n player.flipX = !(playerFacingRight);\n\n //Animations. \n if (!playerSwingSword && !leftMoveKey.isDown && !rightMoveKey.isDown && !isShooting) {\n //Play idle animation.\n player.anims.play('jasonIdleRight', true);\n player.setSize(30, 64);\n player.displayHeight = 64;\n player.displayWidth = 50;\n player.setOffset(14, 30);\n } else if (playerSwingSword) {\n //Play attack animation. \n player.anims.play('jasonAttackRight', true);\n player.setOffset(0, 45);\n\n\n\n\n /* If the player is facing a wall and close to it, the game will use the default hitbox size. \n * If the player is not near a wall, a larger hitbox will be used. \n */\n //Check nearby tiles. \n var tempCheckRightTile = createThis.map.getTileAtWorldXY(player.x + 50, player.y + 31); \n var tempCheckLeftTile = createThis.map.getTileAtWorldXY(player.x - 11, player.y + 31);\n var tempCheckRightTile2 = createThis.map.getTileAtWorldXY(player.x + 50, player.y); \n var tempCheckLeftTile2 = createThis.map.getTileAtWorldXY(player.x - 11, player.y);\n\n //Check nearly tiles. The last two check whether the player is near the edge of the map. \n if ((playerFacingRight && tempCheckRightTile !== null && tempCheckRightTile.collides) || \n (!playerFacingRight && tempCheckLeftTile !== null && tempCheckLeftTile.collides) || \n (playerFacingRight && tempCheckRightTile2 !== null && tempCheckRightTile2.collides) || \n (!playerFacingRight && tempCheckLeftTile2 !== null && tempCheckLeftTile2.collides) || \n (player.x + 50 > gameWidth) || (player.x - 11 < 0)) {\n //Smaller hitbox\n player.setSize(30, 64);\n player.setOffset(0, 45); \n } else if (playerFacingRight) {\n //Expand hitbox to right \n player.setSize(30, 64);\n player.setOffset(0, 45);\n } else {\n //Expand hitbox to left\n player.setSize(30, 64);\n player.setOffset(0, 45);\n }\n }else if( !isShooting) {\n //Play walk animation. \n player.anims.play('jasonRight', true);\n player.displayHeight = 64;\n player.displayWidth = 35;\n player.setSize(30, 64);\n player.setOffset(0, 30);\n }\n \n //Vertical movement\n if (jumpKey._justDown) {\n jumpKey._justDown = false;\n if (playerHasWings || player.body.blocked.down){\n player.setVelocityY(-playerJumpVelocity);\n }else if(!playerDoubleJump){\n //double jump velocity to be halfed ?\n player.setVelocityY(-playerJumpVelocity);\n playerDoubleJump = true;\n }\n }\n \n if(player.body.blocked.down && playerDoubleJump){\n //once player lands on ground reset double jump ability.\n playerDoubleJump = false;\n }\n \n /* If there are portals in the map, iterate through them to check collision \n * and change map if the player is holding the up key.\n */\n if (portalCount > 0) { \n for (i = 0; i < portalCount; i++) {\n if (Phaser.Geom.Intersects.RectangleToRectangle(player.getBounds(), portals[i].getBounds())){\n if (portalKey._justDown && portals[i].activePortal && justPorted === false && !leftMoveKey.isDown && !rightMoveKey.isDown) {\n portalKey._justDown = false;\n justPorted = true;\n playerShip = false;\n changeLevel(portalMap);\n setTimeout(function(){\n justPorted = false;\n },700);\n } \n }\n }\n }\n\n if(displayMapKey.isDown){\n maybeDisplayMap();\n }\n \n playerBlocking();\n\n}", "update() {\n if (this.dead) return;\n\n this.position.y += DEFAULT_SHIP_SPEED * this.speed;\n }", "function tickUpdate(){\r\n\t\t//mets a jour la liste des collisions du joueur\r\n\t\tPlayer.updateColisions();\r\n\t\t\r\n\t\tisInAir = ActualiseIsInAir();\r\n\t\tif (!isInAir && !canGoDown){ canGoDown = true ;}\r\n\t\t\r\n\t\t\r\n\t\tIsMoving = goingLeft||goingRight;\r\n\t\tCalcXvel();\r\n\t\tCalcYvel();\r\n\t\t\r\n\t\tcalcCollisions();\r\n\t\t\r\n\t\t//evite que le joueur aille assez vite pour destabiliser le systeme de collisions\r\n\t\tXvel = Xvel > PlayerR ? PlayerR : Xvel;\r\n\t\tYvel = Yvel > PlayerR ? PlayerR : Yvel;\r\n\t\t\r\n\t\tPlayerX = PlayerX + Xvel;\r\n\t\tPlayerY = PlayerY + Yvel;\r\n\t\t\r\n\t\tPlayer.UpdateXY(PlayerX,PlayerY);\r\n\t\t\r\n\t\tif (debugVisible){ ActualiseDebug(); }\r\n\t\t\r\n\t\t\r\n}", "function moveDown() {\n let prevCol;\n let curCol;\n\n for(x = 0; x < sizeWidth; x++) {\n for(y = 0; y < sizeHeight; y++) {\n if (y === 0) {\n prevCol = get(x * sizeBlock + 1, (sizeHeight - 1) * sizeBlock + 1);\n curCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n\n fill(prevCol);\n rect(x * sizeBlock, y, sizeBlock, sizeBlock);\n }\n else {\n prevCol = curCol;\n curCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n\n fill(prevCol);\n rect(x * sizeBlock, y * sizeBlock, sizeBlock, sizeBlock);\n\n }\n }\n }\n}", "function moveDown(x,y){\r\n\tif(x==horse1)\r\n\t\ty(horse1, 0.49);\r\n\telse if(x == horse2)\r\n\t\ty(horse2, 0.47);\r\n\telse if(x == horse3)\r\n\t\ty(horse3, 0.45);\r\n\telse if(x == horse4)\r\n\t\ty(horse4, 0.43);\r\n}", "function moveDown(){\n //the vertical position of the player changes by adding 1 position\n //what happens when moving up and the player faces the wall\n if (firstLevel[playerPosI + 1][playerPosJ] == \"x\") {\n //do not allow to go down\n return;\n }\n //if the player moves up and faces the box\n if (firstLevel[playerPosI + 1][playerPosJ] == \"*\") {\n //when moving a box and the second consecutive position after the player moves the box\n //when the position is not the wall and not a box\n if (firstLevel[playerPosI + 2][playerPosJ] != \"x\" && firstLevel[playerPosI + 2][playerPosJ] != \"*\") {\n //allow movement\n if (isOverGoal(playerPosI, playerPosJ) == true) {\n //update to player symbol\n firstLevel[playerPosI][playerPosJ] = \"#\";\n } else {\n //update to floor symbol\n firstLevel[playerPosI][playerPosJ] = \"o\";\n }\n //player moves down -> horizontal position is changing -> moving up with the box\n playerPosI = playerPosI + 1;\n //no chane in vertical position\n playerPosJ = playerPosJ;\n //indicate the player symbol\n firstLevel[playerPosI][playerPosJ] = \"&\";\n //and the box position above the player\n firstLevel[playerPosI + 1][playerPosJ] = \"*\";\n }\n } else {\n //if player is on the goal position\n if (isOverGoal(playerPosI, playerPosJ) == true) {\n //update to player symbol\n firstLevel[playerPosI][playerPosJ] = \"#\";\n } else {\n //update to floor symbol\n firstLevel[playerPosI][playerPosJ] = \"o\";\n }\n //position of the player when moving down\n playerPosI = playerPosI + 1;\n playerPosJ = playerPosJ;\n //indicate player symbol\n firstLevel[playerPosI][playerPosJ] = \"&\";\n }\n printArrayHTML(firstLevel);\n}", "function moveTilesDown() {\n for (var column = 3; column >= 0; column--) {\n for (var row = 2; row >= 0; row--) {\n if (checkBelow(row, column) && tileArray[row][column] != null) {\n moveTileDown(row, column);\n }\n }\n }\n }", "function up()\n{\n if(gameIsOn)\n {\n if(pos > 110)\n {\n pos-= speed;\n shark.style.top= pos + \"px\";\n }\n }\n}", "function MoveDown() {\n MoveDownNull = 0;\n \n for (let i = 0; i < itemEls.length; i++) {\n // afterClassName = itemEls[i].className;\n // if (i > 0) {\n // afterafterClassName = itemEls[i - 1].className;\n // }\n // console.log(typeof afterClassName);\n // console.log(itemEls[i].className);\n // console.log(afterClassName);\n // console.log(afterafterClassName);\n // console.log(itemEls[i].classList.contains(\"Empty\"));\n // console.log(afterClassName.indexOf(\"Empty\"));\n const isFirstRow = firstRow.includes(i);\n if (isFirstRow) continue;\n if (itemEls[i].classList.contains(\"Empty\") && !itemEls[i - 1].classList.contains(\"Empty\")) {\n // if (itemEls[i].innerHTML === null && itemEls[i - 1].innerHTML != null) {\n // if (afterClassName.indexOf(\"Empty\") == -1 && afterafterClassName.indexOf(\"Empty\") == 5) {\n \n // 전체 배열 인덱스 교환\n tempNullDown = itemEls[i];\n itemEls[i] = itemEls[i - 1];\n itemEls[i - 1] = tempNullDown;\n \n // tempNullDown = itemEls[i];\n // itemEls[i] = itemEls[i-1];\n // itemEls[i-1] = tempNullDown;\n \n // tempNullDown = itemEls[i];\n // itemEls[i] = itemEls[i-1];\n // itemEls[i-1] = null;\n \n tempLeftDown = itemEls[i].style.left;\n tempTopDown = itemEls[i].style.top;\n itemEls[i].style.left = itemEls[i-1].style.left;\n itemEls[i].style.top = itemEls[i-1].style.top;\n itemEls[i-1].style.left = tempLeftDown;\n itemEls[i-1].style.top = tempTopDown;\n }\n }\n \n for (let i = 0; i < itemsArray.length; i++) {\n const isFirstRow = firstRow.includes(i);\n if (isFirstRow) continue;\n for (let j = itemsArray.length - 1; j > 0; j--) {\n // afterClassName = itemsArray[i][j].className;\n // if (i > 0) {\n // afterafterClassName = itemsArray[i][j - 1].className;\n // }\n // if (afterClassName.indexOf(\"Empty\") === -1 && afterafterClassName.indexOf(\"Empty\") === 5) {\n \n if (itemsArray[i][j].classList.contains(\"Empty\") && !itemsArray[i][j - 1].classList.contains(\"Empty\")) {\n /* Two Dimensional Array Change */\n // let tempTile = itemsArray[i][j];\n // itemsArray[i][j] = itemsArray[i][j-1];\n // itemsArray[i][j-1] = tempTile;\n \n let tempTile = itemsArray[i][j];\n itemsArray[i][j] = itemsArray[i][j - 1];\n itemsArray[i][j - 1] = tempTile;\n \n /* Top, Left Pos Change */\n // itemsArray[i][j].style.top = breadTop[j-1] + \"px\";\n \n // j = itemsArray[i].length;\n }\n }\n }\n // FillEmpty();\n }", "function jumpCollide() {\n\tfor (var i = 0; i < jumpables.length; i++) {\n\t\tif (spriteCollide(jumpables[i].sprite)) {\n\t\t\tinky.colliding = true;\n\t\t\tinky.collidable = jumpables[i].sprite;\n\t\t\treturn true;\n\t\t}\n\t}\n\tinky.collidable = undefined;\n\treturn false;\n}", "function movePlayerDebris(dt)\n\t{\n\t\tfor(var i = 0; i < playerDebris.length; i++)\n\t\t{\n\t\t\tplayerDebris[i].move(dt);\n\t\t}\n\t}", "move() {\n // Check if out of boundaries\n if (this.x + tileSize > w) {\n this.x = 0;\n }\n if (this.x < 0) {\n this.x = w;\n }\n if (this.y + tileSize > h) {\n this.y = 0;\n }\n if (this.y < 0) {\n this.y = h;\n }\n\n // If direction is up, move up (y-)\n if (this.direction == \"up\") {\n this.draw();\n this.y -= tileSize;\n }\n // If direction is left, move left (x-)\n if (this.direction == \"left\") {\n this.draw();\n this.x -= tileSize;\n }\n // If direction is right, move left (x+)\n if (this.direction == \"right\") {\n this.draw();\n this.x += tileSize;\n }\n // If direction is down, move down (y+)\n if (this.direction == \"down\") {\n this.draw();\n this.y += tileSize;\n }\n // If direction is none, return\n if (this.direction == \"none\") {\n this.draw();\n }\n\n\n // Check if head collided with body\n for (let index = 0; index < this.body.length; index++) {\n const bodyPart = this.body[index];\n if (bodyPart[0] == this.coords[0] && bodyPart[1] == this.coords[1]) {\n // Player died\n alert(`Ups! La serpiente no se puede comer a sí misma. Obtuviste ${score} puntos.`);\n }\n }\n }", "dragItem() {\n for (var i = 0; i < this.items.length; i++)\n if (this.items[i] !== undefined)\n if (this.items[i].dragged) {\n var mouseX = game.renderer.plugins.interaction.mouse.global.x;\n var mouseY = game.renderer.plugins.interaction.mouse.global.y;\n\n this.items[i].sprite.x = mouseX - 16;\n this.items[i].sprite.y = mouseY - 16;\n }\n }", "function moveDown() {\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n 0\n );\n }\n\n GameData.row++;\n\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n GameData.activePiece.getType()\n );\n }\n}", "update()\r\n {\r\n var pointer = this.input.activePointer;\r\n this.player.setVelocity(0,0);\r\n\t\t\r\n\t\t//Attack scripts\r\n if((this.keyA.isDown || pointer.leftButtonDown()) && lmb == false && !stunned && !gameIsOver)//Left\r\n {\r\n //Execute left attack\r\n lmb = true;\r\n this.player.play(\"AttackLeft\"); \r\n this.player.once(\"animationcomplete\", function () {self.player.play(\"IdleLeft\");});\r\n \r\n if(leftEnemyQueue[0] != null && ((this.player.x - leftEnemyQueue[0].x) <= weaponRange || leftEnemyQueue[0].inRange == true) )\r\n {\r\n distanceMoved = 0;\r\n distanceToMove = this.player.x - leftEnemyQueue[0].x;\r\n this.MoveWorld();\r\n var enem = leftEnemyQueue[0];\r\n this.EnemyHurt(enem);\r\n \r\n if(!firstLeft)\r\n {\r\n firstLeft = true;\r\n this.firstLeftHint.setScale(0);\r\n this.scoreHint.setScale(0);\r\n this.healthHint.setScale(0);\r\n }\r\n }else //if you clicked and there is nothing there, aka, MISS\r\n {\r\n this.StunPlayer();\r\n distanceMoved = 0;\r\n distanceToMove = weaponRange;\r\n this.MoveWorld();\r\n this.sfx.miss.play();\r\n }\r\n \r\n }\r\n else if(this.keyA.isUp && pointer.leftButtonReleased())\r\n {\r\n lmb = false;\r\n }\r\n \r\n if((this.keyD.isDown || pointer.rightButtonDown()) && rmb == false && !stunned && !gameIsOver)//right\r\n {\r\n //Execute Right attack\r\n rmb = true;\r\n this.player.play(\"AttackRight\");\r\n this.player.once(\"animationcomplete\", function () {self.player.play(\"IdleRight\");});\r\n if(rightEnemyQueue[0] != null && ((rightEnemyQueue[0].x - this.player.x) <= weaponRange || rightEnemyQueue[0].inRange == true))\r\n {\r\n distanceMoved = 0;\r\n distanceToMove = this.player.x - rightEnemyQueue[0].x;\r\n this.MoveWorld();\r\n var enem = rightEnemyQueue[0];\r\n this.EnemyHurt(enem);\r\n \r\n if(!firstRight)\r\n {\r\n firstRight = true;\r\n this.firstRightHint.setScale(0);\r\n this.scoreHint.setScale(0);\r\n this.healthHint.setScale(0);\r\n }\r\n }else //if you clicked and there is nothing there, aka, MISS\r\n {\r\n this.StunPlayer();\r\n distanceMoved = 0;\r\n distanceToMove = -weaponRange;\r\n this.MoveWorld();\r\n this.sfx.miss.play();\r\n }\r\n }\r\n else if(this.keyD.isUp && pointer.rightButtonReleased())\r\n {\r\n rmb = false;\r\n }\r\n \r\n //Right range bar\r\n if(rightEnemyQueue[0] != null && ((rightEnemyQueue[0].x - this.player.x) <= weaponRange || rightEnemyQueue[0].inRange == true) )\r\n {\r\n this.player.rightWeaponRangeBar.fillColor = 0x5fcde4;\r\n this.player.rightWeaponRangeBar.setStrokeStyle(2, 0xffffff);\r\n if(!firstRight)\r\n {\r\n this.firstRightHint.setScale(1);\r\n this.firstRightHint.setText(\"Zombie in Range! Right Click to Attack!\");\r\n }\r\n }else\r\n {\r\n this.player.rightWeaponRangeBar.fillColor = 0x5b6ee1;\r\n this.player.rightWeaponRangeBar.setStrokeStyle(0, 0xffffff);\r\n }\r\n \r\n //Left range bar\r\n if(leftEnemyQueue[0] != null && ((this.player.x - leftEnemyQueue[0].x) <= weaponRange || leftEnemyQueue[0].inRange == true))\r\n {\r\n this.player.leftWeaponRangeBar.fillColor = 0xf21d04;\r\n this.player.leftWeaponRangeBar.setStrokeStyle(2, 0xffffff);\r\n if(!firstLeft)\r\n {\r\n this.firstLeftHint.setScale(1);\r\n this.firstLeftHint.setText(\"Zombie in Range! Left Click to Attack!\");\r\n }\r\n }else\r\n {\r\n this.player.leftWeaponRangeBar.fillColor = 0xac3232;\r\n this.player.leftWeaponRangeBar.setStrokeStyle(0, 0xffffff);\r\n }\r\n \r\n for(var i = 0; i < rightEnemyQueue.length; i++)\r\n {\r\n if(i > 0 && rightEnemyQueue[i-1].x + 32 > rightEnemyQueue[i].x)\r\n {\r\n rightEnemyQueue[i].setVelocityX(100 * gameSpeed);\r\n }else if (rightEnemyQueue[i].x > this.player.x + 32)\r\n {\r\n rightEnemyQueue[i].setVelocityX(-100*gameSpeed);\r\n }else\r\n {\r\n rightEnemyQueue[i].setVelocityX(0);\r\n //trigger left facing attack once\r\n if(!rightEnemyQueue[i].isAttacking && i == 0)\r\n {\r\n rightEnemyQueue[i].isAttacking = true;\r\n var index = i;\r\n //trigger attack function\r\n var attackDelay = this.time.delayedCall(250, function(){\r\n \r\n if(rightEnemyQueue[index] != null && rightEnemyQueue[index].x <= self.player.x + 32)\r\n {\r\n this.EnemyAttack(rightEnemyQueue[index], 1);\r\n }\r\n \r\n }, null, self);\r\n }\r\n }\r\n for(var h = 0; h < rightEnemyQueue[i].health.length; h++)\r\n {\r\n if(rightEnemyQueue[i].healthBars[h] != null && !rightEnemyQueue[i].isDead && !gameIsOver){\r\n rightEnemyQueue[i].healthBars[h].x = rightEnemyQueue[i].x;}else if(gameIsOver)\r\n {\r\n rightEnemyQueue[i].healthBars[h].setScale(0);\r\n }\r\n }\r\n }\r\n for(var i = 0; i < leftEnemyQueue.length; i++)\r\n {\r\n if(i > 0 && leftEnemyQueue[i-1].x - 32 < leftEnemyQueue[i].x)\r\n {\r\n leftEnemyQueue[i].setVelocityX(-100 * gameSpeed);\r\n }else if (leftEnemyQueue[i].x < this.player.x - 32)\r\n {\r\n leftEnemyQueue[i].setVelocityX(100*gameSpeed);\r\n }else\r\n {\r\n leftEnemyQueue[i].setVelocityX(0);\r\n //Trigger right facing attack once\r\n if(!leftEnemyQueue[i].isAttacking && i == 0)\r\n {\r\n leftEnemyQueue[i].isAttacking = true;\r\n var index = i;\r\n //trigger attack function\r\n var attackDelay = this.time.delayedCall(250, function(){\r\n \r\n if(leftEnemyQueue[index] != null && leftEnemyQueue[index].x >= self.player.x - 32)\r\n {\r\n this.EnemyAttack(leftEnemyQueue[index], 0);\r\n }\r\n \r\n }, null, self);\r\n }\r\n }\r\n for(var h = 0; h < leftEnemyQueue[i].health.length; h++)\r\n {\r\n if(leftEnemyQueue[i].healthBars[h] != null && !leftEnemyQueue[i].isDead && !gameIsOver){\r\n leftEnemyQueue[i].healthBars[h].x = leftEnemyQueue[i].x;}else if(gameIsOver)\r\n {\r\n leftEnemyQueue[i].healthBars[h].setScale(0);\r\n }\r\n }\r\n }\r\n \r\n \r\n }", "function checkCollisionTwoItemsForSwaping(item, item2) {\n // if the cols or rows of the items are 1 , doesnt make any sense to set a boundary. Only if the item is bigger we set a boundary\n const horizontalBoundaryItem1 = item.cols === 1 ? 0 : 1;\n const horizontalBoundaryItem2 = item2.cols === 1 ? 0 : 1;\n const verticalBoundaryItem1 = item.rows === 1 ? 0 : 1;\n const verticalBoundaryItem2 = item2.rows === 1 ? 0 : 1;\n return item.x + horizontalBoundaryItem1 < item2.x + item2.cols\n && item.x + item.cols > item2.x + horizontalBoundaryItem2\n && item.y + verticalBoundaryItem1 < item2.y + item2.rows\n && item.y + item.rows > item2.y + verticalBoundaryItem2;\n }", "function moveUp() {\n myGamePiece.speedY -= movementSpeed;\n restrictPlayer();\n}", "function keysUp(e) {\n\tif(e.keyCode == 37 || e.keyCode == 65) {\n\t\tleftDown = false;\n\t}\n\tif(e.keyCode == 39 || e.keyCode == 68) {\n\t\trightDown = false;\n\t}\n\tif(e.keyCode == 32 && (gamePhase == 1 || gamePhase == 2)) {\n\t\tfireMissle();\n\t}\n}", "update() {\n frames = 0;\n this.moveDown();\n }", "function moveUp() {\n bY -= 20; // I decrease Y (move up) on every key press\n}", "updatePlayerPos(dt) {\n \n // first, check colliding with sides of game board\n if(this.playerHitLeftRight()) {\n this.PLAYER.xSpeed *= -.7;\n this.PLAYER.xPos += this.PLAYER.xSpeed;\n }\n \n if(this.playerHitTopBottom()) {\n this.PLAYER.ySpeed *= -.7;\n this.PLAYER.yPos += this.PLAYER.ySpeed;\n }\n \n // not moving horizontal\n if(!this.myKeys.keydown[this.myKeys.KEYBOARD.KEY_LEFT] && !this.myKeys.keydown[this.myKeys.KEYBOARD.KEY_A] && !this.myKeys.keydown[this.myKeys.KEYBOARD.KEY_RIGHT] && !this.myKeys.keydown[this.myKeys.KEYBOARD.KEY_D]) {\n if(this.PLAYER.xSpeed < 0) {\n this.PLAYER.xSpeed += .04;\n }\n \n if(this.PLAYER.xSpeed > 0) {\n this.PLAYER.xSpeed -= .04;\n }\n \n // just make it 0 to stop moving\n if((this.PLAYER.xSpeed > 0 && this.PLAYER.xSpeed < 0.2) || (this.PLAYER.xSpeed < 0 && this.PLAYER.xSpeed > -0.2)) {\n this.PLAYER.xSpeed = 0;\n }\n }\n // not moving vertical\n if(!this.myKeys.keydown[this.myKeys.KEYBOARD.KEY_UP] && !this.myKeys.keydown[this.myKeys.KEYBOARD.KEY_DOWN] && !this.myKeys.keydown[this.myKeys.KEYBOARD.KEY_W] && !this.myKeys.keydown[this.myKeys.KEYBOARD.KEY_S]) {\n if(this.PLAYER.ySpeed < 0) {\n this.PLAYER.ySpeed += .04;\n }\n \n if(this.PLAYER.ySpeed > 0) {\n this.PLAYER.ySpeed -= .04;\n }\n \n // just make it 0 to stop moving\n if((this.PLAYER.ySpeed > 0 && this.PLAYER.ySpeed < 0.2) || (this.PLAYER.ySpeed < 0 && this.PLAYER.ySpeed > -0.2)) {\n this.PLAYER.ySpeed = 0;\n }\n }\n \n \n this.PLAYER.xPos += this.PLAYER.xSpeed;\n this.PLAYER.yPos += this.PLAYER.ySpeed;\n \n }", "function collisions(){\n\n // this variable will allow us to test if collision is true or false\n var test2 = false;\n\n // this will loop through my squid array to see if any objects are colliding\n for ( let i = 1; i < squid.length ; i ++){\n test2 = have_collided(squid[0], squid[i]);\n if (test2 == true){\n break; // if the objects overlap, then we break out of the loop.\n }\n\n }\n // if the collisions happen, then we push the player character back the opposite way.\n if (test2){\n if (movement ==\"up\"){\n down(squid[player]);\n }\n else if(movement == \"down\"){\n up(squid[player]);\n }\n else if (movement == \"left\"){\n right(squid[player]);\n }\n else if (movement == \"right\"){\n left(squid[player]);\n }\n }\n// This removes the collectable item after its spliced from the array.\n setTimeout(remove_food, 1000);\n}", "function up() {\r\n if (dir.y === 0 && !changingDirection) {\r\n dir.x = 0;\r\n dir.y = -1;\r\n changingDirection = true;\r\n }\r\n}", "function jumpHelper(direction) {\n if (jumpspeed >= 0 && jumpup) { // jumping upwards\n new_x = player.x + direction*PLAYERSPEED;\n new_y = player.y - jumpspeed;\n jumpspeed -= GRAVITY;\n collision = detectCollision(new_x, new_y);\n if (collision == 3) { // hit tree trunk\n playerstate.fall();\n }\n else {\n player.x = new_x;\n player.y = new_y;\n }\n }\n else { // \"jumping\" downwards\n if (player.y >= (MAP_HEIGHT * TILE_HEIGHT)) { // prevent player from falling through the map\n player.y = world.worldHeight - TILE_HEIGHT - player.height/2;\n window.addEventListener(\"keydown\", gameKeyDown);\n window.addEventListener(\"keyup\", gameKeyUp);\n playerstate.stand();\n }\n else {\n jumpup = false;\n new_x = player.x + direction*PLAYERSPEED;\n new_y = player.y + jumpspeed;\n below = detectBelow(new_x, new_y);\n collision = detectCollision(new_x, new_y);\n if (below == 0 && collision != 3) {\n player.x = new_x;\n player.y = new_y;\n jumpspeed += GRAVITY;\n }\n else if (below == 2 || below == 1) {\n player.x = new_x;\n player.y = new_y - (new_y % TILE_HEIGHT) - player.height/2 + TILE_HEIGHT;\n jumpup = true;\n jumpspeed = INITIALJUMPSPEED;\n window.addEventListener(\"keydown\", gameKeyDown);\n window.addEventListener(\"keyup\", gameKeyUp);\n playerstate.stand();\n }\n else if (collision == 3) {\n jumpup = true;\n playerstate.fall();\n }\n }\n }\n}", "function MoveDown()\n{\n mrRat.direction = 'down';\n\n if (gameData[mrRat.y + 1][mrRat.x] >= 10)\n {\n //The rat eats a cheese\n if (gameData[mrRat.y + 1][mrRat.x] === 12) {\n EatsCheese(false);\n }\n\n //The rats eats a random cheese\n if (gameData[mrRat.y + 1][mrRat.x] === 15) {\n EatsCheese(true);\n }\n\n //The rat hits the rat poison or rat trap\n if (gameData[mrRat.y + 1][mrRat.x] === 16 || gameData[mrRat.y + 1][mrRat.x] === 13) {\n TheRatDied();\n }\n\n gameData[mrRat.y][mrRat.x] = _GROUND;\n mrRat.y = mrRat.y + 1;\n gameData[mrRat.y][mrRat.x] = _RAT;\n\n //MrRat has reached the gool\n if (mrRat.x == 18 && mrRat.y == 14) {\n Goal();\n return;\n }\n\n DeleteMap();\n DrawMap();\n }\n}", "tick() {\n\t\tif (!this.isGameOver() && !this.element.canMoveDown()) {\n\t\t\tthis.element.copyToBoard();\n\t\t\tthis.element = this.nextElement;\n\t\t\tthis.nextElement = new Element({board: this.board});\n\t\t}\n\t\tthis.element.down();\n\t}", "function checkCollision()\n{\n\tif(rocks.collide(player)) dead = true;\n\n\tif(player.position.y >= Cheight-(pSize/2))\n\t{\n\t\tdead = true;\n\t\tplayer.velocity.y = 0;\n\t\tplayer.position.y = Cheight-(pSize/2);\n\t}\n\tif(player.position.y <= 0)\n\t{\n\t\tplayer.position.y = pSize/2;\n\t\tplayer.velocity.y = 0;\n\t}\n}", "function onSwipeUp() {\n return ((game.input.activePointer.positionDown.y - game.input.activePointer.position.y) > 50 && game.input.activePointer.duration > 100 && game.input.activePointer.duration < 250);\n }", "function applyMovement() {\n if(keyIsDown(87) || keyIsDown(38)){\n paddle_one.moveUp();\n }\n if(keyIsDown(83) || keyIsDown(40)){\n paddle_one.moveDown();\n }\n // AI MOVEMENT\n if(ball.position.y - ball.size*2 < paddle_two.position.y){\n paddle_two.moveUp();\n }else if(ball.position.y + ball.size*3 > paddle_two.position.y + paddle_two.height){\n paddle_two.moveDown();\n }\n}", "function Dog(x, y)\r\n{\r\n // Calculate real coordinates\r\n this.x = (x << 6) + 0x20;\r\n this.y = y << 6;\r\n \r\n // Initialization\r\n this.dir = true;\r\n this.visible = false;\r\n \r\n // Sprite\r\n this.sprite_id = new Sprite;\r\n this.sprite_id.setImage(\"./supercat/items.png\");\r\n this.sprite_id.setPos(-9001, -9001);\r\n this.sprite_id.setSize(60, 64);\r\n this.sprite_id.setImagePos(0, 0x80);\r\n this.sprite_id.setZIndex(50);\r\n this.sprite_id.attach(game.display);\r\n \r\n // Function with the behaviour code\r\n if (!Dog.prototype.run)\r\n Dog.prototype.run = function(item_id)\r\n {\r\n // Too far to be worth processing?\r\n var x = this.x - game.scroll_x;\r\n var y = this.y - game.scroll_y;\r\n if (x < -128 || x > 768 || y < -128 || y > 512)\r\n return;\r\n \r\n // Did the player collide with us?\r\n if (game.player.x + 12 >= this.x - 12 &&\r\n game.player.x - 12 <= this.x + 12 &&\r\n game.player.y >= this.y + 4 &&\r\n game.player.y - 56 <= this.y + 59)\r\n {\r\n // Is the player stamping us?\r\n if (game.player.y < this.y + 60 && game.player.gravity > 0 &&\r\n !game.player.on_floor)\r\n {\r\n // Add score\r\n game.score += 100;\r\n \r\n // Make player bounce\r\n game.player.gravity = -12;\r\n \r\n // For now, just disappear\r\n this.sprite_id.detach();\r\n delete this.sprite_id;\r\n game.items.removeByID(item_id);\r\n return;\r\n }\r\n }\r\n \r\n // Move left?\r\n if (this.dir)\r\n {\r\n // No way? :(\r\n if (game.coll_map[((this.x - 22) >> 6) + (this.y >> 6) *\r\n game.map_width])\r\n {\r\n this.dir = false;\r\n }\r\n // Oh cool!\r\n else\r\n {\r\n this.x -= 6;\r\n }\r\n }\r\n \r\n // Move right?\r\n else\r\n {\r\n // No way? :(\r\n if (game.coll_map[((this.x + 22) >> 6) + (this.y >> 6) *\r\n game.map_width])\r\n {\r\n this.dir = true;\r\n }\r\n // Oh cool!\r\n else\r\n {\r\n this.x += 6;\r\n }\r\n }\r\n }\r\n \r\n // Function to update the sprite\r\n if (!Dog.prototype.draw)\r\n Dog.prototype.draw = function()\r\n {\r\n var x = this.x - game.scroll_x;\r\n var y = this.y - game.scroll_y;\r\n \r\n // Out of range?\r\n if (x < -30 || x > 670 || y < -64 || y > 384)\r\n {\r\n if (this.visible)\r\n {\r\n this.sprite_id.detach();\r\n this.visible = false;\r\n }\r\n }\r\n \r\n // Nope, visible\r\n else\r\n {\r\n // Make sprite visible if needed\r\n if (!this.visible)\r\n {\r\n this.sprite_id.attach(game.display);\r\n this.visible = true;\r\n }\r\n \r\n // Get animation\r\n if (game.global_anim & 2)\r\n x = 60;\r\n else\r\n x = ((game.global_anim >> 1) & 2) ? 120 : 0;\r\n \r\n // Update sprite\r\n if (this.dir)\r\n {\r\n this.sprite_id.setImagePos(x, 0x80);\r\n this.sprite_id.setPos(this.x - game.scroll_x - 25,\r\n this.y - game.scroll_y);\r\n }\r\n else\r\n {\r\n this.sprite_id.setImagePos(x, 0x40);\r\n this.sprite_id.setPos(this.x - game.scroll_x - 35,\r\n this.y - game.scroll_y);\r\n }\r\n }\r\n }\r\n \r\n // Return pointer to this object\r\n return this;\r\n}" ]
[ "0.7066146", "0.697333", "0.6954674", "0.68720376", "0.68440264", "0.6828357", "0.6658349", "0.65899444", "0.65548337", "0.65428257", "0.65382874", "0.6481792", "0.6480561", "0.646844", "0.64506876", "0.6436268", "0.6431473", "0.64204735", "0.6418832", "0.6405917", "0.63897127", "0.6361782", "0.6349572", "0.63440067", "0.63384527", "0.6335141", "0.63160855", "0.630681", "0.62915736", "0.6288772", "0.6284051", "0.6278428", "0.62667984", "0.6249479", "0.6242527", "0.62392765", "0.61716956", "0.61681366", "0.6159562", "0.61521685", "0.6149522", "0.6127555", "0.60855824", "0.6071208", "0.60578513", "0.60333085", "0.602408", "0.6023135", "0.60177386", "0.60153407", "0.6006855", "0.60009944", "0.6000231", "0.5995474", "0.5986402", "0.5977631", "0.5976118", "0.5976002", "0.5974776", "0.5971521", "0.5959438", "0.594766", "0.5946068", "0.59158146", "0.5915084", "0.5910549", "0.5906967", "0.590267", "0.5897777", "0.5896226", "0.58947134", "0.5893073", "0.58882904", "0.58861995", "0.5883531", "0.5882218", "0.5877448", "0.5877042", "0.5870227", "0.5867143", "0.5865147", "0.586073", "0.5860268", "0.58547205", "0.58545995", "0.5853001", "0.5847751", "0.5845673", "0.5840443", "0.583732", "0.58339524", "0.5832444", "0.5828858", "0.582804", "0.5824979", "0.58180785", "0.5813917", "0.5812888", "0.5807061", "0.58000535", "0.5795474" ]
0.0
-1
Compact an item in the layout.
function compactItem(compareWith, l, compactType, cols, fullLayout) { var compactV = compactType === "vertical"; var compactH = compactType === "horizontal"; if (compactV) { // Bottom 'y' possible is the bottom of the layout. // This allows you to do nice stuff like specify {y: Infinity} // This is here because the layout must be sorted in order to get the correct bottom `y`. l.y = Math.min(bottom(compareWith), l.y); // Move the element up as far as it can go without colliding. while (l.y > 0 && !getFirstCollision(compareWith, l)) { l.y--; } } else if (compactH) { l.y = Math.min(bottom(compareWith), l.y); // Move the element left as far as it can go without colliding. while (l.x > 0 && !getFirstCollision(compareWith, l)) { l.x--; } } // Move it down, and keep moving it down if it's colliding. var collides = void 0; while (collides = getFirstCollision(compareWith, l)) { if (compactH) { resolveCompactionCollision(fullLayout, l, collides.x + collides.w, "x"); } else { resolveCompactionCollision(fullLayout, l, collides.y + collides.h, "y"); } // Since we can't grow without bounds horizontally, if we've overflown, let's move it down and try again. if (compactH && l.x + l.w > cols) { l.x = cols - l.w; l.y++; } } return l; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compactItem(compareWith\n/*: Layout*/\n, l\n/*: LayoutItem*/\n, verticalCompact\n/*: boolean*/\n)\n/*: LayoutItem*/\n{\n if (verticalCompact) {\n // Move the element up as far as it can go without colliding.\n while (l.y > 0 && !getFirstCollision(compareWith, l)) {\n l.y--;\n }\n } // Move it down, and keep moving it down if it's colliding.\n\n\n var collides;\n\n while (collides = getFirstCollision(compareWith, l)) {\n l.y = collides.y + collides.h;\n }\n\n return l;\n}", "function compactItem(compareWith\n/*: Layout*/\n, l\n/*: LayoutItem*/\n, verticalCompact\n/*: boolean*/\n)\n/*: LayoutItem*/\n{\n if (verticalCompact) {\n // Move the element up as far as it can go without colliding.\n while (l.y > 0 && !getFirstCollision(compareWith, l)) {\n l.y--;\n }\n } // Move it down, and keep moving it down if it's colliding.\n\n\n var collides;\n\n while (collides = getFirstCollision(compareWith, l)) {\n l.y = collides.y + collides.h;\n }\n\n return l;\n}", "function compactItem(compareWith\n/*: Layout*/\n, l\n/*: LayoutItem*/\n, compactType\n/*: CompactType*/\n, cols\n/*: number*/\n, fullLayout\n/*: Layout*/\n)\n/*: LayoutItem*/\n{\n var compactV = compactType === \"vertical\";\n var compactH = compactType === \"horizontal\";\n\n if (compactV) {\n // Bottom 'y' possible is the bottom of the layout.\n // This allows you to do nice stuff like specify {y: Infinity}\n // This is here because the layout must be sorted in order to get the correct bottom `y`.\n l.y = Math.min(bottom(compareWith), l.y); // Move the element up as far as it can go without colliding.\n\n while (l.y > 0 && !getFirstCollision(compareWith, l)) {\n l.y--;\n }\n } else if (compactH) {\n l.y = Math.min(bottom(compareWith), l.y); // Move the element left as far as it can go without colliding.\n\n while (l.x > 0 && !getFirstCollision(compareWith, l)) {\n l.x--;\n }\n } // Move it down, and keep moving it down if it's colliding.\n\n\n var collides;\n\n while (collides = getFirstCollision(compareWith, l)) {\n if (compactH) {\n resolveCompactionCollision(fullLayout, l, collides.x + collides.w, \"x\");\n } else {\n resolveCompactionCollision(fullLayout, l, collides.y + collides.h, \"y\");\n } // Since we can't grow without bounds horizontally, if we've overflown, let's move it down and try again.\n\n\n if (compactH && l.x + l.w > cols) {\n l.x = cols - l.w;\n l.y++;\n }\n }\n\n return l;\n}", "function compactItem(compareWith, l, verticalCompact) {\n if (verticalCompact) {\n // Bottom 'y' possible is the bottom of the layout.\n // This allows you to do nice stuff like specify {y: Infinity}\n // This is here because the layout must be sorted in order to get the correct bottom `y`.\n l.y = Math.min(bottom(compareWith), l.y);\n\n // Move the element up as far as it can go without colliding.\n while (l.y > 0 && !getFirstCollision(compareWith, l)) {\n l.y--;\n }\n }\n\n // Move it down, and keep moving it down if it's colliding.\n var collides = void 0;\n while (collides = getFirstCollision(compareWith, l)) {\n l.y = collides.y + collides.h;\n }\n return l;\n}", "function compactItem(compareWith, l, compactType, cols) {\n var compactV = compactType === 'vertical';\n var compactH = compactType === 'horizontal';\n if (compactV) {\n // Bottom 'y' possible is the bottom of the layout.\n // This allows you to do nice stuff like specify {y: Infinity}\n // This is here because the layout must be sorted in order to get the correct bottom `y`.\n l.y = Math.min(bottom(compareWith), l.y);\n // Move the element up as far as it can go without colliding.\n while (l.y > 0 && !getFirstCollision(compareWith, l)) {\n l.y--;\n }\n } else if (compactH) {\n l.y = Math.min(bottom(compareWith), l.y);\n // Move the element left as far as it can go without colliding.\n while (l.x > 0 && !getFirstCollision(compareWith, l)) {\n l.x--;\n }\n }\n\n // Move it down, and keep moving it down if it's colliding.\n var collides = void 0;\n while (collides = getFirstCollision(compareWith, l)) {\n if (compactH) {\n l.x = collides.x + collides.w;\n } else {\n l.y = collides.y + collides.h;\n }\n // Since we can't grow without bounds horizontally, if we've overflown, let's move it down and try again.\n if (compactH && l.x + l.w > cols) {\n l.x = cols - l.w;\n l.y++;\n }\n }\n return l;\n}", "collapseItem(item){if(this._isExpanded(item)){this.splice(\"expandedItems\",this._getItemIndexInArray(item,this.expandedItems),1)}}", "function checkInCompactHbox(layout) {\r\n var ct = layout.owner;\r\n if (typeof ct.initialConfig.width !== \"number\") {\r\n var parentCt = ct.ownerCt;\r\n if (parentCt && parentCt._inCompactHbox) {\r\n ct._inCompactHbox = true; // mess with component's autoWidth can upset overflow handling.\r\n delete ct.flex;\r\n }\r\n }\r\n var inCompactHbox = ct._inCompactHbox;\r\n var items = ct.items.items;\r\n for (var i = 0, len = items.length; i < len; i++) {\r\n var child = items[i];\r\n if (typeof child.initialConfig.width !== \"number\") {\r\n if (child.isXType(_columnHBoxXtype) || (inCompactHbox && (child.isXType(_columnBoxXtype) || child.isXType(_columnVBoxXtype)))) {\r\n child._inCompactHbox = true;\r\n if (inCompactHbox) {\r\n delete child.flex;\r\n }\r\n }\r\n }\r\n }\r\n }", "function compactLayout(layout: MosaicNode): MosaicNode {\n if (typeof layout === \"string\") {\n return layout;\n }\n\n const prunedChildren = [layout.first, layout.second].filter(Boolean).map(compactLayout);\n return prunedChildren.length < 2\n ? prunedChildren[0]\n : {\n ...layout,\n first: prunedChildren[0],\n second: prunedChildren[1],\n };\n}", "function collapseItem(item) {\n\t \n\t // If we are loading once then lets save view when we collapse it incase it's changed\n\t if (_options.loadOnce)\n item._detailContent = $(\"#innerDeatilView_\" + item.id).html();\n\t\t\n item._collapsed = true;\n for (var idx = 1; idx <= item._sizePadding; idx++) {\n _dataView.deleteItem(item.id + \".\" + idx);\n }\n item._sizePadding = 0;\n _dataView.updateItem(item.id, item);\n\n // Remove the item from the expandedRows\n _expandedRows = _expandedRows.filter(function (r) {\n return r.id !== item.id;\n });\n }", "function compactMode(menuItem){\n\t\treturn Sfx.getComputedStyle(menuItem.parentNode, \"float\") == \"none\";\n\t}", "__onLayout(e, key) {\n const {\n height,\n } = e.nativeEvent.layout;\n const {\n onItemPlaced,\n } = this.props;\n this.requestAnimationFrame(() => {\n const {\n items,\n } = this.state;\n const heights = this.__getColumnHeights(\n this.props,\n this.state,\n );\n const item = this.props.items\n .filter((item) => item.key === key)[0];\n const parentKeys = this.props.items\n .map(({ key }) => key);\n const minHeight = Math.min(...heights);\n const column = heights.indexOf(minHeight);\n this.setState(\n {\n // XXX: Here, alongside updating the item position,\n // we also clean out any keys which are no longer\n // referenced by the parent.\n items: Object.entries({\n ...items,\n [key]: {\n height,\n column,\n },\n })\n .filter((entry) => {\n return parentKeys.indexOf(entry[0]) >= 0;\n })\n .reduce(\n (obj, entry) => {\n return ({\n ...obj,\n [entry[0]]: entry[1],\n });\n },\n {},\n ),\n },\n () => {\n return onItemPlaced(\n item,\n );\n },\n );\n });\n }", "collapseExpandedItem() {\n if (this.expandedItem !== null) {\n this.expandedItem.expanded = false;\n this.expandedItem = null;\n }\n }", "compact() {\n let compactedSize = 0;\n let {\n table,\n table: {\n length\n },\n heap\n } = this;\n\n for (let i = 0; i < length; i += 3\n /* ENTRY_SIZE */\n ) {\n let offset = table[i];\n let info = table[i + 1\n /* INFO_OFFSET */\n ]; // @ts-ignore (this whole function is currently unused)\n\n let size = info & Size.SIZE_MASK;\n let state = info & 3\n /* STATE_MASK */\n >> 30;\n\n if (state === 2\n /* Purged */\n ) {\n continue;\n } else if (state === 1\n /* Freed */\n ) {\n // transition to \"already freed\" aka \"purged\"\n // a good improvement would be to reuse\n // these slots\n table[i + 1\n /* INFO_OFFSET */\n ] = changeState(info, 2\n /* Purged */\n );\n compactedSize += size;\n } else if (state === 0\n /* Allocated */\n ) {\n for (let j = offset; j <= i + size; j++) {\n heap[j - compactedSize] = heap[j];\n }\n\n table[i] = offset - compactedSize;\n } else if (state === 3\n /* Pointer */\n ) {\n table[i] = offset - compactedSize;\n }\n }\n\n this.offset = this.offset - compactedSize;\n }", "compact() {\n let compactedSize = 0;\n let {\n table,\n table: {\n length\n },\n heap\n } = this;\n\n for (let i = 0; i < length; i += 3\n /* ENTRY_SIZE */\n ) {\n let offset = table[i];\n let info = table[i + 1\n /* INFO_OFFSET */\n ]; // @ts-ignore (this whole function is currently unused)\n\n let size = info & Size.SIZE_MASK;\n let state = info & 3\n /* STATE_MASK */\n >> 30;\n\n if (state === 2\n /* Purged */\n ) {\n continue;\n } else if (state === 1\n /* Freed */\n ) {\n // transition to \"already freed\" aka \"purged\"\n // a good improvement would be to reuse\n // these slots\n table[i + 1\n /* INFO_OFFSET */\n ] = changeState(info, 2\n /* Purged */\n );\n compactedSize += size;\n } else if (state === 0\n /* Allocated */\n ) {\n for (let j = offset; j <= i + size; j++) {\n heap[j - compactedSize] = heap[j];\n }\n\n table[i] = offset - compactedSize;\n } else if (state === 3\n /* Pointer */\n ) {\n table[i] = offset - compactedSize;\n }\n }\n\n this.offset = this.offset - compactedSize;\n }", "compact() {\n let compactedSize = 0;\n let {\n table,\n table: {\n length\n },\n heap\n } = this;\n\n for (let i = 0; i < length; i += 3\n /* ENTRY_SIZE */\n ) {\n let offset = table[i];\n let info = table[i + 1\n /* INFO_OFFSET */\n ]; // @ts-ignore (this whole function is currently unused)\n\n let size = info & Size.SIZE_MASK;\n let state = info & 3\n /* STATE_MASK */\n >> 30;\n\n if (state === 2\n /* Purged */\n ) {\n continue;\n } else if (state === 1\n /* Freed */\n ) {\n // transition to \"already freed\" aka \"purged\"\n // a good improvement would be to reuse\n // these slots\n table[i + 1\n /* INFO_OFFSET */\n ] = changeState(info, 2\n /* Purged */\n );\n compactedSize += size;\n } else if (state === 0\n /* Allocated */\n ) {\n for (let j = offset; j <= i + size; j++) {\n heap[j - compactedSize] = heap[j];\n }\n\n table[i] = offset - compactedSize;\n } else if (state === 3\n /* Pointer */\n ) {\n table[i] = offset - compactedSize;\n }\n }\n\n this.offset = this.offset - compactedSize;\n }", "compact() {\n let compactedSize = 0;\n let {\n handleTable,\n handleState,\n heap\n } = this;\n\n for (let i = 0; i < length; i++) {\n let offset = handleTable[i];\n let size = handleTable[i + 1] - offset;\n let state = handleState[i];\n\n if (state === 2\n /* Purged */\n ) {\n continue;\n } else if (state === 1\n /* Freed */\n ) {\n // transition to \"already freed\" aka \"purged\"\n // a good improvement would be to reuse\n // these slots\n handleState[i] = 2\n /* Purged */\n ;\n compactedSize += size;\n } else if (state === 0\n /* Allocated */\n ) {\n for (let j = offset; j <= i + size; j++) {\n heap[j - compactedSize] = heap[j];\n }\n\n handleTable[i] = offset - compactedSize;\n } else if (state === 3\n /* Pointer */\n ) {\n handleTable[i] = offset - compactedSize;\n }\n }\n\n this.offset = this.offset - compactedSize;\n }", "collapse(index, programmaticUse) {\n const that = this;\n\n index = that._validateItemsIndex(index, 'collapse');\n\n if (isNaN(index)) {\n return;\n }\n\n const isExpanded = that._items[index].expanded;\n\n if ((!isExpanded) || (that._expandModeIs(['single', 'singleFitHeight']) && that.expandedIndexes.indexOf(index) > -1)) {\n return;\n }\n\n that._collapseItem(index, programmaticUse);\n }", "_collapseItem(index, programmaticUse) {\n const that = this;\n let item = that._items[index];\n\n if (!item.expanded) {\n return;\n }\n\n if (that.expandMode === 'none' && programmaticUse) {\n return;\n }\n\n item.expanded = false;\n that.$.fireEvent('collapsing', {\n 'index': index,\n 'label': item.label,\n 'content': item.content.innerHTML\n });\n\n if (that.expandedIndexes.indexOf(index) > -1) {\n let positionInExpandedIndexes = that.expandedIndexes.indexOf(index),\n currentIndexes = that.expandedIndexes.slice();\n\n currentIndexes.splice(positionInExpandedIndexes, 1);\n that.expandedIndexes = currentIndexes;\n }\n\n item.$.accordionItemContent.style.height = '';\n that._handleAnimationsDuration(item, index, 'collapsed');\n }", "function resetHiddenItemSize() {\n TweenLite.to(_element, 0, {scale: 1});\n }", "function resolveCompactionCollision(layout, item, moveToCoord, axis) {\n var sizeProp = heightWidth[axis];\n item[axis] += 1;\n var itemIndex = layout.indexOf(item);\n\n // Go through each item we collide with.\n for (var _i4 = itemIndex + 1; _i4 < layout.length; _i4++) {\n var otherItem = layout[_i4];\n // Ignore static items\n if (otherItem.static) continue;\n\n // Optimization: we can break early if we know we're past this el\n // We can do this b/c it's a sorted layout\n if (otherItem.y > item.y + item.h) break;\n\n if (collides(item, otherItem)) {\n resolveCompactionCollision(layout, otherItem, moveToCoord + item[sizeProp], axis);\n }\n }\n\n item[axis] = moveToCoord;\n}", "collapse(item, far) {\n const that = this;\n\n if (typeof item === 'number') {\n item = that._items[item];\n }\n\n if (!item) {\n return;\n }\n\n const closestSplitter = (that.enableShadowDOM ? item.getRootNode().host : item).closest('jqx-splitter');\n\n if (item instanceof JQX.SplitterItem && closestSplitter === that) {\n item.collapse(far);\n return;\n }\n\n if (typeof item !== 'number' || !that._items[item]) {\n that.error(that.localize('invalidIndex', { elementType: that.nodeName.toLowerCase(), method: 'collapse' }));\n return;\n }\n\n item.collapse(far);\n }", "remove() {\n this._item = null;\n this.render();\n }", "function compact(tree, commonmark) {\n var modifier = modify(iterator);\n\n visit(tree, visitor);\n\n return tree;\n\n function visitor(node) {\n if (node.children) {\n modifier(node);\n }\n }\n\n function iterator(child, index, parent) {\n var siblings = parent.children;\n var prev = index && siblings[index - 1];\n\n if (\n prev &&\n child.type === prev.type &&\n mergeable(prev, commonmark) &&\n mergeable(child, commonmark)\n ) {\n if (child.value) {\n prev.value += child.value;\n }\n\n if (child.children) {\n prev.children = prev.children.concat(child.children);\n }\n\n siblings.splice(index, 1);\n\n if (prev.position && child.position) {\n prev.position.end = child.position.end;\n }\n\n return index;\n }\n }\n}", "async shrink() {\n this._stopAnimation(this._icon, 'grow');\n }", "function clean_item()\n{\n // clean widget area before any add-action\n RMPApplication.debug (\"begin Item cleaned\");\n c_debug(debug.init, \"=> clean_item\");\n id_details_item.setVisible(true);\n id_details_item.open();\n RMPApplication.set(\"my_item\", \"{}\");\n RMPApplication.set(\"action\", \"add\");\n RMPApplication.debug(\"end \" + itemName + \" Widget Area cleaned\");\n}", "function shrink(id) {\n var node = document.getElementById(id);\n var nodes = node.children;\n var titleStyle = nodes[0].style.display;\n var listStyle = nodes[1].style.display;\n\n nodes[0].style.display = \"block\";\n nodes[1].style.display = \"none\";\n}", "deleteItem() {\n this.view.removeFromParentWithTransition(\"remove\", 400);\n if (this.item != null) {\n this.itemDao.deleteById(this.item.getId());\n }\n }", "function expandItem(event) {\n\t\t\tvar targetElement = event,\n\t\t\t\ttargetElement$ = $(targetElement),\n\t\t\t\tnewHeight = (targetElement && targetElement.data(\"fullheight\")) ? targetElement.data(\"fullheight\") : \"\";\n\n\t\t\ttargetElement$.height(newHeight).removeAttr(\"style\");\n\t\t\ttargetElement$.parents(\".normalPostEntryItem\").first().find(\".postExpandClass\").remove();\n\t\t}", "function shrinkLayoutContent_DDK2(iPane, iSection) {\n\t\tvar selector,\n\t\t\t$pane,\n\t\t\t$content,\n\t\t\tp = asPane[iPane],\n\t\t\tsec = iSection? (typeof iSection === \"string\"? iSection : asSection[iSection]) : \"middle\"\n\t\t;\n\n\t\tif (DDK.accordion[p] !== undefined && DDK.accordion[p][sec] !== undefined) {\n\t\t\tselector = \"#layout_\" + (sec === \"middle\"? \"\" : sec + \"_\") + p + \"_accordion > .ui-accordion-content-active\";\n\t\t} else if (DDK.tabs[p] !== undefined && DDK.tabs[p][sec] !== undefined) {\n\t\t\tselector = \"#layout_\" + (sec === \"middle\"? \"\" : sec + \"_\") + \"content_\" + p + \" > .ui-tabs-panel:visible\";\n\t\t} else {\n\t\t\tselector = \"#layout_\" + (sec === \"middle\"? \"\" : sec + \"_\") + \"content_\" + p;\n\t\t}\n\n\t\t$pane = $(selector);\n\t\t$content = $pane.children(\"div.ps-content-row:visible, div.ps-content-block:visible\").not(\".ps-content-fixed\");\n\n\t\t$content\n\t\t\t.addClass(\"ddk-restrict-overflow\")\n\t\t\t.width(layoutContentMinwidth);\n\n\t\t$content.each(function() {\n\t\t\tvar $this = $(this);\n\t\t\tif ($this.hasClass(\"ps-content-block\")) {\n\t\t\t\t$this.height(layoutContentMinheight);\n\t\t\t}\n\t\t});\n\t}", "function closeCart() {\n document.getElementById(\"myItem\").style.width = \"0%\";\n}", "clean() {\r\n this.items.forEach((item) => {\r\n if (item.div.classList.contains(\"pivot\")) {\r\n item.div.classList.remove(\"pivot\");\r\n }\r\n });\r\n }", "get canCompact()\n\t{\n\t\treturn true;\n\t}", "function PackItemOverlay() {}", "function resolveCompactionCollision(layout\n/*: Layout*/\n, item\n/*: LayoutItem*/\n, moveToCoord\n/*: number*/\n, axis\n/*: \"x\" | \"y\"*/\n) {\n var sizeProp = heightWidth[axis];\n item[axis] += 1;\n var itemIndex = layout.map(function (layoutItem) {\n return layoutItem.i;\n }).indexOf(item.i); // Go through each item we collide with.\n\n for (var i = itemIndex + 1; i < layout.length; i++) {\n var otherItem = layout[i]; // Ignore static items\n\n if (otherItem.static) continue; // Optimization: we can break early if we know we're past this el\n // We can do this b/c it's a sorted layout\n\n if (otherItem.y > item.y + item.h) break;\n\n if (collides(item, otherItem)) {\n resolveCompactionCollision(layout, otherItem, moveToCoord + item[sizeProp], axis);\n }\n }\n\n item[axis] = moveToCoord;\n}", "expandListItem(index){\n var buttons = document.getElementsByClassName(\"collapsible\");\n var coll = document.getElementsByClassName(\"content\");\n if (coll[index].style.display === \"block\") {\n coll[index].style.display = \"none\";\n buttons[index].innerHTML = \"&#8744\";\n } else {\n coll[index].style.display = \"block\";\n buttons[index].innerHTML = \"&#8743\";\n }\n }", "function reaveal() {\n itemFive.style.display = \"block\";\n}", "_hideItems() {\n for (let [y, item] of this._items) {\n if (typeof y === 'number') {\n this._items.delete(y);\n this._items.set(Symbol(), item);\n\n item.remove();\n item.wrapper.classList.remove('selected');\n }\n }\n }", "showExpanded() {\n const { item } = this.props;\n if (this.props.expanded) {\n console.log(\"inside ShowExpanded\");\n return (\n <CardSection>\n <Text style={styles.cardStyle}>{item.description}</Text>\n </CardSection>\n );\n }\n }", "function clearBox(item) {\r\n item.style.backgroundColor = '';\r\n}", "function closeAdded () {\n document.getElementById(\"addeditem1\").style.width = \"0\";\n document.getElementById(\"addeditem1\").style.height = \"0\";\n}", "remove(item) {\n const that = this;\n\n if (typeof (item) === 'number') {\n item = that._items[item];\n }\n else if (typeof item === 'string') {\n item = document.getElementById(item);\n }\n\n if (!(item instanceof JQX.TabsWindow)) {\n that.error(that.localize('invalidIndex', { elementType: that.nodeName.toLowerCase(), method: 'remove' }));\n return;\n }\n\n if (item.closest('jqx-docking-layout') !== that) {\n that.error(that.localize('invalidNodeRemove', { elementType: that.nodeName.toLowerCase(), method: 'remove' }));\n return;\n }\n\n that.removeChild(item);\n }", "remove(index) {\n const that = this;\n let item;\n\n if (index instanceof HTMLElement) {\n if (!(index instanceof JQX.AccordionItem)) {\n that.error(that.localize('accordionItemRequired', { method: 'remove' }));\n }\n else if (!that.contains(index)) {\n that.error(that.localize('referenceNodeNotChild', { argument: 'node' }));\n }\n\n item = index;\n index = item.index;\n }\n else {\n index = that._validateItemsIndex(index, 'remove');\n\n if (isNaN(index)) {\n return;\n }\n\n item = that._items[index];\n }\n\n if (item) {\n item.parentNode.removeChild(item);\n that._storeItems();\n\n if (that._expandModeIs(['singleFitHeight'])) {\n that._preventAnimation = true;\n }\n\n if (that._expandModeIs(['single', 'singleFitHeight']) && index === that.expandedIndexes[0] && that._items.length > 0) {\n that._expandItem(0);\n that._selectedItem = that._items[0];\n that._selectedItemIndex = 0;\n that._itemIsFocussed = true;\n }\n\n that.expandedIndexes = that._getExpandedIndexes();\n that._updateExpanedContentHeight();\n that._updateInlineHeight();\n that._storeItemsCoordinates();\n\n that._updateItemsIndexProperty();\n }\n }", "function decreaseItem(itemnumber)\n\t\t{\n\t\t\titems[itemnumber][1]--;\n\t\t\titemQuantityLabels[itemnumber].text = items[itemnumber][1];\n\t\t\tif (items[itemnumber][1] <= 0){\n\t\t\t\titemNameLabels[itemnumber].opacity = 0;\n\t\t\t\titemQuantityLabels[itemnumber].opacity = 0;\n\t\t\t}\n\t\t}", "minimize() {\n const that = this;\n\n if (that._minimized) {\n return;\n }\n\n that.$view.addClass('jqx-visibility-hidden');\n\n if (that.enableShadowDOM) {\n that.$.view.removeAttribute('id');\n\n const templateElements = that.$.view.querySelectorAll('[jqx-id]');\n\n for (let i = 0; i < templateElements.length; i++) {\n templateElements[i].removeAttribute('id');\n }\n }\n\n if (that._edgeMacFF) {\n that.$view.addClass('not-in-view');\n }\n\n that.$hamburgerIcon.removeClass('jqx-hidden');\n\n setTimeout(function () {\n if (that.dropDownAppendTo !== null) {\n that._appendMinimizedContainerToExternalElement(that.$.view);\n }\n\n that.$view.addClass('jqx-list-menu-view-minimized');\n\n that.$.mainContainer.scrollTop = 0;\n that._checkOverflow();\n }, 0);\n\n that._minimized = true;\n that.setAttribute('minimized', '');\n }", "function requestLayout() {\n clearContainer();\n items.forEach((item) => layout(item));\n }", "componentDidUpdate () {\n this.fixSectionItemMeasure()\n }", "expandItem(item){if(!this._isExpanded(item)){this.push(\"expandedItems\",item)}}", "compact() {\n return this._push(CLEAR, this.entries());\n }", "function toggleItemVis(item) {\n\n var itemId = item.id.split('-').pop();\n \n if ($('table#quoteQty-' + itemId + ' tbody.extra').is(':visible')) {\n collapseItem(item);\n }\n else {\n expandItem(item);\n }\n}", "_keepItemProportionsOnResize() {\n const that = this;\n let splitterBarsSize = 0,\n currentItemsSize = 0,\n resizableItems = [];\n\n that.bars.map(bar => splitterBarsSize += bar[that._measurements.size]);\n\n for (let i = 0; i < that._items.length; i++) {\n if (that._items[i].collapsed) {\n continue;\n }\n\n resizableItems.push(that._items[i]);\n currentItemsSize += that._items[i]._sizeBeforeCollapse || that._items[i][that._measurements.size];\n }\n\n if (that._splitterSize) {\n currentItemsSize = that._splitterSize;\n }\n\n const splitterSizeAfterResize = that[that._measurements.size];\n\n for (let i = 0; i < resizableItems.length; i++) {\n if (resizableItems[i].style[that._measurements.dimension].indexOf('%') > -1) {\n continue;\n }\n\n resizableItems[i].style[that._measurements.dimension] = (resizableItems[i]._sizeBeforeCollapse =\n (resizableItems[i]._sizeBeforeCollapse || resizableItems[i][that._measurements.size]) / currentItemsSize * splitterSizeAfterResize) + 'px';\n }\n }", "function eraseOne (attraction) {\n\t\t\tattraction.eraseMarker().eraseItineraryItem();\n\t\t}", "function fitItem(item, props, diff) {\r\r // Cache current values:\r var oldWidth = item.width; // alert(oldWidth);\r var oldHeight = item.height; // alert(oldHeight);\r\r // Wide or tall?\r if (item.width > item.height) {\r\r // alert('wide');\r item.width = props.width - diff.deltaX;\r\r // Scale height using ratio from width:\r var ratioW = item.width / oldWidth;\r item.height = oldHeight * ratioW;\r\r } else {\r\r // alert('tall');\r item.height = props.height - diff.deltaY;\r\r // Scale width using ratio from height:\r var ratioH = item.height / oldHeight;\r item.width = oldWidth * ratioH;\r\r }\r\r // Center:\r item.top = 0 - ((props.height / 2) - (item.height / 2));\r item.left = (props.width / 2) - (item.width / 2);\r\r // Deselect:\r item.selected = false;\r\r}", "function unfoldAllItems() {\n if (displayMode != 'expanded') {\n error(\"unfoldAllItems: can only unfold in expanded mode\");\n return;\n }\n \n foreachItem(function($item) {\n unfoldItem({interactive: true, batch: true, animated: false}, $item);\n });\n\n updateContentPaneButtons();\n}", "function compact(){\n\tvar things = [1,0,2,'',false,\"tom\"];\n\tconsole.log(_.compact(things));\n}", "function foldAllItems() {\n foreachItem(function($item) {\n foldItem({interactive: true, batch: true, animated: false}, $item);\n });\n\n updateContentPaneButtons();\n}", "popItem() {\n let item = this._items.pop();\n this.graphicNode.removeArg(item);\n if(this._items.length >= 1) {\n let last_comma_idx = this.graphicNode.holes.length - 2;\n this.graphicNode.holes.splice(last_comma_idx, 1);\n }\n return item;\n }", "remove(item){\n container.removeChild(item);\n }", "function compact(array) {\n return array.filter((a) => {\n return a;\n });\n}", "handleClick() {\n AppActions.clearItem(this.props.item.description);\n }", "beforeUpdate() {\n this.items.children[this.index].style.transform = `scale(1)`\n }", "_applyItemView(value, old) {\n if (value) {\n this.getStateManager().setState(\"itemView\", value);\n } else {\n this.getStateManager().removeState(\"itemView\");\n }\n }", "render() {\n // Get the items from state\n const {items}=this.state;\n const packedItems = items.filter(row=>row.packed===true);\n const unpackeditems= items.filter(row=>row.packed===false);\n return (\n <div className=\"Application\">\n <NewItem onSubmit={this.addItem}/>\n <CountDown />\n <Items title=\"Unpacked Items\" items={unpackeditems} onCheck={this.onCheck} removepackaedItems={this.removepackaedItems}/>\n <Items title=\"Packed Items\" items={packedItems} onCheck={this.onCheck} removepackaedItems={this.removepackaedItems}/>\n <button className=\"button full-width\" onClick={this.allUnmarked}>Mark All As Unpacked</button>\n {/*<WrappedComponent />*/}\n </div>\n );\n }", "function expand_compact_rac() {\n if($('#rac-view').is(\":visible\")) {\n \n $('.compact').each(function( i ) {\n $(this).fadeToggle(200 + i*100);\n });\n \n if($('button[name=expand]').attr(\"name\") === \"expand\") {\n $('button[name=expand]').text(\"Compact RAC\");\n $('button[name=expand]').attr(\"name\", \"compact\");\n } else if($('button[name=compact]').attr(\"name\") === \"compact\") {\n $('button[name=compact]').text(\"Expand RAC\");\n $('button[name=compact]').attr(\"name\", \"expand\");\n }\n }\n}", "function layout(item) {\n let groupContainer = requireContainer();\n\n let style = styles.get(item.decoration.style);\n if (!style) {\n (0,_utils__WEBPACK_IMPORTED_MODULE_1__.logErrorMessage)(`Unknown decoration style: ${item.decoration.style}`);\n return;\n }\n\n let itemContainer = document.createElement(\"div\");\n itemContainer.setAttribute(\"id\", item.id);\n itemContainer.setAttribute(\"data-style\", item.decoration.style);\n itemContainer.style.setProperty(\"pointer-events\", \"none\");\n\n let viewportWidth = window.innerWidth;\n let columnCount = parseInt(\n getComputedStyle(document.documentElement).getPropertyValue(\n \"column-count\"\n )\n );\n let pageWidth = viewportWidth / (columnCount || 1);\n let scrollingElement = document.scrollingElement;\n let xOffset = scrollingElement.scrollLeft;\n let yOffset = scrollingElement.scrollTop;\n\n function positionElement(element, rect, boundingRect) {\n element.style.position = \"absolute\";\n\n if (style.width === \"wrap\") {\n element.style.width = `${rect.width}px`;\n element.style.height = `${rect.height}px`;\n element.style.left = `${rect.left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n } else if (style.width === \"viewport\") {\n element.style.width = `${viewportWidth}px`;\n element.style.height = `${rect.height}px`;\n let left = Math.floor(rect.left / viewportWidth) * viewportWidth;\n element.style.left = `${left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n } else if (style.width === \"bounds\") {\n element.style.width = `${boundingRect.width}px`;\n element.style.height = `${rect.height}px`;\n element.style.left = `${boundingRect.left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n } else if (style.width === \"page\") {\n element.style.width = `${pageWidth}px`;\n element.style.height = `${rect.height}px`;\n let left = Math.floor(rect.left / pageWidth) * pageWidth;\n element.style.left = `${left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n }\n }\n\n let boundingRect = item.range.getBoundingClientRect();\n\n let elementTemplate;\n try {\n let template = document.createElement(\"template\");\n template.innerHTML = item.decoration.element.trim();\n elementTemplate = template.content.firstElementChild;\n } catch (error) {\n (0,_utils__WEBPACK_IMPORTED_MODULE_1__.logErrorMessage)(\n `Invalid decoration element \"${item.decoration.element}\": ${error.message}`\n );\n return;\n }\n\n if (style.layout === \"boxes\") {\n let doNotMergeHorizontallyAlignedRects = true;\n let clientRects = (0,_rect__WEBPACK_IMPORTED_MODULE_0__.getClientRectsNoOverlap)(\n item.range,\n doNotMergeHorizontallyAlignedRects\n );\n\n clientRects = clientRects.sort((r1, r2) => {\n if (r1.top < r2.top) {\n return -1;\n } else if (r1.top > r2.top) {\n return 1;\n } else {\n return 0;\n }\n });\n\n for (let clientRect of clientRects) {\n const line = elementTemplate.cloneNode(true);\n line.style.setProperty(\"pointer-events\", \"none\");\n positionElement(line, clientRect, boundingRect);\n itemContainer.append(line);\n }\n } else if (style.layout === \"bounds\") {\n const bounds = elementTemplate.cloneNode(true);\n bounds.style.setProperty(\"pointer-events\", \"none\");\n positionElement(bounds, boundingRect, boundingRect);\n\n itemContainer.append(bounds);\n }\n\n groupContainer.append(itemContainer);\n item.container = itemContainer;\n item.clickableElements = Array.from(\n itemContainer.querySelectorAll(\"[data-activable='1']\")\n );\n if (item.clickableElements.length === 0) {\n item.clickableElements = Array.from(itemContainer.children);\n }\n }", "decreaseItem(decrease = this.options.decrease) {\n this.setIndexesByDirection(false)\n Array.from(this.expander.children).forEach((ctx, i) => {\n if (i > (this.options.show - 1) && i > this.lastIndex && i <= (this.lastIndex + decrease)) {\n new Animate(ctx, i, this.lastIndex, {\n delay: this.options.animationDuration, align: 'end', reverse: true, event: function () {\n ctx.classList.add('hidden')\n }\n }).animate()\n }\n })\n }", "function buildCompactText( options ){\n var $result = $();\n options.title = options.title || (options.label ? options.label.text : null);\n $result = $result.add(\n $._bsCreateIcon(\n {icon: options.label ? options.label.icon : 'fas fa_'},\n null,\n options.title,\n 'part-of-compact-text fa-fw text-center flex-grow-0 align-self-center'\n )\n );\n\n var $content = $('<div/>')\n ._bsAddHtml( options )\n .addClass('flex-grow-1');\n\n if (options.title)\n $content.i18n(options.title, 'title');\n\n return $result.add( $content );\n }", "constructor(layout, game, location, properties, underlay) {\n let that = this;\n\n this.location = location;\n\n this.properties = properties;\n this.state = {};\n this._itemInstances = {};\n\n let div = layout;\n\n let itemLayout;\n let updateItemPositions;\n let removeItem;\n if (properties.layout === \"stack\") {\n let itemsLayout = div.packed().overlay();\n itemsLayout.$.addClass(\"stack\");\n itemLayout = function () {\n return itemsLayout.overlay().packed();\n };\n updateItemPositions = function () {\n let widthToDivide = 0.3; // 30%\n let children = [];\n let randomFound = null;\n for (const key in that._itemInstances) {\n let i = that._itemInstances[key];\n if (\n i.item.properties.hidden === undefined &&\n i.item.properties.invisible === undefined\n ) {\n children.push(i);\n }\n if (i.item.properties.random !== undefined) {\n randomFound = i;\n }\n }\n if (randomFound !== null) {\n let filtered = [];\n for (const i of children) {\n if (i.infinite || i === randomFound) {\n filtered.push(i);\n }\n }\n children = filtered;\n }\n let n = children.length;\n if (n === 0) {\n return;\n }\n if (n === 1) {\n children[0].$.parent().css({\n left: 0,\n top: 0,\n });\n return;\n }\n for (const key in children) {\n let angle = Math.PI / 2 + ((Math.PI * 2.0) / n) * key;\n children[key].$.parent().css({\n left: Math.round(Math.cos(angle) * 100 * widthToDivide) + \"%\",\n top: Math.round(Math.sin(angle) * 100 * widthToDivide) + \"%\",\n });\n }\n };\n removeItem = function (i) {\n i.$.parent().remove(); //TODO Upgrade Layout class to handle remove/addClass/removeClass/attr on set()\n updateItemPositions();\n };\n } else {\n let cellLayout;\n if (properties.layout === \"vertical\") {\n cellLayout = div.vertical();\n } else {\n cellLayout = div.horizontal();\n }\n itemLayout = function () {\n return cellLayout.add();\n };\n updateItemPositions = function () {\n let stackableItems = [];\n for (const key in that._itemInstances) {\n if (that._itemInstances[key].item.properties.stackable !== undefined) {\n stackableItems.push(that._itemInstances[key]);\n }\n }\n for (const key in stackableItems) {\n if (key < stackableItems.length - 1) {\n stackableItems[key].$.addClass(\"stacking\");\n } else {\n stackableItems[key].$.removeClass(\"stacking\");\n }\n }\n };\n removeItem = function (i) {\n i.$.remove();\n updateItemPositions();\n };\n }\n\n div.$.addClass(\"spot\")\n .attr(\"data-location\", location)\n .attr(\"data-id\", \"spot:\" + location);\n for (const key in properties) {\n if (key !== \"layout\") {\n div.$.addClass(\"property-\" + key);\n }\n }\n\n let overlayDiv = layout.underlay();\n overlayDiv.$.addClass(\"overlay\");\n\n if (underlay !== undefined) {\n let underlayDiv = layout.underlay();\n underlayDiv.set(underlay);\n underlayDiv.$.addClass(\"underlay\");\n }\n\n this.$ = div.$;\n\n let updateRandom = function () {\n let randomFound = null;\n let total = 0;\n for (const key in that._itemInstances) {\n let i = that._itemInstances[key];\n if (i.item.properties.random !== undefined && !i.infinite) {\n randomFound = i;\n } else if (i.item.properties.hidden === undefined && !i.infinite) {\n total += i.count;\n }\n }\n div.$.removeClass(\"random\");\n if (randomFound !== null) {\n div.$.addClass(\"random\");\n randomFound.setState(\"auto_flag\", \"\" + total);\n }\n };\n /**\n * destroys the infos in the given instance\n * @param instance\n */\n let destroy = function (instance) {\n if (instance.faceIcon !== null) {\n instance.faceIcon.destroy();\n game.friendFaces.remove(instance.faceIcon);\n }\n\n instance.spot = null;\n //%% instance.$.addClass(\"destroyed\"); // In case it is cached somewhere\n game.dragAndDropManager.unconfigureItemInstance(instance);\n removeItem(instance);\n };\n /**\n * update the spot Overlays\n */\n let updateOverlays = function () {\n let overlayFound = new Multimap.Array();\n for (const key in that._itemInstances) {\n let i = that._itemInstances[key];\n if (i.item.properties.overlay !== undefined) {\n let consideredKind;\n let generalKinds = GeneralReference.getGeneralKinds(i.item.kind);\n if (generalKinds.length === 0) {\n consideredKind = i.item.kind;\n } else {\n consideredKind = generalKinds[generalKinds.length - 1].kind;\n }\n overlayFound.get(consideredKind).add(i);\n i.$.removeClass(\"overlayed\");\n }\n }\n overlayDiv.$.empty();\n overlayFound.each(function (overlayFoundPerKind, k) {\n // console.log(\"Found overlay [\" + k + \"] \" + overlayFoundPerKind[0].item.kind + \" (\" + overlayFoundPerKind[0].count + \")\");\n if (overlayFoundPerKind.length === 1) {\n let onlyOverlayFoundPerKind = overlayFoundPerKind[0];\n if (\n (properties.overlayable !== undefined &&\n onlyOverlayFoundPerKind.count === 1) ||\n (onlyOverlayFoundPerKind.item.properties.invisible !== undefined &&\n onlyOverlayFoundPerKind.infinite)\n ) {\n onlyOverlayFoundPerKind.item.createInstance(\n overlayDiv.overlay(),\n false,\n onlyOverlayFoundPerKind.liveId\n );\n onlyOverlayFoundPerKind.$.addClass(\"overlayed\");\n }\n }\n });\n };\n /**\n * update the spots modifiers\n */\n let updateModifiers = function () {\n let modifierFound = new Multimap.Array();\n for (const key in that._itemInstances) {\n let i = that._itemInstances[key];\n if (i.infinite) {\n return;\n }\n if (i.count !== 1) {\n return;\n }\n for (const key in i.item.modifiers) {\n modifierFound.get(key).add(i.item.modifiers[key]);\n }\n }\n that.state = {};\n modifierFound.each(function (a, k) {\n let s = null;\n for (const v of a) {\n s = v;\n }\n that.state[k] = s; // Let's keep only the last one\n });\n DomUtils.eachClass(div.$, function (c) {\n if (c.startsWith(\"state-\")) {\n div.$.removeClass(c);\n }\n });\n for (const key in that.state) {\n div.$.addClass(\"state-\" + key + \"-\" + that.state[key]);\n }\n };\n\n this._destroyItem = function (kind, count) {\n // console.log(\"Destroying \" + kind + \" from \" + location + \" (\" + count + \")\");\n if (kind === undefined) {\n for (const i of that._itemInstances) {\n destroy(i)\n }\n that._itemInstances = {};\n updateOverlays();\n updateRandom();\n updateModifiers();\n } else {\n let existingItemInstance = that._itemInstances[kind];\n if (existingItemInstance === undefined) {\n return;\n }\n if (count === undefined) {\n delete that._itemInstances[kind];\n destroy(existingItemInstance);\n } else {\n if (!existingItemInstance.infinite) {\n existingItemInstance.inc(-count);\n if (!(\"count\" in existingItemInstance.state) &&\n existingItemInstance.count === 0\n ) {\n delete that._itemInstances[existingItemInstance.item.kind];\n destroy(existingItemInstance);\n }\n }\n }\n if (existingItemInstance.item.properties.overlay !== undefined) {\n updateOverlays();\n }\n if ($.isEmptyObject(existingItemInstance.item.modifiers)) {\n updateModifiers();\n }\n //if (existingItemInstance.item.properties.random !== undefined) {\n updateRandom();\n //}\n }\n };\n\n this._setItemState = function (kind, key, value) {\n let existingItemInstance = that._itemInstances[kind];\n if (existingItemInstance === undefined) {\n return;\n }\n existingItemInstance.setState(key, value);\n };\n\n this._addItem = function (kind, count, liveId) {\n // console.log(\"Adding \" + kind + \" to \" + location + \" (\" + count + \") \" + liveId);\n\n let existingItemInstance = that._itemInstances[kind];\n if (\n existingItemInstance !== undefined &&\n existingItemInstance.faceIcon !== null\n ) {\n existingItemInstance.faceIcon.update(null, liveId);\n game.friendFaces.remove(existingItemInstance.faceIcon);\n if (existingItemInstance.liveId !== liveId) {\n existingItemInstance.setLiveId(liveId);\n game.friendFaces.add(existingItemInstance.faceIcon);\n } else {\n existingItemInstance.setLiveId();\n }\n /*\n\t\t\t\tif (existingItemInstance.infinite) {\n\t\t\t\t\tcount = undefined;\n\t\t\t\t}\n\t\t\t\tdelete that._itemInstances[kind];\n\t\t\t\tdestroy(existingItemInstance);\n\t\t\t\texistingItemInstance = undefined;\n\t\t\t\t*/\n }\n\n if (existingItemInstance === undefined) {\n let item = game.itemManager.getItem(kind);\n\n if (item !== null) {\n if (item.properties.unique !== undefined && count !== undefined) {\n for (const i of that._itemInstances) {\n if (\n i.item.properties.unique === item.properties.unique &&\n !i.infinite\n ) {\n delete that._itemInstances[i.item.kind];\n destroy(i);\n }\n }\n }\n\n existingItemInstance = item.createInstance(\n itemLayout(),\n true,\n liveId\n );\n existingItemInstance.spot = that;\n that._itemInstances[kind] = existingItemInstance;\n existingItemInstance.$.attr(\"data-location\", location).attr(\n \"data-id\",\n \"item:\" + location + \":\" + kind\n );\n if (item.properties.steady === undefined) {\n //%% existingItemInstance.$.addClass(\"hoverable\");\n game.dragAndDropManager.configureItemInstance(existingItemInstance);\n }\n\n if (existingItemInstance.faceIcon !== null) {\n existingItemInstance.setLiveId(); // Initialized deactivated\n // game.friendFaces.add(existingItemInstance.faceIcon);\n }\n updateItemPositions();\n } else {\n existingItemInstance = null;\n }\n }\n if (existingItemInstance !== null) {\n if (count === undefined) {\n existingItemInstance.setInfinite();\n } else {\n existingItemInstance.inc(count);\n }\n\n if (existingItemInstance.item.properties.overlay !== undefined) {\n updateOverlays();\n }\n if ($.isEmptyObject(existingItemInstance.item.modifiers)) {\n updateModifiers();\n }\n //if (existingItemInstance.item.properties.random !== undefined) {\n updateRandom();\n //}\n }\n };\n\n this._updateItem = function (kind, liveId) {\n let existingItemInstance = that._itemInstances[kind];\n if (\n existingItemInstance === undefined ||\n existingItemInstance.faceIcon === null\n ) {\n return;\n }\n if (existingItemInstance.liveId !== undefined) {\n game.friendFaces.remove(existingItemInstance.faceIcon);\n }\n existingItemInstance.faceIcon.update(null, liveId);\n if (existingItemInstance.liveId !== liveId) {\n existingItemInstance.setLiveId(liveId);\n game.friendFaces.add(existingItemInstance.faceIcon);\n } else {\n existingItemInstance.setLiveId();\n }\n };\n\n this._destroy = function () {\n //%% that.$.addClass(\"destroyed\");\n that.$.remove();\n };\n }", "change() {\n this._closeAll();\n removeClass(this.el, ['ready', 'show-more', 'measured']);\n var v = document.createDocumentFragment();\n for (var i = 0; i < this.items.length; i++) {\n v.appendChild(this.items[i].el);\n }\n this.visibleContainer.appendChild(v);\n this._initItems();\n addClass(this.el, 'measured');\n this._calculateStyles();\n addClass(this.el, 'ready');\n return this;\n }", "_refreshCostume () {\n if (this.costume) {\n this.width = this.costume.visibleWidth\n this.height = this.costume.visibleHeight\n }\n\n this.element ? this.element.update(this) : null\n }", "_renderItems() {\n this.views.forEach(function(view) {\n view.remove();\n });\n this.views = [];\n this.$listBody.empty();\n\n this.model.collection.each(item => {\n this._addItem(item, item.collection, {\n animate: false,\n });\n });\n }", "getIsFilled() {\n return this.getAllItemsWidth() >= this.getContainerWidth();\n }", "function checkCanCompactFolder(folder) {\n return (\n folder.canCompact &&\n !folder.getFlag(Ci.nsMsgFolderFlags.Virtual) &&\n folder.isCommandEnabled(\"cmd_compactFolder\")\n );\n }", "deleteItem() {\n const index = this.items.findIndex((e) => e.id === this.editItemID);\n this.items.splice(index, 1);\n this.editItemID = null;\n }", "function compressItems(items) {\n console.log(items[0]); // O(1) --> Constant time\n}", "takeout(item) {\n var index = this.item.indexOf(item);\n if (this.open = true && index > -1) {\n this.item.splice(index, 1);\n alert(\"Item has been removed from the backpack.\");\n }\n }", "_getCompactModeDisplayValue(items) {\n const suffix = items.length === 0 || items.length > 1 ? 'values' : 'value';\n return `${items.length} ${suffix}`;\n }", "async compact() {\n return await this.db.persistence.compactDatafile();\n }", "function hideEditBox(expandedItem, affectedItems) {\n var collapseAnimation = WinJS.UI.Animation.createCollapseAnimation(expandedItem, affectedItems);\n // Apply styles\n expandedItem.style.position = \"absolute\";\n expandedItem.style.opacity = \"0\";\n // Execute animation\n collapseAnimation.execute().done(\n function () { expandedItem.style.display = \"none\"; }\n );\n }", "function compressInventoryItem(itemName) {\n\t//get the quantity of the item\n\tvar quantity = calcItemQuantity(itemName);\n\t\n\t//find the item buttons\n\tvar allInputs, itemInput, itemForm;\n\tallInputs = document.evaluate(\n\t \"//input[@value='\" + itemName + \"']\",\n\t document,\n\t null,\n\t XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,\n\t null);\n\t\t\n\t//if the item is actually in the inventory\n\tif (allInputs.snapshotLength > 0) {\n\t\tvar ammo, thisAmmo, weaponList, isWeapon;\n\t\t\n\t\t//if it is an ammo weapon\n\t\tif (itemName == \"shotgun\" || itemName == \"pistol\") {\n\t\t\tammo = 0;\n\t\t\tweaponList = \"\";\n\t\t\tisWeapon = true;\n\t\t}\n\t\telse {\n\t\t\tammo = \"\";\n\t\t\tweaponList = \"\";\n\t\t\tisWeapon = false;\n\t\t}\n\t\t\n\t\t//go through each item button after the first one\n\t\tfor (var i = 1; i < allInputs.snapshotLength; i++) {\n\t\t\t//get the current button\n\t\t\titemInput = allInputs.snapshotItem(i);\n\t\t\t//get the button's corresponding form\n\t\t\titemForm = itemInput.parentNode;\n\n\t\t\tif (isWeapon) {\n\t\t\t\t//get the amount of ammo\n\t\t\t\tthisAmmo = itemForm.textContent.replace(/\\D/g, \"\");\n\t\t\t\t\n\t\t\t\t//add this weapon's ammo to the list\n\t\t\t\tweaponList += \", \" + thisAmmo;\n\t\t\t\t\n\t\t\t\t//increase the total ammo\n\t\t\t\tammo += parseInt(thisAmmo);\n\t\t\t}\n\t\t\t\n\t\t\t//delete the form including the button\n\t\t\titemForm.parentNode.removeChild(itemForm);\n\t\t}\n\t\t\n\t\t//transform the first item button\n\t\titemInput = allInputs.snapshotItem(0);\n\t\titemForm = itemInput.parentNode;\n\t\tif (isWeapon) {\n\t\t\t//format the form as a weapon\n\t\t\tthisAmmo = itemForm.textContent.replace(/\\D/g, \"\");\n\t\t\tweaponList = thisAmmo + weaponList;\n\t\t\tammo += parseInt(thisAmmo);\n\t\t\titemForm.innerHTML = \"\";\n\t\t\titemForm.appendChild(itemInput);\n\t\t\titemForm.innerHTML = quantity + \" x \" + itemForm.innerHTML + \"(\" + weaponList + \") at \" + ammo + \" shots\";\n\t\t}\n\t\telse {\n\t\t\t//format the form as a normal item\n\t\t\titemForm.innerHTML = quantity + \" x \" + itemForm.innerHTML;\n\t\t}\n\t}\n}", "set isExpanded(value) {}", "destroy() {\n const bar = this.items[this.index][0];\n const content = this.items[this.index][1];\n hide(content);\n bar.removeAttribute(ATTRIBUTE_ACTIVE);\n content.removeAttribute(ATTRIBUTE_ACTIVE);\n }", "itemModeForceRender() {\n if (this.item) {\n this.forceRender();\n }\n }", "popItem() {\n let item = this._items.pop();\n this.graphicNode.removeAllItems();\n this._items.forEach((item) => {\n this.graphicNode.addItem(item);\n });\n return item;\n }", "function displayValid(entryItem) {\n entryItem.removeClass();\n}", "function deallocate(item) {\n var index = ctrl.allocated.sourceItems.indexOf(item);\n if (index >= 0) {\n ctrl.allocated.sourceItems.splice(index, 1);\n delete ctrl.allocatedIds[item.id];\n }\n }", "updateExpandIcon() {}", "function removeBagItem(itemIndex){\n bagInventory.splice(itemIndex,1);\n game.scene.run('UIS');\n}", "expand() {\n const previous = this._lastCurrent || (this._items.length > 0 && this._items[0].widget);\n if (previous) {\n this.activate(previous.id);\n }\n }", "removeFlipped ()\r\n {\r\n //card.classList.remove(\"revealed\");\r\n this.arr.forEach (card => {card.classList.remove(\"visible\");})\r\n }", "function _compact() {\n DEBUG && _log.trace(\"Calling Compact().\");\n var droppedRequests = { count: 0};\n _compactChunks(_audioChunks, droppedRequests);\n _compactChunks(_videoChunks, droppedRequests);\n _compactByteBuffer(droppedRequests);\n\n // tell the ASE session to update the pipeline bookkeeping\n if (config.useASE && playback.streamingSession && config.pruneRequestsFromNative &&\n (droppedRequests.count > 0)) {\n _pruneASERequests();\n }\n }", "_showItems () {\n this.listItems.forEach(listItem => listItem.classList.remove(\"responsive-hidden\"));\n }", "function completeItem() {\n const item = this.parentNode.parentNode\n const parent = item.parentNode\n const id = parent.id\n\n /* Check if the item should be added to the readed list or to re-added to unread list */\n const target = (id === 'unreadList') ? document.getElementById('readedList'):document.getElementById('unreadList')\n \n /* Remove from readed list */\n parent.removeChild(item)\n /* Re-add to unreadList */\n target.insertBefore(item, target.childNodes[0])\n}", "function removeItem() {\n let item = this.parentNode.parentNode;\n let parent = item.parentNode;\n parent.removeChild(item);\n deleteTasks();\n \n}", "removeChild(node) {\n const that = this;\n\n function getNewNeighbourItem(deletedItemIndex, item, direction) {\n let index = deletedItemIndex,\n newNeighbourItem = that._items[index];\n\n while (newNeighbourItem) {\n if (!newNeighbourItem.collapsed) {\n break;\n }\n\n newNeighbourItem = that._items[index += direction]\n }\n\n return newNeighbourItem;\n }\n\n if (!that.isCompleted || node instanceof HTMLElement && node.classList.contains('jqx-resize-trigger-container')) {\n const args = Array.prototype.slice.call(arguments, 2);\n return HTMLElement.prototype.removeChild.apply(that, args.concat(Array.prototype.slice.call(arguments)));\n }\n\n if (!node || !(node instanceof JQX.SplitterItem)) {\n that.error(that.localize('invalidNode', { elementType: that.nodeName.toLowerCase(), method: 'removeChild', node: 'node' }));\n return\n }\n\n if (!that._items) {\n return;\n }\n\n let itemIndex = that._items.indexOf(node);\n\n if (node.collapsed) {\n that.$.container.removeChild(that._items.indexOf(node._neighbourItem) > itemIndex ? node.nextElementSibling : node.previousElementSibling);\n }\n else {\n if (node.previousElementSibling instanceof JQX.SplitterBar) {\n that.$.container.removeChild(node.previousElementSibling);\n }\n else if (node.nextElementSibling instanceof JQX.SplitterBar) {\n that.$.container.removeChild(node.nextElementSibling);\n }\n }\n\n that._items.splice(itemIndex, 1);\n itemIndex = Math.max(0, itemIndex - 1);\n\n let totalItemSize = 0\n const uncollapsedItems = that._items.filter(item => !item.collapsed && !item.locked),\n nodeSize = node._sizeBeforeCollapse || node[that._measurements.size];\n\n uncollapsedItems.map(item => totalItemSize += ((item.style[that._measurements.dimension] ? item._sizeBeforeCollapse : 0) || item[that._measurements.size]));\n\n that.$.content.removeChild(node);\n\n //If all left items are collapsed, force uncollapsing of the last item\n if ((that._items.length === 1 && that._items[0].collapsed) || (that._items.length > 0 && that._items.map(item => item.collapsed).indexOf(false) < 0)) {\n const lastItem = that._items[that._items.length - 1];\n let context = lastItem.context;\n\n lastItem.context = lastItem;\n lastItem._expand();\n lastItem.context = context;\n }\n\n for (let i = 0; i < that._items.length; i++) {\n if (that._items[i].collapsed && that._items[i]._neighbourItem === node) {\n let splitterBar, splitterBarContext;\n\n that._items[i]._neighbourItem = getNewNeighbourItem(itemIndex, that._items[i], 1);\n\n if (!that._items[i]._neighbourItem) {\n that._items[i]._neighbourItem = getNewNeighbourItem(itemIndex, that._items[i], -1);\n splitterBar = that._items[i].previousElementSibling;\n\n if (splitterBar) {\n splitterBarContext = splitterBar.context;\n splitterBar.context = splitterBar;\n splitterBar.itemCollapsed = true;\n splitterBar.showFarButton = !(splitterBar.showNearButton = false);\n splitterBar.context = splitterBarContext;\n }\n }\n else {\n splitterBar = that._items[i].nextElementSibling;\n\n if (splitterBar) {\n splitterBarContext = splitterBar.context;\n splitterBar.context = splitterBar;\n splitterBar.itemCollapsed = true;\n splitterBar.showNearButton = !(splitterBar.showFarButton = false);\n splitterBar.context = splitterBarContext;\n }\n }\n }\n }\n\n if (that.autoFitMode === 'proportional') {\n let currentItemSize, newSize, itemMinSize;\n\n for (let i = 0; i < uncollapsedItems.length; i++) {\n currentItemSize = uncollapsedItems[i]._sizeBeforeCollapse || uncollapsedItems[i][that._measurements.size];\n newSize = currentItemSize + (nodeSize * (currentItemSize / totalItemSize));\n\n //Check for item min size\n itemMinSize = uncollapsedItems[i]._sizeLimits[that._measurements.minDimension] || 0;\n uncollapsedItems[i].style[that._measurements.dimension] = (uncollapsedItems[i]._sizeBeforeCollapse = Math.max(0, newSize)) + 'px';\n\n if (itemMinSize > currentItemSize) {\n uncollapsedItems[i][that._measurements.minDimension] = newSize + 'px';\n }\n }\n }\n\n that._autoFitItems();\n }", "function minusItem(){\n let elem = event.currentTarget.dataset.index;\n let elemParent = event.currentTarget.parentElement;\n elemParent.remove();\n pushCameArray();\n cameArray.splice(elem, 1);\n localStorage.setItem(localStorageKey, JSON.stringify(cameArray));\n}", "function clean (callback) {\n return del([layout.destPath], callback);\n}", "function flipCard(item) {\n debug(\"flipCard\", item);\n item.setAttribute(\"class\", \"card open show\");\n }", "function minimize()\n\t{\n\t\t// minimize container\n\t\tif (_container != null)\n\t\t{\n\t\t\t_container.css({\"overflow\": \"hidden\",\n\t\t\t\t\"height\": _options.minimizedHeight});\n\t\t\t_minimized = true;\n\t\t}\n\t}", "get compactOnPropsChange() { return this._compactOnPropsChange; }", "function removeItem() {\n const item = this.parentNode.parentNode\n const parent = item.parentNode\n parent.removeChild(item)\n}" ]
[ "0.6574337", "0.6574337", "0.65441877", "0.6206254", "0.583148", "0.56320024", "0.5434896", "0.5427741", "0.53075033", "0.521415", "0.519827", "0.51959985", "0.51774585", "0.51774585", "0.51774585", "0.5070988", "0.49896237", "0.49621382", "0.4931759", "0.4927066", "0.48434043", "0.48363563", "0.48305318", "0.48227662", "0.4818378", "0.4798573", "0.4794351", "0.476476", "0.46305346", "0.46216056", "0.46168146", "0.46048048", "0.46047992", "0.45861515", "0.4583095", "0.4580911", "0.4574649", "0.45584542", "0.455699", "0.45508382", "0.4546044", "0.4539689", "0.45394838", "0.45366108", "0.45233837", "0.4512785", "0.45125124", "0.4510006", "0.45088947", "0.45080358", "0.45041275", "0.45010644", "0.4498941", "0.44795573", "0.4445277", "0.44452277", "0.444382", "0.44427574", "0.44421497", "0.44408017", "0.44377297", "0.44352707", "0.44323993", "0.44279385", "0.44226164", "0.44117877", "0.4399568", "0.43940538", "0.43866575", "0.43859985", "0.43798816", "0.43561327", "0.43555096", "0.4352661", "0.434998", "0.43497226", "0.43484494", "0.43477362", "0.43380627", "0.43357226", "0.43340722", "0.43324786", "0.43291464", "0.43286017", "0.43266606", "0.43049592", "0.43002763", "0.4299953", "0.42934224", "0.42926434", "0.42839548", "0.42796576", "0.4279519", "0.42722577", "0.4270212", "0.4270134", "0.42659804", "0.42631632", "0.42614943", "0.42570385" ]
0.6029055
4
Flow can't really figure this out, so we just use Object
function autoBindHandlers(el, fns) { fns.forEach(function (key) { return el[key] = el[key].bind(el); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Object() {}", "function Object() {}", "function Object(){}", "function Object(){}", "function NXObject() {}", "get object() {\n\n }", "objd(obj) {\n\n return toObject(obj);\n }", "function Obj() {}", "function object(obj) {\n if (this == window && !isundefined(obj) && callable(obj['__object__']))\n return obj.__object__();\n throw 'The wormhole stop here. Please, is just javascript not python :)'; \n }", "toObject() { throw new Error('virtual function called') }", "function o(e){return\"[object Object]\"==={}.toString.call(e)}", "function Obj(){ return Literal.apply(this,arguments) }", "function obj(objec){\nreturn objec;\n}", "function c(e){return null!==e&&\"object\"==typeof e}", "function BasicObject() {}", "static initialize(obj, type, operation, value) { \n obj['type'] = type;\n obj['operation'] = operation;\n obj['value'] = value;\n }", "payloadToObject(payload){\n let object = {};\n for(let key in this.model) {\n if(payload[key] !== undefined) object[key] = payload[key];\n }\n return object;\n }", "function toObject(Ye){if(null==Ye)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(Ye)}", "function __Object__() {\n }", "obtain(){}", "execStateScopeObject(obj) {\n const serialized_scope = this.getProperties(obj.objectId);\n const scope = this.propertiesToObject(serialized_scope);\n return { value : () => scope,\n property : (prop) =>\n this.execStateScopeObjectProperty(serialized_scope, prop),\n properties : () => serialized_scope.map(elem => elem.value),\n propertyNames : () => serialized_scope.map(elem => elem.name)\n };\n }", "function BasicObject(){}", "function BasicObject(){}", "function instantiatePlainObject() {\n return {};\n }", "get objectReferenceValue() {}", "transfer(obj) {\n if (obj instanceof Frame) {\n if (obj.store != this) {\n if (obj.isanonymous()) {\n let size = obj.slots.length;\n let frame = new Frame(this);\n frame.slots = new Array(size);\n for (let i = 0; i < size; ++i) {\n frame.slots[i] = this.transfer(obj.slots[i]);\n }\n obj = frame;\n } else {\n obj = this.lookup(obj.id);\n }\n }\n } else if (obj instanceof Array) {\n let size = obj.length;\n let array = new Array(size);\n for (let i = 0; i < size; ++i) {\n array[i] = this.transfer(obj[i]);\n }\n obj = array;\n }\n return obj;\n }", "function r(t){return t&&\"object\"===typeof t}", "function o(n){return null!==n&&\"object\"==typeof n}", "get serializedObject() {}", "static get properties() { return {\nstate: {type:Object} \n}}", "objectify(key,value){\n \t return {\n [key]: value\n }\n }", "function t(e){if(null==e)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "function t(e){if(null==e)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "function o(e){return e&&\"object\"==typeof e&&!Array.isArray(e)}", "function r(e){return\"[object Object]\"==={}.toString.call(e)}", "function r(e){return\"[object Object]\"==={}.toString.call(e)}", "function object(o) {\n\treturn Object.create(o);\n}", "function Obj()\r\n{\r\n return {\r\n name: 'hamza',\r\n lastName : 'mubeen'\r\n }\r\n}", "toObject()\n{\n\nreturn{\n 'httpCode': this.httpCode,\n 'message': this.message,\n 'data': this.data,\n 'timestamp': this.timestamp\n}\n}", "function _valueOf(value) {\n var p = {};\n switch (value.type) {\n case 'object':\n p.value = {\n description: value.className,\n hasChildren: true,\n injectedScriptId: value.ref || value.handle,\n type: 'object'\n };\n break;\n case 'function':\n p.value = {\n description: value.text || 'function()',\n hasChildren: true,\n injectedScriptId: value.ref || value.handle,\n type: 'function'\n };\n break;\n case 'undefined':\n p.value = {description: 'undefined'};\n break;\n case 'null':\n p.value = {description: 'null'};\n break;\n case 'script':\n p.value = {description: value.text};\n break;\n default:\n p.value = {description: value.value};\n break;\n }\n return p;\n }", "function isObject(e){return Object.prototype.toString.call(e)===\"[object Object]\"}", "function instantiatePlainObject() {\n\t return {};\n\t }", "function instantiatePlainObject() {\n\t return {};\n\t }", "function instantiatePlainObject() {\n\t return {};\n\t }", "function returnObject(a) {\n return {// The object\n val: a\n };\n}", "get object() {\n\t\treturn this.#object;\n\t}", "static initialize(obj, result, msg) { \n obj['result'] = result;\n obj['msg'] = msg;\n }", "function dereference(obj) {\n\treturn JSON.parse(JSON.stringify(obj));\n}", "function t(e){if(null===e||e===void 0)throw new TypeError('Object.assign cannot be called with null or undefined');return Object(e)}", "function t(e){if(null===e||e===void 0)throw new TypeError('Object.assign cannot be called with null or undefined');return Object(e)}", "function t(e){if(null===e||e===void 0)throw new TypeError('Object.assign cannot be called with null or undefined');return Object(e)}", "function t(e){if(null===e||e===void 0)throw new TypeError('Object.assign cannot be called with null or undefined');return Object(e)}", "function t(e){if(null===e||e===void 0)throw new TypeError('Object.assign cannot be called with null or undefined');return Object(e)}", "function t(e){if(null===e||e===void 0)throw new TypeError('Object.assign cannot be called with null or undefined');return Object(e)}", "function t(e){if(null===e||e===void 0)throw new TypeError('Object.assign cannot be called with null or undefined');return Object(e)}", "function t(e){if(null===e||e===void 0)throw new TypeError('Object.assign cannot be called with null or undefined');return Object(e)}", "function t(e){if(null===e||e===void 0)throw new TypeError('Object.assign cannot be called with null or undefined');return Object(e)}", "function t(e){if(null===e||void 0===e)throw new TypeError('Object.assign cannot be called with null or undefined');return Object(e)}", "static initialize(obj, type) { \n obj['type'] = type;\n }", "static initialize(obj, type) { \n obj['type'] = type;\n }", "static initialize(obj, type) { \n obj['type'] = type;\n }", "function s(e){if(null==e)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "constructor(o) {\n var self = this;\n if (typeof o['asBigInteger'] !== 'undefined') {\n this.asBigInteger = o['asBigInteger'];\n }\n if (typeof o['asCharacter'] !== 'undefined') {\n this.asCharacter = o['asCharacter'];\n }\n if (typeof o['asBoolean'] !== 'undefined') {\n this.asBoolean = o['asBoolean'];\n }\n if (typeof o['asInt'] !== 'undefined') {\n this.asInt = o['asInt'];\n }\n if (typeof o['jsonArray'] !== 'undefined') {\n this.jsonArray = o['jsonArray'];\n }\n if (typeof o['jsonObject'] !== 'undefined') {\n this.jsonObject = o['jsonObject'];\n }\n if (typeof o['asDouble'] !== 'undefined') {\n this.asDouble = o['asDouble'];\n }\n if (typeof o['asString'] !== 'undefined') {\n this.asString = o['asString'];\n }\n if (typeof o['asFloat'] !== 'undefined') {\n this.asFloat = o['asFloat'];\n }\n if (typeof o['asJsonPrimitive'] !== 'undefined') {\n this.asJsonPrimitive = new exports.Com.Google.Gson.JsonPrimitive(o['asJsonPrimitive']);\n }\n if (typeof o['asJsonObject'] !== 'undefined') {\n this.asJsonObject = new exports.Com.Google.Gson.JsonObject(o['asJsonObject']);\n }\n if (typeof o['asJsonArray'] !== 'undefined') {\n this.asJsonArray = new exports.Com.Google.Gson.JsonArray(o['asJsonArray']);\n }\n if (typeof o['asByte'] !== 'undefined') {\n this.asByte = o['asByte'];\n }\n if (typeof o['asNumber'] !== 'undefined') {\n this.asNumber = new exports.Java.Lang.Number(o['asNumber']);\n }\n if (typeof o['jsonNull'] !== 'undefined') {\n this.jsonNull = o['jsonNull'];\n }\n if (typeof o['asLong'] !== 'undefined') {\n this.asLong = o['asLong'];\n }\n if (typeof o['asBigDecimal'] !== 'undefined') {\n this.asBigDecimal = o['asBigDecimal'];\n }\n if (typeof o['asShort'] !== 'undefined') {\n this.asShort = o['asShort'];\n }\n if (typeof o['jsonPrimitive'] !== 'undefined') {\n this.jsonPrimitive = o['jsonPrimitive'];\n }\n if (typeof o['asJsonNull'] !== 'undefined') {\n this.asJsonNull = new exports.Com.Google.Gson.JsonNull(o['asJsonNull']);\n }\n }", "function an(e){if(null==e)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "function Obj() {\n\tevents.EventEmitter.call(this);\n\tthis._data = {}; // Stores data\n\tthis._virtuals = {}; // Stores virtuals\n\tthis._type = {}; // Stores data types\n}", "function t(e){if(null===e||e===void 0)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "function t(e){if(null===e||e===void 0)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "function t(e){if(null===e||e===void 0)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "function t(e){if(null===e||e===void 0)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "function t(e){if(null===e||void 0===e)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "function t(e){if(null===e||void 0===e)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "function t(e){if(null===e||void 0===e)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "function t(e){if(null===e||void 0===e)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "function DartObject(o) {\n this.o = o;\n}", "function returnObjectData() {\n return {\n number: 10,\n string: 'Hello World!',\n boolean: true,\n null: null,\n undefined: undefined,\n };\n}", "static create(object) {\n let type = getType(object);\n let result;\n\n // this object has objectify?\n if (Objectify.hasObjectify(object)) {\n result = object.objectify();\n\n } else {\n // nope, we can force to get the public properties then:\n result = JSON.parse(JSON.stringify(object));\n }\n\n result._otype = type;\n\n return result;\n }", "function n(e){return\"[object Object]\"==={}.toString.call(e)}", "function n(e){return\"[object Object]\"==={}.toString.call(e)}", "function i(t){return null!==t&&\"object\"==typeof t}", "function o(e){return 1==(null!=(t=e)&&\"object\"==typeof t&&!1===Array.isArray(t))&&\"[object Object]\"===Object.prototype.toString.call(e);\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */var t}", "function myObj(){\n return{\n a: 100,\n b: 'Hello'\n }\n}", "_dehydrateArg(arg) {\n if (typeof arg === \"string\") {\n return ({\n type: \"string\",\n value: String(arg)\n });\n } else if (typeof arg === \"function\") {\n // store a pointer to the function in the function lib\n let functionPointerName = \"f@\" + this._functionPointerCounter;\n this._functionPointerCounter++;\n this._functionPointerLib.put(functionPointerName, arg);\n return ({\n type: \"function\",\n name: functionPointerName\n });\n } else if (typeof arg === \"number\") {\n return ({\n type: \"number\",\n value: arg\n });\n } else if (typeof arg === \"boolean\") {\n return ({\n type: \"boolean\",\n value: arg\n })\n } else if (typeof arg === \"object\") {\n\n if (arg.constructor.name === \"Array\") {\n let argDef = {\n type: \"array\",\n elements: [],\n };\n\n arg.forEach(element => {\n argDef.elements.push(this._dehydrateArg(element));\n });\n\n return argDef;\n } else {\n let argDef = {\n type: \"object\",\n properties: {},\n };\n\n for (let prop in arg) {\n if (arg.hasOwnProperty(prop)) {\n argDef.properties[prop] = this._dehydrateArg(arg[prop]);\n }\n }\n\n return argDef;\n }\n\n // return ({\n // type: \"json\",\n // value: JSON.stringify(arg)\n // })\n } else {\n throw new Error(\"Unsupported argument type for arg: \" + arg)\n }\n }", "keyFrameStateFrom(obj) {\n\t\tconst {state, ...styleProperties} = obj;\n\t\treturn {\n\t\t\t[state]: styleProperties\n\t\t};\n\t}", "function r(t){return\"[object Object]\"==={}.toString.call(t)}", "function r(t){return\"[object Object]\"==={}.toString.call(t)}", "function doSmth(o: Object) {\n }", "dump(){ return this.state.toObject(); }", "function toObject(arg) {\n if (arg === null) throw new TypeError('Cannot convert null or undefined to object');\n\n if ((typeof arg === 'undefined' ? 'undefined' : babelHelpers$1['typeof'](arg)) === 'object') return arg;\n return Object(arg);\n}", "function toObject(arg) {\n if (arg === null) throw new TypeError('Cannot convert null or undefined to object');\n\n if ((typeof arg === 'undefined' ? 'undefined' : babelHelpers$1['typeof'](arg)) === 'object') return arg;\n return Object(arg);\n}", "function toObject(arg) {\n if (arg === null) throw new TypeError('Cannot convert null or undefined to object');\n\n if ((typeof arg === 'undefined' ? 'undefined' : babelHelpers$1['typeof'](arg)) === 'object') return arg;\n return Object(arg);\n}", "function toObject(arg) {\n if (arg === null) throw new TypeError('Cannot convert null or undefined to object');\n\n if ((typeof arg === 'undefined' ? 'undefined' : babelHelpers$1['typeof'](arg)) === 'object') return arg;\n return Object(arg);\n}", "function toObject(arg) {\n if (arg === null) throw new TypeError('Cannot convert null or undefined to object');\n\n if ((typeof arg === 'undefined' ? 'undefined' : babelHelpers$1['typeof'](arg)) === 'object') return arg;\n return Object(arg);\n}", "function toObject(arg) {\n if (arg === null) throw new TypeError('Cannot convert null or undefined to object');\n\n if ((typeof arg === 'undefined' ? 'undefined' : babelHelpers$1['typeof'](arg)) === 'object') return arg;\n return Object(arg);\n}", "function object (data) {\n return assigned(data) && Object.prototype.toString.call(data) === '[object Object]';\n }", "function toObject(argument) {\n if (argument === null || argument === undefined) {\n\t\t\tthrow new TypeError('Cannot call method on ' + argument);\n\t\t}\n return Object(argument);\n }", "function d(e,t){for(var n in e=e||{},t)t[n]&&t[n].constructor&&t[n].constructor===Object?(e[n]=e[n]||{},d(e[n],t[n])):e[n]=t[n];return e}", "function ro(t){return Object.prototype.toString.call(t)===\"[object Object]\"}", "function va(t){if(null==t)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(t)}", "static get properties() { return {\n _variables: {type:Object} \n}}", "function Person() {\n return {\n name: 'Tony'\n }\n}", "function isObject$1(e){return\"[object Object]\"===Object.prototype.toString.call(e)}" ]
[ "0.6589869", "0.6589869", "0.6530274", "0.6530274", "0.62831235", "0.62071157", "0.6142698", "0.60488874", "0.59703", "0.5941648", "0.58274406", "0.5815791", "0.57981735", "0.5780073", "0.57720995", "0.57629997", "0.5752905", "0.57090175", "0.56909746", "0.5690108", "0.5682991", "0.5681526", "0.5681526", "0.565794", "0.5644397", "0.5626553", "0.56252944", "0.56237966", "0.56069714", "0.5585843", "0.5581574", "0.55692273", "0.55692273", "0.55679506", "0.55594", "0.55594", "0.5550988", "0.55449563", "0.55359966", "0.5533063", "0.55265987", "0.5525371", "0.5525371", "0.5525371", "0.552316", "0.55091244", "0.5506777", "0.5502267", "0.55009055", "0.55009055", "0.55009055", "0.55009055", "0.55009055", "0.55009055", "0.55009055", "0.55009055", "0.55009055", "0.5497372", "0.5495129", "0.5495129", "0.5495129", "0.5487288", "0.5484567", "0.54791325", "0.5475966", "0.5456373", "0.5456373", "0.5456373", "0.5456373", "0.54538095", "0.54538095", "0.54538095", "0.54538095", "0.5445443", "0.5442978", "0.5441545", "0.5439217", "0.5439217", "0.54363984", "0.5433908", "0.54279923", "0.5423348", "0.54196125", "0.54188895", "0.54188895", "0.5418723", "0.54027617", "0.53846055", "0.53846055", "0.53846055", "0.53846055", "0.53846055", "0.53846055", "0.53830063", "0.53826886", "0.5382628", "0.53789556", "0.5378589", "0.537842", "0.53743786", "0.53706163" ]
0.0
-1
Converts array values to string. `margin: [['5px', '10px']]` > `margin: 5px 10px;` `border: ['1px', '2px']` > `border: 1px, 2px;` `margin: [['5px', '10px'], '!important']` > `margin: 5px 10px !important;` `color: ['red', !important]` > `color: red !important;`
function toCssValue(value) { var ignoreImportant = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (!Array.isArray(value)) return value; var cssValue = ''; // Support space separated values via `[['5px', '10px']]`. if (Array.isArray(value[0])) { for (var i = 0; i < value.length; i++) { if (value[i] === '!important') break; if (cssValue) cssValue += ', '; cssValue += join(value[i], ' '); } } else cssValue = join(value, ', '); // Add !important, because it was ignored. if (!ignoreImportant && value[value.length - 1] === '!important') { cssValue += ' !important'; } return cssValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toCssValue(value) {\n var ignoreImportant = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!Array.isArray(value)) return value;\n\n var cssValue = '';\n\n // Support space separated values via `[['5px', '10px']]`.\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', ');\n\n // Add !important, because it was ignored.\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n }", "function toCssValue(value) {\n\t var ignoreImportant = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\t\n\t if (!Array.isArray(value)) return value;\n\t\n\t var cssValue = '';\n\t\n\t // Support space separated values via `[['5px', '10px']]`.\n\t if (Array.isArray(value[0])) {\n\t for (var i = 0; i < value.length; i++) {\n\t if (value[i] === '!important') break;\n\t if (cssValue) cssValue += ', ';\n\t cssValue += join(value[i], ' ');\n\t }\n\t } else cssValue = join(value, ', ');\n\t\n\t // Add !important, because it was ignored.\n\t if (!ignoreImportant && value[value.length - 1] === '!important') {\n\t cssValue += ' !important';\n\t }\n\t\n\t return cssValue;\n\t}", "function toCssValue(value) {\n var ignoreImportant = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}", "function styleToString(name, value) {\n\t if (Array.isArray(value)) {\n\t return value.map(function (value) {\n\t return styleStringToString(name, value);\n\t }).join(';');\n\t }\n\t return styleStringToString(name, value);\n\t}", "function toCssValue(value) {\n\t if (!Array.isArray(value)) return value;\n\n\t // Support space separated values.\n\t if (Array.isArray(value[0])) {\n\t return toCssValue(value.map(joinWithSpace));\n\t }\n\n\t return value.join(', ');\n\t}", "function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n }", "function toCssValue(value) {\n if (!Array.isArray(value)) return value;\n\n // Support space separated values.\n if (Array.isArray(value[0])) {\n return toCssValue(value.map(joinWithSpace));\n }\n\n return value.join(', ');\n}", "function toCssValue(value) {\n if (!Array.isArray(value)) return value;\n\n // Support space separated values.\n if (Array.isArray(value[0])) {\n return toCssValue(value.map(joinWithSpace));\n }\n\n return value.join(', ');\n}", "function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}", "function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}", "function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}", "function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}", "function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}", "function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}", "function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}", "function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}", "function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}", "function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}", "function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}", "function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}", "function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}", "function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}", "function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}", "function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}", "function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}", "function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}", "function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}", "function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}", "function simpleStringify(arr) {\n if (arr.length == 0) {\n return \"\";\n }\n\n var keys = Object.keys(arr[0]);\n return keys.join(\",\") + \"\\n\" +\n arr.map(function(obj) {\n return Object.values(obj).map(function(v){\n return typeof v === \"string\" ? '\"' + (''+v).replace(/\"/g,'\"\"') + '\"' : v\n }).join(\",\");\n }).join(\"\\n\");\n }", "function format(values) {\n return values.map(value => typeof value === 'string' ? value : util_1.inspect(value, { depth: Infinity })).join(' ');\n}", "function arrayToString(arr) {\n return arr.join(\"\")\n }", "function arrayToString(array) {\n return array.join('')\n }", "function arrWithNoBrsAndSpacesToString(array) {\n\tlet arrSpaces = array.map((item) => {\n\t\treturn item.join(' ')\n\t})\n\tconsole.log(arrSpaces)\n\t// console.log(arrSpaces)\n\tlet strBrsSpaces = arrSpaces.join('<br>')\n\treturn strBrsSpaces\n}", "formatArray() {\n let formattedArray = this.manipulateString().map(y => {\n switch (y) {\n case '':\n return ''\n break;\n case ' ':\n return ' '\n break;\n case ',':\n return ','\n break;\n case \"!\":\n return y\n break;\n default:\n return `[${y}]`\n break;\n }\n }).join(' - ')\n\n return formattedArray\n }", "function arrayToString(arr) {\n var arrString = arr.join(\", \");\n return arrString;\n}", "function stringifyArr(arr){\n\tvar str = \"[\";\n\tarr.forEach(function(e){\n\t\tstr += \"'\"+e+\"', \";\n\t});\n\tstr += \"]\";\n\treturn str.replace(\"', ]\", \"']\");\t\n}", "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "function arrToStrFormatted(a) {\n if (a != 0) {\n return a.toString().split(\",\").join(\", \");\n }\n return 0;\n }", "function arrayToStringV2(arr) {\n let result = '';\n arr.forEach((elem) => {\n result += elem;\n });\n return result;\n}", "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += Array.isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "function makeSetOfValues(arr) {\n if (arr.length <= 0) {\n return \"()\";\n }\n var valuesSet = {};\n for (var i in arr) {\n valuesSet[arr[i]] = \"\";\n }\n var str = \"(\";\n for (var i in valuesSet) {\n str += \"'\" + i + \"',\";\n }\n str = str.substring(0, str.length - 1);\n str += \")\";\n return str;\n }", "function printProps(array){\n if(array!=null){\n let s = '';\n for(var i=0; i<array.length; i++){\n if(i == 0){\n s = array[i];\n }\n else\n s += ', '+array[i];\n }\n return s;\n }\n else\n return \"__NOPROP__\";\n}", "function flattenToString(arr) {\n var i,\n iz,\n elem,\n result = '';\n\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += isArray(elem) ? flattenToString(elem) : elem;\n }\n\n return result;\n }", "toListString(arr) {\n\t\tif (!arr.length) return '';\n\t\tif (arr.length === 1) return arr[0];\n\t\tif (arr.length === 2) return `${arr[0]} and ${arr[1]}`;\n\t\treturn `${arr.slice(0, -1).join(\", \")}, and ${arr.slice(-1)[0]}`;\n\t}", "function formatAsFriendlyString(value) {\n if (value === null) {\n return 'null';\n }\n else if (Array.isArray(value)) {\n return '[' + value.map(function (v) { return formatAsFriendlyString(v); }).join(',') + ']';\n }\n else if (typeof value === 'string') {\n return \"\\\"\" + value + \"\\\"\";\n }\n else {\n return \"\" + value;\n }\n}", "function formatAsFriendlyString(value) {\n if (value === null) {\n return 'null';\n }\n else if (Array.isArray(value)) {\n return '[' + value.map(function (v) { return formatAsFriendlyString(v); }).join(',') + ']';\n }\n else if (typeof value === 'string') {\n return \"\\\"\" + value + \"\\\"\";\n }\n else {\n return \"\" + value;\n }\n}", "function stringify(array){\n\tvar arrayB=[]\n\tfor(i in array)\n\t\tarrayB[i]=\"\"+array[i];\n\treturn arrayB;\n}", "function formatAsFriendlyString(value) {\n if (value === null) {\n return 'null';\n }\n else if (Array.isArray(value)) {\n return '[' + value.map(v => formatAsFriendlyString(v)).join(',') + ']';\n }\n else if (typeof value === 'string') {\n return `\"${value}\"`;\n }\n else {\n return `${value}`;\n }\n}", "function arrToString(arr) {\n pantryString = \"\";\n for (let i = 0; i < arr.length; i++) {\n if (i < arr.length - 1) {\n pantryString += arr[i] + \", \";\n } else if (i === arr.length - 1) {\n pantryString += arr[i];\n }\n }\n return pantryString;\n}", "function arrToStr(arr) {\n var str = '';\n\n for (var i = 0; i < arr.length; i++) {\n str += arr[i].toString();\n }\n\n return str;\n}", "function valueToString(value) {\n if (value == null) {\n return \"[null]\";\n }\n if ($.isArray(value)) {\n var ret = \"\";\n for (var i = 0; i < value.length; i++) {\n ret += value == null ? \"[null]\" : singleValueToString(value[i]);\n if (i < value.length - 1) {\n ret += \",\";\n }\n }\n return ret;\n } else {\n return singleValueToString(value);\n }\n }", "function quotedJoined (array) {\n return array\n .map(el => `\"${el}\"`)\n .join(' ')\n}", "stringThisArray(array){\n return array.join(\"\");\n }", "function arrayToString(array) {\n var string = \"\";\n for (let j = 0; j < array.length; j++){\n var string = string + array[j] + '\\n';\n };\n return string = string.slice(0, -1);\n }", "function array2string($arr) {\n\tvar str = \"\";\n\t$arr.forEach(item => {\n\t\tstr += item + '\\n';\n\t});\n\treturn str;\n}", "function arrayToString(a) {\n return \"[\" + a.join(\", \") + \"]\";\n}", "function stringifyArray(input){\n return input.join(',');\n}", "function stringifyProperties(properties) {\n return properties\n .map(([name, value]) => {\n if (!Array.isArray(value))\n return styleToString(name, value);\n return value.map(x => styleToString(name, x)).join(\";\");\n })\n .join(\";\");\n}", "function stringifyProperties(properties) {\n return properties\n .map(([name, value]) => {\n if (!Array.isArray(value))\n return styleToString(name, value);\n return value.map(x => styleToString(name, x)).join(\";\");\n })\n .join(\";\");\n}", "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += Array.isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += Array.isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "function flattenToString(arr) {\n var i,\n iz,\n elem,\n result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += Array.isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "function stringConcat(arr) {\n const result = arr.reduce(arr.toString());\n return result;\n}", "static listArrayAsString(stringArray) {\n // Check if argument is an array\n if (Array.isArray(stringArray)) {\n let arrayItemText = '';\n // Loop through each value of array\n for (let index = 0, arrLength = stringArray.length; index < arrLength; index++) {\n arrayItemText += stringArray[index];\n // If array length is more than 1 and index is NOT the last element\n // If array length is 2, only add ' and '\n // Else: If index is second to last element, add ', and ' Else add ', '\n if (arrLength > 1 && index != arrLength - 1) {\n arrayItemText += (arrLength == 2) ? ' and '\n : (index == arrLength - 2) ? ', and ' : ', ';\n }\n }\n // Return created string\n return arrayItemText;\n } else if (typeof stringArray == 'string') // Else if argument is string, return the same string\n return stringArray;\n }", "function outputString(arr) {\n var arr1 = arr.join(' ');\n var arr2 = arr.join('+');\n var arr3 = arr.join(',');\n console.log(arr1);\n console.log(arr2);\n console.log(arr3);\n}", "function arrayString (val) {\n var result = '{'\n for (var i = 0; i < val.length; i++) {\n if (i > 0) {\n result = result + ','\n }\n if (val[i] === null || typeof val[i] === 'undefined') {\n result = result + 'NULL'\n } else if (Array.isArray(val[i])) {\n result = result + arrayString(val[i])\n } else if (val[i] instanceof Buffer) {\n result += '\\\\\\\\x' + val[i].toString('hex')\n } else {\n result += escapeElement(prepareValue(val[i]))\n }\n }\n result = result + '}'\n return result\n}", "function arrayString (val) {\n var result = '{'\n for (var i = 0; i < val.length; i++) {\n if (i > 0) {\n result = result + ','\n }\n if (val[i] === null || typeof val[i] === 'undefined') {\n result = result + 'NULL'\n } else if (Array.isArray(val[i])) {\n result = result + arrayString(val[i])\n } else if (val[i] instanceof Buffer) {\n result += '\\\\\\\\x' + val[i].toString('hex')\n } else {\n result += escapeElement(prepareValue(val[i]))\n }\n }\n result = result + '}'\n return result\n}", "function arrayString (val) {\n var result = '{'\n for (var i = 0; i < val.length; i++) {\n if (i > 0) {\n result = result + ','\n }\n if (val[i] === null || typeof val[i] === 'undefined') {\n result = result + 'NULL'\n } else if (Array.isArray(val[i])) {\n result = result + arrayString(val[i])\n } else if (val[i] instanceof Buffer) {\n result += '\\\\\\\\x' + val[i].toString('hex')\n } else {\n result += escapeElement(prepareValue(val[i]))\n }\n }\n result = result + '}'\n return result\n}", "function array(arr){\n\n return arr.split(\",\").slice(1,-1).join(\" \") || null\n }", "function array_to_string(a) {\r\n var out = '';\r\n if (!a) return out;\r\n for (i=0;i<a.length;i++) {\r\n out = out + i + \":\" + a[i] + \"\\n\";\r\n }\r\n return out;\r\n}" ]
[ "0.690426", "0.6801259", "0.67925686", "0.6577485", "0.6524869", "0.65052235", "0.6428712", "0.6428712", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63733435", "0.6202636", "0.61194134", "0.6008052", "0.5958089", "0.59399664", "0.59365284", "0.5862328", "0.58447003", "0.58447003", "0.58447003", "0.5810207", "0.5787626", "0.5738078", "0.5737839", "0.57351327", "0.57308537", "0.5716049", "0.5712444", "0.5712444", "0.56915396", "0.5689582", "0.56890166", "0.56755894", "0.5662005", "0.5655306", "0.56462973", "0.56456935", "0.5639385", "0.5620834", "0.56067175", "0.56041056", "0.56041056", "0.55966234", "0.55966234", "0.5582839", "0.5573954", "0.555769", "0.55495787", "0.55443954", "0.55443954", "0.55443954", "0.5539067", "0.5528035" ]
0.678838
28
Create a rule instance.
function createRule() { var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed'; var decl = arguments[1]; var options = arguments[2]; var jss = options.jss; var declCopy = (0, _cloneStyle2['default'])(decl); var rule = jss.plugins.onCreateRule(name, declCopy, options); if (rule) return rule; // It is an at-rule and it has no instance. if (name[0] === '@') { (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name); } return new _StyleRule2['default'](name, declCopy, options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static makeRule(options) {\n return new Rule(options.name, options.severity, options.selector ? Selector.parse(options.selector) : null, Rule.makePattern(options.pattern), options.lint || options.message, options.applies);\n }", "create(context) {\n freezeDeeply(context.options);\n freezeDeeply(context.settings);\n freezeDeeply(context.parserOptions);\n\n // freezeDeeply(context.languageOptions);\n\n return (typeof rule === \"function\" ? rule : rule.create)(context);\n }", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n }", "function Rule(ruleOption, ruleValue){\n this.ruleOption = ruleOption;\n this.ruleValue = ruleValue;\n}", "function createRule() {\n\t var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n\t var decl = arguments[1];\n\t var options = arguments[2];\n\t var jss = options.jss;\n\t\n\t var declCopy = (0, _cloneStyle2['default'])(decl);\n\t\n\t var rule = jss.plugins.onCreateRule(name, declCopy, options);\n\t if (rule) return rule;\n\t\n\t // It is an at-rule and it has no instance.\n\t if (name[0] === '@') {\n\t (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n\t }\n\t\n\t return new _StyleRule2['default'](name, declCopy, options);\n\t}", "function createRule() {\n\t var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n\t var decl = arguments[1];\n\t var options = arguments[2];\n\t var jss = options.jss;\n\n\t var declCopy = (0, _cloneStyle2['default'])(decl);\n\n\t var rule = jss.plugins.onCreateRule(name, declCopy, options);\n\t if (rule) return rule;\n\n\t // It is an at-rule and it has no instance.\n\t if (name[0] === '@') {\n\t (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n\t }\n\n\t return new _StyleRule2['default'](name, declCopy, options);\n\t}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n var declCopy = (0, _cloneStyle2['default'])(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "constructor() { \n \n RecordRule.initialize(this);\n }", "add(rule) { \n this.rules[rule.type] = rule \n rule.parser = this\n }", "function Rule(controller, condition, value) {\n this.init(controller, condition, value);\n }", "function Rule(input, output){\n\tthis.input = input;\n\tthis.output = output;\n}", "constructor(scope, id, props) {\n super(scope, id, { type: CfnRule.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_connect_CfnRuleProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnRule);\n }\n throw error;\n }\n cdk.requireProperty(props, 'actions', this);\n cdk.requireProperty(props, 'function', this);\n cdk.requireProperty(props, 'instanceArn', this);\n cdk.requireProperty(props, 'name', this);\n cdk.requireProperty(props, 'publishStatus', this);\n cdk.requireProperty(props, 'triggerEventSource', this);\n this.attrRuleArn = cdk.Token.asString(this.getAtt('RuleArn', cdk.ResolutionTypeHint.STRING));\n this.actions = props.actions;\n this.function = props.function;\n this.instanceArn = props.instanceArn;\n this.name = props.name;\n this.publishStatus = props.publishStatus;\n this.triggerEventSource = props.triggerEventSource;\n this.tags = new cdk.TagManager(cdk.TagType.STANDARD, \"AWS::Connect::Rule\", props.tags, { tagPropertyName: 'tags' });\n }", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') ;\n\n return null;\n }", "function Rule(data) {\n var rules = document.getElementById('rules');\n this.node = document.getElementById('rule-template').cloneNode(true);\n this.node.id = 'rule' + (Rule.next_id++);\n this.node.rule = this;\n rules.appendChild(this.node);\n this.node.hidden = false;\n\n if (data) {\n this.getElement('matcher').value = data.matcher;\n this.getElement('match-param').value = data.match_param;\n this.getElement('action').value = data.action;\n this.getElement('action-js').value = data.action_js;\n this.getElement('enabled').checked = data.enabled;\n }\n\n this.getElement('enabled-label').htmlFor = this.getElement('enabled').id =\n this.node.id + '-enabled';\n\n this.render();\n\n this.getElement('matcher').onchange = storeRules;\n this.getElement('match-param').onkeyup = storeRules;\n this.getElement('action').onchange = storeRules;\n this.getElement('action-js').onkeyup = storeRules;\n this.getElement('enabled').onchange = storeRules;\n\n var rule = this;\n this.getElement('move-up').onclick = function() {\n var sib = rule.node.previousSibling;\n rule.node.parentNode.removeChild(rule.node);\n sib.parentNode.insertBefore(rule.node, sib);\n storeRules();\n };\n this.getElement('move-down').onclick = function() {\n var parentNode = rule.node.parentNode;\n var sib = rule.node.nextSibling.nextSibling;\n parentNode.removeChild(rule.node);\n if (sib) {\n parentNode.insertBefore(rule.node, sib);\n } else {\n parentNode.appendChild(rule.node);\n }\n storeRules();\n };\n this.getElement('remove').onclick = function() {\n rule.node.parentNode.removeChild(rule.node);\n storeRules();\n };\n storeRules();\n}", "function makeRule(pattern, style) {\n pattern.style = style;\n return pattern;\n}", "createRule(name, style, options) {\n options = {\n ...options,\n sheet: this,\n jss: this.options.jss,\n Renderer: this.options.Renderer\n }\n // Scope options overwrite instance options.\n if (options.named == null) options.named = this.options.named\n const rule = createRule(name, style, options)\n // Register conditional rule, it will stringify it's child rules properly.\n if (rule.type === 'conditional') {\n this.rules[rule.selector] = rule\n }\n // This is a rule which is a child of a condtional rule.\n // We need to register its class name only.\n else if (rule.options.parent && rule.options.parent.type === 'conditional') {\n // Only named rules should be referenced in `classes`.\n if (rule.options.named) this.classes[name] = rule.className\n }\n else {\n this.rules[rule.selector] = rule\n if (options.named) {\n this.rules[name] = rule\n this.classes[name] = rule.className\n }\n }\n options.jss.plugins.run(rule)\n return rule\n }", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Unknown rule \" + name) : void 0;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Unknown rule \" + name) : void 0;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) name = 'unnamed';\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n if (name[0] === '@') warning__default['default'](false, \"[JSS] Unknown rule \" + name);\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n false ? 0 : void 0;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n false ? 0 : void 0;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n false ? 0 : void 0;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n false ? undefined : void 0;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n false ? undefined : void 0;\n }\n\n return null;\n}", "function Rule(rule_id) {\n this.target = $('#rule'+rule_id+'_target').val();\n this.pattern = $('#rule'+rule_id+'_pattern').val();\n}", "function Rule(prev, props) {\n this.prev = prev;\n this.props = props;\n this.context = null;\n}", "function Rule(opts) {\n if(!(this instanceof Rule)) {\n return new Rule(opts);\n }\n\n for(var k in opts) {\n this[k] = opts[k];\n }\n\n // reason constants\n this.reasons = Reason.reasons;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(false, \"[JSS] Unknown rule \" + name) : void 0;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_6__.default)(false, \"[JSS] Unknown rule \" + name) : 0;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_6__.default)(false, \"[JSS] Unknown rule \" + name) : 0;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_6__.default)(false, \"[JSS] Unknown rule \" + name) : 0;\n }\n\n return null;\n}", "addRule(rule) {\n if (!this.rules[rule.input]) this.rules[rule.input] = [];\n this.rules[rule.input].push(rule);\n }", "constructor() {\n this.rules = [];\n }", "constructor() {\n /**\n * @type {Object<string, string>}\n */\n this._rules = {};\n }", "constructor(scope, id, props) {\n super(scope, id, { type: CfnReceiptRule.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_ses_CfnReceiptRuleProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnReceiptRule);\n }\n throw error;\n }\n cdk.requireProperty(props, 'rule', this);\n cdk.requireProperty(props, 'ruleSetName', this);\n this.rule = props.rule;\n this.ruleSetName = props.ruleSetName;\n this.after = props.after;\n }", "_parseRule(rule){\n\t\tvar _rule = {};\n\n\t\tif (_.isPlainObject(rule))\n\t\t\t_rule = rule;\n\t\telse {\n\t\t\tvar rule_segments = rule.split(';');\n\n\t\t\t//lets parse the rule\n\t\t\t_.each(rule_segments,function(rule_segment){\n\t\t\t\tvar segment = rule_segment.split('=');\n\n\t\t\t\tswitch(segment[0].toUpperCase()){\n\t\t\t\t\tcase 'FREQ':\n\t\t\t\t\t\t_rule.freq = segment[1].toUpperCase();\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'INTERVAL':\n\t\t\t\t\t\t_rule.interval = parseInt(segment[1]);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'COUNT':\n\t\t\t\t\t\t_rule.count = parseInt(segment[1]);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'DTSTART':\n\t\t\t\t\t\tthis.setStartDate(moment.utc(segment[1])); //must be utc string\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'UNTIL':\n\t\t\t\t\t\tthis.setEndDate(moment.utc(segment[1])); //must be utc string\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'BYDAY':\n\t\t\t\t\t\t_rule.days_of_week = _.filter(segment[1].split(','),function(day){ return day.length; });\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'BYMONTHDAY':\n\t\t\t\t\t\t_rule.day_of_month = parseInt(segment[1]);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'BYMONTH':\n\t\t\t\t\t\t_rule.month = parseInt(segment[1]);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'BYSETPOS':\n\t\t\t\t\t\t_rule.set_pos = parseInt(segment[1]);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'WKST':\n\t\t\t\t\t\t_rule.start_of_week = segment[1];\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'EXDATE':\n\t\t\t\t\t\t_rule.exdate = _.map(segment[1].split(','),function(date){\n\t\t\t\t\t\t\tvar m = moment.unix(date/1000);\n\t\t\t\t\t\t\treturn m.isValid() ? m : date;\n\t\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}.bind(this));\n\t\t}\n\n\t\treturn _rule;\n\t}", "function Rule(controller, rule, callback, name) {\n this.controller = controller;\n this.rule = rule\n this.callback = callback;\n this.name = name;\n this._infix = null;\n\t\tthis.history = [];\n \n // Cached copy of the recent most score\n this.recentScore = 0;\n \n // TODO: these functions might be useful\n // this.isEnabled = true;\n // this.disable = function() { this.isEnabled = false; return this; }\n // this.enable = function() { this.isEnabled = true; return this; }\n // this.destroy = function() { this.controller._rules.remove(this); }\n\t\t\n\t\tthis.eval = function(terms) {\n var output = this._infix.clone();\n var operators = [];\n \n while(output.length > 0) {\n var token = output.shift();\n \n\t\t\t\tif(token == 'not') {\n\t\t\t\t\tvar a = operators.pop();\n\t\t\t\t\tvar c = this.controller.operators.Negate(isNaN(a) ? terms[a] : a);\n\t\t\t\t\t\n\t\t\t\t\toperators.push(c);\n\t\t\t\n } else if(token == 'or' || token == 'and') {\n var a = operators.pop();\n var b = operators.pop();\n var c = null;\n \n if( isNaN(a) && isNaN(terms[a])) {\n throw new Error(\"Unknown term '\" + a + \"'.\");\n break;\n }\n \n if( isNaN(b) && isNaN(terms[b])) {\n throw new Error(\"Unknown term '\" + b + \"'.\");\n break;\n }\n \n // Use lookup if the variable is not a number.\n a = isNaN(a) ? terms[a] : a;\n b = isNaN(b) ? terms[b] : b;\n \n // Execute Zadeh operators\n if(token == 'or') {\n c = this.controller.operators.Or(a, b);\n } else {\n c = this.controller.operators.And(a, b);\n }\n \n // Push back into stack for next iteration.\n operators.push(c);\n } else {\n operators.push(token);\n }\n }\n \n\t\t\tvar last = operators.last();\n\t\t\t\n\t\t\t// Just incase the rule only has one variable.\n\t\t\tif(isNaN(last)) {\n\t\t\t\tlast = terms[last];\n\t\t\t} \n\t\t\t\n\t\t\tthis.history.push(last);\n\n\t\t\t// Trim to some maximum size. These\n\t\t\t// values are used for debug drawing.\n\t\t\twhile(this.history.length > 80) {\n\t\t\t\tthis.history.shift();\n\t\t\t}\n\t\t\t\n\t\t\treturn last;\n\t\t};\n }", "function createRule(selector) {\n var index = styleSheet.cssRules.length;\n styleSheet.insertRule(selector + ' {}', index);\n return styleSheet.cssRules[index];\n}", "loadRule(ruleId, config, severity, options, parser, report) {\n const meta = config.getMetaTable();\n const rule = this.instantiateRule(ruleId, options);\n rule.name = ruleId;\n rule.init(parser, report, severity, meta);\n /* call setup callback if present */\n if (rule.setup) {\n rule.setup();\n }\n return rule;\n }", "function Rule () {\n this.continue = false;\n\tthis.filters = [];\n\tthis.modifiers = [];\n\tthis.codeLines = [];\n\n\tthis.match = function (item) {\n\t\treturn this.filters.every( function (filter) { return filter.match( item ); } );\n\t}\n\n\tthis.applyTo = function (item) {\n\t\tthis.modifiers.forEach( function (modifier) { modifier.applyTo( item ); } );\n\t}\n}", "makeRecurrence(rule) {\n const event = this.eventRecord,\n eventCopy = event.copy();\n let recurrence = event.recurrence;\n\n if (!rule && recurrence) {\n recurrence = recurrence.copy();\n } else {\n recurrence = new event.recurrenceModel({\n rule\n });\n } // bind cloned recurrence to the cloned event\n\n recurrence.timeSpan = eventCopy; // update cloned event w/ start date from the UI field\n\n eventCopy.setStartDate(this.values.startDate);\n recurrence.suspendTimeSpanNotifying();\n return recurrence;\n }", "function trigger() {\n let rule\n const ruleType = ruleTypes[this.measure]\n\n // Make sure units and measure is defined and not null\n if (this.units == null || !this.measure) {\n return this\n }\n\n // Error if we don't have a valid ruleType\n if (ruleType !== \"calendar\" && ruleType !== \"interval\") {\n throw new Error(`Invalid measure provided: ${this.measure}`)\n }\n\n // Create the rule\n if (ruleType === \"interval\") {\n if (!this.start) {\n throw new Error(\"Must have a start date set to set an interval!\")\n }\n\n rule = Interval.create(this.units, this.measure)\n }\n\n if (ruleType === \"calendar\") {\n rule = Calendar.create(this.units, this.measure)\n }\n\n // Remove the temporary rule data\n this.units = null\n this.measure = null\n\n if (rule.measure === \"weeksOfMonthByDay\" && !this.hasRule(\"daysOfWeek\")) {\n throw new Error(\"weeksOfMonthByDay must be combined with daysOfWeek\")\n }\n\n // Remove existing rule based on measure\n for (let i = 0; i < this.rules.length; i++) {\n if (this.rules[i].measure === rule.measure) {\n this.rules.splice(i, 1)\n }\n }\n\n this.rules.push(rule)\n return this\n}", "create(argv) {\n const resourceRule = argv.strategy_resource ?\n argv.strategy_resource : \"./resource/never\";\n\n return require(resourceRule);\n }", "function RuleOption(opt){\n\tthis.suffix = opt.suffix;\n\tthis.name = opt.name;\n\tthis.ruleType = opt.ruleType;\n\tthis.validate = opt.validate || function(vCtx){\n\t\treturn true\n\t};\n\t\n\truleOptions[this.suffix] = this;\n\truleOptions[this.name] = this;\t\n}", "get rule() {\n\t\treturn this.__rule;\n\t}", "get rule() {\n\t\treturn this.__rule;\n\t}", "function FooRule() {\n}", "function Pattern(name, listed, describe, rules) {\n this.name = name;\n this.listed = listed;\n this.describe = describe;\n this.rules = rules;\n }", "function Ruleset() {\n\n // Hold a tree of rules\n this.rules = [];\n }", "function Pattern(name, listed, describe, rules) {\r\n this.name = name;\r\n this.listed = listed;\r\n this.describe = describe;\r\n this.rules = rules;\r\n }", "addRule(name, def) {\r\n this.rules[name] = Renderer.convertTemplate(def);\r\n }", "rule(r) { return this.rules[r] }" ]
[ "0.68346745", "0.6652633", "0.6574626", "0.6499335", "0.64848536", "0.64727724", "0.632433", "0.62896234", "0.6206375", "0.6174969", "0.61651593", "0.6152218", "0.5943596", "0.594291", "0.5940071", "0.58681977", "0.58068746", "0.58068746", "0.58058995", "0.5769641", "0.5769641", "0.5769641", "0.5762905", "0.5762905", "0.5745318", "0.56983316", "0.5671866", "0.56094843", "0.56094843", "0.56094843", "0.56094843", "0.56094843", "0.56094843", "0.56094843", "0.56094843", "0.56094843", "0.56094843", "0.56094843", "0.56094843", "0.56094843", "0.56094843", "0.56094843", "0.56094843", "0.56094843", "0.56094843", "0.56034046", "0.55637956", "0.55637956", "0.55637956", "0.5482047", "0.5383272", "0.53446835", "0.5322285", "0.5299712", "0.52393943", "0.5223388", "0.52125907", "0.52115667", "0.5191118", "0.5189223", "0.5138809", "0.51212966", "0.51206064", "0.51206064", "0.51135504", "0.5113328", "0.5107398", "0.509651", "0.50894964", "0.5087557" ]
0.64493954
31
This is done to register the method called with moment() without creating circular dependencies.
function setHookCallback (callback) { hookCallback = callback; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(moment) {\n this.moment = moment;\n }", "moment(date) {\n return moment(date);\n }", "viewDateMoment () {\n const m = moment(this.props.viewDate)\n return function () {\n return m.clone()\n }\n }", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\n return null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\n return null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\n return null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function DateHelper() {}", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Mb(c,d),Sb(this,e,a),this}}", "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Mb(c,d),Sb(this,e,a),this}}", "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Mb(c,d),Sb(this,e,a),this}}", "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Mb(c,d),Sb(this,e,a),this}}", "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Mb(c,d),Sb(this,e,a),this}}", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Nb(c,d),Sb(this,e,a),this}}", "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"===typeof c?+c:c,e=Nb(c,d),Sb(this,e,a),this}}", "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\n return null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Nb(c,d),Sb(this,e,a),this}}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(\n\t name,\n\t 'moment().' +\n\t name +\n\t '(period, number) is deprecated. Please use moment().' +\n\t name +\n\t '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n\t );\n\t tmp = val;\n\t val = period;\n\t period = tmp;\n\t }\n\t\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function oldMomentFormat(mom,formatStr){return oldMomentProto.format.call(mom,formatStr);// oldMomentProto defined in moment-ext.js\n}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(\n\t name,\n\t 'moment().' +\n\t name +\n\t '(period, number) is deprecated. Please use moment().' +\n\t name +\n\t '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n\t );\n\t tmp = val;\n\t val = period;\n\t period = tmp;\n\t }\n\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(\n\t name,\n\t 'moment().' +\n\t name +\n\t '(period, number) is deprecated. Please use moment().' +\n\t name +\n\t '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n\t );\n\t tmp = val;\n\t val = period;\n\t period = tmp;\n\t }\n\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\t\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\t\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\t\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\t\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "resetCalendarMoment(date =\"\"){\n if(date && /^([0-9]{4}-[0-9]{2}-[0-9]{2})/.test(date)){\n //if there is date string\n //and it is in date pattern\n //then create that moment\n this._moment = moment(date);\n }else{\n this._moment = moment();\n }\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n tmp = val;\n val = period;\n period = tmp;\n }\n\n val = typeof val === 'string' ? +val : val;\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\t\n\t val = typeof val === 'string' ? +val : val;\n\t dur = create__createDuration(val, period);\n\t add_subtract__addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\t\n\t val = typeof val === 'string' ? +val : val;\n\t dur = create__createDuration(val, period);\n\t add_subtract__addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "calcCurrentMoment() {\n return moment();\n }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\t\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\t\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\t\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\t\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\t\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = create__createDuration(val, period);\n\t add_subtract__addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = create__createDuration(val, period);\n\t add_subtract__addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = create__createDuration(val, period);\n\t add_subtract__addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = create__createDuration(val, period);\n\t add_subtract__addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = create__createDuration(val, period);\n\t add_subtract__addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n tmp = val;\n val = period;\n period = tmp;\n }\n\n val = typeof val === 'string' ? +val : val;\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function makeShortcut(name, key) {\n moment.fn[name] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function Sb(a, b) {\n return function (c, d) {\n var e, f;\n //invert the arguments, but complain about it\n return null === d || isNaN(+d) || (y(b, \"moment().\" + b + \"(period, number) is deprecated. Please use moment().\" + b + \"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"), f = c, c = d, d = f), c = \"string\" == typeof c ? +c : c, e = Ob(c, d), Tb(this, e, a), this\n }\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n\treturn function (val, period) {\n\t\tvar dur, tmp;\n\t\t//invert the arguments, but complain about it\n\t\tif (period !== null && !isNaN(+period)) {\n\t\t\tdeprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t\t\t'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t\t\ttmp = val; val = period; period = tmp;\n\t\t}\n\n\t\tval = typeof val === 'string' ? +val : val;\n\t\tdur = createDuration(val, period);\n\t\taddSubtract(this, dur, direction);\n\t\treturn this;\n\t};\n}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period).');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = moment.duration(val, period);\n\t addOrSubtractDurationFromMoment(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n tmp = val; val = period; period = tmp;\n }\n\n val = typeof val === 'string' ? +val : val;\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period).');\n\t tmp = val;val = period;period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = moment.duration(val, period);\n\t addOrSubtractDurationFromMoment(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }" ]
[ "0.68071914", "0.6107244", "0.59238935", "0.57483727", "0.57483727", "0.57483727", "0.57483727", "0.57483727", "0.57483727", "0.57483727", "0.57483727", "0.57483727", "0.57483727", "0.57483727", "0.57483727", "0.57483727", "0.57399976", "0.57399976", "0.57399976", "0.57353735", "0.57353735", "0.57353735", "0.57353735", "0.57353735", "0.5726664", "0.5697392", "0.56674117", "0.56674117", "0.56674117", "0.56674117", "0.56674117", "0.5642839", "0.5642839", "0.5642839", "0.5642839", "0.5642839", "0.5642839", "0.5642839", "0.5642839", "0.5642839", "0.5642839", "0.5642839", "0.5642839", "0.56427515", "0.56267977", "0.5614278", "0.55875444", "0.5574263", "0.5560566", "0.5560566", "0.547612", "0.547612", "0.547612", "0.547612", "0.54577166", "0.54577166", "0.54522496", "0.5434995", "0.5430038", "0.5430038", "0.5422081", "0.5412276", "0.5412276", "0.5412276", "0.5412276", "0.5412276", "0.54109806", "0.54109806", "0.54109806", "0.54109806", "0.54109806", "0.5408168", "0.53985184", "0.53752035", "0.53703576", "0.53703576", "0.53703576", "0.53703576", "0.53703576", "0.53703576", "0.53703576", "0.53703576", "0.53703576", "0.5368419", "0.5363329", "0.5355717", "0.53326446", "0.53311086", "0.53294736", "0.5327475", "0.5320344", "0.5320344", "0.5320344", "0.5320344", "0.5320344", "0.5320344", "0.5320344", "0.5320344", "0.5320344", "0.5320344", "0.5320344" ]
0.0
-1
compare two arrays, return the number of differences
function compareArrays(array1, array2, dontConvert) { var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i; for (i = 0; i < len; i++) { if ((dontConvert && array1[i] !== array2[i]) || (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) { diffs++; } } return diffs + lengthDiff; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function countDifferences(a, b) {\n let diffs = 0;\n for (let i = 0; i < a.length; ++i) {\n if (a[i] !== b[i]) {\n ++diffs;\n }\n }\n return diffs;\n}", "function howmany_diff(ary1, ary2){\n for (var i = 0; i < ary1.length; i++){\n var a = ary1[i]\n var b = ary2[i]\n if (a != b){\n diff++\n }\n }\n }", "function howmany_diff(ary1, ary2) {\n for (var i = 0; i < ary1.length; i++) {\n var a = ary1[i]\n var b = ary2[i]\n if (a != b) {\n diff++\n }\n }\n }", "function arrayDiff(a1, a2) {\n\tvar totalDiff = 0;\n\ta2.forEach((elem, index) => {\n\t\ttotalDiff += Math.abs(elem - a1[index]);\n\t});\n\treturn totalDiff;\n}", "function compatibility(arr1, arr2) {\n var totalDiff = 0;\n for (let i in arr1) {\n totalDiff = totalDiff + difference(arr1[i], arr2[i])\n }\n return totalDiff\n}", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length);\n var lengthDiff = Math.abs(array1.length - array2.length);\n var diffs = 0;\n var i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i])\n || (!dontConvert && Object(__WEBPACK_IMPORTED_MODULE_0__type_checks__[\"k\" /* toInt */])(array1[i]) !== Object(__WEBPACK_IMPORTED_MODULE_0__type_checks__[\"k\" /* toInt */])(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n}", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }" ]
[ "0.82811505", "0.82811505", "0.82811505", "0.82811505", "0.82811505", "0.82811505", "0.82811505", "0.82811505", "0.82811505", "0.82811505", "0.82811505", "0.7997368", "0.7985993", "0.7953109", "0.7923902", "0.7710744", "0.7559878", "0.75489837", "0.7534625", "0.7505893", "0.7505893", "0.7505893", "0.7505893", "0.7505893", "0.7505893", "0.7505893", "0.7505893", "0.7505893", "0.7505893", "0.7505893", "0.7505893", "0.7505893", "0.7505893", "0.75023156", "0.75023156", "0.75023156", "0.75023156", "0.75023156", "0.75023156", "0.75023156", "0.75023156", "0.75023156", "0.75023156", "0.75023156", "0.75023156", "0.75023156", "0.75023156", "0.75023156", "0.75023156", "0.75023156", "0.7500715", "0.7500715", "0.7500715", "0.7499404", "0.74901015" ]
0.0
-1
format date using native date object
function formatMoment(m, format) { if (!m.isValid()) { return m.localeData().invalidDate(); } format = expandFormat(format, m.localeData()); formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); return formatFunctions[format](m); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "formatDate(date) {\n\t\treturn date.toString()\n\t\t.replace(/(\\d{4})(\\d{2})(\\d{2})/, (string, year, month, day) => `${year}-${month}-${day}`);\n\t}", "static formatDate(date) {\n return new Date(date).toLocaleDateString();\n }", "formatTheDate(date, format) {\n const [ year, month, day ] = (date.toISOString()).substr(0, 10).split('-');\n return dateFns.format(new Date(\n year,\n (month - 1),\n day,\n ), format);\n }", "function formatDate(obj) {\n const date = new Date(obj.date).toLocaleString(\"default\", {\n day: \"numeric\",\n month: \"long\",\n year: \"numeric\",\n });\n obj.date = date;\n return obj;\n}", "function formatDate(date) {\n return format(new Date(date), 'yyyy-MM-dd')\n}", "getFormattedDate(date) {\n return dayjs(date).format(\"MMM MM, YYYY\");\n }", "function formatDate(date) {\n var d = new Date(date);\n d = d.toLocaleString();\n return d;\n }", "function formatDate(d) {\n return `${d.year}-${d.month}-${d.day}`\n }", "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "function _getFormattedDate(date) {\n var year = date.getFullYear();\n var month = (1 + date.getMonth()).toString();\n month = month.length > 1 ? month : '0' + month;\n var day = date.getDate().toString();\n day = day.length > 1 ? day : '0' + day;\n return month + '/' + day + '/' + year;\n }", "function formatDate(date, format) {\n return format\n .replace(/yyyy/i, util_toString(date.getFullYear()))\n .replace(/MM/i, lpad(date.getMonth() + 1))\n .replace(/M/i, util_toString(date.getMonth()))\n .replace(/dd/i, lpad(date.getDate()))\n .replace(/d/i, util_toString(date.getDate()));\n}", "function formatDate(date) {\n var day = date.getDate();\n var month = date.getMonth() + 1; //Months are zero based\n var year = date.getFullYear();\n var formattedDate = year + \"-\" + month + \"-\" + day;\n return formattedDate;\n }", "function formatDate(date) {\n\tif (date == null) {\n\t\treturn null;\n\t}\n\tvar d = date.getDate();\n\tvar m = date.getMonth() + 1;\n\tvar y = date.getFullYear();\n\treturn '' + (d <= 9 ? '0' + d : d) + '-' + (m <= 9 ? '0' + m : m) + '-' + y;\n}", "function formatDate(date) {\n let source = new Date(date);\n let day = source.getDate();\n let month = source.getMonth() + 1;\n let year = source.getFullYear();\n\n return `${day}/${month}/${year}`;\n }", "function formatDate(date) {\n\treturn new Date(date.split(' ').join('T'))\n}", "function formatDate(date) {\r\n date = new Date(date);\r\n let DD = date.getDate();\r\n if (DD < 10) {\r\n DD = \"0\" + DD;\r\n }\r\n let MM = date.getMonth() +1;\r\n if (MM < 10) {\r\n MM = \"0\" + MM;\r\n }\r\n const YYYY = date.getFullYear();\r\n return DD + \"/\" + MM + \"/\" + YYYY;\r\n }", "getFormattedDate(date) {\n const year = date.getFullYear();\n const month = (date.getUTCMonth() + 1).toString().padStart(2, '0');\n const day = (date.getUTCDate()).toString().padStart(2, '0');\n // Logger.log(`Day: ${day}, Month: ${month}, Year:${year}`)\n const dateFormatted = `${year}-${month}-${day}`;\n return dateFormatted;\n }", "function formatDate(date) {\n \n var dd = date.getDate();\n if (dd < 10) {\n dd = '0' + dd;\n }\n \n var mm = date.getMonth() + 1;\n if (mm < 10) {\n mm = '0' + mm;\n }\n \n var yy = date.getFullYear();\n if (yy < 10) {\n yy = '0' + yy;\n }\n \n return mm + '/' + dd + '/' + yy;\n }", "function formatDate(date) {\r\n\r\n let dd = date.getDate();\r\n if (dd < 10) dd = '0' + dd;\r\n\r\n let mm = date.getMonth() + 1;\r\n if (mm < 10) mm = '0' + mm;\r\n\r\n let yy = date.getFullYear() % 100;\r\n if (yy < 10) yy = '0' + yy;\r\n\r\n return dd + '.' + mm + '.' + yy;\r\n}", "function formatDate(date) {\r\n date = new Date(date);\r\n let DD = date.getDate();\r\n if (DD < 10) {\r\n DD = \"0\" + DD;\r\n }\r\n let MM = date.getMonth() +1;\r\n if (MM < 10) {\r\n MM = \"0\" + MM;\r\n }\r\n const YYYY = date.getFullYear();\r\n return DD + \"/\" + MM + \"/\" + YYYY;\r\n}", "function formatDate(date){\n\t\tvar formatted = {\n\t\t\tdate:date,\n\t\t\tyear:date.getFullYear().toString().slice(2),\n\t\t\tmonth:s.months[date.getMonth()],\n\t\t\tmonthAbv:s.monthsAbv[date.getMonth()],\n\t\t\tmonthNum:date.getMonth() + 1,\n\t\t\tday:date.getDate(),\n\t\t\tslashDate:undefined,\n\t\t\ttime:formatTime(date)\n\t\t}\n\t\tformatted.slashDate = formatted.monthNum + '/' + formatted.day + '/' + formatted.year;\n\t\treturn formatted;\n\t}", "function formatDate(date) {\n var day = (\"0\" + date.getDate()).slice(-2);\n var month = (\"0\" + (date.getMonth() + 1)).slice(-2);\n var year = date.getFullYear().toString().slice(-2);\n return day + month + year;\n}", "function formatDate(date)\n{\n g_date=date.getDate();\n if(g_date <=9)\n {\n g_date=\"0\"+g_date;\n }\n g_month=date.getMonth();\n g_year=date.getFullYear();\n if (g_year < 2000) g_year += 1900;\n return todaysMonthName(date)+\" \"+g_date+\", \"+g_year;\n}", "function formatDate(date,formatStr){return renderFakeFormatString(getParsedFormatString(formatStr).fakeFormatString,date);}", "function getFormattedDate(date) {\n return $filter('date')(date, 'yyyy-MM-dd');\n }", "_stringify(date){\n date = date.toLocaleDateString();\n return date;\n }", "function formatDate(date, format){\n if(!date){\n return '0000-00-00';\n }\n var dd = date.substring(0, 2);\n var mm = date.substring(3, 5);\n var yy = date.substring(6);\n if (format == 'dmy') {\n return dd + '-' + mm + '-' + yy;\n } else {\n return yy + '-' + mm + '-' + dd;\n }\n }", "function formatDate(date) {\n var day = date.getDate();\n if (day < 10) {\n day = \"0\" + day;\n }\n\n var month = date.getMonth() + 1;\n if (month < 10) {\n month = \"0\" + month;\n }\n\n var year = date.getFullYear();\n\n return day + \".\" + month + \".\" + year;\n}", "formatDate (date){\n var d = new Date(date),\n month = (d.getMonth() + 1),\n day = d.getDate(),\n year = d.getFullYear();\n if (month.length < 2)\n month = '0' + month;\n if (day.length < 2)\n day = '0' + day;\n return [year, month, day].join('-');\n }", "function convertToFormat (dateObj, dateFormat) {\r\n var month = dateObj.getMonth() + 1;\r\n var date = dateObj.getDate();\r\n var year = dateObj.getFullYear();\r\n var dateString;\r\n switch (dateFormat) {\r\n case 'yyyy.m.d':\r\n dateString = year + '.' + month + '.' + date;\r\n break;\r\n case 'yyyy-m-d':\r\n dateString = year + '-' + month + '-' + date;\r\n break;\r\n case 'yyyy/m/d':\r\n dateString = year + '/' + month + '/' + date;\r\n break;\r\n case 'yyyy/mm/dd':\r\n dateString = year + '/' + _makeTwoDigits(month) + '/' + _makeTwoDigits(date);\r\n break;\r\n case 'dd/mm/yyyy':\r\n dateString = _makeTwoDigits(date) + '/' + _makeTwoDigits(month) + '/' + year;\r\n break;\r\n case 'dd-mm-yyyy':\r\n dateString = _makeTwoDigits(date) + '-' + _makeTwoDigits(month) + '-' + year;\r\n break;\r\n case 'd-m-yyyy':\r\n dateString = date + '-' + month + '-' + year;\r\n break;\r\n case 'd/m/yyyy':\r\n dateString = date + '/' + month + '/' + year;\r\n break;\r\n case 'd/mm/yyyy':\r\n dateString = date + '/' + _makeTwoDigits(month) + '/' + year;\r\n break;\r\n case 'dd.mm.yyyy':\r\n dateString = _makeTwoDigits(date) + '.' + _makeTwoDigits(month) + '.' + year;\r\n break;\r\n case 'm/d/yyyy':\r\n dateString = month + '/' + date + '/' + year;\r\n break;\r\n default:\r\n dateString = _makeTwoDigits(date) + '.' + _makeTwoDigits(month) + '.' + year;\r\n }\r\n return dateString;\r\n }", "function formatDate(){\n if (!Date.prototype.toISODate) {\n Date.prototype.toISODate = function() {\n return this.getFullYear() + '-' +\n ('0'+ (this.getMonth()+1)).slice(-2) + '-' +\n ('0'+ this.getDate()).slice(-2);\n }\n }\n }", "function formatDate(date) {\n const d = new Date(date);\n return d.getFullYear() + \"-\" + twoDigits(d.getMonth() + 1) + \"-\" + twoDigits(d.getDate());\n}", "function formatDate(d) {\n if (d === undefined){\n d = (new Date()).toISOString()\n }\n let currDate = new Date(d);\n let year = currDate.getFullYear();\n let month = currDate.getMonth() + 1;\n let dt = currDate.getDate();\n let time = currDate.toLocaleTimeString('en-SG')\n\n if (dt < 10) {\n dt = '0' + dt;\n }\n if (month < 10) {\n month = '0' + month;\n }\n\n return dt + \"/\" + month + \"/\" + year + \" \" + time ;\n }", "function formattedDate(d) {\n let month = String(d.getMonth() + 1);\n let day = String(d.getDate());\n const year = String(d.getFullYear());\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return `${year}-${month}-${day}`;\n }", "function formattedDate(date) {\r\n\t\t\t\t\tvar d = new Date(date),\r\n\t\t\t\t\t\tmonth = '' + (d.getMonth() + 1),\r\n\t\t\t\t\t\tday = '' + d.getDate(),\r\n\t\t\t\t\t\tyear = d.getFullYear();\r\n\r\n\t\t\t\t\tif (month.length < 2) month = '0' + month;\r\n\t\t\t\t\tif (day.length < 2) day = '0' + day;\r\n\t\t\t\t\treturn [year, month, day].join('-');\r\n\t\t\t\t}", "function getFormattDate(date) {\n let month = (1 + date.getMonth()).toString();\n month = month.length > 1 ? month : \"0\" + month;\n\n let day = date.getDate().toString();\n day = day.length > 1 ? day : \"0\" + day;\n\n return (date.getFullYear() + \"-\" + month + \"-\" + day);\n}", "function getFormattDate(date) {\n let month = (1 + date.getMonth()).toString();\n month = month.length > 1 ? month : \"0\" + month;\n\n let day = date.getDate().toString();\n day = day.length > 1 ? day : \"0\" + day;\n\n return (date.getFullYear() + \"-\" + month + \"-\" + day);\n}", "function formatDate(date) {\r\n var d = date ? new Date(date) : new Date()\r\n month = '' + (d.getMonth() + 1),\r\n day = '' + d.getDate(),\r\n year = d.getFullYear();\r\n if (month.length < 2)\r\n month = '0' + month;\r\n if (day.length < 2)\r\n day = '0' + day;\r\n\r\n return `${day}${month}${year}`;\r\n}", "function _formatDate(date) {\n\t//remove timezone GMT otherwise move time\n\tvar offset = date.getTimezoneOffset() * 60000;\n\tvar dateFormatted = new Date(date - offset);\n dateFormatted = dateFormatted.toISOString();\n if (dateFormatted.indexOf(\"T\") > 0)\n dateFormatted = dateFormatted.split('T')[0];\n return dateFormatted;\n}", "function formatDate(date) {\n const month = date.getMonth() + 1;\n const day = date.getDate();\n const year = date.getFullYear();\n \n return `${month}/${day}/${year}`;\n }", "function formatDate(date) {\r\n return date.getFullYear().toString() + (date.getMonth() + 1).toString().padStart(2, '0') + date.getDate().toString() \r\n + date.getHours().toString().padStart(2, '0') + date.getMinutes().toString().padStart(2, '0');\r\n }", "function formatDate(date) {\n var dd = date.getDate()\n if (dd < 10) dd = '0' + dd;\n var mm = date.getMonth() + 1\n if (mm < 10) mm = '0' + mm;\n var yy = date.getFullYear();\n if (yy < 10) yy = '0' + yy;\n return dd + '.' + mm + '.' + yy;\n}", "formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n return [year, month, day].join('-');\n }", "function formatDate(date) {\n // date is a date object\n const options = { year: 'numeric', month: 'short', day: 'numeric', timeZone: 'UTC' };\n return date.toLocaleString('en-US', options);\n}", "function formatDate(date) {\n // date is a date object\n const options = { year: 'numeric', month: 'long', day: 'numeric', timeZone: 'UTC' };\n return date.toLocaleDateString('en-US', options);\n}", "function _date(obj) {\n return exports.PREFIX.date + ':' + obj.toISOString();\n}", "function get_formatted_date(date) {\n function get_formatted_num(num, expected_length) {\n var str = \"\";\n var num_str = num.toString();\n var num_zeros = expected_length - num_str.length;\n for (var i = 0; i < num_zeros; ++i) {\n str += '0';\n }\n str += num_str;\n return str;\n }\n var msg = get_formatted_num(date.getFullYear(), 4) + \"-\";\n msg += get_formatted_num(date.getMonth() + 1, 2) + \"-\";\n msg += get_formatted_num(date.getDate(), 2) + \" \";\n msg += get_formatted_num(date.getHours(), 2) + \":\";\n msg += get_formatted_num(date.getMinutes(), 2) + \":\";\n msg += get_formatted_num(date.getSeconds(), 2);\n return msg;\n}", "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n \n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n \n return [year, month, day].join('-');\n }", "function formatDate(date,format) {\n if (!format){\n format = \"yyyy-MM-dd\";\n }\n if (date === null){\n return null;\n }\n if (!(date instanceof Date)){\n date = new Date(date);\n }\n let day = date.getDate();\n let month = date.getMonth();\n let year = date.getFullYear();\n let hour = date.getHours();\n let min = date.getMinutes();\n let sec = date.getSeconds();\n\n let str = format.replace(\"yyyy\",year)\n .replace(\"MM\",fillString(month+1,2,-1,\"0\"))\n .replace(\"dd\",fillString(day,2,-1,\"0\"))\n .replace(\"HH\",fillString(hour,2,-1,\"0\"))\n .replace(\"mm\",fillString(min,2,-1,\"0\"))\n .replace(\"ss\",fillString(sec,2,-1,\"0\"))\n ;\n return str;\n }", "function formattedDate(date) {\n\n // Récupération\n var month = String(date.getMonth() + 1);\n var day = String(date.getDate());\n var year = String(date.getFullYear());\n\n // Ajout du 0\n if (month.length < 2) \n month = '0' + month;\n\n // Ajout du 0\n if (day.length < 2) \n day = '0' + day;\n\n return day+'/'+month+'/'+year;\n }", "function prettyFormatDate(date) {\n return Utilities.formatDate(new Date(date), \"GMT-7\", \"MM/dd/yy\").toString();\n}", "function formatDate(date) {\n var newDate = new Date(date);\n var dd = newDate.getDate();\n var mm = newDate.getMonth() + 1; // January is 0!\n\n var yyyy = newDate.getFullYear();\n\n if (dd < 10) {\n dd = \"0\".concat(dd);\n }\n\n if (mm < 10) {\n mm = \"0\".concat(mm);\n }\n\n var formatedDate = \"\".concat(dd, \"/\").concat(mm, \"/\").concat(yyyy);\n return formatedDate;\n}", "function formatDate(date) {\n var day = date.getDate();\n var month = date.getMonth();\n var year = date.getFullYear();\n month++;\n if (month < 10)\n month = '0' + month;\n if (day < 10)\n day = '0' + day;\n return [year, month, day].join('-').toString();\n}", "formatDate(date) {\n return date.toISOString().replaceAll(\"-\", \"\").substring(0, 8);\n }", "function formatDate(date) {\n\t\tvar day = date.getDate();\n\t\t\n\t\t// Add '0' if needed\n\t\tif (parseInt(day / 10) == 0) {\n\t\t\tday = \"0\" + day;\n\t\t}\n\t\t\n\t\tvar month = date.getMonth() + 1; // months start at 0\n\t\t\n\t\t// Add '0' if needed\n\t\tif (parseInt(month / 10) == 0) {\n\t\t\tmonth = \"0\" + month;\n\t\t}\n\t\t\n\t\tvar year = date.getFullYear();\n\t\t\n\t\treturn day + \"/\" + month + \"/\" + year;\n\t}", "function formatDate(date) {\n\t\treturn (date.getMonth() + 1 + '/' + date.getDate() + '/' + date.getFullYear() + ' - ' + formatTime([date.getHours(), date.getMinutes()]));\n\t}", "function formatDate(date)\n{\n date = new Date(date * 1000);\n return '' + date.getFullYear() + '/' + lpad(date.getMonth(), 2, '0') + '/' + lpad(date.getDate(), 2, '0') + ' ' + lpad(date.getHours(), 2, '0') + ':' + lpad(date.getMinutes(), 2, '0');\n}", "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) {\n month = '0' + month;\n }\n if (day.length < 2) {\n day = '0' + day;\n }\n\n return [year, month, day].join('-');\n}", "_convertDateObjToString(obj) {\n\n let date = \"\";\n\n if (obj && obj.day && obj.month && obj.year) {\n let month = String(obj.month);\n let day = String(obj.day);\n let year = String(obj.year);\n\n if (month.length < 2) {\n month = \"0\" + month;\n }\n\n if (day.length < 2) {\n day = \"0\" + day;\n }\n\n if (year.length < 4) {\n var l = 4 - year.length;\n for (var i = 0; i < l; i++) {\n year = \"0\" + year;\n }\n }\n date = year + \"-\" + month + \"-\" + day;\n }\n\n return date;\n }", "formatDate(x) {\n let date = new Date(x)\n let _month = date.getMonth() + 1 < 10 ? `0${date.getMonth() + 1}` : date.getMonth() + 1\n let _date = date.getDate() < 10 ? `0${date.getDate()}` : date.getDate()\n let _hour = date.getHours() < 10 ? `0${date.getHours()}` : date.getHours()\n let _minute = date.getMinutes() < 10 ? `0${date.getMinutes()}` : date.getMinutes()\n let _second = date.getSeconds() < 10 ? `0${date.getSeconds()}` : date.getSeconds()\n let dateStr = `${date.getFullYear()}-${_month}-${_date} ${_hour}:${_minute}:${_second}`\n return dateStr\n }", "returnDateFormat(date){\n var day = new Date(date);\n return day.toDateString();\n }", "formatDateTime(date, format) {\n date = new Date(date);\n var result = format || 'y-m-d h:i:s';\n result = result.replace('y', date.getFullYear());\n result = result.replace('m', this.pad(date.getMonth() + 1, 2));\n result = result.replace('d', this.pad(date.getDate(), 2));\n result = result.replace('h', this.pad(date.getHours(), 2));\n result = result.replace('i', this.pad(date.getMinutes(), 2));\n result = result.replace('s', this.pad(date.getSeconds(), 2));\n return result;\n }", "function formatDate (date) {\n if (date) {\n const year = date.getFullYear()\n const month = date.getMonth() + 1\n const day = date.getDate()\n return year + '-' + month.toString().padStart(2, '0') + '-' + day.toString().padStart(2, '0')\n } else {\n return ''\n }\n}", "function formatDate(date) {\n var date = new Date(date * 1000);\n return `${date.getMonth() + 1}/${date.getDate()}/${date.getUTCFullYear()}`;\n}", "formatted_date() {\n return this.created_at.toLocaleDateString()\n }", "function formatDate(date) {\n var year = date.getFullYear()\n var month = (1 + date.getMonth()).toString()\n var day = date.getUTCDate()\n return month + \"/\" + day + \"/\" + year\n}", "static formatDate(date) {\n let formattedDate = '';\n\n formattedDate += date.getUTCFullYear();\n formattedDate += '-' + ('0' + (date.getUTCMonth() + 1)).substr(-2);\n formattedDate += '-' + ('0' + date.getUTCDate()).substr(-2);\n\n return formattedDate;\n }", "function formatDate(date){\n var yr = date.getFullYear();\n var mnth = date.getMonth()+1;\n if(mnth < 10){\n mnth = `0${mnth}`;\n }\n var day = date.getDate()\n if(day < 10){\n day = `0${day}`;\n }\n return yr+\"-\"+mnth+\"-\"+day;\n}", "function formatDate(date){\n var dd = date.getDate(),\n mm = date.getMonth()+1, //January is 0!\n yyyy = date.getFullYear();\n\n if(dd<10) dd='0'+dd;\n if(mm<10) mm='0'+mm;\n\n return yyyy+'-'+mm+'-'+dd;\n}", "function dateformat(date) {\n \n // Main array that will be used to sort out the date.\n let dateArray = date.split('-');\n // Sorts days\n let dayArray = dateArray[2].split('T');\n let day = dayArray[0];\n // Sets up month and year months\n let month = dateArray[1];\n let year = dateArray[0];\n // Using the global standard or writing DOB\n let formatedDOB = [day, month, year].join('-');\n // Retuns the data from the formatted DOB.\n return formatedDOB;\n }", "function formatDate ( date ) {\n return date.getDate() + nth(date.getDate()) + \" \" +\n months[date.getMonth()] + \" \" +\n date.getFullYear();\n}", "function formatDate(date) {\n if (date) {\n var formattedDate = new Date(date);\n return formattedDate.toLocaleDateString();\n } else {\n return null;\n }\n}", "function formatDate(date) {\n return date.getFullYear() + '-' +\n (date.getMonth() < 9 ? '0' : '') + (date.getMonth()+1) + '-' +\n (date.getDate() < 10 ? '0' : '') + date.getDate();\n}", "function formatDate(date, formatStr) {\n\t\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n\t}", "function pgFormatDate(date) {\n /* Via http://stackoverflow.com/questions/3605214/javascript-add-leading-zeroes-to-date */\n return String(date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate()); \n}", "function formatDate(date) {\n\t\t\t\treturn date.getDate() + \"-\" + (date.getMonth()+1) + \"-\" + date.getFullYear();\n\t\t\t}", "function setFormatoDate(data) {\n let dd = (\"0\" + (data.getDate())).slice(-2);\n let mm = (\"0\" + (data.getMonth() + 1)).slice(-2);\n let yyyy = data.getFullYear();\n return dd + '/' + mm + '/' + yyyy;\n}", "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "prettyBirthday() {//Can be put in method\n return dayjs(this.person.dob.date)\n .format('DD MMMM YYYY')//change in assignment to different format not default\n }", "function dateFormatter(date){\n var year = date.getFullYear();\n var month = date.getMonth() + 1;\n var day = date.getDate();\n return year + '-' + ('0' + month).slice(-2) + '-' + day; // the '0' and the slicing is for left padding\n}", "static formatDate (date, format) {\n let year = date.getFullYear(),\n month = Timer.zero(date.getMonth()+1),\n day = Timer.zero(date.getDate()),\n hours = Timer.zero(date.getHours()),\n minute = Timer.zero(date.getMinutes()),\n second = Timer.zero(date.getSeconds()),\n week = date.getDay();\n return format.replace(/yyyy/g, year)\n .replace(/MM/g, month)\n .replace(/dd/g, day)\n .replace(/hh/g, hours)\n .replace(/mm/g, minute)\n .replace(/ss/g, second)\n .replace(/ww/g, Timer.weekName(week));\n }", "function formatDate(date){\n var yyyy = date.getFullYear();\n var mm = date.getMonth() + 1;\n var dd = date.getDate();\n //console.log(\"This is dd\" + dd);\n if(dd<10){\n dd='0'+ dd;\n }\n if(mm<10){\n mm='0'+mm;\n } \n return ( mm + '/' + dd + '/' + yyyy);\n \n }", "function format(d) {\n const month = d.getMonth() >= 9 ? d.getMonth() + 1 : `0${d.getMonth() + 1}`;\n const day = d.getDate() >= 10 ? d.getDate() : `0${d.getDate()}`;\n const year = d.getFullYear();\n return `${month}/${day}/${year}`;\n}", "function formatDate(dateToConvert) {\n\treturn format(new Date(dateToConvert));\n}", "dateFormate(d) {\n const date = new Date(d)\n const j = date.getDate()\n const m = (date.getUTCMonth() + 1)\n const a = date.getUTCFullYear()\n return (\"0\" + j).slice(-2) + '/' + (\"0\" + m).slice(-2) + '/' + a\n }", "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n return [year, month, day].join('-');\n }", "function formatDate(date) {\n let year = date.getFullYear();\n let month = date.getMonth() + 1;\n let day = date.getDate();\n return [year, month, day].join('-');\n}", "formatDate(value, format) {\n format = format || '';\n if (value) {\n return window.moment(value)\n .format(format);\n }\n return \"n/a\";\n }", "function formatDate(date) {\n result = \"\";\n if (date) {\n result += date.getDate() + \"/\"; // Day\n result += (date.getMonth() + 1) + \"/\";\n result += (date.getYear() + 1900);\n }\n return result;\n}", "formatDate(d) {\n return moment(d).format('DD/MM/YYYY')\n }", "function formattedDate(d = new Date()) {\n return [d.getDate(), d.getMonth() + 1, d.getFullYear()]\n .map((n) => (n < 10 ? `0${n}` : `${n}`))\n .join(\"/\")\n .concat(` at ${getTime(d)}`);\n }", "_formatDate(date, tzOffset) {\n let str = window.iotlg.dateFormat;\n let actualDate = new Date();\n actualDate.setTime(date.getTime() + this._getMilliseconds(tzOffset, UNIT_HOUR));\n let hours = (actualDate.getUTCHours());\n let day = (actualDate.getUTCDate());\n\n str = str.replace(\"yyyy\", actualDate.getUTCFullYear());\n str = str.replace(\"mm\", this._fillUp(actualDate.getUTCMonth() + 1, 2));\n str = str.replace(\"dd\", this._fillUp(day, 2));\n str = str.replace(\"hh\", this._fillUp(hours, 2));\n str = str.replace(\"MM\", this._fillUp(actualDate.getUTCMinutes(), 2));\n str = str.replace(\"ss\", this._fillUp(actualDate.getUTCSeconds(), 2));\n str = str.replace(\" \", \"\\n\");\n return str;\n }", "function formatDate(rawDate) {\n return rawDate.replace(/(\\d{4})[-/](\\d{2})[-/](\\d{2})/, '$3.$2.$1');\n}", "function formatDate(val) {\n var d = new Date(val),\n day = d.getDate(),\n month = d.getMonth() + 1,\n year = d.getFullYear();\n\n if (day < 10) {\n day = \"0\" + day;\n }\n if (month < 10) {\n month = \"0\" + month;\n }\n return month + \"/\" + day + \"/\" + year;\n}", "getDateFormated(date) {\n const formatDate = new Intl.DateTimeFormat('en-GB', {\n day: 'numeric',\n month: 'short',\n year: 'numeric'\n }).format;\n return formatDate(date);\n }", "function formattedDate(d = new Date) {\n\treturn [d.getDate(), d.getMonth()+1, d.getFullYear()]\n\t\t.map(n => n < 10 ? `0${n}` : `${n}`).join('/');\n }", "function reFormatDate(date) {\n const d= new Date(Date.parse(date));\n let mm = d.getMonth() + 1;\n const yyyy = d.getFullYear();\n let dd = d.getDate();\n\n if (dd < 10) {\n dd = `0${dd}`;\n }\n if (mm < 10) {\n mm = `0${mm}`;\n }\n return `${yyyy}-${mm}-${dd}`;\n }" ]
[ "0.75326866", "0.7420164", "0.73876584", "0.7385484", "0.7349305", "0.73363584", "0.7304889", "0.73006487", "0.7294178", "0.7294178", "0.7294178", "0.72198546", "0.7214603", "0.7210451", "0.71882045", "0.71826977", "0.7178597", "0.7168202", "0.7166666", "0.71578765", "0.7136146", "0.71349835", "0.71151835", "0.7093839", "0.706165", "0.7061519", "0.7048695", "0.7047947", "0.70349354", "0.70265055", "0.7025534", "0.7015198", "0.7003021", "0.69942075", "0.69853264", "0.69851565", "0.6983645", "0.69776374", "0.69776374", "0.6977418", "0.69769365", "0.6975265", "0.696972", "0.696335", "0.69605833", "0.6957015", "0.6956592", "0.6952107", "0.6949238", "0.6949197", "0.69431907", "0.69423485", "0.69416785", "0.6938525", "0.6934973", "0.6934778", "0.6933255", "0.6922046", "0.69155365", "0.6914491", "0.69144833", "0.6909942", "0.68964064", "0.68887526", "0.6888571", "0.6874685", "0.6871356", "0.6870593", "0.6870209", "0.6867715", "0.6864856", "0.6863069", "0.68511087", "0.6847044", "0.684454", "0.6839347", "0.6834848", "0.68345577", "0.682663", "0.6825858", "0.6825858", "0.6825858", "0.68247", "0.6818275", "0.68179244", "0.68146193", "0.6811811", "0.6810673", "0.68102336", "0.68095076", "0.68084896", "0.6803768", "0.6800531", "0.6793565", "0.67912674", "0.6790335", "0.67874086", "0.67860335", "0.678414", "0.67838544", "0.6778337" ]
0.0
-1
pick the locale from the array try ['enau', 'engb'] as 'enau', 'engb', 'en', as in move through the list trying each substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
function chooseLocale(names) { var i = 0, j, next, locale, split; while (i < names.length) { split = normalizeLocale(names[i]).split('-'); j = split.length; next = normalizeLocale(names[i + 1]); next = next ? next.split('-') : null; while (j > 0) { locale = loadLocale(split.slice(0, j).join('-')); if (locale) { return locale; } if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) { //the next array item is better than a shallower substring of this one break; } j--; } i++; } return globalLocale; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n \n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n}" ]
[ "0.70808", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.7072442" ]
0.0
-1
This function will load locale and then set the global locale. If no arguments are passed in, it will simply return the current global locale key.
function getSetGlobalLocale (key, values) { var data; if (key) { if (isUndefined(values)) { data = getLocale(key); } else { data = defineLocale(key, values); } if (data) { // moment.duration._locale = moment._locale = data; globalLocale = data; } else { if ((typeof console !== 'undefined') && console.warn) { //warn user if arguments are passed but the locale could not be set console.warn('Locale ' + key + ' not found. Did you forget to load it?'); } } } return globalLocale._abbr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale ' + key + ' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined$1(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\r\n var data;\r\n if (key) {\r\n if (isUndefined(values)) {\r\n data = getLocale(key);\r\n }\r\n else {\r\n data = defineLocale(key, values);\r\n }\r\n\r\n if (data) {\r\n // moment.duration._locale = moment._locale = data;\r\n globalLocale = data;\r\n }\r\n else {\r\n if ((typeof console !== 'undefined') && console.warn) {\r\n //warn user if arguments are passed but the locale could not be set\r\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\r\n }\r\n }\r\n }\r\n\r\n return globalLocale._abbr;\r\n }", "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn(\n 'Locale ' + key + ' not found. Did you forget to load it?'\n );\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn User if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }" ]
[ "0.7326747", "0.7298492", "0.72952205", "0.7249647", "0.7249647", "0.7249647", "0.7249647", "0.7249647", "0.7249647", "0.72418416", "0.72418416", "0.72305644", "0.72183263", "0.72145385", "0.72106117", "0.72106117", "0.72106117", "0.72106117", "0.72068065", "0.72064245", "0.72062695", "0.72062695", "0.72062695", "0.72062695", "0.72062695" ]
0.0
-1
Pick the first defined of two or three arguments.
function defaults(a, b, c) { if (a != null) { return a; } if (b != null) { return b; } return c; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pick() {\n\tvar args = arguments,\n\t\ti,\n\t\targ,\n\t\tlength = args.length;\n\tfor (i = 0; i < length; i++) {\n\t\targ = args[i];\n\t\tif (typeof arg !== 'undefined' && arg !== null) {\n\t\t\treturn arg;\n\t\t}\n\t}\n}", "function pick() {\n\t\tvar args = arguments,\n\t\t\ti,\n\t\t\targ,\n\t\t\tlength = args.length;\n\t\tfor (i = 0; i < length; i++) {\n\t\t\targ = args[i];\n\t\t\tif (arg !== UNDEFINED && arg !== null) {\n\t\t\t\treturn arg;\n\t\t\t}\n\t\t}\n\t}", "function firstArg() {\n\treturn arguments != \"\" ? [...arguments].shift() : undefined;\n}", "function pick() {\n var args = arguments,\n i,\n arg,\n length = args.length;\n for (i = 0; i < length; i++) {\n arg = args[i];\n if (arg !== UNDEFINED && arg !== null) {\n return arg;\n }\n }\n }", "function getFirstDefined() {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n for (var _i3 = 0, _args = args; _i3 < _args.length; _i3++) {\n var arg = _args[_i3];\n\n if (arg !== undefined) {\n return arg;\n }\n }\n\n return undefined;\n } // variable used to generate id", "function $pick() {\r\n\t\tfor (var i=0,l=arguments.length; i<l; i++) {\r\n\t\t\tif ($chk(arguments[i])) return arguments[i];\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "function v1() {\r\n for (var args = arguments, i = 0, l = args.length; i < l && args[i] == undefined; i++);\r\n return has(args, i) ? args[i] : args[l - 1];\r\n }", "function or() {\r\n\t\t\tvar remain = _.without(arguments, undefined); \r\n\t\t\tif (remain.length === 0)\r\n\t\t\t\treturn undefined;\r\n\t\t\treturn remain[0];\r\n\t\t}", "function getFirstDefined(...args) {\n\t for (const arg of args) {\n\t if (arg !== undefined) {\n\t return arg;\n\t }\n\t }\n\t return undefined;\n\t}", "function f(x) {\n let firstArg = arguments[0];\n\n return firstArg;\n}", "function firstDefined() {\n var i = -1;\n while (++i < arguments.length) {\n if (arguments[i] !== undefined) {\n return arguments[i];\n }\n }\n return undefined;\n }", "function get_arg_2() { return arguments[2]; }", "function firstString() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n for (var i = 0; i < args.length; i++) {\n var arg = args[i];\n if (typeof arg === \"string\") {\n return arg;\n }\n }\n}", "function mrcPick(arg, def) {\n return (typeof arg !== \"undefined\" ? arg : def);\n}", "function firstString() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n for (var i = 0; i < args.length; i++) {\r\n var arg = args[i];\r\n if (typeof arg === \"string\") {\r\n return arg;\r\n }\r\n }\r\n}", "function f(a, b, c, d, e, f) {\n let sixthArg = arguments[5];\n let thirdArg = arguments[2];\n\n return sixthArg;\n}", "function myOtherFunction (first_argument = second_argument, second_argument) {}", "function RandomArg()\n{\n\tvar r = Math.floor(Math.random()*arguments.length);\n\treturn arguments[r];\n}", "function getArg(aArgs,aName,aDefaultValue){if(aName in aArgs){return aArgs[aName];}else if(arguments.length===3){return aDefaultValue;}else{throw new Error('\"'+aName+'\" is a required argument.');}}", "function randomChoice()\n{\n assert (\n arguments.length > 0,\n 'must supply at least one possible choice'\n );\n\n var idx = randomInt(0, arguments.length - 1);\n\n return arguments[idx];\n}", "function doWhat(first, second, third) {\n if (arguments.length != 3) {\n throw new Error(\"Excepts 3 arguments, but invoke with \" +\n arguments.length + \" arguments\");\n }\n}", "function isTwoPassed(){\n var args = Array.prototype.slice.call(arguments);\n return args.indexOf(2) != -1;\n}", "function getArg(args, type, number) {\n var count = 1, number = (number || 1);\n for (var i = 0; i < args.length; i++) {\n //Check for type, If function then ensure \"callee\" is excluded\n if (typeof args[i] == type && !(type == \"function\" && args[i].name == \"callee\")) {\n if (number == 1) return args[i];\n else number++;\n }\n }\n }", "function abc(a,b) {\n var c = 6;\n return arguments[0] + b + c;\n}", "function foo() {\n\tvar a = arguments[0] !== (void 0) ? arguments[0] : 2;\n\tconsole.log( a );\n}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName]\n } else if (arguments.length === 3) {\n return aDefaultValue\n } else {\n throw new Error('\"' + aName + '\" is a required argument.')\n }\n }", "function getFirstElement ([a, b]) {\n let getArray = [a, b] \n return getArray[0]\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function one(a,...rest){\n console.log(a,rest)\n}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t\t if (aName in aArgs) {\n\t\t return aArgs[aName];\n\t\t } else if (arguments.length === 3) {\n\t\t return aDefaultValue;\n\t\t } else {\n\t\t throw new Error('\"' + aName + '\" is a required argument.');\n\t\t }\n\t\t}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function sayArguments(first, second) {\n first = first || 'first';\n second = second || 'second'; // || Значение по умолчанию\n let args = '';\n\n for (let i = 0; i < arguments.length; i++) {\n args += arguments[i] + ' ';\n }\n console.log( 'Arguments: ' + args );\n}", "function smallestValue(){\n return Math.min(...arguments);\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n }\n throw new Error('\"' + aName + '\" is a required argument.');\n\n}", "function test() {\n return arguments.slice(arguments.length - 1)[0]; //ERROR, there is not slice method\n}", "function getThirdArgument() {\n\n // Stores all possible arguments in array\n argumentArray = process.argv;\n\n // Loops through words in node argument\n for (var i = 3; i < argumentArray.length; i++) {\n argument += argumentArray[i];\n }\n return argument;\n}", "function oneOf(args) { }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}" ]
[ "0.76293796", "0.75582266", "0.7454984", "0.7448525", "0.6879006", "0.6671625", "0.6651035", "0.6640051", "0.6581468", "0.648993", "0.6479717", "0.64059037", "0.6300056", "0.6299914", "0.6286635", "0.61624765", "0.6150181", "0.59610116", "0.595939", "0.59325296", "0.59306544", "0.5918026", "0.58860403", "0.5864823", "0.58458054", "0.5843397", "0.5843397", "0.5843397", "0.5843397", "0.5819639", "0.5818896", "0.57886404", "0.5776125", "0.5776125", "0.5776125", "0.5776125", "0.5776125", "0.5776125", "0.5776125", "0.5776125", "0.5776125", "0.5776125", "0.5776125", "0.5776125", "0.5776125", "0.5776125", "0.5776125", "0.5776125", "0.5776125", "0.5776125", "0.5776125", "0.5776125", "0.5776125", "0.5776125", "0.5774112", "0.57645905", "0.57645905", "0.57645905", "0.57645905", "0.57645905", "0.57645905", "0.57645905", "0.57645905", "0.57645905", "0.57645905", "0.57645905", "0.57645905", "0.5755699", "0.5752241", "0.5741812", "0.5737021", "0.57286906", "0.5721004", "0.5665936", "0.5659385", "0.5655039", "0.5655039", "0.5655039", "0.5655039", "0.5655039", "0.5655039", "0.5655039", "0.5655039", "0.5655039", "0.5655039", "0.5655039", "0.5655039", "0.5655039", "0.5655039", "0.5655039", "0.5655039", "0.5655039", "0.5655039", "0.5655039", "0.5655039", "0.5655039", "0.5655039", "0.5655039", "0.5655039", "0.5655039", "0.5655039" ]
0.0
-1
convert an array to a date. the array should mirror the parameters below note: all values past the year are optional and will default to the lowest possible value. [year, month, day , hour, minute, second, millisecond]
function configFromArray (config) { var i, date, input = [], currentDate, expectedWeekday, yearToUse; if (config._d) { return; } currentDate = currentDateArray(config); //compute day of the year from weeks and weekdays if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { dayOfYearFromWeekInfo(config); } //if the day of the year is set, figure out what it is if (config._dayOfYear != null) { yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) { getParsingFlags(config)._overflowDayOfYear = true; } date = createUTCDate(yearToUse, 0, config._dayOfYear); config._a[MONTH] = date.getUTCMonth(); config._a[DATE] = date.getUTCDate(); } // Default to current date. // * if no year, month, day of month are given, default to today // * if day of month is given, default month and year // * if month is given, default only year // * if year is given, don't default anything for (i = 0; i < 3 && config._a[i] == null; ++i) { config._a[i] = input[i] = currentDate[i]; } // Zero out whatever was not defaulted, including time for (; i < 7; i++) { config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; } // Check for 24:00:00.000 if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) { config._nextDay = true; config._a[HOUR] = 0; } config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input); expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay(); // Apply timezone offset from input. The actual utcOffset can be changed // with parseZone. if (config._tzm != null) { config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); } if (config._nextDay) { config._a[HOUR] = 24; } // check for mismatching day of week if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) { getParsingFlags(config).weekdayMismatch = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dateFromArray(input) {\n return new Date(input[0], input[1] || 0, input[2] || 1, input[3] || 0, input[4] || 0, input[5] || 0, input[6] || 0);\n }", "function dateFromArray(input) {\n return new Date(input[0], input[1] || 0, input[2] || 1, input[3] || 0, input[4] || 0, input[5] || 0, input[6] || 0);\n }", "function datearray(num)\n{\n var ret = []\n var day = Math.floor(num/1000000)\n ret.push(day)\n num = num-(day*1000000)\n var month = Math.floor(num/10000)\n ret.push(month)\n num = num-(month*10000)\n var year = Math.floor(num)\n ret.push(year)\n return ret\n}", "function SP_CreateDateObject(arrDate)\n{\n\tvar oDate;\n\t\n\tif(arrDate.length == 3)\n\t{\n\t\t// Check First Element is either day or year\n\t\t\n\t\tif(arrDate[0].length == 4) //means year , passing array date is of format yyyy-mmm-dd\n\t\t{\n\t\t\toDate = new Date(arrDate[0], --arrDate[1], arrDate[2]);\n\t\t}\n\t\telse //means day, passing array date is of format dd-mmm-yyyy \n\t\t{\n\t\t\toDate = new Date(arrDate[2], SP_GetMonthNumber(arrDate[1]), arrDate[0]);\t\t\n\t\t}\n\t}\n\telse\n\t{\n\t\toDate = new Date();\n\t}\n\t\n\treturn oDate;\n}", "function formArray (array, oneRMArray) {\n var data = []\n for (var i = 0; i < array.length; i++) {\n var d;\n var monthString = array[i].month.toString();\n var dayString = array[i].day.toString();\n var yearString = array[i].year.toString();\n var d = new Date(monthString + \"-\" + dayString + \"-\" + yearString);\n var dParsed = Date.parse(d);\n\n data[i] = {\n x: dParsed,\n y: oneRMArray[i]\n } \n }\n return data\n }", "function formatDATADate(dateArr) {\r\n\r\n var val = [];\r\n\r\n for (date in dateArr) {\r\n val.push(new Date(formatDate(date)).getTime());\r\n }\r\n\r\n return val;\r\n}", "makeArray(d) {\n var da = new Date(d);\n return [da.getUTCFullYear(), da.getUTCMonth() + 1, da.getUTCDate(), 0, 0, 0, 0];\n }", "function fillDate(array) {\n var last = array.length - 1;\n var firstDate = array[0].datestamp;\n var lastDate = array[last].datestamp;\n\n var fullarray = betweenDate(firstDate, lastDate);\n\n return fullarray;\n }", "fromArray(a) {\n var d = [].concat(a);\n d[1]--;\n return Date.UTC.apply(null, d);\n }", "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += config._tzh || 0;\n input[4] += config._tzm || 0;\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += config._tzh || 0;\n input[4] += config._tzm || 0;\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += config._tzh || 0;\n input[4] += config._tzm || 0;\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += config._tzh || 0;\n input[4] += config._tzm || 0;\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += config._tzh || 0;\n input[4] += config._tzm || 0;\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += ~~((config._tzm || 0) / 60);\n input[4] += ~~((config._tzm || 0) % 60);\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += ~~((config._tzm || 0) / 60);\n input[4] += ~~((config._tzm || 0) % 60);\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += ~~((config._tzm || 0) / 60);\n input[4] += ~~((config._tzm || 0) % 60);\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "function BuildDates(date){\r\n var array = new Array();\r\n array['day'] = (date.getDate() < 10) ?\r\n '0' + date.getDate().toString() :\r\n date.getDate().toString();\r\n \r\n array['month'] = (date.getMonth() < 9) ?\r\n '0' + (date.getMonth()+1).toString() :\r\n (date.getMonth()+1).toString();\r\n \r\n array['year'] = date.getFullYear().toString();\r\n return array;\r\n}", "function date() {\n return new Date(year, ...arguments)\n }", "function dateFromArray(config) {\n var i, date, input = [], currentDate;\n\n if (config._d) {\n return;\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n currentDate = currentDateArray(config);\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += ~~((config._tzm || 0) / 60);\n input[4] += ~~((config._tzm || 0) % 60);\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "function createDateArray( date ) {\r\n return date.split( '-' ).map(function( value ) { return +value })\r\n }", "function makeFriendlyDates(arr) {\n var months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n var start = arr[0].split('-'), startStr = '';\n var end = arr[1].split('-'), endStr = '';\n var result = [];\n function toNum(str) {\n return +str;\n }\n // convert to readable day formant\n function dayFormat(day) {\n switch (day) {\n case 1:\n case 21:\n return day + 'st';\n case 2:\n case 22:\n return day + 'nd';\n case 3:\n case 23:\n return day + 'rd';\n default:\n return day + 'th';\n }\n }\n start = start.map(toNum);\n end = end.map(toNum);\n var startYear = start[0], startMonth = start[1], startDay = start[2];\n var endYear = end[0], endMonth = end[1], endDay = end[2];\n // ending date equals to starting date\n if (arr[0] === arr[1]) {\n result.push(months[startMonth - 1] + ' ' + dayFormat(startDay) + ', ' + startYear);\n return result;\n }\n startStr += months[startMonth - 1] + ' ' + dayFormat(startDay);\n if (endYear === startYear) {\n if (startYear !== 2016) {\n startStr += ', ' + startYear; \n }\n if (endMonth === startMonth ) {\n endStr += dayFormat(endDay); // two dates within a month, just output ending day\n } else {\n endStr += months[endMonth - 1] + ' ' + dayFormat(endDay);\n }\n } else if (endYear - startYear === 1) {\n if (endMonth === startMonth && endDay < startDay || endMonth < startMonth) { // within one year\n endStr += months[endMonth - 1] + ' ' + dayFormat(endDay);\n if (startYear !== 2016) {\n startStr += ', ' + startYear; \n }\n } else if (endMonth >= startMonth) { // exceed one year\n startStr += ', ' + startYear;\n endStr += months[endMonth - 1] + ' ' + dayFormat(endDay) + ', ' + endYear;\n }\n } else if (endYear - startYear > 1) { // exceed one year\n startStr += ', ' + startYear;\n endStr += months[endMonth - 1] + ' ' + dayFormat(endDay) + ', ' + endYear;\n }\n\n result.push(startStr, endStr);\n return result;\n}", "function makeDateArray(weatherData, array){\n weatherData.data.forEach((item, index) => {\n Object.keys(item).forEach(key => {\n if(key === \"datetime\") {\n array.push(dateFormat(weatherData.data[index][key]));\n return array;\n }\n });\n });\n}", "formatDateForArray(date, month, year) {\n //console.log('month-->'+month+'date-->'+date);\n if (month <= 9 ) \n month = '0' + (month+1);\n if (date <= 9) \n date = '0' + (date);\n\n return [year, month, date].join('-');\n }", "parseDate(arrayOfStrings)\n {\n let newStr=arrayOfStrings[3];\n newStr += '-';\n switch(arrayOfStrings[1])\n {\n case 'Jan':\n newStr+='01';\n break;\n case 'Feb':\n newStr+='02';\n break;\n case 'Mar':\n newStr+='03';\n break;\n case 'Apr':\n newStr+='04';\n break;\n case 'May':\n newStr+='05';\n break;\n case 'Jun':\n newStr+='06';\n break;\n case 'Jul':\n newStr+='07';\n break;\n case 'Aug':\n newStr+='08';\n break;\n case 'Sep':\n newStr+='09';\n break;\n case 'Oct':\n newStr+='10';\n break;\n case 'Nov':\n newStr+='11';\n break;\n case 'Dec':\n newStr+='12';\n break;\n default:\n break;\n }\n newStr+='-';\n newStr+=arrayOfStrings[2];\n\n return newStr;\n }", "function sortByYear\n(\n array\n) \n{\n return array.sort(function(a,b)\n {\n var x = parseInt(a.number.split('-')[1]);\n var y = parseInt(b.number.split('-')[1]);\n return ((x < y) ? -1 : ((x > y) ? 0 : 1));\n }).reverse();\n}", "function frmt_date(a,field) {\n for(var i=0; i < a.length; i++){\n if( ! a[i][field] ) { continue }\n var d = new Date(a[i][field] * 1000)\n a[i][field] = d.toISOString().substr(0,16).replace('T',' ')\n }\n return(a)\n}", "function date2arr(date)\r\n{\r\n\t//\tdate = yyyy-mm-dd\r\n\tif(date != null && date.length > 0 && date.toLowerCase() != \"null\")\r\n\t{\r\n\t\tvar tmp = date.split(\"-\");\r\n\t\tvar arr = new Array();\r\n\t\tarr[0] = tmp[2];\r\n\t\tarr[1] = tmp[1];\r\n\t\tarr[2] = Number(tmp[0]);\r\n\t\treturn arr;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn null;\r\n\t}\r\n}", "function normalizeDate(year, month, day) {\n return [year.padStart(4, '2000'), month.padStart(2, '0'), day.padStart(2, '0')];\n }", "function transformSortDate(arr) {\n const sortedArray = arr.sort((a, b) => {\n return b.timestamp + a.timestamp;\n });\n return sortedArray;\n}", "function dateStringToObject(date){\n var splitString = date.split(\"-\");// gonna set up our YYYY-MM-DD format\n var dateObject = {}; // object variable we will push results to\n // date should have a year(1), month(2), day(3) array input\n dateObject.year = splitString[0];\n dateObject.month = splitString[1];\n dateObject.day = splitString[2];\n return dateObject;\n} //(OPTION 1)", "function textifyDates(myArr){\n \n \n for(var r=0; r < myArr.length; r++){\n for(var c=0; c < myArr[r].length; c++){\n if (Object.prototype.toString.call(myArr[r][c]) === '[object Date]'){\n try { \n //myArr[r] = myArr[r].toString();\n myArr[r] = Utilities.formatDate(myArr[r], \"GMT+08:00\", \"dd-MMM-yyyy\")\n } \n catch(err) { myArr[r][c] = err};\n }\n }\n }\n return myArr;\n}", "function dateToUnix(dateArr){\n var d = new Date(dateArr[2],months.indexOf(getMonth(dateArr)),dateArr[1].substr(0,dateArr[1].length-1),0,0,0,0);\n return d.valueOf() / 1000 -18000;\n}", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function gregorianDateArrToStr([year, month, day]): string {\n return moment.utc([year, month - 1, day]).format('YYYY-MM-DD');\n}", "function toDate(value){if(isDate(value)){return value;}if(typeof value==='number'&&!isNaN(value)){return new Date(value);}if(typeof value==='string'){value=value.trim();var parsedNb=parseFloat(value);// any string that only contains numbers, like \"1234\" but not like \"1234hello\"\nif(!isNaN(value-parsedNb)){return new Date(parsedNb);}if(/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)){/* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */var _a=Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__read\"])(value.split('-').map(function(val){return+val;}),3),y=_a[0],m=_a[1],d=_a[2];return new Date(y,m-1,d);}var match=void 0;if(match=value.match(ISO8601_DATE_REGEX)){return isoStringToDate(match);}}var date=new Date(value);if(!isDate(date)){throw new Error(\"Unable to convert \\\"\"+value+\"\\\" into a date\");}return date;}", "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== config._d.getDay()) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }", "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== config._d.getDay()) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }", "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== config._d.getDay()) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }", "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function convertDates(d) {\n\tfor (var i = d.length; i--;)\n\t\tconvertDateObj(d[i]);\n\treturn d;\n}", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray(config) {\n var i, date, input = [],\n currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray(config) {\n var i, date, input = [],\n currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray(config) {\n var i, date, input = [],\n currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray(config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function makeDateObjects(data){\r\n\t\tconsole.log(\"makeDateObjects\");\r\n\t\tfor (i = 0; i < data.length; i++){\r\n\t\t\tvar datestring = data[i][selectedOptions.dateField];\r\n\t\t\tvar thisYear = parseInt(datestring.substring(0,4));\r\n\t\t\tvar thisMonth = parseInt(datestring.substring(5,7));\r\n\t\t\tvar thisDay = parseInt(datestring.substring(8,10));\r\n\t\t\tvar thisDateComplete = new Date(thisYear, thisMonth-1, thisDay); // JS-Date Month begins at 0\r\n\t\t\tzaehlstellen_data[i][selectedOptions.dateField] = thisDateComplete;\r\n\t\t}\r\n\t}", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }" ]
[ "0.70556146", "0.70556146", "0.6968585", "0.6850404", "0.6635095", "0.6459753", "0.613038", "0.61257774", "0.6066985", "0.6015293", "0.6015293", "0.6015293", "0.6015293", "0.6015293", "0.59616965", "0.59616965", "0.59616965", "0.5901381", "0.58887535", "0.58766466", "0.58678675", "0.5801828", "0.5768205", "0.56834215", "0.56509805", "0.5617561", "0.56129885", "0.5597271", "0.5560929", "0.5516224", "0.55027395", "0.5437363", "0.53852874", "0.5293231", "0.5290657", "0.5289045", "0.52870214", "0.52870214", "0.52870214", "0.52870214", "0.52725995", "0.52598953", "0.5259648", "0.5258728", "0.5258728", "0.5258728", "0.5256293", "0.52557397", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654", "0.5248654" ]
0.0
-1
date from iso format
function configFromISO(config) { var i, l, string = config._i, match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), allowTime, dateFormat, timeFormat, tzFormat; if (match) { getParsingFlags(config).iso = true; for (i = 0, l = isoDates.length; i < l; i++) { if (isoDates[i][1].exec(match[1])) { dateFormat = isoDates[i][0]; allowTime = isoDates[i][2] !== false; break; } } if (dateFormat == null) { config._isValid = false; return; } if (match[3]) { for (i = 0, l = isoTimes.length; i < l; i++) { if (isoTimes[i][1].exec(match[3])) { // match[2] should be 'T' or space timeFormat = (match[2] || ' ') + isoTimes[i][0]; break; } } if (timeFormat == null) { config._isValid = false; return; } } if (!allowTime && timeFormat != null) { config._isValid = false; return; } if (match[4]) { if (tzRegex.exec(match[4])) { tzFormat = 'Z'; } else { config._isValid = false; return; } } config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); configFromStringAndFormat(config); } else { config._isValid = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isoDate(date)\n{\n\treturn date.getFullYear() + \"-\" + (date.getMonth() + 1) + \"-\" + date.getDate()\n}", "function dateFromISO8601(isostr) {\n var parts = isostr.match(/\\d+/g);\n var date = new Date(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]);\n var mm = date.getMonth() + 1;\n mm = (mm < 10) ? '0' + mm : mm;\n var dd = date.getDate();\n dd = (dd < 10) ? '0' + dd : dd;\n var yyyy = date.getFullYear();\n var finaldate = mm + '/' + dd + '/' + yyyy;\n return finaldate;\n }", "function parseIsoDate(dateStr) {\n \tif(dateStr.length <10) return null;\n \tvar d = dateStr.substring(0,10).split('-');\t\n \tfor(var i in d) { \n \t\td[i]=parseInt(d[i]);\n \t};\n \td[1] = d[1] -1;//month;\n \tvar t = dateStr.substring(11,19).split(':');\n \treturn new Date(d[0],d[1],d[2],t[0],t[1],t[2]);\n }", "function ISOdate(d) {\r\n\ttry {\r\n\t\treturn d.toISOString().slice(0,10);\r\n\t}catch(e){\r\n\t\treturn 'Invalid ';\r\n\t}\r\n}", "function isoStringToDate(match){var date=new Date(0);var tzHour=0;var tzMin=0;// match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\nvar dateSetter=match[8]?date.setUTCFullYear:date.setFullYear;var timeSetter=match[8]?date.setUTCHours:date.setHours;// if there is a timezone defined like \"+01:00\" or \"+0100\"\nif(match[9]){tzHour=Number(match[9]+match[10]);tzMin=Number(match[9]+match[11]);}dateSetter.call(date,Number(match[1]),Number(match[2])-1,Number(match[3]));var h=Number(match[4]||0)-tzHour;var m=Number(match[5]||0)-tzMin;var s=Number(match[6]||0);var ms=Math.round(parseFloat('0.'+(match[7]||0))*1000);timeSetter.call(date,h,m,s,ms);return date;}", "function datetoisostring() { // @return String:\r\n return uudate(this).ISO();\r\n}", "function parseISODate(str) {\n pieces = /(\\d{4})-(\\d{2})-(\\d{2})/g.exec(str);\n if (pieces === null)\n return null;\n var year = parseInt(pieces[1], 10),\n month = parseInt(pieces[2], 10),\n day = parseInt(pieces[3], 10);\n return new Date(year, month - 1, day); // In ISO, months are 1-12; in JavaScript, months are 0-11.\n }", "function toISODate(date) {\n return date.toISOString().split('T')[0];\n }", "convertISOToCalendarFormat(ISOdate) {\n const isoArray = ISOdate.toString().split(' ');\n let day = isoArray[2];\n const monthStr = isoArray[1];\n const year = isoArray[3];\n\n const month = convertMonthStringtoNumber(monthStr);\n\n day = day.length === 2 ? day : '0' + day;\n\n return year + '-' + month + '-' + day;\n }", "function dateFromIsoString(isoDateString) {\r\n return fastDateParse.apply(null, isoDateString.split(/\\D/));\r\n }", "function isoToDate(s) {\n if (s instanceof Date) { return s; }\n if (typeof s === 'string') { return new Date(s); }\n}", "function iso8601Decoder(isoStr) {\n return Date.parse(isoStr);\n }", "function formatIso(date) {\n\t return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n\t}", "function formatIso(date) {\n\t return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n\t}", "function formatIso(date) {\n\t return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n\t}", "function formatIso(date) {\n\t return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n\t}", "function parseIsoToTimestamp(_date) {\n if ( _date !== null ) {\n var s = $.trim(_date);\n s = s.replace(/-/, \"/\").replace(/-/, \"/\");\n s = s.replace(/-/, \"/\").replace(/-/, \"/\");\n s = s.replace(/:00.000/, \"\");\n s = s.replace(/T/, \" \").replace(/Z/, \" UTC\");\n s = s.replace(/([\\+\\-]\\d\\d)\\:?(\\d\\d)/, \" $1$2\"); // -04:00 -> -0400\n return Number(new Date(s));\n }\n return null;\n }", "function convertDate( date ){\n\tvar day;\n\tvar month;\n\tvar year;\n\n\t//Extract year, month and day\n\tmonth = date.substr(0,2);\n\tday = date.substr(3,2);\n\tyear = date.substr(6);\n\n\t//compile the ynab compatible format\n\tdate = (year + \"-\" + month + \"-\" + day);\n\t\n\treturn date;\n}", "function amzDate(date, short) {\n const result = date.toISOString().replace(/[:\\-]|\\.\\d{3}/g, '').substr(0, 17)\n if (short) {\n return result.substr(0, 8)\n }\n return result\n}", "function parseISOString(s) {\n var b = s.split(/\\D+/);\n return new Date(Date.UTC(b[0], --b[1], b[2], b[3], b[4], 0, 0));\n}", "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function convertDate(date) {\n let day = date.substr(8, 2);\n let month = date.substr(5, 2);\n let year = date.substr(0, 4);\n date = day + \"/\" + month + \"/\" + year;\n return date;\n }", "function parseDate(isoString) {\n // Parse isoDateTimeString to JavaScript date object\n isoString = isoString.split('.', 1);\n return new Date(isoString[0] + '+00:00');\n }", "function isoDateFormat(strDateView) {\n return moment(strDateView, \"DD/MM/YYYY HH:mm\").format(\"YYYY-MM-DD HH:mm\")\n}", "function formatIso(date) {\n return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n}", "function formatIso(date) {\n return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n}", "function formatIso(date) {\n return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n}", "function formatIso(date) {\n return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n}", "function formatIso(date) {\n return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n}", "function formatIso(date) {\n return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n}", "function formatIso(date) {\n return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n}", "function _dateCoerce(obj) {\n return obj.toISOString();\n}", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function formatDateIso(date) {\n\tif (!date || date == null) {\n\t\treturn \"\";\n\t}\n\t\n\tvar jsDate = new Date(date);\n\t\n\t// get the calendar-date components of the iso date. \n\tvar YYYY = jsDate.getFullYear();\n\tvar MM = (jsDate.getMonth() + 1) < 10 ? '0' + (jsDate.getMonth() + 1) : (jsDate.getMonth() + 1); // month should be in the form 'MM'.\n\tvar DD = jsDate.getDate() < 10 ? '0' + jsDate.getDate() : jsDate.getDate(); // day should be in the form 'DD'.\n\t\n\t// get the clock-time components of the iso date.\n\tvar hh = jsDate.getHours() < 10 ? '0' + jsDate.getHours() : jsDate.getHours(); // hours should be in the form 'hh'.\n\tvar mm = jsDate.getMinutes() < 10 ? '0' + jsDate.getMinutes() : jsDate.getMinutes(); // minutes should be in the form 'mm'.\n\tvar ss = jsDate.getSeconds() < 10 ? '0' + jsDate.getSeconds() : jsDate.getSeconds(); // seconds should be in the form 'ss'.\n\tvar sss = '000'; //just hardcoded 000 for milliseconds...\n\t\n\t// assemble the iso date from the date and time components.\n\tvar isoDate = YYYY + '-' + MM + '-' + DD + 'T' + // add the date components.\n\t\thh + ':' + mm + ':' + ss + '.' + sss + 'Z'; // add the time components.\n\t\t\n\t// return the iso-formatted version of the date.\n\treturn isoDate;\n}", "function getDate(dateISO){ \n let appointmentDate = new Date(dateISO);\n const date = appointmentDate.getDate() +'/' + appointmentDate.getMonth() + '/'+ appointmentDate.getFullYear();\n return date;\n }", "static isoDateTime(date) {\n var pad;\n console.log('Util.isoDatetime()', date);\n console.log('Util.isoDatetime()', date.getUTCMonth().date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes, date.getUTCSeconds);\n pad = function(n) {\n if (n < 10) {\n return '0' + n;\n } else {\n return n;\n }\n };\n return date.getFullYear()(+'-' + pad(date.getUTCMonth() + 1) + '-' + pad(date.getUTCDate()) + 'T' + pad(date.getUTCHours()) + ':' + pad(date.getUTCMinutes()) + ':' + pad(date.getUTCSeconds()) + 'Z');\n }", "makeDateRFC3339(date) {\n var ret = this.dateStrings(date)\n return ret.year + \"-\" + ret.month + \"-\" + ret.day\n }", "function dateConverter(date){\r\n dateF = date.trim();\r\n let d = dateF.substring(0, 2);\r\n let m = dateF.substring(3,5);\r\n let y = dateF.substring(6,10);\r\n return(y +\"-\"+m+\"-\"+d);\r\n}", "function formatDateToISO(date) {\n return date.toISOString().split('T')[0];\n}", "function ISODateString(a){function b(a){return a<10?\"0\"+a:a}return a.getUTCFullYear()+\"-\"+b(a.getUTCMonth()+1)+\"-\"+b(a.getUTCDate())+\"T\"+b(a.getUTCHours())+\":\"+b(a.getUTCMinutes())+\":\"+b(a.getUTCSeconds())+\"Z\"}", "function isoToFormattedDate(timestamp) {\n\tvar date = new Date(timestamp);\n\treturn (date.getMonth() + 1) + '/' + date.getDate() + '/' + date.getFullYear();\n}", "isIsoFormat(value) {\n let dateRegex = RegExp('[0-9][0-9][0-9][0-9]-[0-1][0-9]-[0-3][0-9]$');\n return dateRegex.test(value);\n }", "function parseDateFormat(date) {\n return $filter('date')(date, 'yyyy-MM-dd');\n }", "function isoDateString(date, extended) {\n date = (date === undefined ? new Date() : date);\n var dash = (extended === 1 ? \"-\" : \"\");\n var yr = date.getFullYear();\n var dd = (\"0\" + date.getDate()).slice(-2);\n var mm = (\"0\" + (date.getMonth()+1)).slice(-2);\n \n return yr.toString() + dash +\n mm.toString() + dash +\n dd.toString();\n}", "function ISO_2022() {}", "function ISO_2022() {}", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(string) {\n var format = 'YYYY-MM-DDT',\n i;\n if (isoRegex.exec(string)) {\n for (i = 0; i < 3; i++) {\n if (isoTimes[i][1].exec(string)) {\n format += isoTimes[i][0];\n break;\n }\n }\n return makeDateFromStringAndFormat(string, format + 'Z');\n }\n return new Date(string);\n }", "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0; // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours; // if there is a timezone defined like \"+01:00\" or \"+0100\"\n\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0); // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n\n var ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function get_date(d) {\n var date1 = new Date(d.substr(0, 4), d.substr(5, 2) - 1, d.substr(8, 2), d.substr(11, 2), d.substr(14, 2), d.substr(17, 2));\n return date1;\n }", "function convert_date(str){var tmp=str.split(\".\");return new Date(tmp[1]+\"/\"+tmp[0]+\"/\"+tmp[2])}", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n moment.createFromInputFallback(config);\n }\n }", "function convertBritishToISO(date) {\r\n dateF = date.trim();\r\n let d = dateF.substring(0, 2);\r\n let m = dateF.substring(3,5);\r\n let y = dateF.substring(6,10);\r\n return(y +\"/\"+m+\"/\"+d);\r\n}", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n \n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function toISODate(date) { // yyyy-mm-dd\n \"use strict\";\n var yyyy, mm, dd;\n // JavaScript provides no simple way to format a date-only\n yyyy = \"\" + date.getFullYear();\n mm = date.getMonth() + 1; // Months go from 0 .. 11\n dd = date.getDate();\n // Need leading zeroes to form the yyyy-mm-dd pattern.\n if (mm < 10) {\n mm = \"0\" + mm; // This converts it to a string\n }\n if (dd < 10) {\n dd = \"0\" + dd; // This converts it to a string\n }\n return \"\" + yyyy + \"-\" + mm + \"-\" + dd;\n}", "function formatDate(isoDateStr) {\n var date = new Date(isoDateStr);\n var monthNames = [\n \"Jan\", \"Feb\", \"Mar\",\n \"Apr\", \"May\", \"Jun\", \"Jul\",\n \"Aug\", \"September\", \"Oct\",\n \"Nov\", \"Dec\"\n ];\n\n var day = date.getDate();\n var monthIndex = date.getMonth();\n var year = date.getFullYear();\n var yearStr = \"\";\n if (year != (new Date()).getFullYear()) {\n yearStr = \", \" + String(year);\n }\n\n return \" \" + monthNames[monthIndex] + \" \" + day + \" \" + yearStr;\n}", "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function parseDate (date) {\n var d = '';\n var t = date.indexOf('T');\n let index = date.indexOf('-');\n \n if(index === -1 && t === 8){\n d += date.substring(0, 4) + '-';\n d += date.substring(4, 6) + '-';\n d += date.substring(6, 8) + date.substr(8);\n } else if (index > -1 && t === 10) {\n return date;\n } else {\n console.error('invalid date');\n return null;\n }\n return d;\n }", "function iso8601date() {\n var date = new Date();\n\n function pad(number) {\n return (number < 10 ? '0' : '') + number;\n }\n function pad3(number) {\n return (number < 10 ? '0' : (number < 100 ? '00' : '')) + number;\n }\n\n return date.getUTCFullYear() + '-' +\n pad(date.getUTCMonth() + 1) + '-' +\n pad(date.getUTCDay()) + ' ' +\n pad(date.getUTCHours()) + ':' +\n pad(date.getUTCMinutes()) + ':' +\n pad(date.getUTCSeconds()) + '.' +\n pad3(date.getUTCMilliseconds());\n}", "function toIsoDate(dateString) {\n var splitted = dateString.split(\"/\");\n return new Date(splitted[2], splitted[1] - 1, splitted[0]);\n}", "extractDateFormat() {\n const isoString = '2018-12-31T12:00:00.000Z' // example date\n\n const intlString = this.props.intl.formatDate(isoString) // generate a formatted date\n const dateParts = isoString.split('T')[0].split('-') // prepare to replace with pattern parts\n\n return intlString\n .replace(dateParts[2], 'dd')\n .replace(dateParts[1], 'MM')\n .replace(dateParts[0], 'yyyy')\n }", "makeDateObjectFromCompact(datestring) {\n if (datestring !== undefined && datestring.length === 8) {\n let year = parseInt(datestring.substring(0, 4))\n let month = parseInt(datestring.substring(4, 6)) - 1\n let day = parseInt(datestring.substring(6, 8))\n return new Date(year, month, day)\n } else {\n return \"\"\n }\n }", "function ISODateString(d){\n function pad(n){return n<10 ? '0'+n : n}\n return d.getUTCFullYear()+'-'\n + pad(d.getUTCMonth()+1)+'-'\n + pad(d.getUTCDate())+'T'\n + pad(d.getUTCHours())+':'\n + pad(d.getUTCMinutes())+':'\n + pad(d.getUTCSeconds())+'Z'}", "getFormattedDate ({ date }) {\n if (typeof date === 'string') {\n return format(parseISO(date), \"d 'de' MMMM', às' HH'h'mm\", {\n locale: ptBR\n })\n }\n return format(date, \"d 'de' MMMM', às' HH'h'mm\", {\n locale: ptBR\n })\n }", "function makeDateFromString(config) {\n\t parseISO(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t moment.createFromInputFallback(config);\n\t }\n\t }", "function makeDateFromString(config) {\n\t parseISO(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t moment.createFromInputFallback(config);\n\t }\n\t }", "function FormatDate(date) {\n return new Date( parseInt( date.substr(6) ) );\n}", "function convertDate(dateIn)\n{\n let dateYear = dateIn.charAt(0);\n dateYear += dateIn.charAt(1);\n dateYear += dateIn.charAt(2);\n dateYear += dateIn.charAt(3);\n\n let dateMonth = dateIn.charAt(5) + dateIn.charAt(6);\n let dateDay = dateIn.charAt(8) + dateIn.charAt(9);\n\n let dateOut = dateDay + '-' + dateMonth + '-' + dateYear;\n return dateOut;\n}", "function convertDate(date) {\n let day = date.substring(8);\n let month = date.substring(5, 7);\n let year = date.substring(2,4);\n let newDate = `${month} /${day} /${year}`;\n return newDate;\n}", "function to_date(x){\n return new Date(x.substring(0,4), x.substring(5,7)-1, x.substring(8,10), x.substring(11,13), x.substring(14,16), x.substring(17,19));\n}", "function getISOLocalDate(value) {\n if (!value) {\n return value;\n }\n\n var date = new Date(value);\n\n if (isNaN(date.getTime())) {\n throw new Error(\"Invalid date: \".concat(value));\n }\n\n var year = getYear(date);\n var month = \"0\".concat(getMonth(date)).slice(-2);\n var day = \"0\".concat(getDay(date)).slice(-2);\n return \"\".concat(year, \"-\").concat(month, \"-\").concat(day);\n}", "function getISOLocalDate(value) {\n if (!value) {\n return value;\n }\n\n var date = new Date(value);\n\n if (isNaN(date.getTime())) {\n throw new Error(\"Invalid date: \".concat(value));\n }\n\n var year = getYear(date);\n var month = \"0\".concat(getMonth(date)).slice(-2);\n var day = \"0\".concat(getDay(date)).slice(-2);\n return \"\".concat(year, \"-\").concat(month, \"-\").concat(day);\n}", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }" ]
[ "0.7161587", "0.7084152", "0.69561076", "0.68181574", "0.66757625", "0.66372114", "0.6559707", "0.6525335", "0.6466161", "0.6465599", "0.644205", "0.64171946", "0.6406543", "0.6406543", "0.6406543", "0.6406543", "0.63656497", "0.63241196", "0.6322188", "0.62742394", "0.62635076", "0.62635076", "0.62635076", "0.62635076", "0.6256379", "0.62237656", "0.6219025", "0.6201553", "0.6201553", "0.6201553", "0.6201553", "0.6201553", "0.6201553", "0.6201553", "0.6187698", "0.6187633", "0.618634", "0.618634", "0.61794", "0.61792564", "0.6172095", "0.613812", "0.61320627", "0.6129032", "0.609373", "0.6090011", "0.6071324", "0.60647243", "0.6062863", "0.60613644", "0.60613644", "0.606091", "0.606091", "0.606091", "0.606091", "0.606091", "0.6034974", "0.6000997", "0.5995632", "0.5995632", "0.5995632", "0.5995632", "0.5985886", "0.59761006", "0.5967464", "0.5967464", "0.59647685", "0.59567374", "0.59377056", "0.5936541", "0.5930827", "0.5930827", "0.5930827", "0.5930827", "0.5930827", "0.5930065", "0.5928079", "0.59234697", "0.5912456", "0.5900138", "0.5890115", "0.5882479", "0.58786935", "0.58786935", "0.58709115", "0.58588386", "0.5855063", "0.585465", "0.58419347", "0.58419347", "0.5841354", "0.5841354", "0.5841354", "0.5841354", "0.5841354", "0.5841354", "0.5841354", "0.5841354", "0.5841354", "0.5841354", "0.5841354" ]
0.0
-1
date and time from ref 2822 format
function configFromRFC2822(config) { var match = rfc2822.exec(preprocessRFC2822(config._i)); if (match) { var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]); if (!checkWeekday(match[1], parsedArray, config)) { return; } config._a = parsedArray; config._tzm = calculateOffset(match[8], match[9], match[10]); config._d = createUTCDate.apply(null, config._a); config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); getParsingFlags(config).rfc2822 = true; } else { config._isValid = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createDrupalDateFromPieces(date, hour, minute, marker) {\n //Build time\n var time = hour + ':' + minute + ' ' + marker;\n //Build full date\n var dateTime = moment(date + ' ' + time, 'YYYY-MM-DD hh:mm A');\n //Return date in 24-hour format\n return moment(dateTime);\n }", "function createdOnParser(data) {\n let str = data.split('T');\n let date = str[0];\n let time = str[1].split('.')[0];\n return `${ date } at ${ time }`;\n }", "function render_datetime(data){\n\t var datetime = data.split(' ');\n\t var date = datetime[0].split('-').reverse().join('/');\n\t var time = datetime[1].substring(0,5);\n\t return date+' às '+time;\n\t}", "function longForm(){\n return Date.parse(date.split(\",\")[1].match(/[a-zA-Z0-9 \\:]+/)[0].trim().replace(\" at \", \" \"));\n }", "function dl(e,t,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function formatDate(date, format) {\n format = format + \"\";\n var result = \"\";\n var i_format = 0;\n var c = \"\";\n var token = \"\";\n var y = date.getYear() + \"\";\n var M = date.getMonth() + 1;\n var d = date.getDate();\n var E = date.getDay();\n var H = date.getHours();\n var m = date.getMinutes();\n var s = date.getSeconds();\n var yyyy, yy, MMM, MM, dd, hh, h, mm, ss, ampm, HH, H, KK, K, kk, k;\n // Convert real date parts into formatted versions\n var value = new Object();\n if (y.length < 4) {\n y = \"\" + (y - 0 + 1900);\n }\n value[\"y\"] = \"\" + y;\n value[\"yyyy\"] = y;\n value[\"yy\"] = y.substring(2, 4);\n value[\"M\"] = M;\n value[\"MM\"] = LZ(M);\n value[\"MMM\"] = MONTH_NAMES[M - 1];\n value[\"NNN\"] = MONTH_NAMES[M + 11];\n value[\"d\"] = d;\n value[\"dd\"] = LZ(d);\n value[\"E\"] = DAY_NAMES[E + 7];\n value[\"EE\"] = DAY_NAMES[E];\n value[\"H\"] = H;\n value[\"HH\"] = LZ(H);\n if (H == 0) {\n value[\"h\"] = 12;\n } else if (H > 12) {\n value[\"h\"] = H - 12;\n } else {\n value[\"h\"] = H;\n }\n value[\"hh\"] = LZ(value[\"h\"]);\n if (H > 11) {\n value[\"K\"] = H - 12;\n } else {\n value[\"K\"] = H;\n }\n value[\"k\"] = H + 1;\n value[\"KK\"] = LZ(value[\"K\"]);\n value[\"kk\"] = LZ(value[\"k\"]);\n if (H > 11) {\n value[\"a\"] = \"PM\";\n } else {\n value[\"a\"] = \"AM\";\n }\n value[\"m\"] = m;\n value[\"mm\"] = LZ(m);\n value[\"s\"] = s;\n value[\"ss\"] = LZ(s);\n while (i_format < format.length) {\n c = format.charAt(i_format);\n token = \"\";\n while ((format.charAt(i_format) == c) && (i_format < format.length)) {\n token += format.charAt(i_format++);\n }\n if (value[token] != null) {\n result = result + value[token];\n } else {\n result = result + token;\n }\n }\n return result;\n}", "function transformDateAndTime(datetime) {\n\t//console.log(\"Date Initial: \" + datetime);\n\tdatetime = datetime.replace(/[^0-9]/g, '');\n\t//console.log(\"Date First: \" + datetime);\n\tdatetime = datetime.substring(4,8) + datetime.substring(2, 4) + datetime.substring(0, 2) + \"T\" \n\t\t\t\t+ datetime.substring(8,14) + \"Z\";\n\treturn datetime;\n}", "function t(e,t,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var a=\" \";return(e%100>=20||e>=100&&e%100==0)&&(a=\" de \"),e+a+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "makeDateRFC3339(date) {\n var ret = this.dateStrings(date)\n return ret.year + \"-\" + ret.month + \"-\" + ret.day\n }", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function gh_time(str, format) {\r\n if (!str) {\r\n return 'invalid date';\r\n }\r\n return str.replace(/T.+/, '');\r\n //var d = new Date(str.replace(/T/, ' ').replace(/Z/, ''));\r\n //return this.date(d, format);\r\n}", "function t(e,t,r){var n=\" \";return(e%100>=20||e>=100&&e%100==0)&&(n=\" de \"),e+n+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[r]}", "function t(e,t,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var a=\" \";return(e%100>=20||e>=100&&e%100==0)&&(a=\" de \"),e+a+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var a=\" \";return(e%100>=20||e>=100&&e%100==0)&&(a=\" de \"),e+a+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var o=\" \";return(e%100>=20||e>=100&&e%100==0)&&(o=\" de \"),e+o+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,a){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[a]}", "function readTime(){\n checkLen(8);\n var low = buf.readUInt32LE(pos);\n var high = buf.readUInt32LE(pos + 4) & 0x3FFFFFFF;\n var tz = (buf[pos + 7] & 0xc0) >> 6;\n pos += 8;\n return formDateString(high, low, tz);\n }", "function formatDate(date,format) {\r\n\tformat=format+\"\";\r\n\tvar result=\"\";\r\n\tvar i_format=0;\r\n\tvar c=\"\";\r\n\tvar token=\"\";\r\n\tvar y=date.getYear()+\"\";\r\n\tvar M=date.getMonth()+1;\r\n\tvar d=date.getDate();\r\n\tvar E=date.getDay();\r\n\tvar H=date.getHours();\r\n\tvar m=date.getMinutes();\r\n\tvar s=date.getSeconds();\r\n\tvar yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;\r\n\t// Convert real date parts into formatted versions\r\n\tvar value=new Object();\r\n\tif (y.length < 4) {y=\"\"+(y-0+1900);}\r\n\tvalue[\"y\"]=\"\"+y;\r\n\tvalue[\"yyyy\"]=y;\r\n\tvalue[\"yy\"]=y.substring(2,4);\r\n\tvalue[\"M\"]=M;\r\n\tvalue[\"MM\"]=LZ(M);\r\n\tvalue[\"MMM\"]=MONTH_NAMES[M-1];\r\n\tvalue[\"NNN\"]=MONTH_NAMES[M+11];\r\n\tvalue[\"d\"]=d;\r\n\tvalue[\"dd\"]=LZ(d);\r\n\tvalue[\"E\"]=DAY_NAMES[E+7];\r\n\tvalue[\"EE\"]=DAY_NAMES[E];\r\n\tvalue[\"H\"]=H;\r\n\tvalue[\"HH\"]=LZ(H);\r\n\tif (H==0){value[\"h\"]=12;}\r\n\telse if (H>12){value[\"h\"]=H-12;}\r\n\telse {value[\"h\"]=H;}\r\n\tvalue[\"hh\"]=LZ(value[\"h\"]);\r\n\tif (H>11){value[\"K\"]=H-12;} else {value[\"K\"]=H;}\r\n\tvalue[\"k\"]=H+1;\r\n\tvalue[\"KK\"]=LZ(value[\"K\"]);\r\n\tvalue[\"kk\"]=LZ(value[\"k\"]);\r\n\tif (H > 11) { value[\"a\"]=\"PM\"; }\r\n\telse { value[\"a\"]=\"AM\"; }\r\n\tvalue[\"m\"]=m;\r\n\tvalue[\"mm\"]=LZ(m);\r\n\tvalue[\"s\"]=s;\r\n\tvalue[\"ss\"]=LZ(s);\r\n\twhile (i_format < format.length) {\r\n\t\tc=format.charAt(i_format);\r\n\t\ttoken=\"\";\r\n\t\twhile ((format.charAt(i_format)==c) && (i_format < format.length)) {\r\n\t\t\ttoken += format.charAt(i_format++);\r\n\t\t\t}\r\n\t\tif (value[token] != null) { result=result + value[token]; }\r\n\t\telse { result=result + token; }\r\n\t\t}\r\n\treturn result;\r\n\t}", "function gexfDateString(date) {\n\tvar ye = '' + date.getFullYear();\n\tvar mo = '' + (date.getMonth() + 1);\n\tvar da = '' + date.getDate();\n\tvar ho = '' + date.getHours();\n\tvar mi = '' + date.getMinutes();\n\tvar se = '' + date.getSeconds();\n\twhile (mo.length < 2) mo = '0' + mo;\n\twhile (da.length < 2) da = '0' + da;\n\twhile (ho.length < 2) ho = '0' + ho;\n\twhile (mi.length < 2) mi = '0' + mi;\n\twhile (se.length < 2) se = '0' + se;\n\treturn [ye,'-',mo,'-',da,'T',ho,':',mi,':',se].join('');\n}", "function formatDate(date,format) {\r\n\tformat=format+\"\";\r\n\tvar result=\"\";\r\n\tvar i_format=0;\r\n\tvar c=\"\";\r\n\tvar token=\"\";\r\n\tvar y=date.getYear()+\"\";\r\n\tvar M=date.getMonth()+1;\r\n\tvar d=date.getDate();\r\n\tvar E=date.getDay();\r\n\tvar H=date.getHours();\r\n\tvar m=date.getMinutes();\r\n\tvar s=date.getSeconds();\r\n\tvar yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;\r\n\t// Convert real date parts into formatted versions\r\n\tvar value=new Array();\r\n\tif (y.length < 4) {\t\r\n\t\ty=\"\"+(y-0+1900);\r\n\t}\r\n\tvalue[\"y\"]=\"\"+y;\r\n\tvalue[\"yyyy\"]=y;\r\n\tvalue[\"yy\"]=y.substring(2,4);\r\n\tvalue[\"M\"]=M;\r\n\tvalue[\"MM\"]=LZ(M);\r\n\tvalue[\"MMM\"]=MONTH_NAMES[M-1];\r\n\tvalue[\"NNN\"]=MONTH_NAMES[M+11];\r\n\tvalue[\"d\"]=d;\r\n\tvalue[\"dd\"]=LZ(d);\r\n\tvalue[\"E\"]=DAY_NAMES[E+7];\r\n\tvalue[\"EE\"]=DAY_NAMES[E];\r\n\tvalue[\"H\"]=H;\r\n\tvalue[\"HH\"]=LZ(H);\r\n\tif (H==0){value[\"h\"]=12;}\r\n\telse if (H>12){value[\"h\"]=H-12;}\r\n\telse {value[\"h\"]=H;}\r\n\tvalue[\"hh\"]=LZ(value[\"h\"]);\r\n\tif (H>11){value[\"K\"]=H-12;} else {value[\"K\"]=H;}\r\n\tvalue[\"k\"]=H+1;\r\n\tvalue[\"KK\"]=LZ(value[\"K\"]);\r\n\tvalue[\"kk\"]=LZ(value[\"k\"]);\r\n\tif (H > 11) { value[\"a\"]=\"PM\"; }\r\n\telse { value[\"a\"]=\"AM\"; }\r\n\tvalue[\"m\"]=m;\r\n\tvalue[\"mm\"]=LZ(m);\r\n\tvalue[\"s\"]=s;\r\n\tvalue[\"ss\"]=LZ(s);\r\n\twhile (i_format < format.length) {\r\n\t\tc=format.charAt(i_format);\r\n\t\ttoken=\"\";\r\n\t\twhile ((format.charAt(i_format)==c) && (i_format < format.length)) {\r\n\t\t\ttoken += format.charAt(i_format++);\r\n\t\t\t}\r\n\t\tif (value[token] != null) { result=result + value[token]; }\r\n\t\telse { result=result + token; }\r\n\t\t}\r\n\treturn result;\r\n\t}", "function process_date(date) {\n var ts = date.split('-'), dpart=[], hpart=[];\n\n function t2s(t) {\n if (!t) { return '00'; }\n return ( +t < 10 ? '0' : '' ) + t;\n }\n\n for (i=0; i<3; i++) { //u\n dpart.push(t2s(ts[i]));\n }\n for (i=3; i<6; i++) {\n hpart.push(t2s(ts[i]));\n }\n\n return dpart.join('/') + ' ' + hpart.join(':');\n }", "function t(e,t,n){var a=\" \";return(e%100>=20||e>=100&&e%100==0)&&(a=\" de \"),e+a+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var a=\" \";return(e%100>=20||e>=100&&e%100==0)&&(a=\" de \"),e+a+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var a=\" \";return(e%100>=20||e>=100&&e%100==0)&&(a=\" de \"),e+a+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var a=\" \";return(e%100>=20||e>=100&&e%100==0)&&(a=\" de \"),e+a+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function e(t,e,n){var i=\" \";return(t%100>=20||t>=100&&t%100==0)&&(i=\" de \"),t+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function e(t,e,n){var i=\" \";return(t%100>=20||t>=100&&t%100==0)&&(i=\" de \"),t+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function e(t,e,n){var i=\" \";return(t%100>=20||t>=100&&t%100==0)&&(i=\" de \"),t+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function e(t,e,n){var i=\" \";return(t%100>=20||t>=100&&t%100==0)&&(i=\" de \"),t+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function e(t,e,r){var i=\" \";return(t%100>=20||t>=100&&t%100==0)&&(i=\" de \"),t+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[r]}", "function t(e,t,a){var n=\" \";return(e%100>=20||e>=100&&e%100==0)&&(n=\" de \"),e+n+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[a]}", "function e(t,e,n){var i=\" \";return(t%100>=20||t>=100&&t%100==0)&&(i=\" de \"),t+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function e(t,e,n){var r=\" \";return(t%100>=20||t>=100&&t%100==0)&&(r=\" de \"),t+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function e(t,e,r){var n=\" \";return(t%100>=20||t>=100&&t%100==0)&&(n=\" de \"),t+n+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[r]}", "function convertDate(time) {\n\tif (time == undefined || time.length != 19) {\n\t\tconsole.log(\"Time is not valid!\" + \" (1064)\");\n\t\treturn new Date();\n\t}\n\tvar d = new Date(time.substring(6,10), time.substring(3,5), time.substring(0,2), time.substring(11,13), time.substring(14,16), time.substring(17,19));\n\tconsole.log(\"Converted time from \" + time + \" to \" + d + \" (1065)\");\n\treturn d;\n}", "function e(t,e,n){var r=\" \";return(t%100>=20||t>=100&&t%100==0)&&(r=\" de \"),t+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function cubism_graphiteFormatDate(time) {\n return Math.floor(time / 1000);\n}", "function cubism_graphiteFormatDate(time) {\n return Math.floor(time / 1000);\n}", "function a(e,a,t){var n=\" \";return(e%100>=20||e>=100&&e%100==0)&&(n=\" de \"),e+n+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[t]}", "static _extractDateParts(date){return{day:date.getDate(),month:date.getMonth(),year:date.getFullYear()}}", "function t(a,r,_){var l={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"s\\u0103pt\\u0103m\\xE2ni\",MM:\"luni\",yy:\"ani\"},h=\" \";return(a%100>=20||a>=100&&a%100==0)&&(h=\" de \"),a+h+l[_]}", "function dateFormat(datum){\n \t\t\tvar day = datum.getDay();\n \t\t\tvar date = datum.getDate();\n \t\t\tvar month = datum.getMonth();\n \t\t\tvar year = datum.getYear();\n \t\t\tvar hour = datum.getHours();\n \t\t\tvar minutes = datum.getMinutes();\n\t\t}", "toFinnishTime(date) {\n //var date = new Date();\n date.setHours(date.getHours()+2);\n return date.toJSON().replace(/T/, ' ').replace(/\\..+/, '');\n }", "parseOracleDate(buf, useLocalTime = true) {\n let fseconds = 0;\n if (buf.length >= 11) {\n fseconds = Math.floor(buf.readUInt32BE(7) / (1000 * 1000));\n }\n const year = (buf[0] - 100) * 100 + buf[1] - 100;\n return settings._makeDate(useLocalTime, year, buf[2], buf[3], buf[4] - 1,\n buf[5] - 1, buf[6] - 1, fseconds, 0);\n }", "getReadableDate (timestamp) {\n try {\n const _date = new Date(timestamp * 1000).toISOString().slice(0, 10)\n const _time = new Date(timestamp * 1000).toISOString().slice(11, 19)\n\n return `${_date} ${_time}`\n } catch (error) {\n console.error(error)\n }\n }", "function convertDate(date, time) {\n\tvar y = eval(date.substring(0, 4));\n\tvar m = eval(date.substring(5, 7));\n\tvar d = eval(date.substring(8, 10));\n\t\n\t// Assume toDateString() returns a string like 'Thu Jul 08 2010'\n\tvar str = new Date(y, m - 1, d).toDateString().substring(0, 10);\n\t\n\tif (time.indexOf(':') >= 0) {\n\t\tstr += ', ' + twentyFourHourToTwelveHour(time.substring(0, 5));\t\n\t}\n\treturn str;\n}", "function get_formatted_date(date) {\n function get_formatted_num(num, expected_length) {\n var str = \"\";\n var num_str = num.toString();\n var num_zeros = expected_length - num_str.length;\n for (var i = 0; i < num_zeros; ++i) {\n str += '0';\n }\n str += num_str;\n return str;\n }\n var msg = get_formatted_num(date.getFullYear(), 4) + \"-\";\n msg += get_formatted_num(date.getMonth() + 1, 2) + \"-\";\n msg += get_formatted_num(date.getDate(), 2) + \" \";\n msg += get_formatted_num(date.getHours(), 2) + \":\";\n msg += get_formatted_num(date.getMinutes(), 2) + \":\";\n msg += get_formatted_num(date.getSeconds(), 2);\n return msg;\n}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";if(e%100>=20||e>=100&&e%100===0){o=\" de \"}return e+o+r[n]}", "function datehashrfc() { // @return RFC1123DateString: \"Wed, 16 Sep 2009 16:18:14 GMT\"\r\n var rv = (new Date(this.time)).toUTCString();\r\n\r\n if (uu.ie && rv.indexOf(\"UTC\") > 0) {\r\n // http://d.hatena.ne.jp/uupaa/20080515\r\n\r\n rv = rv.replace(/UTC/, \"GMT\");\r\n (rv.length < 29) && (rv = rv.replace(/, /, \", 0\")); // [IE] fix format\r\n }\r\n return rv;\r\n}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},a=\" \";if(e%100>=20||e>=100&&e%100===0){a=\" de \"}return e+a+r[n]}", "function filenameToReadableDate(filename) {\n var split = filename.split('T');\n var date = split[0].split('_')[2].split('-');\n var time = split[1].substr(0, 4);\n return date[2] + '/' + date[1] + '/' + date[0] + ' at ' + time.substr(0, 2) + ':' + time.substr(2, 4);\n }", "function ms(e,t,n){var a=\" \";return(e%100>=20||e>=100&&e%100==0)&&(a=\" de \"),e+a+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function formatDateAndTime(datetime)\n{\n\treturn datetime.substring(9, 11)+\":\"+datetime.substring(11,13)+\":\"+datetime.substring(13,15)\n\t\t\t+\" \"+datetime.substring(6,8)+\"-\"+datetime.substring(4,6)+\"-\"+datetime.substring(0,4);\n}", "function getTime(time) {\n time = time.toString().split(' ');\n var month = new Date(Date.parse(time[1] +\" 1, 2000\")).getMonth()+1\n var hms = time[4].split(':');\n var new_time = time[3] + '-' + (\"00\" + month).slice(-2) + '-' + time[2] + 'T' + hms[0] + ':' + hms[1] + ':' + hms[2] + '.000Z';\n return new_time;\n }", "function parseDate (date) {\n var d = '';\n var t = date.indexOf('T');\n let index = date.indexOf('-');\n \n if(index === -1 && t === 8){\n d += date.substring(0, 4) + '-';\n d += date.substring(4, 6) + '-';\n d += date.substring(6, 8) + date.substr(8);\n } else if (index > -1 && t === 10) {\n return date;\n } else {\n console.error('invalid date');\n return null;\n }\n return d;\n }", "function parse_external_time(text, success) {\n var time = TIME_RE.exec(text);\n if (time != null) {\n time = new Date(time[1].trim()).getTime();\n success(time);\n }\n}", "function cut_date(register_date){\n let register_date_string = register_date.toISOString();\n let split_date = register_date_string.split(\"T\")[1];\n let split_time = split_date.split(\".\")[0];\n return split_time;\n}", "function e(e,t,n){return e+(20<=e%100||100<=e&&e%100==0?\" de \":\" \")+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}" ]
[ "0.653082", "0.63895303", "0.6154629", "0.6096161", "0.60804975", "0.605977", "0.60540193", "0.605324", "0.605324", "0.605324", "0.605324", "0.6040541", "0.6028883", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.60169667", "0.59945226", "0.59771127", "0.597495", "0.597495", "0.596328", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5933974", "0.59314626", "0.5928641", "0.59284973", "0.59065413", "0.5901136", "0.58995897", "0.58995897", "0.58995897", "0.58995897", "0.58909506", "0.58909506", "0.58909506", "0.58909506", "0.5867927", "0.5867427", "0.5847704", "0.5847463", "0.58446264", "0.5814297", "0.58098656", "0.5782785", "0.5782785", "0.5782707", "0.5776116", "0.57668716", "0.57485163", "0.5724437", "0.5722063", "0.5720733", "0.5718697", "0.5715817", "0.5714077", "0.56996375", "0.56862354", "0.56841004", "0.56840295", "0.56804836", "0.5677643", "0.56740606", "0.567262", "0.5671365", "0.56699353" ]
0.0
-1
date from iso format or fallback
function configFromString(config) { var matched = aspNetJsonRegex.exec(config._i); if (matched !== null) { config._d = new Date(+matched[1]); return; } configFromISO(config); if (config._isValid === false) { delete config._isValid; } else { return; } configFromRFC2822(config); if (config._isValid === false) { delete config._isValid; } else { return; } // Final attempt, use Input Fallback hooks.createFromInputFallback(config); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isoToDate(s) {\n if (s instanceof Date) { return s; }\n if (typeof s === 'string') { return new Date(s); }\n}", "function isoStringToDate(match){var date=new Date(0);var tzHour=0;var tzMin=0;// match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\nvar dateSetter=match[8]?date.setUTCFullYear:date.setFullYear;var timeSetter=match[8]?date.setUTCHours:date.setHours;// if there is a timezone defined like \"+01:00\" or \"+0100\"\nif(match[9]){tzHour=Number(match[9]+match[10]);tzMin=Number(match[9]+match[11]);}dateSetter.call(date,Number(match[1]),Number(match[2])-1,Number(match[3]));var h=Number(match[4]||0)-tzHour;var m=Number(match[5]||0)-tzMin;var s=Number(match[6]||0);var ms=Math.round(parseFloat('0.'+(match[7]||0))*1000);timeSetter.call(date,h,m,s,ms);return date;}", "function parseIsoDate(dateStr) {\n \tif(dateStr.length <10) return null;\n \tvar d = dateStr.substring(0,10).split('-');\t\n \tfor(var i in d) { \n \t\td[i]=parseInt(d[i]);\n \t};\n \td[1] = d[1] -1;//month;\n \tvar t = dateStr.substring(11,19).split(':');\n \treturn new Date(d[0],d[1],d[2],t[0],t[1],t[2]);\n }", "function makeDateFromString(config) {\n\t parseISO(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t moment.createFromInputFallback(config);\n\t }\n\t }", "function makeDateFromString(config) {\n\t parseISO(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t moment.createFromInputFallback(config);\n\t }\n\t }", "function ISOdate(d) {\r\n\ttry {\r\n\t\treturn d.toISOString().slice(0,10);\r\n\t}catch(e){\r\n\t\treturn 'Invalid ';\r\n\t}\r\n}", "function isoDate(date)\n{\n\treturn date.getFullYear() + \"-\" + (date.getMonth() + 1) + \"-\" + date.getDate()\n}", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "isIsoFormat(value) {\n let dateRegex = RegExp('[0-9][0-9][0-9][0-9]-[0-1][0-9]-[0-3][0-9]$');\n return dateRegex.test(value);\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n\t\tparseISO(config);\n\t\tif (config._isValid === false) {\n\t\t\tdelete config._isValid;\n\t\t\tmoment.createFromInputFallback(config);\n\t\t}\n\t}", "function parseISODate(str) {\n pieces = /(\\d{4})-(\\d{2})-(\\d{2})/g.exec(str);\n if (pieces === null)\n return null;\n var year = parseInt(pieces[1], 10),\n month = parseInt(pieces[2], 10),\n day = parseInt(pieces[3], 10);\n return new Date(year, month - 1, day); // In ISO, months are 1-12; in JavaScript, months are 0-11.\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function dateFromISO8601(isostr) {\n var parts = isostr.match(/\\d+/g);\n var date = new Date(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]);\n var mm = date.getMonth() + 1;\n mm = (mm < 10) ? '0' + mm : mm;\n var dd = date.getDate();\n dd = (dd < 10) ? '0' + dd : dd;\n var yyyy = date.getFullYear();\n var finaldate = mm + '/' + dd + '/' + yyyy;\n return finaldate;\n }", "function validateDateFormat(sDateToBeProcressed) {\r\n \"use strict\";\r\n var oDates = new Date(sDateToBeProcressed);\r\n if (isNaN(oDates)) {\r\n var arrSplitedDate = sDateToBeProcressed.replace(/[-]/g, \"/\");\r\n arrSplitedDate = arrSplitedDate.split(\"/\");\r\n var sFormattedDate = arrSplitedDate[1] + \"-\" + arrSplitedDate[0] + \"-\" + arrSplitedDate[2];\r\n oDates = new Date(sFormattedDate);\r\n }\r\n return oDates.toISOString();\r\n}", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function parseIsoToTimestamp(_date) {\n if ( _date !== null ) {\n var s = $.trim(_date);\n s = s.replace(/-/, \"/\").replace(/-/, \"/\");\n s = s.replace(/-/, \"/\").replace(/-/, \"/\");\n s = s.replace(/:00.000/, \"\");\n s = s.replace(/T/, \" \").replace(/Z/, \" UTC\");\n s = s.replace(/([\\+\\-]\\d\\d)\\:?(\\d\\d)/, \" $1$2\"); // -04:00 -> -0400\n return Number(new Date(s));\n }\n return null;\n }", "function dateFromIsoString(isoDateString) {\r\n return fastDateParse.apply(null, isoDateString.split(/\\D/));\r\n }", "deserialize(value) {\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n // The `Date` constructor accepts formats other than ISO 8601, so we need to make sure the\n // string is the right format first.\n if (ISO_8601_REGEX.test(value)) {\n let date = new Date(value);\n if (this.isValid(date)) {\n return date;\n }\n }\n }\n return super.deserialize(value);\n }", "deserialize(value) {\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n // The `Date` constructor accepts formats other than ISO 8601, so we need to make sure the\n // string is the right format first.\n if (ISO_8601_REGEX.test(value)) {\n let date = new Date(value);\n if (this.isValid(date)) {\n return date;\n }\n }\n }\n return super.deserialize(value);\n }", "deserialize(value) {\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n // The `Date` constructor accepts formats other than ISO 8601, so we need to make sure the\n // string is the right format first.\n if (ISO_8601_REGEX.test(value)) {\n let date = new Date(value);\n if (this.isValid(date)) {\n return date;\n }\n }\n }\n return super.deserialize(value);\n }", "getFormattedDate ({ date }) {\n if (typeof date === 'string') {\n return format(parseISO(date), \"d 'de' MMMM', às' HH'h'mm\", {\n locale: ptBR\n })\n }\n return format(date, \"d 'de' MMMM', às' HH'h'mm\", {\n locale: ptBR\n })\n }", "function universal() {\n return doFormat(date, {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n weekday: 'long',\n hour: 'numeric',\n minute: '2-digit',\n second: '2-digit'\n });\n }", "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0; // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours; // if there is a timezone defined like \"+01:00\" or \"+0100\"\n\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0); // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n\n var ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n }", "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function getISOLocalDate(value) {\n if (!value) {\n return value;\n }\n\n var date = new Date(value);\n\n if (isNaN(date.getTime())) {\n throw new Error(\"Invalid date: \".concat(value));\n }\n\n var year = getYear(date);\n var month = \"0\".concat(getMonth(date)).slice(-2);\n var day = \"0\".concat(getDay(date)).slice(-2);\n return \"\".concat(year, \"-\").concat(month, \"-\").concat(day);\n}", "function getISOLocalDate(value) {\n if (!value) {\n return value;\n }\n\n var date = new Date(value);\n\n if (isNaN(date.getTime())) {\n throw new Error(\"Invalid date: \".concat(value));\n }\n\n var year = getYear(date);\n var month = \"0\".concat(getMonth(date)).slice(-2);\n var day = \"0\".concat(getDay(date)).slice(-2);\n return \"\".concat(year, \"-\").concat(month, \"-\").concat(day);\n}", "function configFromISO(config) {\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils_type_checks__[\"b\" /* isString */])(config._i)) {\n return config;\n }\n var input = config._i;\n var match = extendedIsoRegex.exec(input) || basicIsoRegex.exec(input);\n var allowTime;\n var dateFormat;\n var timeFormat;\n var tzFormat;\n if (!match) {\n config._isValid = false;\n return config;\n }\n // getParsingFlags(config).iso = true;\n var i;\n var l;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(match[1])) {\n dateFormat = isoDates[i][0];\n allowTime = isoDates[i][2] !== false;\n break;\n }\n }\n if (dateFormat == null) {\n config._isValid = false;\n return config;\n }\n if (match[3]) {\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(match[3])) {\n // match[2] should be 'T' or space\n timeFormat = (match[2] || ' ') + isoTimes[i][0];\n break;\n }\n }\n if (timeFormat == null) {\n config._isValid = false;\n return config;\n }\n }\n if (!allowTime && timeFormat != null) {\n config._isValid = false;\n return config;\n }\n if (match[4]) {\n if (tzRegex.exec(match[4])) {\n tzFormat = 'Z';\n }\n else {\n config._isValid = false;\n return config;\n }\n }\n config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__from_string_and_format__[\"a\" /* configFromStringAndFormat */])(config);\n}", "function parseDateFormat(date) {\n return $filter('date')(date, 'yyyy-MM-dd');\n }", "function configFromISO(config) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__utils_type_checks__[\"i\" /* isString */])(config._i)) {\n return config;\n }\n var input = config._i;\n var match = extendedIsoRegex.exec(input) || basicIsoRegex.exec(input);\n var allowTime;\n var dateFormat;\n var timeFormat;\n var tzFormat;\n if (!match) {\n config._isValid = false;\n return config;\n }\n // getParsingFlags(config).iso = true;\n var i;\n var l;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(match[1])) {\n dateFormat = isoDates[i][0];\n allowTime = isoDates[i][2] !== false;\n break;\n }\n }\n if (dateFormat == null) {\n config._isValid = false;\n return config;\n }\n if (match[3]) {\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(match[3])) {\n // match[2] should be 'T' or space\n timeFormat = (match[2] || ' ') + isoTimes[i][0];\n break;\n }\n }\n if (timeFormat == null) {\n config._isValid = false;\n return config;\n }\n }\n if (!allowTime && timeFormat != null) {\n config._isValid = false;\n return config;\n }\n if (match[4]) {\n if (tzRegex.exec(match[4])) {\n tzFormat = 'Z';\n }\n else {\n config._isValid = false;\n return config;\n }\n }\n config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n return Object(__WEBPACK_IMPORTED_MODULE_2__from_string_and_format__[\"a\" /* configFromStringAndFormat */])(config);\n}", "function makeDateFromString(string) {\n var format = 'YYYY-MM-DDT',\n i;\n if (isoRegex.exec(string)) {\n for (i = 0; i < 3; i++) {\n if (isoTimes[i][1].exec(string)) {\n format += isoTimes[i][0];\n break;\n }\n }\n return makeDateFromStringAndFormat(string, format + 'Z');\n }\n return new Date(string);\n }", "normalize(str) {\n if (str && !CommonUtils.isDate(str)) {\n var match = str.match(/^(\\d{1,2})\\/(\\d{1,2})\\/(\\d{4})$/);\n if (match) {\n return new Date(match[3], match[2] - 1, match[1]);\n }\n match = str.match(/^(\\d{4})-(\\d{1,2})-(\\d{1,2})$/);\n if (match) {\n return new Date(match[1], match[2] - 1, match[3]);\n }\n }\n }", "function parseDate (date) {\n var d = '';\n var t = date.indexOf('T');\n let index = date.indexOf('-');\n \n if(index === -1 && t === 8){\n d += date.substring(0, 4) + '-';\n d += date.substring(4, 6) + '-';\n d += date.substring(6, 8) + date.substr(8);\n } else if (index > -1 && t === 10) {\n return date;\n } else {\n console.error('invalid date');\n return null;\n }\n return d;\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0; // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours; // if there is a timezone defined like \"+01:00\" or \"+0100\"\n\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0); // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "convertDateToISOString(date) {\n if (date) return moment(date, defaultDateFormat).toISOString();\n return date;\n }", "function isoDateFormat(strDateView) {\n return moment(strDateView, \"DD/MM/YYYY HH:mm\").format(\"YYYY-MM-DD HH:mm\")\n}", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n \n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0; // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours; // if there is a timezone defined like \"+01:00\" or \"+0100\"\n\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0); // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n\n var ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function _dateCoerce(obj) {\n return obj.toISOString();\n}", "function configFromISO(config){var i,l,string=config._i,match=extendedIsoRegex.exec(string)||basicIsoRegex.exec(string),allowTime,dateFormat,timeFormat,tzFormat;if(match){getParsingFlags(config).iso=true;for(i=0,l=isoDates.length;i<l;i++){if(isoDates[i][1].exec(match[1])){dateFormat=isoDates[i][0];allowTime=isoDates[i][2]!==false;break;}}if(dateFormat==null){config._isValid=false;return;}if(match[3]){for(i=0,l=isoTimes.length;i<l;i++){if(isoTimes[i][1].exec(match[3])){// match[2] should be 'T' or space\r\n\ttimeFormat=(match[2]||' ')+isoTimes[i][0];break;}}if(timeFormat==null){config._isValid=false;return;}}if(!allowTime&&timeFormat!=null){config._isValid=false;return;}if(match[4]){if(tzRegex.exec(match[4])){tzFormat='Z';}else{config._isValid=false;return;}}config._f=dateFormat+(timeFormat||'')+(tzFormat||'');configFromStringAndFormat(config);}else{config._isValid=false;}}// date from iso format or fallback", "function configFromISO(config){var i,l,string=config._i,match=extendedIsoRegex.exec(string)||basicIsoRegex.exec(string),allowTime,dateFormat,timeFormat,tzFormat;if(match){getParsingFlags(config).iso=true;for(i=0,l=isoDates.length;i<l;i++){if(isoDates[i][1].exec(match[1])){dateFormat=isoDates[i][0];allowTime=isoDates[i][2]!==false;break;}}if(dateFormat==null){config._isValid=false;return;}if(match[3]){for(i=0,l=isoTimes.length;i<l;i++){if(isoTimes[i][1].exec(match[3])){// match[2] should be 'T' or space\r\n\ttimeFormat=(match[2]||' ')+isoTimes[i][0];break;}}if(timeFormat==null){config._isValid=false;return;}}if(!allowTime&&timeFormat!=null){config._isValid=false;return;}if(match[4]){if(tzRegex.exec(match[4])){tzFormat='Z';}else{config._isValid=false;return;}}config._f=dateFormat+(timeFormat||'')+(tzFormat||'');configFromStringAndFormat(config);}else{config._isValid=false;}}// date from iso format or fallback", "function ISO_2022() {}", "function ISO_2022() {}", "function iso8601Decoder(isoStr) {\n return Date.parse(isoStr);\n }", "function parseISO(config) {\n\t var i, l,\n\t string = config._i,\n\t match = isoRegex.exec(string);\n\n\t if (match) {\n\t config._pf.iso = true;\n\t for (i = 0, l = isoDates.length; i < l; i++) {\n\t if (isoDates[i][1].exec(string)) {\n\t // match[5] should be 'T' or undefined\n\t config._f = isoDates[i][0] + (match[6] || ' ');\n\t break;\n\t }\n\t }\n\t for (i = 0, l = isoTimes.length; i < l; i++) {\n\t if (isoTimes[i][1].exec(string)) {\n\t config._f += isoTimes[i][0];\n\t break;\n\t }\n\t }\n\t if (string.match(parseTokenTimezone)) {\n\t config._f += 'Z';\n\t }\n\t makeDateFromStringAndFormat(config);\n\t } else {\n\t config._isValid = false;\n\t }\n\t }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }" ]
[ "0.69155526", "0.669977", "0.6644896", "0.65540725", "0.65540725", "0.65211886", "0.6494941", "0.6487338", "0.64510757", "0.6431595", "0.6431595", "0.6410263", "0.6410263", "0.6407163", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6386239", "0.63719565", "0.63676095", "0.63676095", "0.63676095", "0.63676095", "0.63676095", "0.63107383", "0.6304614", "0.6296533", "0.6296533", "0.6296533", "0.6296533", "0.62961155", "0.62961155", "0.62961155", "0.62961155", "0.6237332", "0.6228521", "0.62229276", "0.62229276", "0.62229276", "0.6217752", "0.61811936", "0.6167205", "0.6166935", "0.6166935", "0.6166935", "0.6166935", "0.6166935", "0.61611396", "0.61611396", "0.61494136", "0.61250824", "0.61206865", "0.61180955", "0.61120665", "0.6108371", "0.6103288", "0.6103288", "0.6103288", "0.6103288", "0.6103288", "0.6071146", "0.6058316", "0.60540026", "0.6051979", "0.6010418", "0.60099983", "0.600717", "0.600717", "0.5990565", "0.5990565", "0.5980365", "0.59758157", "0.59728056", "0.59728056", "0.59728056", "0.5972622", "0.5972622", "0.5972622", "0.5972622", "0.5972622", "0.5972622" ]
0.0
-1
date from string and format string
function configFromStringAndFormat(config) { // TODO: Move this to another part of the creation flow to prevent circular deps if (config._f === hooks.ISO_8601) { configFromISO(config); return; } if (config._f === hooks.RFC_2822) { configFromRFC2822(config); return; } config._a = []; getParsingFlags(config).empty = true; // This array is used to make a Date, either with `new Date` or `Date.UTC` var string = '' + config._i, i, parsedInput, tokens, token, skipped, stringLength = string.length, totalParsedInputLength = 0; tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; for (i = 0; i < tokens.length; i++) { token = tokens[i]; parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; // console.log('token', token, 'parsedInput', parsedInput, // 'regex', getParseRegexForToken(token, config)); if (parsedInput) { skipped = string.substr(0, string.indexOf(parsedInput)); if (skipped.length > 0) { getParsingFlags(config).unusedInput.push(skipped); } string = string.slice(string.indexOf(parsedInput) + parsedInput.length); totalParsedInputLength += parsedInput.length; } // don't parse if it's not a known token if (formatTokenFunctions[token]) { if (parsedInput) { getParsingFlags(config).empty = false; } else { getParsingFlags(config).unusedTokens.push(token); } addTimeToArrayFromToken(token, parsedInput, config); } else if (config._strict && !parsedInput) { getParsingFlags(config).unusedTokens.push(token); } } // add remaining unparsed input length to the string getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength; if (string.length > 0) { getParsingFlags(config).unusedInput.push(string); } // clear _12h flag if hour is <= 12 if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) { getParsingFlags(config).bigHour = undefined; } getParsingFlags(config).parsedDateParts = config._a.slice(0); getParsingFlags(config).meridiem = config._meridiem; // handle meridiem config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem); configFromArray(config); checkOverflow(config); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeDateFromStringAndFormat(string, format) {\n var datePartArray = [0, 0, 1, 0, 0, 0, 0],\n config = {\n tzh : 0, // timezone hour offset\n tzm : 0 // timezone minute offset\n },\n tokens = format.match(formattingTokens),\n i, parsedInput;\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n string = string.replace(getParseRegexForToken(tokens[i]), '');\n addTimeToArrayFromToken(tokens[i], parsedInput, datePartArray, config);\n }\n // handle am pm\n if (config.isPm && datePartArray[3] < 12) {\n datePartArray[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config.isPm === false && datePartArray[3] === 12) {\n datePartArray[3] = 0;\n }\n // handle timezone\n datePartArray[3] += config.tzh;\n datePartArray[4] += config.tzm;\n // return\n return config.isUTC ? new Date(Date.UTC.apply({}, datePartArray)) : dateFromArray(datePartArray);\n }", "function format_date(d_str) {\n return new Date(d_str.replace(/(\\d{2}).(\\d{2}).(\\d{4})/, \"$2/$1/$3\"))\n}", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens);\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n\n // add remaining unparsed input to the string\n if (string) {\n config._il = string;\n }\n\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function get_date_from_string(date_str){\n var parts =date_str.split('-');\n if(parts[0].length == 6){\n // working with date format DDMMYY\n var date_list = parts[0].match(/.{1,2}/g);\n var result_date = new Date(date_list[2].padStart(4, '20'), date_list[1]-1, date_list[0])\n return result_date;\n }else if(parts[0].length == 2){\n var result_date = new Date(parts[2].padStart(4, '20'), parts[1]-1, parts[0]);\n return result_date;\n }else{\n // unknown format. Do nothing\n return\n }\n}", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n\n // add remaining unparsed input to the string\n if (string) {\n config._il = string;\n }\n\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n\n // add remaining unparsed input to the string\n if (string) {\n config._il = string;\n }\n\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n\n // add remaining unparsed input to the string\n if (string) {\n config._il = string;\n }\n\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function parseDate(str) {\n var m = str.match(/^(\\d{4})\\-(\\d{1,2})\\-(\\d{1,2})/);\n return (m) ? `${m[2]}/${m[3]}/${m[1]}` : null;\n}", "function convert_date(str){var tmp=str.split(\".\");return new Date(tmp[1]+\"/\"+tmp[0]+\"/\"+tmp[2])}", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function str2date(str) {\n\t\t\ttry {\n\t\t\t\tvar t = (str).split(/[- :]/);\n\t\t\t\treturn new Date(t[0], t[1]-1, t[2], t[3], t[4], t[5]);\n\t\t\t} catch (err) {\n\t\t\t\talert(err);\n\t\t\t}\n\t\t}", "function str2date(str) {\n\t\t\ttry {\n\t\t\t\tvar t = (str).split(/[- :]/);\n\t\t\t\treturn new Date(t[0], t[1]-1, t[2], t[3], t[4], t[5]);\n\t\t\t} catch (err) {\n\t\t\t\talert(err);\n\t\t\t}\n\t\t}", "function makeDateFromStringAndFormat(string, format) {\n var inArray = [0, 0, 1, 0, 0, 0, 0],\n timezoneHours = 0,\n timezoneMinutes = 0,\n isUsingUTC = false,\n inputParts = string.match(inputCharacters),\n formatParts = format.match(tokenCharacters),\n len = Math.min(inputParts.length, formatParts.length),\n i,\n isPm;\n\n // function to convert string input to date\n function addTime(format, input) {\n var a;\n switch (format) {\n // MONTH\n case 'M' :\n // fall through to MM\n case 'MM' :\n inArray[1] = ~~input - 1;\n break;\n case 'MMM' :\n // fall through to MMMM\n case 'MMMM' :\n for (a = 0; a < 12; a++) {\n if (moment.monthsParse[a].test(input)) {\n inArray[1] = a;\n break;\n }\n }\n break;\n // DAY OF MONTH\n case 'D' :\n // fall through to DDDD\n case 'DD' :\n // fall through to DDDD\n case 'DDD' :\n // fall through to DDDD\n case 'DDDD' :\n inArray[2] = ~~input;\n break;\n // YEAR\n case 'YY' :\n input = ~~input;\n inArray[0] = input + (input > 70 ? 1900 : 2000);\n break;\n case 'YYYY' :\n inArray[0] = ~~Math.abs(input);\n break;\n // AM / PM\n case 'a' :\n // fall through to A\n case 'A' :\n isPm = (input.toLowerCase() === 'pm');\n break;\n // 24 HOUR\n case 'H' :\n // fall through to hh\n case 'HH' :\n // fall through to hh\n case 'h' :\n // fall through to hh\n case 'hh' :\n inArray[3] = ~~input;\n break;\n // MINUTE\n case 'm' :\n // fall through to mm\n case 'mm' :\n inArray[4] = ~~input;\n break;\n // SECOND\n case 's' :\n // fall through to ss\n case 'ss' :\n inArray[5] = ~~input;\n break;\n // TIMEZONE\n case 'Z' :\n // fall through to ZZ\n case 'ZZ' :\n isUsingUTC = true;\n a = (input || '').match(timezoneParseRegex);\n if (a && a[1]) {\n timezoneHours = ~~a[1];\n }\n if (a && a[2]) {\n timezoneMinutes = ~~a[2];\n }\n // reverse offsets\n if (a && a[0] === '+') {\n timezoneHours = -timezoneHours;\n timezoneMinutes = -timezoneMinutes;\n }\n break;\n }\n }\n for (i = 0; i < len; i++) {\n addTime(formatParts[i], inputParts[i]);\n }\n // handle am pm\n if (isPm && inArray[3] < 12) {\n inArray[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (isPm === false && inArray[3] === 12) {\n inArray[3] = 0;\n }\n // handle timezone\n inArray[3] += timezoneHours;\n inArray[4] += timezoneMinutes;\n // return\n return isUsingUTC ? new Date(Date.UTC.apply({}, inArray)) : dateFromArray(inArray);\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function dateParser(strDate, format){\nif(!checkValidDate(strDate))\nreturn new Date();\n\nvar slash1 = strDate.indexOf(\"/\");\nif (slash1 == -1) { slash1 = strDate.indexOf(\"-\"); }\n// if no slashes or dashes, invalid date\nif (slash1 == -1) { return false; }\nvar dateYear = strDate.substring(0, slash1);\nvar dateYearAndMonth = strDate.substring(slash1+1, strDate.length);\nvar slash2 = dateYearAndMonth.indexOf(\"/\");\nif (slash2 == -1) { slash2 = dateYearAndMonth.indexOf(\"-\"); }\n// if not a second slash or dash, invalid date\nif (slash2 == -1) { return false; }\nvar dateMonth = dateYearAndMonth.substring(0, slash2);\nvar dateDay = dateYearAndMonth.substring(slash2+1, dateYearAndMonth.length);\nvar retDate = new Date(dateYear,dateMonth-1,dateDay);\nreturn retDate;\n}", "function stringToDate(_date,_format,_delimiter)\r\n{\r\n var formatLowerCase=_format.toLowerCase();\r\n var formatItems=formatLowerCase.split(_delimiter);\r\n var dateItems=_date.split(_delimiter);\r\n var monthIndex=formatItems.indexOf(\"mm\");\r\n var dayIndex=formatItems.indexOf(\"dd\");\r\n var yearIndex=formatItems.indexOf(\"yyyy\");\r\n var month=parseInt(dateItems[monthIndex]);\r\n month-=1;\r\n var formatedDate = new Date(dateItems[yearIndex],month,dateItems[dayIndex]);\r\n return formatedDate;\r\n}", "function makeDateFromString(string) {\n var format = 'YYYY-MM-DDT',\n i;\n if (isoRegex.exec(string)) {\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n format += isoTimes[i][0];\n break;\n }\n }\n return parseTokenTimezone.exec(string) ? \n makeDateFromStringAndFormat(string, format + ' Z') :\n makeDateFromStringAndFormat(string, format);\n }\n return new Date(string);\n }", "function stringToDate(_date,_format,_delimiter)\n{\n var formatLowerCase=_format.toLowerCase();\n var formatItems=formatLowerCase.split(_delimiter);\n var dateItems=_date.split(_delimiter);\n var monthIndex=formatItems.indexOf(\"mm\");\n var dayIndex=formatItems.indexOf(\"dd\");\n var yearIndex=formatItems.indexOf(\"yyyy\");\n var month=parseInt(dateItems[monthIndex]);\n month-=1;\n var formatedDate = new Date(dateItems[yearIndex],month,dateItems[dayIndex]);\n return formatedDate;\n}", "function makeDateFromString(string) {\n var format = 'YYYY-MM-DDT',\n i;\n if (isoRegex.exec(string)) {\n for (i = 0; i < 3; i++) {\n if (isoTimes[i][1].exec(string)) {\n format += isoTimes[i][0];\n break;\n }\n }\n return makeDateFromStringAndFormat(string, format + 'Z');\n }\n return new Date(string);\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function $dateFromString(obj, expr, options) {\n var args = core_1.computeValue(obj, expr, null, options);\n args.format = args.format || _internal_1.DATE_FORMAT;\n args.onNull = args.onNull || null;\n var dateString = args.dateString;\n if (util_1.isNil(dateString))\n return args.onNull;\n // collect all separators of the format string\n var separators = args.format.split(/%[YGmdHMSLuVzZ]/);\n separators.reverse();\n var matches = args.format.match(/(%%|%Y|%G|%m|%d|%H|%M|%S|%L|%u|%V|%z|%Z)/g);\n var dateParts = {};\n // holds the valid regex of parts that matches input date string\n var expectedPattern = \"\";\n for (var i = 0, len = matches.length; i < len; i++) {\n var formatSpecifier = matches[i];\n var props = _internal_1.DATE_SYM_TABLE[formatSpecifier];\n if (util_1.isObject(props)) {\n // get pattern and alias from table\n var m = props.re.exec(dateString);\n // get the next separtor\n var delimiter = separators.pop() || \"\";\n if (m !== null) {\n // store and cut out matched part\n dateParts[props.name] = /^\\d+$/.exec(m[0]) ? parseInt(m[0]) : m[0];\n dateString =\n dateString.substr(0, m.index) +\n dateString.substr(m.index + m[0].length);\n // construct expected pattern\n expectedPattern +=\n _internal_1.regexQuote(delimiter) + _internal_1.regexStrip(props.re.toString());\n }\n else {\n dateParts[props.name] = null;\n }\n }\n }\n // 1. validate all required date parts exists\n // 2. validate original dateString against expected pattern.\n if (util_1.isNil(dateParts.year) ||\n util_1.isNil(dateParts.month) ||\n util_1.isNil(dateParts.day) ||\n !new RegExp(\"^\" + expectedPattern + \"$\").exec(args.dateString))\n return args.onError;\n var tz = _internal_1.parseTimezone(args.timezone);\n // create the date. month is 0-based in Date\n var d = new Date(Date.UTC(dateParts.year, dateParts.month - 1, dateParts.day, 0, 0, 0));\n if (!util_1.isNil(dateParts.hour))\n d.setUTCHours(dateParts.hour);\n if (!util_1.isNil(dateParts.minute))\n d.setUTCMinutes(dateParts.minute);\n if (!util_1.isNil(dateParts.second))\n d.setUTCSeconds(dateParts.second);\n if (!util_1.isNil(dateParts.millisecond))\n d.setUTCMilliseconds(dateParts.millisecond);\n // The minute part is unused when converting string.\n // This was observed in the tests on MongoDB site but not officially stated anywhere\n tz.minute = 0;\n _internal_1.adjustDate(d, tz);\n return d;\n}", "formatDate(str) {\n let string = str.slice(0, str.lastIndexOf('T'))\n let fields = string.split('-');\n let finalString = fields[2] + '-' + fields[1] + '-' + fields[0]\n return finalString\n }", "formatDate(str) {\n let string = str.slice(0, str.lastIndexOf('T'))\n let fields = string.split('-');\n let finalString = fields[2] + '-' + fields[1] + '-' + fields[0]\n return finalString\n }", "function formatDate(date, formatStr) {\n\t\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n\t}", "function format_date(date_string, data_source) {\n var date = new Date(date_string);\n return {v: date, f: date_string};\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n \n config._a = [];\n config._pf.empty = true;\n \n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n \n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n \n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n \n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n \n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (getParseRegexForToken(token, config).exec(string) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (getParseRegexForToken(token, config).exec(string) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function formatDate(date, formatStr) {\n return formatDateWithChunks(date, getFormatStringChunks(formatStr));\n }", "function formatDate(string){\n var options = { year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric' };\n return new Date(string).toLocaleDateString([],options);\n}", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "function getFormatDate(date) {\n\t\tvar arr = date.split('/');\n\t\treturn new Date(parseInt(arr[2]), parseInt(arr[1])-1, parseInt(arr[0]));\n\t}", "function makeDateFromStringAndFormat(config) {\n\t if (config._f === moment.ISO_8601) {\n\t parseISO(config);\n\t return;\n\t }\n\n\t config._a = [];\n\t config._pf.empty = true;\n\n\t // This array is used to make a Date, either with `new Date` or `Date.UTC`\n\t var string = '' + config._i,\n\t i, parsedInput, tokens, token, skipped,\n\t stringLength = string.length,\n\t totalParsedInputLength = 0;\n\n\t tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n\t for (i = 0; i < tokens.length; i++) {\n\t token = tokens[i];\n\t parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n\t if (parsedInput) {\n\t skipped = string.substr(0, string.indexOf(parsedInput));\n\t if (skipped.length > 0) {\n\t config._pf.unusedInput.push(skipped);\n\t }\n\t string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n\t totalParsedInputLength += parsedInput.length;\n\t }\n\t // don't parse if it's not a known token\n\t if (formatTokenFunctions[token]) {\n\t if (parsedInput) {\n\t config._pf.empty = false;\n\t }\n\t else {\n\t config._pf.unusedTokens.push(token);\n\t }\n\t addTimeToArrayFromToken(token, parsedInput, config);\n\t }\n\t else if (config._strict && !parsedInput) {\n\t config._pf.unusedTokens.push(token);\n\t }\n\t }\n\n\t // add remaining unparsed input length to the string\n\t config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n\t if (string.length > 0) {\n\t config._pf.unusedInput.push(string);\n\t }\n\n\t // handle am pm\n\t if (config._isPm && config._a[HOUR] < 12) {\n\t config._a[HOUR] += 12;\n\t }\n\t // if is 12 am, change hours to 0\n\t if (config._isPm === false && config._a[HOUR] === 12) {\n\t config._a[HOUR] = 0;\n\t }\n\n\t dateFromConfig(config);\n\t checkOverflow(config);\n\t }", "function makeDateFromStringAndFormat(config) {\n\t\tif (config._f === moment.ISO_8601) {\n\t\t\tparseISO(config);\n\t\t\treturn;\n\t\t}\n\n\t\tconfig._a = [];\n\t\tconfig._pf.empty = true;\n\n\t\t// This array is used to make a Date, either with `new Date` or `Date.UTC`\n\t\tvar string = '' + config._i, i, parsedInput, tokens, token, skipped, stringLength = string.length, totalParsedInputLength = 0;\n\n\t\ttokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n\t\tfor (i = 0; i < tokens.length; i++) {\n\t\t\ttoken = tokens[i];\n\t\t\tparsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n\t\t\tif (parsedInput) {\n\t\t\t\tskipped = string.substr(0, string.indexOf(parsedInput));\n\t\t\t\tif (skipped.length > 0) {\n\t\t\t\t\tconfig._pf.unusedInput.push(skipped);\n\t\t\t\t}\n\t\t\t\tstring = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n\t\t\t\ttotalParsedInputLength += parsedInput.length;\n\t\t\t}\n\t\t\t// don't parse if it's not a known token\n\t\t\tif (formatTokenFunctions[token]) {\n\t\t\t\tif (parsedInput) {\n\t\t\t\t\tconfig._pf.empty = false;\n\t\t\t\t} else {\n\t\t\t\t\tconfig._pf.unusedTokens.push(token);\n\t\t\t\t}\n\t\t\t\taddTimeToArrayFromToken(token, parsedInput, config);\n\t\t\t} else if (config._strict && !parsedInput) {\n\t\t\t\tconfig._pf.unusedTokens.push(token);\n\t\t\t}\n\t\t}\n\n\t\t// add remaining unparsed input length to the string\n\t\tconfig._pf.charsLeftOver = stringLength - totalParsedInputLength;\n\t\tif (string.length > 0) {\n\t\t\tconfig._pf.unusedInput.push(string);\n\t\t}\n\n\t\t// clear _12h flag if hour is <= 12\n\t\tif (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n\t\t\tconfig._pf.bigHour = undefined;\n\t\t}\n\t\t// handle am pm\n\t\tif (config._isPm && config._a[HOUR] < 12) {\n\t\t\tconfig._a[HOUR] += 12;\n\t\t}\n\t\t// if is 12 am, change hours to 0\n\t\tif (config._isPm === false && config._a[HOUR] === 12) {\n\t\t\tconfig._a[HOUR] = 0;\n\t\t}\n\t\tdateFromConfig(config);\n\t\tcheckOverflow(config);\n\t}", "function parseDate(str) {\n \t\t//var m = str.match(/^(\\d{1,2})-(\\d{1,2})-(\\d{4})$/);\n \t\tvar m = str.match(/^(0?[1-9]|[12][0-9]|3[01])[\\.\\-](0?[1-9]|1[012])[\\.\\-]\\d{4}$/);\n \t\treturn (m) ? new Date(m[3], m[2]-1, m[1]) : null;\n\t}", "function unformatDate(datestr) {\n var y = parseInt(datestr.slice(0, 4)),\n m = parseInt(datestr.slice(5, 7)) - 1,\n dy = parseInt(datestr.slice(8));\n\n return (new Date(y, m, dy));\n}", "function unformatDate(datestr) {\n var y = parseInt(datestr.slice(0, 4)),\n m = parseInt(datestr.slice(5, 7)) - 1,\n dy = parseInt(datestr.slice(8));\n\n return (new Date(y, m, dy));\n}", "function makeDateFromStringAndFormat(config) {\n\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\t if (config._f === moment.ISO_8601) {\n\t parseISO(config);\n\t return;\n\t }\n\n\t config._a = [];\n\t config._pf.empty = true;\n\n\t // This array is used to make a Date, either with `new Date` or `Date.UTC`\n\t var string = '' + config._i,\n\t i,\n\t parsedInput,\n\t tokens,\n\t token,\n\t skipped,\n\t stringLength = string.length,\n\t totalParsedInputLength = 0;\n\n\t tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n\t for (i = 0; i < tokens.length; i++) {\n\t token = tokens[i];\n\t parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n\t if (parsedInput) {\n\t skipped = string.substr(0, string.indexOf(parsedInput));\n\t if (skipped.length > 0) {\n\t config._pf.unusedInput.push(skipped);\n\t }\n\t string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n\t totalParsedInputLength += parsedInput.length;\n\t }\n\t // don't parse if it's not a known token\n\t if (formatTokenFunctions[token]) {\n\t if (parsedInput) {\n\t config._pf.empty = false;\n\t } else {\n\t config._pf.unusedTokens.push(token);\n\t }\n\t addTimeToArrayFromToken(token, parsedInput, config);\n\t } else if (config._strict && !parsedInput) {\n\t config._pf.unusedTokens.push(token);\n\t }\n\t }\n\n\t // add remaining unparsed input length to the string\n\t config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n\t if (string.length > 0) {\n\t config._pf.unusedInput.push(string);\n\t }\n\n\t // clear _12h flag if hour is <= 12\n\t if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n\t config._pf.bigHour = undefined;\n\t }\n\t // handle meridiem\n\t config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\t dateFromConfig(config);\n\t checkOverflow(config);\n\t }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function getDateFromString(str)\n{\n var dateRE1 = /([0-9]{1,4})(?:\\-|\\/|\\.|\\u5e74|\\u6708|\\u65e5)([0-9]{1,2})(?:\\-|\\/|\\.|\\u5e74|\\u6708|\\u65e5)*([0-9]{1,4})*/i;\n var dateRE2 = /(on)?\\s*(([0-9]*)(?:st|th|rd|nd)*(?:\\s|of|\\-a|\\-|,|\\.)*(january|jan|february|feb|march|mar|april|apr|may|june|jun|july|jul|august|aug|september|sept|sep|october|oct|november|nov|december|dec)(?:\\s|\\-|\\.)*([0-9]*))/i;\n var dateRE3 = /(on)?\\s*((january|jan|february|feb|march|mar|april|apr|may|june|jun|july|jul|august|aug|september|sept|sep|october|oct|november|nov|december|dec)(?:\\s|,|\\.|\\-)*([0-9]+)(?:st|th|rd|nd)*(?:\\s|,|\\.|\\-a|\\-)*([0-9]*))/i;\n var dateRE4 = /(on)?\\s*((next)?\\s*(monday|mon|tuesday|tue|wednesday|wed|thursday|thu|friday|fri|saturday|sat|sunday|sun))/i;\n var dateRE5 = /(in)?\\s*(one|two|three|four|five|six|seven|eight|nine|ten|[0-9]+)\\s*(years|year|yrs|yr|months|month|mons|mon|weeks|week|wks|wk|days|day)/i;\n var dateRE6 = /end\\s*of\\s*(?:the)*\\s*(week|w|month|m)/i;\n var dateRE7 =/(on)?\\s*([0-9]+)(?:st|th|rd|nd)/i;\n var dateRE8 = /\\s*(yesterday|tod|today|tom|tomorrow)/i;\n \n \n if (DEBUG) log(\"getDateFromString: Looking for date in '\" + str + \"'\");\n var dateRE1match = dateRE1.exec(str);\n var dateRE2match = dateRE2.exec(str);\n var dateRE3match = dateRE3.exec(str);\n var dateRE4match = dateRE4.exec(str);\n var dateRE5match = dateRE5.exec(str);\n var dateRE6match = dateRE6.exec(str);\n var dateRE7match = dateRE7.exec(str);\n var dateRE8match = dateRE8.exec(str);\n \n if (dateRE1match)\n {\n if (DEBUG) log(\"dateRE1 match for '\" + str + \"' = '\" + dateRE1match[0] + \"'\");\n return dateRE1match[0];\n }\n \n if (dateRE2match)\n {\n if (DEBUG) log(\"dateRE2 match for '\" + str + \"' = '\" + dateRE2match[0] + \"'\");\n return dateRE2match[0];\n }\n \n if (dateRE3match)\n {\n if (DEBUG) log(\"dateRE3 match for '\" + str + \"' = '\" + dateRE3match[0] + \"'\");\n return dateRE3match[0];\n }\n \n if (dateRE4match)\n {\n if (DEBUG) log(\"dateRE4 match for '\" + str + \"' = '\" + dateRE4match[0] + \"'\");\n return dateRE4match[0];\n }\n \n if (dateRE5match)\n {\n if (DEBUG) log(\"dateRE5 match for '\" + str + \"' = '\" + dateRE5match[0] + \"'\");\n return dateRE5match[0];\n }\n \n if (dateRE6match)\n {\n if (DEBUG) log(\"dateRE6 match for '\" + str + \"' = '\" + dateRE6match[0] + \"'\");\n return dateRE6match[0];\n }\n \n if (dateRE7match)\n {\n if (DEBUG) log(\"dateRE7 match for '\" + str + \"' = '\" + dateRE7match[0] + \"'\");\n return dateRE7match[0];\n }\n \n if (dateRE8match)\n {\n if (DEBUG) log(\"dateRE8 match for '\" + str + \"' = '\" + dateRE8match[0] + \"'\");\n return dateRE8match[0];\n }\n \n if (DEBUG) log(\"NO MATCH FOR DATE STRING '\" + str + \"'!!!!!\");\n return;\n}", "function parseStringToDate(string) {\n if (string) {\n var parts = string.match(/(\\d+)/g);\n // new Date(year, month [, date [, hours[, minutes[, seconds[, ms]]]]])\n return new Date(parts[0], parts[1] - 1, parts[2]); // months are 0-based\n }\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n dateFromConfig(config);\n checkOverflow(config);\n }", "function formatDate(string) {\n var date = new Date(string);\n let options = {\n day: \"numeric\",\n month: \"long\",\n };\n return date.toLocaleString(\"en-US\", options);\n }", "function formatDate(date, format){\n if(!date){\n return '0000-00-00';\n }\n var dd = date.substring(0, 2);\n var mm = date.substring(3, 5);\n var yy = date.substring(6);\n if (format == 'dmy') {\n return dd + '-' + mm + '-' + yy;\n } else {\n return yy + '-' + mm + '-' + dd;\n }\n }", "function castStringToDate(str) {\n if (str !== undefined && str.length === 16) {\n let day = str.slice(0, 2);\n let month = str.slice(3, 5);\n let americanDateString = month + '-' + day + str.slice(5); // MM-DD-YYYY HH:MM\n return new Date(americanDateString);\n } else {\n console.error('Error casting ' + str + ' to date.')\n }\n return new Date()\n}", "normalize(str) {\n if (str && !CommonUtils.isDate(str)) {\n var match = str.match(/^(\\d{1,2})\\/(\\d{1,2})\\/(\\d{4})$/);\n if (match) {\n return new Date(match[3], match[2] - 1, match[1]);\n }\n match = str.match(/^(\\d{4})-(\\d{1,2})-(\\d{1,2})$/);\n if (match) {\n return new Date(match[1], match[2] - 1, match[3]);\n }\n }\n }", "function formatDate(date,formatStr){return renderFakeFormatString(getParsedFormatString(formatStr).fakeFormatString,date);}", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }" ]
[ "0.7541918", "0.73771065", "0.7178186", "0.7178186", "0.7178186", "0.7178186", "0.7165116", "0.71642524", "0.71642524", "0.71642524", "0.71642524", "0.71642524", "0.7151704", "0.71465707", "0.71465707", "0.71465707", "0.70902205", "0.708685", "0.70298785", "0.70298785", "0.7017626", "0.7017626", "0.7017626", "0.7017626", "0.7017626", "0.7004189", "0.7004189", "0.6966651", "0.6964289", "0.69496155", "0.69416946", "0.69332683", "0.69214123", "0.69008076", "0.6897582", "0.6897582", "0.6897582", "0.6897582", "0.6897582", "0.6896022", "0.68925893", "0.68925893", "0.6883293", "0.68807197", "0.6880282", "0.6880282", "0.6856762", "0.6855586", "0.6855586", "0.6854372", "0.68497694", "0.68497145", "0.68497145", "0.68497145", "0.68497145", "0.68497145", "0.68497145", "0.68497145", "0.68497145", "0.68367076", "0.68367076", "0.68367076", "0.68367076", "0.68367076", "0.6830939", "0.6781024", "0.67556775", "0.6725881", "0.67256165", "0.67256165", "0.67248094", "0.67248094", "0.67248094", "0.67229813", "0.67144066", "0.67144066", "0.67144066", "0.67144066", "0.67144066", "0.67144066", "0.66972095", "0.6684886", "0.66836876", "0.66836876", "0.6680801", "0.6676208", "0.6672588", "0.6663546", "0.66594774", "0.6651975", "0.6651975", "0.6651975", "0.6651975", "0.6651975", "0.6651975", "0.6651975", "0.6651975", "0.6651975", "0.6651975", "0.6651975", "0.6651975" ]
0.0
-1
date from string and array of format strings
function configFromStringAndArray(config) { var tempConfig, bestMoment, scoreToBeat, i, currentScore; if (config._f.length === 0) { getParsingFlags(config).invalidFormat = true; config._d = new Date(NaN); return; } for (i = 0; i < config._f.length; i++) { currentScore = 0; tempConfig = copyConfig({}, config); if (config._useUTC != null) { tempConfig._useUTC = config._useUTC; } tempConfig._f = config._f[i]; configFromStringAndFormat(tempConfig); if (!isValid(tempConfig)) { continue; } // if there is any input that was not parsed add a penalty for that format currentScore += getParsingFlags(tempConfig).charsLeftOver; //or tokens currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; getParsingFlags(tempConfig).score = currentScore; if (scoreToBeat == null || currentScore < scoreToBeat) { scoreToBeat = currentScore; bestMoment = tempConfig; } } extend(config, bestMoment || tempConfig); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeDateFromStringAndArray(string, formats) {\n var output,\n inputParts = string.match(parseMultipleFormatChunker) || [],\n formattedInputParts,\n scoreToBeat = 99,\n i,\n currentDate,\n currentScore;\n for (i = 0; i < formats.length; i++) {\n currentDate = makeDateFromStringAndFormat(string, formats[i]);\n formattedInputParts = formatMoment(new Moment(currentDate), formats[i]).match(parseMultipleFormatChunker) || [];\n currentScore = compareArrays(inputParts, formattedInputParts);\n if (currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n output = currentDate;\n }\n }\n return output;\n }", "function makeDateFromStringAndFormat(string, format) {\n var datePartArray = [0, 0, 1, 0, 0, 0, 0],\n config = {\n tzh : 0, // timezone hour offset\n tzm : 0 // timezone minute offset\n },\n tokens = format.match(formattingTokens),\n i, parsedInput;\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n string = string.replace(getParseRegexForToken(tokens[i]), '');\n addTimeToArrayFromToken(tokens[i], parsedInput, datePartArray, config);\n }\n // handle am pm\n if (config.isPm && datePartArray[3] < 12) {\n datePartArray[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config.isPm === false && datePartArray[3] === 12) {\n datePartArray[3] = 0;\n }\n // handle timezone\n datePartArray[3] += config.tzh;\n datePartArray[4] += config.tzm;\n // return\n return config.isUTC ? new Date(Date.UTC.apply({}, datePartArray)) : dateFromArray(datePartArray);\n }", "function makeDateFromStringAndArray(string, formats) {\n var output,\n inputParts = string.match(inputCharacters),\n scores = [],\n scoreToBeat = 99,\n i,\n curDate,\n curScore;\n for (i = 0; i < formats.length; i++) {\n curDate = makeDateFromStringAndFormat(string, formats[i]);\n curScore = compareArrays(inputParts, formatMoment(new Moment(curDate), formats[i]).match(inputCharacters));\n if (curScore < scoreToBeat) {\n scoreToBeat = curScore;\n output = curDate;\n }\n }\n return output;\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n\n // add remaining unparsed input to the string\n if (string) {\n config._il = string;\n }\n\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n\n // add remaining unparsed input to the string\n if (string) {\n config._il = string;\n }\n\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n\n // add remaining unparsed input to the string\n if (string) {\n config._il = string;\n }\n\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens);\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n\n // add remaining unparsed input to the string\n if (string) {\n config._il = string;\n }\n\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "parseDate(arrayOfStrings)\n {\n let newStr=arrayOfStrings[3];\n newStr += '-';\n switch(arrayOfStrings[1])\n {\n case 'Jan':\n newStr+='01';\n break;\n case 'Feb':\n newStr+='02';\n break;\n case 'Mar':\n newStr+='03';\n break;\n case 'Apr':\n newStr+='04';\n break;\n case 'May':\n newStr+='05';\n break;\n case 'Jun':\n newStr+='06';\n break;\n case 'Jul':\n newStr+='07';\n break;\n case 'Aug':\n newStr+='08';\n break;\n case 'Sep':\n newStr+='09';\n break;\n case 'Oct':\n newStr+='10';\n break;\n case 'Nov':\n newStr+='11';\n break;\n case 'Dec':\n newStr+='12';\n break;\n default:\n break;\n }\n newStr+='-';\n newStr+=arrayOfStrings[2];\n\n return newStr;\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (getParseRegexForToken(token, config).exec(string) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (getParseRegexForToken(token, config).exec(string) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function $dateFromString(obj, expr, options) {\n var args = core_1.computeValue(obj, expr, null, options);\n args.format = args.format || _internal_1.DATE_FORMAT;\n args.onNull = args.onNull || null;\n var dateString = args.dateString;\n if (util_1.isNil(dateString))\n return args.onNull;\n // collect all separators of the format string\n var separators = args.format.split(/%[YGmdHMSLuVzZ]/);\n separators.reverse();\n var matches = args.format.match(/(%%|%Y|%G|%m|%d|%H|%M|%S|%L|%u|%V|%z|%Z)/g);\n var dateParts = {};\n // holds the valid regex of parts that matches input date string\n var expectedPattern = \"\";\n for (var i = 0, len = matches.length; i < len; i++) {\n var formatSpecifier = matches[i];\n var props = _internal_1.DATE_SYM_TABLE[formatSpecifier];\n if (util_1.isObject(props)) {\n // get pattern and alias from table\n var m = props.re.exec(dateString);\n // get the next separtor\n var delimiter = separators.pop() || \"\";\n if (m !== null) {\n // store and cut out matched part\n dateParts[props.name] = /^\\d+$/.exec(m[0]) ? parseInt(m[0]) : m[0];\n dateString =\n dateString.substr(0, m.index) +\n dateString.substr(m.index + m[0].length);\n // construct expected pattern\n expectedPattern +=\n _internal_1.regexQuote(delimiter) + _internal_1.regexStrip(props.re.toString());\n }\n else {\n dateParts[props.name] = null;\n }\n }\n }\n // 1. validate all required date parts exists\n // 2. validate original dateString against expected pattern.\n if (util_1.isNil(dateParts.year) ||\n util_1.isNil(dateParts.month) ||\n util_1.isNil(dateParts.day) ||\n !new RegExp(\"^\" + expectedPattern + \"$\").exec(args.dateString))\n return args.onError;\n var tz = _internal_1.parseTimezone(args.timezone);\n // create the date. month is 0-based in Date\n var d = new Date(Date.UTC(dateParts.year, dateParts.month - 1, dateParts.day, 0, 0, 0));\n if (!util_1.isNil(dateParts.hour))\n d.setUTCHours(dateParts.hour);\n if (!util_1.isNil(dateParts.minute))\n d.setUTCMinutes(dateParts.minute);\n if (!util_1.isNil(dateParts.second))\n d.setUTCSeconds(dateParts.second);\n if (!util_1.isNil(dateParts.millisecond))\n d.setUTCMilliseconds(dateParts.millisecond);\n // The minute part is unused when converting string.\n // This was observed in the tests on MongoDB site but not officially stated anywhere\n tz.minute = 0;\n _internal_1.adjustDate(d, tz);\n return d;\n}", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n \n scoreToBeat,\n i,\n currentScore;\n \n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n \n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n \n if (!isValid(tempConfig)) {\n continue;\n }\n \n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n \n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n \n tempConfig._pf.score = currentScore;\n \n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n \n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromStringAndFormat(config) {\n\t\tif (config._f === moment.ISO_8601) {\n\t\t\tparseISO(config);\n\t\t\treturn;\n\t\t}\n\n\t\tconfig._a = [];\n\t\tconfig._pf.empty = true;\n\n\t\t// This array is used to make a Date, either with `new Date` or `Date.UTC`\n\t\tvar string = '' + config._i, i, parsedInput, tokens, token, skipped, stringLength = string.length, totalParsedInputLength = 0;\n\n\t\ttokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n\t\tfor (i = 0; i < tokens.length; i++) {\n\t\t\ttoken = tokens[i];\n\t\t\tparsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n\t\t\tif (parsedInput) {\n\t\t\t\tskipped = string.substr(0, string.indexOf(parsedInput));\n\t\t\t\tif (skipped.length > 0) {\n\t\t\t\t\tconfig._pf.unusedInput.push(skipped);\n\t\t\t\t}\n\t\t\t\tstring = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n\t\t\t\ttotalParsedInputLength += parsedInput.length;\n\t\t\t}\n\t\t\t// don't parse if it's not a known token\n\t\t\tif (formatTokenFunctions[token]) {\n\t\t\t\tif (parsedInput) {\n\t\t\t\t\tconfig._pf.empty = false;\n\t\t\t\t} else {\n\t\t\t\t\tconfig._pf.unusedTokens.push(token);\n\t\t\t\t}\n\t\t\t\taddTimeToArrayFromToken(token, parsedInput, config);\n\t\t\t} else if (config._strict && !parsedInput) {\n\t\t\t\tconfig._pf.unusedTokens.push(token);\n\t\t\t}\n\t\t}\n\n\t\t// add remaining unparsed input length to the string\n\t\tconfig._pf.charsLeftOver = stringLength - totalParsedInputLength;\n\t\tif (string.length > 0) {\n\t\t\tconfig._pf.unusedInput.push(string);\n\t\t}\n\n\t\t// clear _12h flag if hour is <= 12\n\t\tif (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n\t\t\tconfig._pf.bigHour = undefined;\n\t\t}\n\t\t// handle am pm\n\t\tif (config._isPm && config._a[HOUR] < 12) {\n\t\t\tconfig._a[HOUR] += 12;\n\t\t}\n\t\t// if is 12 am, change hours to 0\n\t\tif (config._isPm === false && config._a[HOUR] === 12) {\n\t\t\tconfig._a[HOUR] = 0;\n\t\t}\n\t\tdateFromConfig(config);\n\t\tcheckOverflow(config);\n\t}", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n\t var tempConfig, bestMoment, scoreToBeat, i, currentScore;\n\n\t if (config._f.length === 0) {\n\t config._pf.invalidFormat = true;\n\t config._d = new Date(NaN);\n\t return;\n\t }\n\n\t for (i = 0; i < config._f.length; i++) {\n\t currentScore = 0;\n\t tempConfig = copyConfig({}, config);\n\t if (config._useUTC != null) {\n\t tempConfig._useUTC = config._useUTC;\n\t }\n\t tempConfig._pf = defaultParsingFlags();\n\t tempConfig._f = config._f[i];\n\t makeDateFromStringAndFormat(tempConfig);\n\n\t if (!_isValid(tempConfig)) {\n\t continue;\n\t }\n\n\t // if there is any input that was not parsed add a penalty for that format\n\t currentScore += tempConfig._pf.charsLeftOver;\n\n\t //or tokens\n\t currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n\t tempConfig._pf.score = currentScore;\n\n\t if (scoreToBeat == null || currentScore < scoreToBeat) {\n\t scoreToBeat = currentScore;\n\t bestMoment = tempConfig;\n\t }\n\t }\n\n\t extend(config, bestMoment || tempConfig);\n\t }", "parseDate(value, format) {\n if (format == null || value == null) {\n throw \"Invalid arguments\";\n }\n value = (typeof value === \"object\" ? value.toString() : value + \"\");\n if (value === \"\") {\n return null;\n }\n let iFormat, dim, extra, iValue = 0, shortYearCutoff = (typeof this.shortYearCutoff !== \"string\" ? this.shortYearCutoff : new Date().getFullYear() % 100 + parseInt(this.shortYearCutoff, 10)), year = -1, month = -1, day = -1, doy = -1, literal = false, date, lookAhead = (match) => {\n let matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);\n if (matches) {\n iFormat++;\n }\n return matches;\n }, getNumber = (match) => {\n let isDoubled = lookAhead(match), size = (match === \"@\" ? 14 : (match === \"!\" ? 20 :\n (match === \"y\" && isDoubled ? 4 : (match === \"o\" ? 3 : 2)))), minSize = (match === \"y\" ? size : 1), digits = new RegExp(\"^\\\\d{\" + minSize + \",\" + size + \"}\"), num = value.substring(iValue).match(digits);\n if (!num) {\n throw \"Missing number at position \" + iValue;\n }\n iValue += num[0].length;\n return parseInt(num[0], 10);\n }, getName = (match, shortNames, longNames) => {\n let index = -1;\n let arr = lookAhead(match) ? longNames : shortNames;\n let names = [];\n for (let i = 0; i < arr.length; i++) {\n names.push([i, arr[i]]);\n }\n names.sort((a, b) => {\n return -(a[1].length - b[1].length);\n });\n for (let i = 0; i < names.length; i++) {\n let name = names[i][1];\n if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {\n index = names[i][0];\n iValue += name.length;\n break;\n }\n }\n if (index !== -1) {\n return index + 1;\n }\n else {\n throw \"Unknown name at position \" + iValue;\n }\n }, checkLiteral = () => {\n if (value.charAt(iValue) !== format.charAt(iFormat)) {\n throw \"Unexpected literal at position \" + iValue;\n }\n iValue++;\n };\n if (this.view === 'month') {\n day = 1;\n }\n for (iFormat = 0; iFormat < format.length; iFormat++) {\n if (literal) {\n if (format.charAt(iFormat) === \"'\" && !lookAhead(\"'\")) {\n literal = false;\n }\n else {\n checkLiteral();\n }\n }\n else {\n switch (format.charAt(iFormat)) {\n case \"d\":\n day = getNumber(\"d\");\n break;\n case \"D\":\n getName(\"D\", this.getTranslation(primeng_api__WEBPACK_IMPORTED_MODULE_6__[\"TranslationKeys\"].DAY_NAMES_SHORT), this.getTranslation(primeng_api__WEBPACK_IMPORTED_MODULE_6__[\"TranslationKeys\"].DAY_NAMES));\n break;\n case \"o\":\n doy = getNumber(\"o\");\n break;\n case \"m\":\n month = getNumber(\"m\");\n break;\n case \"M\":\n month = getName(\"M\", this.getTranslation(primeng_api__WEBPACK_IMPORTED_MODULE_6__[\"TranslationKeys\"].MONTH_NAMES_SHORT), this.getTranslation(primeng_api__WEBPACK_IMPORTED_MODULE_6__[\"TranslationKeys\"].MONTH_NAMES));\n break;\n case \"y\":\n year = getNumber(\"y\");\n break;\n case \"@\":\n date = new Date(getNumber(\"@\"));\n year = date.getFullYear();\n month = date.getMonth() + 1;\n day = date.getDate();\n break;\n case \"!\":\n date = new Date((getNumber(\"!\") - this.ticksTo1970) / 10000);\n year = date.getFullYear();\n month = date.getMonth() + 1;\n day = date.getDate();\n break;\n case \"'\":\n if (lookAhead(\"'\")) {\n checkLiteral();\n }\n else {\n literal = true;\n }\n break;\n default:\n checkLiteral();\n }\n }\n }\n if (iValue < value.length) {\n extra = value.substr(iValue);\n if (!/^\\s+/.test(extra)) {\n throw \"Extra/unparsed characters found in date: \" + extra;\n }\n }\n if (year === -1) {\n year = new Date().getFullYear();\n }\n else if (year < 100) {\n year += new Date().getFullYear() - new Date().getFullYear() % 100 +\n (year <= shortYearCutoff ? 0 : -100);\n }\n if (doy > -1) {\n month = 1;\n day = doy;\n do {\n dim = this.getDaysCountInMonth(year, month - 1);\n if (day <= dim) {\n break;\n }\n month++;\n day -= dim;\n } while (true);\n }\n date = this.daylightSavingAdjust(new Date(year, month - 1, day));\n if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {\n throw \"Invalid date\"; // E.g. 31/02/00\n }\n return date;\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n initializeParsingFlags(tempConfig);\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n initializeParsingFlags(tempConfig);\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n initializeParsingFlags(tempConfig);\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n\t\tvar tempConfig, bestMoment,\n\n\t\tscoreToBeat, i, currentScore;\n\n\t\tif (config._f.length === 0) {\n\t\t\tconfig._pf.invalidFormat = true;\n\t\t\tconfig._d = new Date(NaN);\n\t\t\treturn;\n\t\t}\n\n\t\tfor (i = 0; i < config._f.length; i++) {\n\t\t\tcurrentScore = 0;\n\t\t\ttempConfig = copyConfig({}, config);\n\t\t\tif (config._useUTC != null) {\n\t\t\t\ttempConfig._useUTC = config._useUTC;\n\t\t\t}\n\t\t\ttempConfig._pf = defaultParsingFlags();\n\t\t\ttempConfig._f = config._f[i];\n\t\t\tmakeDateFromStringAndFormat(tempConfig);\n\n\t\t\tif (!isValid(tempConfig)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// if there is any input that was not parsed add a penalty for that format\n\t\t\tcurrentScore += tempConfig._pf.charsLeftOver;\n\n\t\t\t//or tokens\n\t\t\tcurrentScore += tempConfig._pf.unusedTokens.length * 10;\n\n\t\t\ttempConfig._pf.score = currentScore;\n\n\t\t\tif (scoreToBeat == null || currentScore < scoreToBeat) {\n\t\t\t\tscoreToBeat = currentScore;\n\t\t\t\tbestMoment = tempConfig;\n\t\t\t}\n\t\t}\n\n\t\textend(config, bestMoment || tempConfig);\n\t}", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n\t var tempConfig,\n\t bestMoment,\n\n\t scoreToBeat,\n\t i,\n\t currentScore;\n\n\t if (config._f.length === 0) {\n\t config._pf.invalidFormat = true;\n\t config._d = new Date(NaN);\n\t return;\n\t }\n\n\t for (i = 0; i < config._f.length; i++) {\n\t currentScore = 0;\n\t tempConfig = copyConfig({}, config);\n\t if (config._useUTC != null) {\n\t tempConfig._useUTC = config._useUTC;\n\t }\n\t tempConfig._pf = defaultParsingFlags();\n\t tempConfig._f = config._f[i];\n\t makeDateFromStringAndFormat(tempConfig);\n\n\t if (!isValid(tempConfig)) {\n\t continue;\n\t }\n\n\t // if there is any input that was not parsed add a penalty for that format\n\t currentScore += tempConfig._pf.charsLeftOver;\n\n\t //or tokens\n\t currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n\t tempConfig._pf.score = currentScore;\n\n\t if (scoreToBeat == null || currentScore < scoreToBeat) {\n\t scoreToBeat = currentScore;\n\t bestMoment = tempConfig;\n\t }\n\t }\n\n\t extend(config, bestMoment || tempConfig);\n\t }", "function makeDateFromStringAndFormat(config) {\n\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\t if (config._f === moment.ISO_8601) {\n\t parseISO(config);\n\t return;\n\t }\n\n\t config._a = [];\n\t config._pf.empty = true;\n\n\t // This array is used to make a Date, either with `new Date` or `Date.UTC`\n\t var string = '' + config._i,\n\t i, parsedInput, tokens, token, skipped,\n\t stringLength = string.length,\n\t totalParsedInputLength = 0;\n\n\t tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n\t for (i = 0; i < tokens.length; i++) {\n\t token = tokens[i];\n\t parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n\t if (parsedInput) {\n\t skipped = string.substr(0, string.indexOf(parsedInput));\n\t if (skipped.length > 0) {\n\t config._pf.unusedInput.push(skipped);\n\t }\n\t string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n\t totalParsedInputLength += parsedInput.length;\n\t }\n\t // don't parse if it's not a known token\n\t if (formatTokenFunctions[token]) {\n\t if (parsedInput) {\n\t config._pf.empty = false;\n\t }\n\t else {\n\t config._pf.unusedTokens.push(token);\n\t }\n\t addTimeToArrayFromToken(token, parsedInput, config);\n\t }\n\t else if (config._strict && !parsedInput) {\n\t config._pf.unusedTokens.push(token);\n\t }\n\t }\n\n\t // add remaining unparsed input length to the string\n\t config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n\t if (string.length > 0) {\n\t config._pf.unusedInput.push(string);\n\t }\n\n\t // handle am pm\n\t if (config._isPm && config._a[HOUR] < 12) {\n\t config._a[HOUR] += 12;\n\t }\n\t // if is 12 am, change hours to 0\n\t if (config._isPm === false && config._a[HOUR] === 12) {\n\t config._a[HOUR] = 0;\n\t }\n\n\t dateFromConfig(config);\n\t checkOverflow(config);\n\t }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n dateFromConfig(config);\n checkOverflow(config);\n }", "function stringToDate(_date,_format,_delimiter)\r\n{\r\n var formatLowerCase=_format.toLowerCase();\r\n var formatItems=formatLowerCase.split(_delimiter);\r\n var dateItems=_date.split(_delimiter);\r\n var monthIndex=formatItems.indexOf(\"mm\");\r\n var dayIndex=formatItems.indexOf(\"dd\");\r\n var yearIndex=formatItems.indexOf(\"yyyy\");\r\n var month=parseInt(dateItems[monthIndex]);\r\n month-=1;\r\n var formatedDate = new Date(dateItems[yearIndex],month,dateItems[dayIndex]);\r\n return formatedDate;\r\n}", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n \n config._a = [];\n config._pf.empty = true;\n \n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n \n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n \n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n \n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n \n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function stringToDate(_date,_format,_delimiter)\n{\n var formatLowerCase=_format.toLowerCase();\n var formatItems=formatLowerCase.split(_delimiter);\n var dateItems=_date.split(_delimiter);\n var monthIndex=formatItems.indexOf(\"mm\");\n var dayIndex=formatItems.indexOf(\"dd\");\n var yearIndex=formatItems.indexOf(\"yyyy\");\n var month=parseInt(dateItems[monthIndex]);\n month-=1;\n var formatedDate = new Date(dateItems[yearIndex],month,dateItems[dayIndex]);\n return formatedDate;\n}" ]
[ "0.6992099", "0.69120616", "0.6811551", "0.6738145", "0.6738145", "0.6738145", "0.6738145", "0.6738145", "0.6711522", "0.6711522", "0.6711522", "0.6697953", "0.65985", "0.65868574", "0.65868574", "0.6574106", "0.6574106", "0.6574106", "0.6574106", "0.6574106", "0.6574106", "0.6574106", "0.6574106", "0.65634376", "0.64812696", "0.64613736", "0.64613736", "0.64613736", "0.64613736", "0.64613736", "0.64203715", "0.64203715", "0.64203715", "0.64203715", "0.6419803", "0.6408758", "0.6408758", "0.6408758", "0.6408758", "0.6408758", "0.6408758", "0.6408758", "0.6408758", "0.6408758", "0.6408758", "0.6402224", "0.6394826", "0.6394594", "0.6394594", "0.6394594", "0.63722247", "0.63722247", "0.63722247", "0.63722247", "0.63722247", "0.63722247", "0.6365226", "0.6365226", "0.6365226", "0.6365226", "0.6365226", "0.6365226", "0.6365226", "0.6365226", "0.6365226", "0.6365226", "0.6365226", "0.6365226", "0.6365226", "0.6365226", "0.6365226", "0.6365226", "0.6365226", "0.6365226", "0.6365226", "0.63573766", "0.63512844", "0.63512844", "0.63512844", "0.63512844", "0.63512844", "0.63512844", "0.63512844", "0.63512844", "0.63512844", "0.63512844", "0.63512844", "0.63512844", "0.63501936", "0.634273", "0.6342221", "0.6342221", "0.6342221", "0.6331941", "0.6326767", "0.6326767", "0.632435", "0.632435", "0.6300018", "0.6276161", "0.6274519" ]
0.0
-1
Pick a moment m from moments so that m[fn](other) is true for all other. This relies on the function fn to be transitive. moments should either be an array of moment objects or an array, whose first element is an array of moment objects.
function pickBy(fn, moments) { var res, i; if (moments.length === 1 && isArray(moments[0])) { moments = moments[0]; } if (!moments.length) { return createLocal(); } res = moments[0]; for (i = 1; i < moments.length; ++i) { if (!moments[i].isValid() || moments[i][fn](res)) { res = moments[i]; } } return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n\t\tvar res, i;\n\t\tif (moments.length === 1 && isArray(moments[0])) {\n\t\t\tmoments = moments[0];\n\t\t}\n\t\tif (!moments.length) {\n\t\t\treturn moment();\n\t\t}\n\t\tres = moments[0];\n\t\tfor (i = 1; i < moments.length; ++i) {\n\t\t\tif (moments[i][fn](res)) {\n\t\t\t\tres = moments[i];\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}", "function pickBy(fn, moments) {\n\t var res, i;\n\t if (moments.length === 1 && isArray(moments[0])) {\n\t moments = moments[0];\n\t }\n\t if (!moments.length) {\n\t return moment();\n\t }\n\t res = moments[0];\n\t for (i = 1; i < moments.length; ++i) {\n\t if (moments[i][fn](res)) {\n\t res = moments[i];\n\t }\n\t }\n\t return res;\n\t }", "function pickBy(fn, moments) {\n\t var res, i;\n\t if (moments.length === 1 && isArray(moments[0])) {\n\t moments = moments[0];\n\t }\n\t if (!moments.length) {\n\t return moment();\n\t }\n\t res = moments[0];\n\t for (i = 1; i < moments.length; ++i) {\n\t if (moments[i][fn](res)) {\n\t res = moments[i];\n\t }\n\t }\n\t return res;\n\t }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }" ]
[ "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.75758684", "0.75520873", "0.7440163", "0.7440163", "0.72953826" ]
0.0
-1
TODO: Use [].sort instead?
function min () { var args = [].slice.call(arguments, 0); return pickBy('isBefore', args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sort() {\n\t}", "sort() {\n\t}", "function Sort() {}", "sort(){\n\n }", "function sortItems(arr) {\r\n return arr.sort();\r\n}", "function sort(theArray){\n\n}", "function arrangeElements( array ) {\r\n\tarray = array.sort();\r\n\treturn array;\r\n}", "function alfa (arr){\n\tfor (var i = 0; i< arr.length;i++){\n\t\tarr[i].sort();\n\t}\n\treturn arr;\n}", "Sort() {\n\n }", "function Sort(arr)\n{\n\n}", "sort() {\n const ret = [].sort.apply(this, arguments);\n this._registerAtomic('$set', this);\n return ret;\n }", "sort() {\n const ret = [].sort.apply(this, arguments);\n this._registerAtomic('$set', this);\n return ret;\n }", "function sortFunction(val){\n return val.sort();\n}", "function dd(a){a=a.ob();for(var b=[],c=[],d=0;d<a.length;d++){var e=a[d].Lf;e&&(e=e.call(a[d]))&&(e[2]?b.push(e):c.push(e))}c.sort(ed);b.sort(ed);return[c,b]}", "function sort() {\n // // parse arguments into an array\n var args = [].slice.call(arguments);\n\n // // .. do something with each element of args\n // // YOUR CODE HERE\n var sortedargs = args.sort(function(a, b) {\n return a > b ? 1 : -1\n })\n return sortedargs\n}", "function Zc(a){a=a.Xb();for(var b=[],c=[],d=0;d<a.length;d++){var e=a[d].Zg;e&&(e=e.call(a[d]))&&(e[2]?b.push(e):c.push(e))}c.sort($c);b.sort($c);return[c,b]}", "function yg(a){a=a.Zb();for(var b=[],c=[],d=0;d<a.length;d++){var e=a[d].ah;e&&(e=e.call(a[d]))&&(e[2]?b.push(e):c.push(e))}c.sort(zg);b.sort(zg);return[c,b]}", "function sortArr(a, b){\n return a - b ;\n }", "function sort(argument) {\r\n return argument.sort();\r\n}", "function copySorted(arr) {\n return arr.slice().sort();\n}", "function sortData(data)\n\t{\n\t\tfor (let i = 0; i < data.length; i++)\n \t{\n\t \tfor (let j = 0; j < data.length - i - 1; j++)\n\t \t{\n\t \t\tif (+data[j].subCount < +data[j + 1].subCount)\n\t \t\t{\n\t \t\t\tlet tmp = data[j];\n\t \t\t\tdata[j] = data[j + 1];\n\t \t\t\tdata[j + 1] = tmp;\n\t \t\t}\n\t \t}\n \t}\n \treturn data;\n\t}", "function sortMyList() {\n seanBeanMovies.forEach(function(movie) {\n newar.push(movie);\n });\n console.log(newar.sort());\n}", "function sortArray(arr) {\r\n var temp = 0;\r\n for (var i = 0; i < arr.length; ++i) {\r\n for (var j = 0; j < arr.length - 1; ++j) {\r\n if (arr[j].name.charCodeAt(0) < arr[j + 1].name.charCodeAt(0)) {\r\n temp = arr[j + 1];\r\n arr[j + 1] = arr[j];\r\n arr[j] = temp;\r\n }\r\n }\r\n }\r\n console.log(arr);\r\n}", "function sortFunction(){\r\n // parse arguments into an array\r\n var args = [].slice.call(arguments);\r\n return args.sort();\r\n}", "sortBy(arr, compare) {\n let sorted = [];\n sorted = arr.sort(compare);\n return sorted;\n }", "function sortedUUIDs(arr) {\n return arr.map(function (el) {\n return el.uuid;\n }).sort();\n}", "function sortNameUp(arr) {\n return arr.sort()\n }", "function subSort(arr) {\n // didnt get this one. try again\n}", "function mergeSort(array) {\n\n}", "getSortArray() {\n const sortable = []; // {\"1\": 10, \"49\": 5}\n for (const key in this.numberPool) \n sortable.push([Number(key), this.numberPool[key]]);\n \n sortable.sort((a, b) => b[1] - a[1]); // Descending\n return sortable;\n }", "__getArray (sort) {\n sort = sort || 'id'\n\n let items = []\n\n this.state.data.forEach((item) => items.push(item))\n\n items.sort((a, b) => {\n if (a[sort] > b[sort]) return -1\n if (a[sort] < b[sort]) return 1\n return 0\n })\n\n return items\n }", "sort(callback) {\r\n return this.array.sort(callback);\r\n }", "function sortArr2(arr) {\n console.table(arr.sort((a, b) => a - b)\n );\n}", "function show(a) {\n a.sort();\n a.map( e => console.log(e) );\n}", "function mergeSort(arr) {\n\n}", "sortSpecies() {\n //Sortira igrace po vrsti\n for (let s of this.species) {\n s.sortSpecies();\n }\n\n //Sortira vrste po fitnesu najboljeg igraca\n let temp = [];\n for (let i = 0; i < this.species.length; i++) {\n let max = 0;\n let maxIndex = 0;\n for (let j = 0; j < this.species.length; j++) {\n if (this.species[j].bestFitness > max) {\n max = this.species[j].bestFitness;\n maxIndex = j;\n }\n }\n temp.push(this.species[maxIndex]);\n this.species.splice(maxIndex, 1);\n i--;\n }\n this.species = [];\n arrayCopy(temp, this.species);\n }", "function sortArray1(arr) {\n return arr.sort((a, b) => a-b)\n}", "function Ob(){for(var a=J.vb(),b=[],c=[],d=0;d<a.length;d++){var e=a[d].Ak;e&&(e=e.call(a[d]))&&(e[2]?b.push(e):c.push(e))}c.sort(Pb);b.sort(Pb);return[c,b]}", "sort() {\n for (let i = 0; i < this.values.length - 1; i++) {\n let min = i;\n for (let j = i + 1; j < this.values.length; j++) {\n if (this.values[j] < this.values[min]) min = j;\n }\n\n this.swap(i, min);\n }\n }", "_sortBy(array, selectors) {\n return array.concat().sort((a, b) => {\n for (let selector of selectors) {\n let reverse = selector.order ? -1 : 1;\n\n a = selector.value ? JP.query(a, selector.value)[0] : JP.query(a,selector)[0];\n b = selector.value ? JP.query(b, selector.value)[0] : JP.query(b,selector)[0];\n\n if (a.toUpperCase() > b.toUpperCase()) {\n return reverse;\n }\n if (a.toUpperCase() < b.toUpperCase()) {\n return -1 * reverse;\n }\n }\n return 0;\n });\n }", "function sortData (data) {\n ...\n}", "function start()\n{\n var a = [ 10, 1, 9, 2, 8, 3, 7, 4, 6, 5 ];\n\n outputArray( \"Data items in original order: \", a,\n document.getElementById( \"originalArray\" ) ); \n a.sort( compareIntegers ); // sort the array\n outputArray( \"Data items in ascending order: \", a,\n document.getElementById( \"sortedArray\" ) ); \n} // end function start", "function sortJson() {\r\n\t \r\n}", "sortedItems() {\n return this.childItems.slice().sort((i1, i2) => {\n return i1.index - i2.index;\n });\n }", "function myarrayresult(){\r\narray2.sort(function (a,b) {\r\n return a-b; //For assending order \r\n return b-a; //For descendening Order // Correct \r\n});\r\n}", "sort() {\n let a = this.array;\n const step = 1;\n let compares = 0;\n for (let i = 0; i < a.length; i++) {\n let tmp = a[i];\n for (var j = i; j >= step; j -= step) {\n this.store(step, i, j, tmp, compares);\n compares++;\n if (a[j - step] > tmp) {\n a[j] = a[j - step];\n this.store(step, i, j, tmp, compares);\n } else {\n break;\n }\n }\n a[j] = tmp;\n this.store(step, i, j, tmp, compares);\n }\n this.array = a;\n }", "function task14_16_10(){\n var scores =[320,230,480,120];\n document.write(\"Scores of Students : \"+scores + \"<br>\");\n scores.sort();\n document.write(\"Ordered Score of Students : \"+scores);\n}", "function baseSortBy(array, comparer) {\n var length = array.length;\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n}", "function copySorted(arr){\n let a=arr.slice(0);\n return a.sort();\n}", "function sortKids(mmdKidsList) {\r\n\t\tvar sortedList = [];\r\n\t\tif (mmdKidsList && mmdKidsList instanceof Array) {\r\n\t\t\tfor (var i = 0; i < mmdKidsList.length; i++){\r\n\t\t\t\tif (mmdKidsList[i].scalar){\r\n\t\t\t\t\tsortedList.push(mmdKidsList[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (var j = 0; j < mmdKidsList.length; j++){\r\n\t\t\t\tif (!mmdKidsList[j].scalar){\r\n\t\t\t\t\tsortedList.push(mmdKidsList[j]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sortedList;\r\n \t}", "function sortVersionArray(arr) {\n return arr.map( a => a.replace(/\\d+/g, n => +n+100000 ) ).sort()\n .map( a => a.replace(/\\d+/g, n => +n-100000 ) );\n}", "function sortArray() {\n\n //PRZYPISANIE WARTOSCI DO TABLICY\n var points = [41, 3, 6, 1, 114, 54, 64];\n\n //SORTOWANIE OD NAJMNIEJSZEJ DO NAJWIEKSZEJ\n points.sort(function (a, b) {\n //POROWNANIE DWOCH ELEM. TABLICY - MNIEJSZY STAWIA PO LEWEJ, WIEKSZY PO PRAWEJ\n return a - b;\n });\n\n //ZWROCENIE POSORTOWANEJ TABLICY\n return points;\n}", "function sort(unsortedArray) {\n // Your code here\n}", "function testSorts()\n{\n\n\tconsole.log(\"============= original googleResults =============\");\n\tconsole.log(googleResults);\n\t\n\tconsole.log(\"==== before sort array element index name rating ====\");\n\t\n\tgoogleResults.forEach(function(element,index)\n\t{\n\t\t console.log(index + \": name: \" + element.name + \" rating: \" + element.rating);\n\n\t});\n\n\t\t// commented for testing\n\t\t//googleResults.sortByRatingAscending();\n\t\t\n\t\t// commented for testing\n\t\tgoogleResults.sortByRatingDescending();\n\t\t\n\t//===============================================================\t\n\n\tconsole.log(\"============= after sort =============\");\n\n\tgoogleResults.forEach(function(element,index)\n\t{\n\t\t console.log(index + \": name: \" + element.name + \" rating: \" + element.rating);\n\n\t});\n\t\n}//END test", "function sort(arr) {\n return null; \n}", "nameSort() {\n orders.sort( \n function(a,b) {\n return (a[0] < b[0]) ? -1 : (a[0] > b[0]) ? 1 : 0; \n }\n ); \n }", "function alphabeticalOrder(arr) {\n // Add your code below this line\n return arr.sort()\n\n // Add your code above this line\n}", "sort(){\n\t\tvar sortable = [];\n\t\tfor (var vehicle in this.primes) {\n\t\t sortable.push([vehicle, this.primes[vehicle]]);\n\t\t}\n\t\treturn sortable.sort(function(a, b) {\n\t\t return a[1] - b[1];\n\t\t});\n\t}", "function sortContacts(arr){\n arr.sort(function(a,b){\n if (a < b) return -1;\n else if (a > b) return 1;\n return 0;\n });\n return arr;\n }", "itemsToSort() {\n return [];\n }", "function sortMin(arr){\n arr = arr.sort(function(a, b){\n return a>b;\n });\n return arr; \n}", "sort() {\n const a = this.dict;\n const n = a.length;\n\n if( n < 2 ) { // eslint-disable-line \n } else if( n < 100 ) {\n // insertion sort\n for( let i = 1; i < n; i += 1 ) {\n const item = a[ i ];\n let j = i - 1;\n while( j >= 0 && item[ 0 ] < a[ j ][ 0 ] ) {\n a[ j + 1 ] = a[ j ];\n j -= 1;\n }\n a[ j + 1 ] = item;\n }\n } else {\n /**\n * Bottom-up iterative merge sort\n */\n for( let c = 1; c <= n - 1; c = 2 * c ) {\n for( let l = 0; l < n - 1; l += 2 * c ) {\n const m = l + c - 1;\n const r = Math.min( l + 2 * c - 1, n - 1 );\n if( m > r ) continue;\n merge( a, l, m, r );\n }\n }\n }\n }", "function sortArray(arr)\n{\n var abc = 'abcdefghijklmnopqrstuvwxyz';\n var dummy = [];\n\n var assignPriority = function (e)\n {\n if (e === \"...\")\n return ((27 + 1) * 26);\n\n var content = e.split('');\n if (isNaN(content[1]))\n return (((abc.indexOf(content[0]) + 1) * 26) * 100);\n\n return (content[1] * 10) + abc.indexOf(content[0]);\n }\n\n arr.forEach(function (e)\n {\n dummy.push(e);\n dummy.sort(function (a, b)\n {\n return assignPriority(a) - assignPriority(b);\n })\n });\n\n arr.length = 0;\n dummy.forEach(function (e)\n {\n if (arr.indexOf(e) === -1)\n {\n arr.push(e);\n }\n });\n}", "function treatArray(raw_arr)\n{\n var arr;\narr=sortArray(raw_arr)\narr=filterArray(arr)\nreturn arr\n}", "function sortedArr(arr) {\n const sortedArray = arr.slice().sort((a, b) => a - b)\n return sortedArray\n}", "function sortArguments(...args) {\n return args.sort();\n}", "sort() {\n if(this.data.length >= 2){\n for (var i = 0; i < this.data.length - 1; i++){\n for (var j = i + 1; j < this.data.length; j++){\n if (this.data[i].users.length < this.data[j].users.length){\n let tmp = this.data[i];\n this.data[i] = this.data[j];\n this.data[j] = tmp;\n \n }\n }\n \n }\n }\n }", "function sortArray() {\n //Twoj komentarz ...\n //deklaracje tablicy z elemtami\n var points = [41, 3, 6, 1, 114, 54, 64];\n\n //Twoj komentarz ...\n points.sort(function(a, b) {\n //Twoj komentarz ...\n\n return a - b;\n });\n\n //Twoj komentarz ...\n //zwrócenie tablicy points\n return points;\n}", "function bc(){for(var a=B.Za(),b=[],c=[],d=0;d<a.length;d++){var e=a[d].Hf;e&&(e=e.call(a[d]))&&(e[2]?b.push(e):c.push(e))}c.sort(cc);b.sort(cc);return[c,b]}", "sorted(x) {\n super.sorted(0, x);\n }", "sort () {\r\n this._data.sort((a, b) => a.sortOrder !== b.sortOrder ? b.sortOrder - a.sortOrder : a.value.localeCompare(b.value))\r\n }", "sortListItems() {\n let sortedItems = this.props.listItems.slice();\n return sortedItems.sort((a, b) => {\n if (a.value > b.value) {\n return -1;\n } else if (a.value < b.value) {\n return 1;\n }\n return 0;\n });\n }", "function sortPlaylist() {\n playlistArr = Object.entries(livePlaylist);\n\n if (playlistArr.length > 2) {\n var sorted = false;\n while (!sorted) {\n sorted = true;\n for (var i = 1; i < playlistArr.length - 1; i++) {\n if ((playlistArr[i][1].upvote < playlistArr[i + 1][1].upvote)) {\n sorted = false;\n var temp = playlistArr[i];\n playlistArr[i] = playlistArr[i + 1];\n playlistArr[i + 1] = temp;\n // })\n }\n // playlistArr[i][1].index = i;\n }\n }\n }\n return playlistArr;\n}", "function alphabetSort(){\n const tilesArr = [\"Caribbean\", \"The Bahamans\", \"Mexico\", \"Europe\", \"Bermuda\", \"Alaska\", \"Canada & New England\", \"Hawaii\", \"Panama Canal\", \"Transatlantic\", \"Transpacific\", \"Australia\"];\n tilesArr.sort()\n console.log(tilesArr);\n}", "function _sort(array) {\n array.sort(function (a, b) {\n return b.length - a.length;\n });\n }", "function sort() {\n elementArray.sort(function (x, y) {\n return x.elem - y.elem;\n });\n render(elementArray);\n }", "function sort(compare, elements) {\n //let property = elements[property];\n \n if (Array.isArray(elements)) {\n if (elements.length <= 1) {\n return elements;\n }\n else {\n const middle = Math.floor(elements.length /2);\n \n const left = elements.slice(0, middle);\n const right = elements.slice(middle, elements.length);\n \n const leftSorted = sort(compare, left);\n const rightSorted = sort(compare, right);\n return merge(compare, leftSorted, rightSorted);\n }\n }\n return elements;\n}", "function byAge(arr){\n return arr.sort(function(a, b){\n return a.age - b.age;\n });\n}", "function sort() {\n renderContent(numArray.sort());\n}", "function ed(a){a=a.tc();for(var b=[],c=[],d=0;d<a.length;d++){var e=a[d].cA;e&&(e=e.call(a[d]))&&(e[2]?b.push(e):c.push(e))}c.sort(fd);b.sort(fd);return[c,b]}", "_orderSort(l, r) {\n return l.order - r.order;\n }", "function sortList(a,b) {\n if (a.total < b.total)\n return -1;\n if (a.total > b.total)\n return 1;\n return 0;\n }", "function sortList(a,b) {\n if (a.total < b.total)\n return -1;\n if (a.total > b.total)\n return 1;\n return 0;\n }", "function ls (lista) {\nreturn lista.sort(function(x, y) {\n return y.length - x.length; \n })\n}", "function solution(nums){\n return Array.isArray(nums) ? nums.sort((a, b) => a - b) : [];\n}", "serialize() {\n //creates array with spread syntax, then sorts\n //not cross-compatible with some older versions of browsers like IE11\n const sorted = [...this.data];\n sorted.sort((a , b) => {\n return a.comparator - b.comparator;\n });\n return JSON.stringify(sorted);\n }", "serialize() {\n //creates array with spread syntax, then sorts\n //not cross-compatible with some older versions of browsers like IE11\n const sorted = [...this.data];\n sorted.sort((a , b) => {\n return a.comparator - b.comparator;\n });\n return JSON.stringify(sorted);\n }", "function qsort(l){\r\n return sortBy(compare, l);\r\n}", "function quickersort(a){\n var left = []\n , right = []\n , pivot = a[0]\n if(a.length == 0){\n return []\n }\n for(var i = 1; i < a.length; i++){\n a[i] < pivot ? left.push(a[i]) : right.push(a[i])\n }\n return quickersort(left).concat(pivot, quickersort(right))\n}", "function sort(a, b) {\n return a - b;\n}", "function sort(array) {\n var buf;\n\n for (var j = 0; j < array.length-1; j++)\n for (var i = 0; i < array.length-j; i++) {\n if (array[i] > array[i+1]) {\n buf = array[i];\n array[i] = array[i+1];\n array[i+1] = buf;\n }\n }\n\n return array;\n }", "function urutAscending(array) {\r\n array.sort((a, b) => {\r\n return a - b\r\n })\r\nreturn array;\r\n}", "function mSort (array) {\n if (array.length === 1) {\n return array // return once we hit an array with a single item\n }\n const middle = Math.floor(array.length / 2) // get the middle item of the array rounded down\n const left = array.slice(0, middle) // items on the left side\n const right = array.slice(middle) // items on the right side\n return merge(\n mSort(left),\n mSort(right)\n )\n }", "function sortAsc(a, b) {\n return a[1] - b[1];\n }", "function sortScores(){\n //basically this function will take the two arrays, sort the scores, and set the index of the other\n //To print the high score page in order\n var tempScores = highScoreScores.slice(0);\n var tempNames = highScoreNames.slice(0);\n\n highScoreScores.sort(function(a,b){return b-a});\n for(i=0;i<tempNames.length;i++){\n //Have to admit, the following line of code gave me a headache, but I got it to work\n highScoreNames[i] = tempNames[tempScores.indexOf(highScoreScores[i])];\n }\n}", "async function TopologicalSort(){}", "sorted(matches) {\n // sort on i primary, j secondary\n return matches.sort((m1, m2) => (m1.i - m2.i) || (m1.j - m2.j));\n }", "function asc(arr) {\n\t arr.sort(function (a, b) {\n\t return a - b;\n\t });\n\t return arr;\n\t }", "function sortArray(){\n\n /*Uses the built in sort -method that can accept a function that specifies\n how the array should be sorted. In this case we want the array to be sorted\n based on the object's price. Lower priced cars go first.*/\n function compare(a,b) {\n if (a.price < b.price) return -1;\n if (a.price > b.price) return 1;\n return 0;\n }\n listOfCars.sort(compare);\n console.table(listOfCars);\n\n }", "function rankitup(array) {\narray.sort(function(a, b){return a-b});\n}", "function sortUnique(a, aRef) {\n return a.filter(function (s, i) {\n return (s && a.indexOf(s) === i);\n }).sort((aRef instanceof Array) ? function (a, b) {\n // Sort by reference string array\n var nA = aRef.indexOf(a),\n nB = aRef.indexOf(b);\n if (nA > -1 && nB > -1)\n return nA - nB;\n else\n return ascendNumeric(a, b);\n } : ascendNumeric);\n}" ]
[ "0.7690018", "0.7690018", "0.743278", "0.73817414", "0.7223793", "0.7045839", "0.7001987", "0.6979922", "0.6941385", "0.68807125", "0.6870136", "0.6870136", "0.6834353", "0.6828496", "0.6822426", "0.68005633", "0.6790196", "0.6769818", "0.6721127", "0.6708953", "0.6707716", "0.6705091", "0.6701715", "0.6698726", "0.66884625", "0.6673228", "0.6654777", "0.6644944", "0.6620766", "0.66155", "0.66044503", "0.6582413", "0.65753365", "0.65745014", "0.6574325", "0.6566982", "0.65658796", "0.65635663", "0.6547234", "0.6537416", "0.6533053", "0.64816135", "0.6477538", "0.64773774", "0.64662033", "0.6439261", "0.64224166", "0.6411387", "0.6407275", "0.6404987", "0.6394021", "0.6391928", "0.63844424", "0.6378931", "0.636413", "0.63597816", "0.6358738", "0.6354149", "0.63519746", "0.63512844", "0.63492537", "0.63439023", "0.6337988", "0.63348204", "0.6332989", "0.6331558", "0.63302344", "0.6328908", "0.6319132", "0.631545", "0.6311143", "0.63084996", "0.63080776", "0.6306662", "0.6305015", "0.63041025", "0.6303335", "0.6303125", "0.6303021", "0.62972736", "0.62948924", "0.6294324", "0.6294324", "0.6293406", "0.62853324", "0.6279536", "0.6279536", "0.62756", "0.6275408", "0.6273514", "0.6269528", "0.62694144", "0.6263817", "0.6263231", "0.62486017", "0.62472373", "0.6243395", "0.62428373", "0.62412995", "0.62381005", "0.62379766" ]
0.0
-1
Return a moment from input, that is local/utc/zone equivalent to model.
function cloneWithOffset(input, model) { var res, diff; if (model._isUTC) { res = model.clone(); diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf(); // Use low-level api, because this fn is low-level api. res._d.setTime(res._d.valueOf() + diff); hooks.updateOffset(res, false); return res; } else { return createLocal(input).local(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeAs(input, model) {\n\t return model._isUTC ? moment(input).zone(model._offset || 0) :\n\t moment(input).local();\n\t }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n\t var res, diff;\n\t if (model._isUTC) {\n\t res = model.clone();\n\t diff = (moment.isMoment(input) || isDate(input) ? +input : +moment(input)) - +res;\n\t // Use low-level api, because this fn is low-level api.\n\t res._d.setTime(+res._d + diff);\n\t moment.updateOffset(res, false);\n\t return res;\n\t } else {\n\t return moment(input).local();\n\t }\n\t }", "function makeAs(input, model) {\n\t\tvar res, diff;\n\t\tif (model._isUTC) {\n\t\t\tres = model.clone();\n\t\t\tdiff = (moment.isMoment(input) || isDate(input) ? +input : +moment(input)) - (+res);\n\t\t\t// Use low-level api, because this fn is low-level api.\n\t\t\tres._d.setTime(+res._d + diff);\n\t\t\tmoment.updateOffset(res, false);\n\t\t\treturn res;\n\t\t} else {\n\t\t\treturn moment(input).local();\n\t\t}\n\t}", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function momentify(source) {\r\n return moment.utc(source);\r\n}", "parse(value) {\n return +moment.utc(value);\n }", "function makeMoment(args, parseAsUTC, parseZone) {\n var input = args[0];\n var isSingleString = args.length == 1 && typeof input === 'string';\n var isAmbigTime;\n var isAmbigZone;\n var ambigMatch;\n var mom;\n\n if (moment.isMoment(input)) {\n mom = moment.apply(null, args); // clone it\n transferAmbigs(input, mom); // the ambig flags weren't transfered with the clone\n }\n else if (isNativeDate(input) || input === undefined) {\n mom = moment.apply(null, args); // will be local\n }\n else { // \"parsing\" is required\n isAmbigTime = false;\n isAmbigZone = false;\n\n if (isSingleString) {\n if (ambigDateOfMonthRegex.test(input)) {\n // accept strings like '2014-05', but convert to the first of the month\n input += '-01';\n args = [input]; // for when we pass it on to moment's constructor\n isAmbigTime = true;\n isAmbigZone = true;\n }\n else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n isAmbigTime = !ambigMatch[5]; // no time part?\n isAmbigZone = true;\n }\n }\n else if ($.isArray(input)) {\n // arrays have no timezone information, so assume ambiguous zone\n isAmbigZone = true;\n }\n // otherwise, probably a string with a format\n\n if (parseAsUTC || isAmbigTime) {\n mom = moment.utc.apply(moment, args);\n }\n else {\n mom = moment.apply(null, args);\n }\n\n if (isAmbigTime) {\n mom._ambigTime = true;\n mom._ambigZone = true; // ambiguous time always means ambiguous zone\n }\n else if (parseZone) { // let's record the inputted zone somehow\n if (isAmbigZone) {\n mom._ambigZone = true;\n }\n else if (isSingleString) {\n if (mom.utcOffset) {\n mom.utcOffset(input); // if not a valid zone, will assign UTC\n }\n else {\n mom.zone(input); // for moment-pre-2.9\n }\n }\n }\n }\n\n mom._fullCalendar = true; // flag for extended functionality\n\n return mom;\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function makeMoment(args, parseAsUTC, parseZone) {\n\t\tvar input = args[0];\n\t\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\t\tvar isAmbigTime;\n\t\tvar isAmbigZone;\n\t\tvar ambigMatch;\n\t\tvar mom;\n\n\t\tif (moment.isMoment(input) || isNativeDate(input) || input === undefined) {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\t\telse { // \"parsing\" is required\n\t\t\tisAmbigTime = false;\n\t\t\tisAmbigZone = false;\n\n\t\t\tif (isSingleString) {\n\t\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\t\tinput += '-01';\n\t\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\t\tisAmbigTime = true;\n\t\t\t\t\tisAmbigZone = true;\n\t\t\t\t}\n\t\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\t\tisAmbigZone = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ($.isArray(input)) {\n\t\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\t// otherwise, probably a string with a format\n\n\t\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\t\tmom = moment.utc.apply(moment, args);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmom = moment.apply(null, args);\n\t\t\t}\n\n\t\t\tif (isAmbigTime) {\n\t\t\t\tmom._ambigTime = true;\n\t\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t\t}\n\t\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\t\tif (isAmbigZone) {\n\t\t\t\t\tmom._ambigZone = true;\n\t\t\t\t}\n\t\t\t\telse if (isSingleString) {\n\t\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tmom._fullCalendar = true; // flag for extended functionality\n\n\t\treturn mom;\n\t}", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar mom;\n\n\tif (moment.isMoment(input) || isNativeDate(input) || input === undefined) {\n\t\tmom = moment.apply(null, args);\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\tmom = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\tmom._ambigTime = true;\n\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\tmom._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t}\n\t\t}\n\t}\n\n\tmom._fullCalendar = true; // flag for extended functionality\n\n\treturn mom;\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar mom;\n\n\tif (moment.isMoment(input) || isNativeDate(input) || input === undefined) {\n\t\tmom = moment.apply(null, args);\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\tmom = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\tmom._ambigTime = true;\n\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\tmom._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t}\n\t\t}\n\t}\n\n\tmom._fullCalendar = true; // flag for extended functionality\n\n\treturn mom;\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar mom;\n\n\tif (moment.isMoment(input) || isNativeDate(input) || input === undefined) {\n\t\tmom = moment.apply(null, args);\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\tmom = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\tmom._ambigTime = true;\n\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\tmom._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t}\n\t\t}\n\t}\n\n\tmom._fullCalendar = true; // flag for extended functionality\n\n\treturn mom;\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar mom;\n\n\tif (moment.isMoment(input) || isNativeDate(input) || input === undefined) {\n\t\tmom = moment.apply(null, args);\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\tmom = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\tmom._ambigTime = true;\n\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\tmom._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t}\n\t\t}\n\t}\n\n\tmom._fullCalendar = true; // flag for extended functionality\n\n\treturn mom;\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar mom;\n\n\tif (moment.isMoment(input) || isNativeDate(input) || input === undefined) {\n\t\tmom = moment.apply(null, args);\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\tmom = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\tmom._ambigTime = true;\n\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\tmom._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t}\n\t\t}\n\t}\n\n\tmom._fullCalendar = true; // flag for extended functionality\n\n\treturn mom;\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar output; // an object with fields for the new FCMoment object\n\n\tif (moment.isMoment(input)) {\n\t\toutput = moment.apply(null, args); // clone it\n\n\t\t// the ambig properties have not been preserved in the clone, so reassign them\n\t\tif (input._ambigTime) {\n\t\t\toutput._ambigTime = true;\n\t\t}\n\t\tif (input._ambigZone) {\n\t\t\toutput._ambigZone = true;\n\t\t}\n\t}\n\telse if (isNativeDate(input) || input === undefined) {\n\t\toutput = moment.apply(null, args); // will be local\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC) {\n\t\t\toutput = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\toutput = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\toutput._ambigTime = true;\n\t\t\toutput._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\toutput._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\toutput.zone(input); // if not a valid zone, will assign UTC\n\t\t\t}\n\t\t}\n\t}\n\n\treturn new FCMoment(output);\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar output; // an object with fields for the new FCMoment object\n\n\tif (moment.isMoment(input)) {\n\t\toutput = moment.apply(null, args); // clone it\n\n\t\t// the ambig properties have not been preserved in the clone, so reassign them\n\t\tif (input._ambigTime) {\n\t\t\toutput._ambigTime = true;\n\t\t}\n\t\tif (input._ambigZone) {\n\t\t\toutput._ambigZone = true;\n\t\t}\n\t}\n\telse if (isNativeDate(input) || input === undefined) {\n\t\toutput = moment.apply(null, args); // will be local\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC) {\n\t\t\toutput = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\toutput = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\toutput._ambigTime = true;\n\t\t\toutput._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\toutput._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\toutput.zone(input); // if not a valid zone, will assign UTC\n\t\t\t}\n\t\t}\n\t}\n\n\treturn new FCMoment(output);\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar mom;\n\n\tif (moment.isMoment(input)) {\n\t\tmom = moment.apply(null, args); // clone it\n\t\ttransferAmbigs(input, mom); // the ambig flags weren't transfered with the clone\n\t}\n\telse if (isNativeDate(input) || input === undefined) {\n\t\tmom = moment.apply(null, args); // will be local\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\tmom = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\tmom._ambigTime = true;\n\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\tmom._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\tif (mom.utcOffset) {\n\t\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmom.zone(input); // for moment-pre-2.9\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tmom._fullCalendar = true; // flag for extended functionality\n\n\treturn mom;\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar mom;\n\n\tif (moment.isMoment(input)) {\n\t\tmom = moment.apply(null, args); // clone it\n\t\ttransferAmbigs(input, mom); // the ambig flags weren't transfered with the clone\n\t}\n\telse if (isNativeDate(input) || input === undefined) {\n\t\tmom = moment.apply(null, args); // will be local\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\tmom = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\tmom._ambigTime = true;\n\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\tmom._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\tif (mom.utcOffset) {\n\t\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmom.zone(input); // for moment-pre-2.9\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tmom._fullCalendar = true; // flag for extended functionality\n\n\treturn mom;\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar mom;\n\n\tif (moment.isMoment(input)) {\n\t\tmom = moment.apply(null, args); // clone it\n\t\ttransferAmbigs(input, mom); // the ambig flags weren't transfered with the clone\n\t}\n\telse if (isNativeDate(input) || input === undefined) {\n\t\tmom = moment.apply(null, args); // will be local\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\tmom = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\tmom._ambigTime = true;\n\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\tmom._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\tif (mom.utcOffset) {\n\t\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmom.zone(input); // for moment-pre-2.9\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tmom._fullCalendar = true; // flag for extended functionality\n\n\treturn mom;\n}", "function cloneWithOffset(input, model) {\n\tvar res, diff;\n\tif (model._isUTC) {\n\t\tres = model.clone();\n\t\tdiff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();\n\t\t// Use low-level api, because this fn is low-level api.\n\t\tres._d.setTime(res._d.valueOf() + diff);\n\t\thooks.updateOffset(res, false);\n\t\treturn res;\n\t} else {\n\t\treturn createLocal(input).local();\n\t}\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n if (parseAsUTC === void 0) { parseAsUTC = false; }\n if (parseZone === void 0) { parseZone = false; }\n var input = args[0];\n var isSingleString = args.length === 1 && typeof input === 'string';\n var isAmbigTime;\n var isAmbigZone;\n var ambigMatch;\n var mom;\n if (moment.isMoment(input) || util_1.isNativeDate(input) || input === undefined) {\n mom = moment.apply(null, args);\n }\n else { // \"parsing\" is required\n isAmbigTime = false;\n isAmbigZone = false;\n if (isSingleString) {\n if (ambigDateOfMonthRegex.test(input)) {\n // accept strings like '2014-05', but convert to the first of the month\n input += '-01';\n args = [input]; // for when we pass it on to moment's constructor\n isAmbigTime = true;\n isAmbigZone = true;\n }\n else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n isAmbigTime = !ambigMatch[5]; // no time part?\n isAmbigZone = true;\n }\n }\n else if ($.isArray(input)) {\n // arrays have no timezone information, so assume ambiguous zone\n isAmbigZone = true;\n }\n // otherwise, probably a string with a format\n if (parseAsUTC || isAmbigTime) {\n mom = moment.utc.apply(moment, args);\n }\n else {\n mom = moment.apply(null, args);\n }\n if (isAmbigTime) {\n mom._ambigTime = true;\n mom._ambigZone = true; // ambiguous time always means ambiguous zone\n }\n else if (parseZone) { // let's record the inputted zone somehow\n if (isAmbigZone) {\n mom._ambigZone = true;\n }\n else if (isSingleString) {\n mom.utcOffset(input); // if not a valid zone, will assign UTC\n }\n }\n }\n mom._fullCalendar = true; // flag for extended functionality\n return mom;\n}", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(res._d.valueOf() + diff);\n hooks.updateOffset(res, false);\n return res;\n } else {\n return createLocal(input).local();\n }\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(res._d.valueOf() + diff);\n hooks.updateOffset(res, false);\n return res;\n } else {\n return createLocal(input).local();\n }\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(res._d.valueOf() + diff);\n hooks.updateOffset(res, false);\n return res;\n } else {\n return createLocal(input).local();\n }\n }", "function makeMoment(args, parseAsUTC, parseZone) {\n if (parseAsUTC === void 0) { parseAsUTC = false; }\n if (parseZone === void 0) { parseZone = false; }\n var input = args[0];\n var isSingleString = args.length === 1 && typeof input === 'string';\n var isAmbigTime;\n var isAmbigZone;\n var ambigMatch;\n var mom;\n if (moment.isMoment(input) || util_1.isNativeDate(input) || input === undefined) {\n mom = moment.apply(null, args);\n }\n else {\n isAmbigTime = false;\n isAmbigZone = false;\n if (isSingleString) {\n if (ambigDateOfMonthRegex.test(input)) {\n // accept strings like '2014-05', but convert to the first of the month\n input += '-01';\n args = [input]; // for when we pass it on to moment's constructor\n isAmbigTime = true;\n isAmbigZone = true;\n }\n else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n isAmbigTime = !ambigMatch[5]; // no time part?\n isAmbigZone = true;\n }\n }\n else if ($.isArray(input)) {\n // arrays have no timezone information, so assume ambiguous zone\n isAmbigZone = true;\n }\n // otherwise, probably a string with a format\n if (parseAsUTC || isAmbigTime) {\n mom = moment.utc.apply(moment, args);\n }\n else {\n mom = moment.apply(null, args);\n }\n if (isAmbigTime) {\n mom._ambigTime = true;\n mom._ambigZone = true; // ambiguous time always means ambiguous zone\n }\n else if (parseZone) {\n if (isAmbigZone) {\n mom._ambigZone = true;\n }\n else if (isSingleString) {\n mom.utcOffset(input); // if not a valid zone, will assign UTC\n }\n }\n }\n mom._fullCalendar = true; // flag for extended functionality\n return mom;\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n if (parseAsUTC === void 0) { parseAsUTC = false; }\n if (parseZone === void 0) { parseZone = false; }\n var input = args[0];\n var isSingleString = args.length === 1 && typeof input === 'string';\n var isAmbigTime;\n var isAmbigZone;\n var ambigMatch;\n var mom;\n if (moment.isMoment(input) || util_1.isNativeDate(input) || input === undefined) {\n mom = moment.apply(null, args);\n }\n else {\n isAmbigTime = false;\n isAmbigZone = false;\n if (isSingleString) {\n if (ambigDateOfMonthRegex.test(input)) {\n // accept strings like '2014-05', but convert to the first of the month\n input += '-01';\n args = [input]; // for when we pass it on to moment's constructor\n isAmbigTime = true;\n isAmbigZone = true;\n }\n else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n isAmbigTime = !ambigMatch[5]; // no time part?\n isAmbigZone = true;\n }\n }\n else if ($.isArray(input)) {\n // arrays have no timezone information, so assume ambiguous zone\n isAmbigZone = true;\n }\n // otherwise, probably a string with a format\n if (parseAsUTC || isAmbigTime) {\n mom = moment.utc.apply(moment, args);\n }\n else {\n mom = moment.apply(null, args);\n }\n if (isAmbigTime) {\n mom._ambigTime = true;\n mom._ambigZone = true; // ambiguous time always means ambiguous zone\n }\n else if (parseZone) {\n if (isAmbigZone) {\n mom._ambigZone = true;\n }\n else if (isSingleString) {\n mom.utcOffset(input); // if not a valid zone, will assign UTC\n }\n }\n }\n mom._fullCalendar = true; // flag for extended functionality\n return mom;\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n if (parseAsUTC === void 0) { parseAsUTC = false; }\n if (parseZone === void 0) { parseZone = false; }\n var input = args[0];\n var isSingleString = args.length === 1 && typeof input === 'string';\n var isAmbigTime;\n var isAmbigZone;\n var ambigMatch;\n var mom;\n if (moment.isMoment(input) || util_1.isNativeDate(input) || input === undefined) {\n mom = moment.apply(null, args);\n }\n else {\n isAmbigTime = false;\n isAmbigZone = false;\n if (isSingleString) {\n if (ambigDateOfMonthRegex.test(input)) {\n // accept strings like '2014-05', but convert to the first of the month\n input += '-01';\n args = [input]; // for when we pass it on to moment's constructor\n isAmbigTime = true;\n isAmbigZone = true;\n }\n else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n isAmbigTime = !ambigMatch[5]; // no time part?\n isAmbigZone = true;\n }\n }\n else if ($.isArray(input)) {\n // arrays have no timezone information, so assume ambiguous zone\n isAmbigZone = true;\n }\n // otherwise, probably a string with a format\n if (parseAsUTC || isAmbigTime) {\n mom = moment.utc.apply(moment, args);\n }\n else {\n mom = moment.apply(null, args);\n }\n if (isAmbigTime) {\n mom._ambigTime = true;\n mom._ambigZone = true; // ambiguous time always means ambiguous zone\n }\n else if (parseZone) {\n if (isAmbigZone) {\n mom._ambigZone = true;\n }\n else if (isSingleString) {\n mom.utcOffset(input); // if not a valid zone, will assign UTC\n }\n }\n }\n mom._fullCalendar = true; // flag for extended functionality\n return mom;\n}", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (constructor_1.isMoment(input) || is_date_1.default(input) ? input.valueOf() : local_1.createLocal(input).valueOf()) - res.valueOf();\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(res._d.valueOf() + diff);\n hooks_1.hooks.updateOffset(res, false);\n return res;\n }\n else {\n return local_1.createLocal(input).local();\n }\n}" ]
[ "0.85007477", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.7951696", "0.7934528", "0.7897827", "0.78496075", "0.78496075", "0.78496075", "0.78496075", "0.78496075", "0.78496075", "0.78496075", "0.78496075", "0.78496075", "0.78496075", "0.78496075", "0.78496075", "0.78496075", "0.78496075", "0.7114856", "0.65993816", "0.656049", "0.65438", "0.6516134", "0.65115094", "0.65115094", "0.65115094", "0.65115094", "0.65115094", "0.65115094", "0.65115094", "0.65115094", "0.65115094", "0.65115094", "0.65115094", "0.65115094", "0.65115094", "0.6476368", "0.6476368", "0.6476368", "0.6476368", "0.6476368", "0.6404806", "0.6404806", "0.63852865", "0.63852865", "0.63852865", "0.6376506", "0.63663816", "0.6364064", "0.6364064", "0.6344212", "0.6329767", "0.6329767", "0.6329767", "0.6322531" ]
0.0
-1
MOMENTS keepLocalTime = true means only change the timezone, without affecting the local hour. So 5:31:26 +0300 [utcOffset(2, true)]> 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset +0200, so we adjust the time as needed, to be valid. Keeping the time actually adds/subtracts (one hour) from the actual represented time. That is why we call updateOffset a second time. In case it wants us to change the offset again _changeInProgress == true case, then we have to adjust, because there is no such time in the given timezone.
function getSetOffset (input, keepLocalTime, keepMinutes) { var offset = this._offset || 0, localAdjust; if (!this.isValid()) { return input != null ? this : NaN; } if (input != null) { if (typeof input === 'string') { input = offsetFromString(matchShortOffset, input); if (input === null) { return this; } } else if (Math.abs(input) < 16 && !keepMinutes) { input = input * 60; } if (!this._isUTC && keepLocalTime) { localAdjust = getDateOffset(this); } this._offset = input; this._isUTC = true; if (localAdjust != null) { this.add(localAdjust, 'm'); } if (offset !== input) { if (!keepLocalTime || this._changeInProgress) { addSubtract(this, createDuration(input - offset, 'm'), 1, false); } else if (!this._changeInProgress) { this._changeInProgress = true; hooks.updateOffset(this, true); this._changeInProgress = null; } } return this; } else { return this._isUTC ? offset : getDateOffset(this); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSetOffset(input,keepLocalTime){var offset=this._offset||0,localAdjust;if(!this.isValid()){return input!=null?this:NaN;}if(input!=null){if(typeof input==='string'){input=offsetFromString(matchShortOffset,input);}else if(Math.abs(input)<16){input=input*60;}if(!this._isUTC&&keepLocalTime){localAdjust=getDateOffset(this);}this._offset=input;this._isUTC=true;if(localAdjust!=null){this.add(localAdjust,'m');}if(offset!==input){if(!keepLocalTime||this._changeInProgress){add_subtract__addSubtract(this,create__createDuration(input-offset,'m'),1,false);}else if(!this._changeInProgress){this._changeInProgress=true;utils_hooks__hooks.updateOffset(this,true);this._changeInProgress=null;}}return this;}else{return this._isUTC?offset:getDateOffset(this);}}", "function getSetOffset(input,keepLocalTime){var offset=this._offset||0,localAdjust;if(!this.isValid()){return input!=null?this:NaN;}if(input!=null){if(typeof input==='string'){input=offsetFromString(matchShortOffset,input);}else if(Math.abs(input)<16){input=input*60;}if(!this._isUTC&&keepLocalTime){localAdjust=getDateOffset(this);}this._offset=input;this._isUTC=true;if(localAdjust!=null){this.add(localAdjust,'m');}if(offset!==input){if(!keepLocalTime||this._changeInProgress){add_subtract__addSubtract(this,create__createDuration(input-offset,'m'),1,false);}else if(!this._changeInProgress){this._changeInProgress=true;utils_hooks__hooks.updateOffset(this,true);this._changeInProgress=null;}}return this;}else{return this._isUTC?offset:getDateOffset(this);}}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\r\n var offset = this._offset || 0,\r\n localAdjust;\r\n if (input != null) {\r\n if (typeof input === 'string') {\r\n input = offsetFromString(input);\r\n }\r\n if (Math.abs(input) < 16) {\r\n input = input * 60;\r\n }\r\n if (!this._isUTC && keepLocalTime) {\r\n localAdjust = getDateOffset(this);\r\n }\r\n this._offset = input;\r\n this._isUTC = true;\r\n if (localAdjust != null) {\r\n this.add(localAdjust, 'm');\r\n }\r\n if (offset !== input) {\r\n if (!keepLocalTime || this._changeInProgress) {\r\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\r\n } else if (!this._changeInProgress) {\r\n this._changeInProgress = true;\r\n utils_hooks__hooks.updateOffset(this, true);\r\n this._changeInProgress = null;\r\n }\r\n }\r\n return this;\r\n } else {\r\n return this._isUTC ? offset : getDateOffset(this);\r\n }\r\n }", "function getSetOffset(input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(input);\n\t }\n\t if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(input);\n\t }\n\t if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset(input,keepLocalTime,keepMinutes){var offset=this._offset||0,localAdjust;if(!this.isValid()){return input!=null?this:NaN;}if(input!=null){if(typeof input==='string'){input=offsetFromString(matchShortOffset,input);if(input===null){return this;}}else if(Math.abs(input)<16&&!keepMinutes){input=input*60;}if(!this._isUTC&&keepLocalTime){localAdjust=getDateOffset(this);}this._offset=input;this._isUTC=true;if(localAdjust!=null){this.add(localAdjust,'m');}if(offset!==input){if(!keepLocalTime||this._changeInProgress){addSubtract(this,createDuration(input-offset,'m'),1,false);}else if(!this._changeInProgress){this._changeInProgress=true;hooks.updateOffset(this,true);this._changeInProgress=null;}}return this;}else{return this._isUTC?offset:getDateOffset(this);}}", "function getSetOffset(input,keepLocalTime,keepMinutes){var offset=this._offset||0,localAdjust;if(!this.isValid()){return input!=null?this:NaN;}if(input!=null){if(typeof input==='string'){input=offsetFromString(matchShortOffset,input);if(input===null){return this;}}else if(Math.abs(input)<16&&!keepMinutes){input=input*60;}if(!this._isUTC&&keepLocalTime){localAdjust=getDateOffset(this);}this._offset=input;this._isUTC=true;if(localAdjust!=null){this.add(localAdjust,'m');}if(offset!==input){if(!keepLocalTime||this._changeInProgress){addSubtract(this,createDuration(input-offset,'m'),1,false);}else if(!this._changeInProgress){this._changeInProgress=true;hooks.updateOffset(this,true);this._changeInProgress=null;}}return this;}else{return this._isUTC?offset:getDateOffset(this);}}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset(input,keepLocalTime,keepMinutes){var offset=this._offset || 0,localAdjust;if(!this.isValid()){return input != null?this:NaN;}if(input != null){if(typeof input === 'string'){input = offsetFromString(matchShortOffset,input);if(input === null){return this;}}else if(Math.abs(input) < 16 && !keepMinutes){input = input * 60;}if(!this._isUTC && keepLocalTime){localAdjust = getDateOffset(this);}this._offset = input;this._isUTC = true;if(localAdjust != null){this.add(localAdjust,'m');}if(offset !== input){if(!keepLocalTime || this._changeInProgress){addSubtract(this,createDuration(input - offset,'m'),1,false);}else if(!this._changeInProgress){this._changeInProgress = true;hooks.updateOffset(this,true);this._changeInProgress = null;}}return this;}else {return this._isUTC?offset:getDateOffset(this);}}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\r\n var offset = this._offset || 0,\r\n localAdjust;\r\n if (!this.isValid()) {\r\n return input != null ? this : NaN;\r\n }\r\n if (input != null) {\r\n if (typeof input === 'string') {\r\n input = offsetFromString(matchShortOffset, input);\r\n } else if (Math.abs(input) < 16) {\r\n input = input * 60;\r\n }\r\n if (!this._isUTC && keepLocalTime) {\r\n localAdjust = getDateOffset(this);\r\n }\r\n this._offset = input;\r\n this._isUTC = true;\r\n if (localAdjust != null) {\r\n this.add(localAdjust, 'm');\r\n }\r\n if (offset !== input) {\r\n if (!keepLocalTime || this._changeInProgress) {\r\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\r\n } else if (!this._changeInProgress) {\r\n this._changeInProgress = true;\r\n utils_hooks__hooks.updateOffset(this, true);\r\n this._changeInProgress = null;\r\n }\r\n }\r\n return this;\r\n } else {\r\n return this._isUTC ? offset : getDateOffset(this);\r\n }\r\n }", "function getSetOffset(input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset(input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset(input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (!this.isValid()) {\n\t return input != null ? this : NaN;\n\t }\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(matchShortOffset, input);\n\t } else if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (!this.isValid()) {\n\t return input != null ? this : NaN;\n\t }\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(matchShortOffset, input);\n\t } else if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (!this.isValid()) {\n\t return input != null ? this : NaN;\n\t }\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(matchShortOffset, input);\n\t } else if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (!this.isValid()) {\n\t return input != null ? this : NaN;\n\t }\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(matchShortOffset, input);\n\t } else if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (!this.isValid()) {\n\t return input != null ? this : NaN;\n\t }\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(matchShortOffset, input);\n\t } else if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (!this.isValid()) {\n\t return input != null ? this : NaN;\n\t }\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(matchShortOffset, input);\n\t } else if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (!this.isValid()) {\n\t return input != null ? this : NaN;\n\t }\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(matchShortOffset, input);\n\t } else if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (!this.isValid()) {\n\t return input != null ? this : NaN;\n\t }\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(matchShortOffset, input);\n\t } else if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (!this.isValid()) {\n\t return input != null ? this : NaN;\n\t }\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(matchShortOffset, input);\n\t } else if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (!this.isValid()) {\n\t return input != null ? this : NaN;\n\t }\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(matchShortOffset, input);\n\t } else if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset(input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset(input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (!this.isValid()) {\n\t return input != null ? this : NaN;\n\t }\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(matchShortOffset, input);\n\t } else if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}" ]
[ "0.6656803", "0.6656803", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.65901136", "0.6589509", "0.6586642", "0.6544375", "0.6544375", "0.6535081", "0.6535081", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.6440189", "0.64363396", "0.64314604", "0.6430424", "0.6423289", "0.6421166", "0.6421166", "0.63864446", "0.63864446", "0.63864446", "0.63864446", "0.63864446", "0.63864446", "0.63864446", "0.63864446", "0.63864446", "0.63864446", "0.637674", "0.635881", "0.63521767", "0.63521767", "0.63521767", "0.63521767", "0.63521767", "0.63521767", "0.63521767", "0.63521767", "0.63521767", "0.63521767", "0.63521767", "0.63521767" ]
0.0
-1
TODO: remove 'name' arg after deprecation is removed
function createAdder(direction, name) { return function (val, period) { var dur, tmp; //invert the arguments, but complain about it if (period !== null && !isNaN(+period)) { deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'); tmp = val; val = period; period = tmp; } val = typeof val === 'string' ? +val : val; dur = createDuration(val, period); addSubtract(this, dur, direction); return this; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setName(name) { }", "constructor(name) {\n super(name);\n this.name = name;\n }", "constructor(name) {\n this.name = name;\n }", "constructor(name) {\n this.name = name;\n }", "constructor(name) {\n this.name = name;\n }", "constructor(name) {\n this.name = name;\n }", "constructor(name) {\n this._name = name;\n }", "constructor(name) {\n this._name = name;\n }", "constructor(name) {\n this._name = name;\n }", "constructor(name){\n this._name = name;\n }", "setName( name ) {\n this.name = name;\n }", "getName(newName) {\n this.name = newName;\n }", "setName(name) {\n\t\tthis.name = name;\n\t}", "constructor(name){\n this.name = name\n }", "constructor(name){\n this.name = name;\n }", "setName(name) {\n this.name = name;\n }", "setName(name) {\n this._name = name;\n }", "set type(name) {\n console.warn(\"prototype.type = 'ModelName' is deprecated, use static __name__ instead\");\n this.constructor.__name__ = name;\n }", "set name(x) { this._name = x; }", "get name() {return this._name;}", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "setName(name){\n this.name = name;\n }", "set name(value) { this._name = value || \"unknown\"; }", "constructor({ name }) { // { name } is bringing in a object and deconstructing/ unpacking the object into the class \n this.name = name // name is the object you bring in, and this.name is this specific instance of the class is the name of it \n }", "getName() {}", "function getName() { return name; }", "get name() {\n return this.use().name;\n }", "function name(name) {\n return name;\n }", "setName(value){\n\t\tthis.name = value;\n\t}", "constructor(name='test') {\n this.name = name;\n }", "constructor() {\n super();\n this.name = 'none';\n }", "set setName(name){\n _name=name;\n }", "set name(newName) {\n this.setName(newName);\n }", "get name(): string { throw new Error(\"Member class not implemented\"); }", "set name(value) {\n\t\tthis._name = value;\n\t}", "name(name) {\n\t\tthis._name = name;\n\t\treturn this;\n\t}", "get name() {\r\n\t\treturn this._name;\r\n\t}", "name() { }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "getName() {\r\n return this.name;\r\n }", "name(str) {\n this._name = str;\n return this;\n }", "constructor(name) { // méthode constructor avec pour paramètre name\n super(name); // utiliser super pour appeler name\n this.name = \"Kuma\"; // le name devient Kuma\n }", "get name() {\n\t\treturn this.__name;\n\t}", "get name() {\n\t\treturn this.__name;\n\t}", "get name() {\n\t\treturn this.__name;\n\t}", "get name() {\n\t\treturn this.__name;\n\t}", "get name() {\n\t\treturn this.__name;\n\t}", "get name() {\n\t\treturn this.__name;\n\t}", "get name() {\n\t\treturn this.__name;\n\t}", "get name () {\n console.warn(\n 'Deprecation warning: \"channel.name\" is deprecated, use channel.channelName instead'\n )\n return this.channelName\n }", "get name() {\n \treturn 'Stephanie';\n }", "get name() {\r\n return this._name;\r\n }", "get name() {\n\t return this._name;\n\t }", "function getName() {\n\treturn name;\n}", "setName(namePicked) {\n this.name = namePicked; //refer to the object itself using 'this'\n }", "set name(newName) {\n if (newName) {\n this._name = newName;\n }\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "set name(newName) {\n this.setName(newName);\n }", "get name() {\n\t\treturn this._name;\n\t}", "get name() {\n\t\treturn this._name;\n\t}", "get name () {\n\t\treturn this._name;\n\t}", "get name () {\n\t\treturn this._name;\n\t}", "get name () {\n\t\treturn this._name;\n\t}", "get name () {\n\t\treturn this._name;\n\t}", "get name () {\n\t\treturn this._name;\n\t}", "get name () {\n\t\treturn this._name;\n\t}", "_$name() {\n super._$name();\n this._value.name = this._node.key.name;\n }", "function getName(name) {\n return name\n}", "constructor(transport, name) {\n super(transport);\n this.name = name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "function ensureNameField(desc) {\n desc.name = '';\n }", "get getName() {\n return this._name;\n }", "get name () {\n return this._name;\n }", "['@_name']() {\n super['@_name']();\n if (this._value.name) return;\n\n this._value.name = this._node.declarations[0].id.name;\n }", "function name() {}", "set name(newName) {\n\t this.setName(newName);\n\t }", "constructor () {\n this._name = 'u1';\n }", "get name() {}", "get name() {}", "get name() {}", "get name() {}" ]
[ "0.67782986", "0.6759405", "0.67381084", "0.67381084", "0.67381084", "0.67381084", "0.6733258", "0.6733258", "0.67120683", "0.66484624", "0.6612438", "0.6540716", "0.65202653", "0.65195", "0.6489472", "0.6465985", "0.6462259", "0.6415414", "0.6381141", "0.6297654", "0.6276111", "0.6276111", "0.6276111", "0.6276111", "0.6276111", "0.6276111", "0.6276111", "0.6276111", "0.6185439", "0.6112878", "0.60964316", "0.60552776", "0.6050006", "0.60477877", "0.60141873", "0.5992784", "0.5989703", "0.5979093", "0.5960276", "0.59392995", "0.5917421", "0.5909178", "0.5909035", "0.59078485", "0.59005576", "0.5888179", "0.5888179", "0.5888179", "0.5888179", "0.58705187", "0.58636767", "0.5862385", "0.5862183", "0.5862183", "0.5862183", "0.5862183", "0.5862183", "0.5862183", "0.5862183", "0.58525527", "0.58471906", "0.5845746", "0.58370185", "0.58324045", "0.5831436", "0.5828061", "0.5827184", "0.5827184", "0.58205706", "0.5813581", "0.5813581", "0.5809684", "0.5809684", "0.5809684", "0.5809684", "0.5809684", "0.5809684", "0.5802686", "0.58016807", "0.57931566", "0.57724303", "0.57724303", "0.57724303", "0.57724303", "0.57724303", "0.57724303", "0.57724303", "0.57724303", "0.57724303", "0.57724303", "0.5757861", "0.575781", "0.5756826", "0.5755341", "0.57532394", "0.5749995", "0.57188797", "0.5716756", "0.5716756", "0.5716756", "0.5716756" ]
0.0
-1
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same
function inspect () { if (!this.isValid()) { return 'moment.invalid(/* ' + this._i + ' */)'; } var func = 'moment'; var zone = ''; if (!this.isLocal()) { func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; zone = 'Z'; } var prefix = '[' + func + '("]'; var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY'; var datetime = '-MM-DD[T]HH:mm:ss.SSS'; var suffix = zone + '[")]'; return this.format(prefix + year + datetime + suffix); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inspect(){if(!this.isValid()){return'moment.invalid(/* '+this._i+' */)';}var func='moment';var zone='';if(!this.isLocal()){func=this.utcOffset()===0?'moment.utc':'moment.parseZone';zone='Z';}var prefix='['+func+'(\"]';var year=0<=this.year()&&this.year()<=9999?'YYYY':'YYYYYY';var datetime='-MM-DD[T]HH:mm:ss.SSS';var suffix=zone+'[\")]';return this.format(prefix+year+datetime+suffix);}", "function inspect(){if(!this.isValid()){return'moment.invalid(/* '+this._i+' */)';}var func='moment';var zone='';if(!this.isLocal()){func=this.utcOffset()===0?'moment.utc':'moment.parseZone';zone='Z';}var prefix='['+func+'(\"]';var year=0<=this.year()&&this.year()<=9999?'YYYY':'YYYYYY';var datetime='-MM-DD[T]HH:mm:ss.SSS';var suffix=zone+'[\")]';return this.format(prefix+year+datetime+suffix);}", "function inspect(){if(!this.isValid()){return 'moment.invalid(/* ' + this._i + ' */)';}var func='moment';var zone='';if(!this.isLocal()){func = this.utcOffset() === 0?'moment.utc':'moment.parseZone';zone = 'Z';}var prefix='[' + func + '(\"]';var year=0 <= this.year() && this.year() <= 9999?'YYYY':'YYYYYY';var datetime='-MM-DD[T]HH:mm:ss.SSS';var suffix=zone + '[\")]';return this.format(prefix + year + datetime + suffix);}", "function inspect () {\n\tif (!this.isValid()) {\n\t\treturn 'moment.invalid(/* ' + this._i + ' */)';\n\t}\n\tvar func = 'moment';\n\tvar zone = '';\n\tif (!this.isLocal()) {\n\t\tfunc = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t\tzone = 'Z';\n\t}\n\tvar prefix = '[' + func + '(\"]';\n\tvar year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\tvar datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\tvar suffix = zone + '[\")]';\n\n\treturn this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\t\n\t return this.format(prefix + year + datetime + suffix);\n\t }", "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\t\n\t return this.format(prefix + year + datetime + suffix);\n\t }", "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\t\n\t return this.format(prefix + year + datetime + suffix);\n\t }", "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\t\n\t return this.format(prefix + year + datetime + suffix);\n\t }", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\n\t return this.format(prefix + year + datetime + suffix);\n\t }", "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\n\t return this.format(prefix + year + datetime + suffix);\n\t }", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}" ]
[ "0.7135904", "0.7135904", "0.7119796", "0.70928735", "0.70805424", "0.70805424", "0.70805424", "0.70805424", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.70532155", "0.70532155", "0.7049166", "0.7049166" ]
0.0
-1
If passed a locale key, it will set the locale for this instance. Otherwise, it will return the locale configuration variables for this instance.
function locale (key) { var newLocaleData; if (key === undefined) { return this._locale._abbr; } else { newLocaleData = getLocale(key); if (newLocaleData != null) { this._locale = newLocaleData; } return this; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function locale(key){var newLocaleData;if(key===undefined){return this._locale._abbr;}else{newLocaleData=getLocale(key);if(newLocaleData!=null){this._locale=newLocaleData;}return this;}}", "function locale(key){var newLocaleData;if(key===undefined){return this._locale._abbr;}else{newLocaleData=getLocale(key);if(newLocaleData!=null){this._locale=newLocaleData;}return this;}}", "function locale(key){var newLocaleData;if(key === undefined){return this._locale._abbr;}else {newLocaleData = getLocale(key);if(newLocaleData != null){this._locale = newLocaleData;}return this;}}", "function locale(key){var newLocaleData;if(key===undefined){return this._locale._abbr;}else{newLocaleData=locale_locales__getLocale(key);if(newLocaleData!=null){this._locale=newLocaleData;}return this;}}", "function locale(key){var newLocaleData;if(key===undefined){return this._locale._abbr;}else{newLocaleData=locale_locales__getLocale(key);if(newLocaleData!=null){this._locale=newLocaleData;}return this;}}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}" ]
[ "0.7287264", "0.7287264", "0.7233862", "0.7206993", "0.7206993", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703" ]
0.0
-1
actual modulo handles negative numbers (for dates before 1970):
function mod$1(dividend, divisor) { return (dividend % divisor + divisor) % divisor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mod (x, y) {return x < 0? y - (-x % y) : x % y;}", "function testRemainder_17() {\n assertEquals(-0, -0 % Number.MAX_VALUE);\n}", "function moduloWithNegativeZeroDividend(a, b, c)\n{\n var temp = a * b;\n return temp % c;\n}", "function modulo(dividend, divisor)\n{\n var epsilon = divisor / 10000;\n var remainder = dividend % divisor;\n\n if (Math.abs(remainder - divisor) < epsilon || Math.abs(remainder) < epsilon) {\n remainder = 0;\n }\n\n return remainder;\n}", "function modulo(dividend, divisor)\n{\n var epsilon = divisor / 10000;\n var remainder = dividend % divisor;\n\n if (Math.abs(remainder - divisor) < epsilon || Math.abs(remainder) < epsilon) {\n remainder = 0;\n }\n\n return remainder;\n}", "function modulo(dividend, divisor)\n{\n var epsilon = divisor / 10000;\n var remainder = dividend % divisor;\n\n if (Math.abs(remainder - divisor) < epsilon || Math.abs(remainder) < epsilon) {\n remainder = 0;\n }\n\n return remainder;\n}", "function positiveMod(quotient, divisor) {\n var regularMod = quotient % divisor;\n return regularMod < 0 ? regularMod + Math.abs(divisor) : regularMod; \n}", "function modulo(dividend, divisor) {\n var epsilon = divisor / 10000;\n var remainder = dividend % divisor;\n\n if (Math.abs(remainder - divisor) < epsilon || Math.abs(remainder) < epsilon) {\n remainder = 0;\n }\n\n return remainder;\n}", "function safe_mod(a, b) {\n if (b === 0) {\n return 0\n }\n\n return a % b\n}", "_mod(val) {\n if (this.pillar === false) return val\n return (val + this.largezero) % this.width\n }", "function mod( a, b ){ let v = a % b; return ( v < 0 )? b+v : v; }", "function mod(v, d) { return ((v % d) + d) % d; }", "function __Mod(a, b)\n{\n return a - (b * Math.floor(a / b));\n}", "function fixedModulus(a, b) {\n return ((a % b) + b) % b;\n}", "function mod(a, b) {\n\t return a - (b * Math.floor(a / b));\n\t}", "function mod(a, b) {\n\t return a - (b * Math.floor(a / b));\n\t}", "function mod(a, b) {\n\t return a - (b * Math.floor(a / b));\n\t}", "function mod(a, b){\r\n return a - (b * Math.floor(a / b));\r\n}", "function moduloWithNegativeZeroDivisor(a, b, c)\n{\n var temp = a * b;\n return c % temp;\n}", "function mod(a, b)\n{\n return a - (b * Math.floor(a / b));\n}", "function modulo (x,y){\nif( x< y){\n\treturn x;\n }\n\twhile(x >=0){\n x= x-y;\n }\n return y+x;\n\t}", "function mathModulo(n, d) {\n return ((n % d) + d) % d;\n}", "function caml_mod(x,y) {\n if (y == 0) caml_raise_zero_divide ();\n return x%y;\n}", "function mod(a, b) {\n return a - (b * Math.floor(a / b));\n}", "function mod(a, b) {\n return a - (b * Math.floor(a / b));\n}", "function mod(a, b) {\n return a - (b * Math.floor(a / b));\n}", "function mod(a, b) {\n return a - (b * Math.floor(a / b));\n}", "function mod(a, b) {\n return a - (b * Math.floor(a / b));\n}", "function mod(a, b) {\n return a - (b * Math.floor(a / b));\n}", "function mod(a, b){return ((a%b)+b)%b;}", "function mod(a, b) {\n\n return a - (b * Math.floor(a / b));\n\n}", "function mod$1(dividend,divisor){return (dividend % divisor + divisor) % divisor;}", "function evansMod(i, mod) {\n while (i < 0) {\n i += mod;\n }\n return i % mod;\n}", "function moduloWithUnusedNegativeZeroDividend(a, b, c)\n{\n var temp = a * b;\n return (temp % c) | 0;\n}", "function mod(dividend, divisor) {\n let value = dividend % divisor;\n if (value < 0) value += divisor;\n return value;\n }", "_mod(val) {\r\n if (this.pillar === false) return val\r\n return (val + this.largezero) % this.grid.length\r\n }", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function sc_modulo(x, y) {\n var remainder = x % y;\n // if they don't have the same sign\n if ((remainder * y) < 0)\n\treturn remainder + y;\n else\n\treturn remainder;\n}", "function remainder(x, y) {\nreturn x%y;\n}", "function fmod(a, n) {\n\treturn a - n * Math.floor(a / n);\n}", "function remainder(x, y) {\n return x % y;\n }", "function modnum(duration,num,sub){\n\n if(num - sub < 0){\n\treturn duration + (num - sub)%duration;\n }\n else{\n\treturn (num - sub)%duration;\n }\n \n}", "function goodMod(a, b)\n{\n return (b + (a%b)) % b;\n}", "remainder(seconds) {\n return (this.timestamp / (seconds * 1000)) % 1;\n }", "function Modulo(lastNum, secondToLastNum)\n{\n\n // Initialize result\n let result = 0;\n\n // calculating mod of b with a to make\n // b like 0 <= b < a\n for (let i = 0; i < secondToLastNum.length; i++)\n result = (result * 10 + secondToLastNum[i] - '0') % lastNum;\n\n return result; // return modulo\n}", "function modNoBug(num,den){\n\t\treturn ( (num % den ) + den ) % den;\n\t}", "function remainder(x, y) {\n return x % y;\n}", "function remainder(x, y) {\n var z = x/y\n if (z == 1){\n return 0\n } else {\n return x;\n }\n}", "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "function remainder(n, d) {\n return n % d;\n}", "function mod(v, d) {\n var out = v % d;\n return out < 0 ? out + d : out;\n}", "function mod (num, m) { return ((num % m) + m) % m; }", "function mod (num, m) { return ((num % m) + m) % m; }", "function mod (num, m) { return ((num % m) + m) % m; }", "function amod(a, b) {\n\t return mod(a - 1, b) + 1;\n\t}", "function mod(v, d) {\n var out = v % d;\n return out < 0 ? out + d : out;\n}", "function remainder(x,y){\n return x%y;\n}", "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "function sc_remainder(x, y) {\n return x % y;\n}", "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "function modulus (x, y) {\n\treturn x % y;\n}", "static monthMod(month) {\n return month % 12\n }", "function mod(x, n) {\n const m = x % n;\n return m + (m && x * n < 0 ? n : 0); // add n when m is not 0 and x and n have different signs\n}", "function gmod(n,m){ return ((n%m)+m)%m; }", "function mod$1(dividend, divisor) {\n\t return (dividend % divisor + divisor) % divisor;\n\t }", "function mod(n,m){\n n = n%m;\n if(n<0) n+=m;\n return n;\n}", "function mod(dividend, divisor) {\r\n return (dividend % divisor + divisor) % divisor;\r\n }", "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "function mod$1(dividend, divisor) {\n\t return ((dividend % divisor) + divisor) % divisor;\n\t }", "function mod$1(dividend, divisor) {\n\t return ((dividend % divisor) + divisor) % divisor;\n\t }", "function mod$1(dividend, divisor) {\n\t return ((dividend % divisor) + divisor) % divisor;\n\t }", "function modul(x=null, y=null){\n\treturn x % y;\n}", "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n}", "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n}", "function isOddWithoutModulo(num) {\n // your code here\n if(num === 0) {\n return false;\n }\n // gets rid of negative signs\n num = Math.abs(num);\n\n while(num >= 2) {\n num -= 2;\n }\n if(num === 1) {\n return true;\n } else {\n return false;\n }\n }", "function mod(x, range) {\n if (x < range) return x;\n if (x >= range) return Math.abs(range - x);\n}", "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n}", "function mod(a, b) {\n\treturn (a % b + b) % b\n}", "function mod(a, b) {\n return (a % b + b) % b\n}", "function amod(a, b)\n{\n return mod(a - 1, b) + 1;\n}", "function amod(a, b) {\n return mod(a - 1, b) + 1;\n}", "function amod(a, b) {\n return mod(a - 1, b) + 1;\n}", "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "function reminderOf(number, number2){\n console.log(number % number2);\n}", "function resteDiv(a, b) {\n //% modulo divise a par b et donne le reste\n return a % b;\n}", "function caml_int64_mod (x, y)\n{\n if (caml_int64_is_zero (y)) caml_raise_zero_divide ();\n var sign = x[3] ^ y[3];\n if (x[3] & 0x8000) x = caml_int64_neg(x);\n if (y[3] & 0x8000) y = caml_int64_neg(y);\n var r = caml_int64_udivmod(x, y)[2];\n if (sign & 0x8000) r = caml_int64_neg(r);\n return r;\n}", "function mod(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n}" ]
[ "0.7011867", "0.6988145", "0.674535", "0.6723566", "0.6723566", "0.6723566", "0.6701297", "0.6668326", "0.6645316", "0.66428584", "0.66218877", "0.6618685", "0.6583922", "0.6566572", "0.6554226", "0.6554226", "0.6554226", "0.6545889", "0.6528715", "0.6494052", "0.6486551", "0.6482626", "0.64558953", "0.6443063", "0.6443063", "0.6443063", "0.6443063", "0.6443063", "0.6443063", "0.6435337", "0.64278626", "0.64248985", "0.64121133", "0.6391965", "0.63909525", "0.637608", "0.6366594", "0.6366594", "0.6366594", "0.6366594", "0.6366594", "0.6366594", "0.6366594", "0.6366594", "0.6366594", "0.63576144", "0.6356696", "0.6345408", "0.6345255", "0.63403577", "0.63368165", "0.62844825", "0.6255996", "0.62533414", "0.62035054", "0.6168977", "0.6165491", "0.61647624", "0.6160082", "0.6155802", "0.6155802", "0.6155802", "0.61533296", "0.614115", "0.61371017", "0.61349654", "0.6123179", "0.6107205", "0.6103875", "0.6101324", "0.60930747", "0.60916936", "0.60890496", "0.6072139", "0.6071133", "0.6070546", "0.6070546", "0.6066303", "0.6066303", "0.6066303", "0.6064576", "0.6056001", "0.6056001", "0.60531497", "0.6046982", "0.60454774", "0.60391176", "0.603568", "0.60246354", "0.6021277", "0.6021277", "0.60135454", "0.60135454", "0.60135454", "0.60135454", "0.60135454", "0.60135454", "0.6012473", "0.60043025", "0.6002288", "0.6000981" ]
0.0
-1
() (5) (fmt, 5) (fmt) (true) (true, 5) (true, fmt, 5) (true, fmt)
function listWeekdaysImpl (localeSorted, format, index, field) { if (typeof localeSorted === 'boolean') { if (isNumber(format)) { index = format; format = undefined; } format = format || ''; } else { format = localeSorted; index = format; localeSorted = false; if (isNumber(format)) { index = format; format = undefined; } format = format || ''; } var locale = getLocale(), shift = localeSorted ? locale._week.dow : 0; if (index != null) { return get$1(format, (index + shift) % 7, field, 'day'); } var i; var out = []; for (i = 0; i < 7; i++) { out[i] = get$1(format, (i + shift) % 7, field, 'day'); } return out; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function foo5(a /* : number */, a2 /* : number */) /* : string => boolean => Foo */ {\n return s => b => ({\n moom: b,\n soup: s,\n nmb: a + a2 + 1\n })\n}", "function P$4(t){return t?[l$b(t[0]),l$b(t[1]),l$b(t[2]),l$b(t[3]),l$b(t[4]),l$b(t[5])]:[l$b(),l$b(),l$b(),l$b(),l$b(),l$b()]}", "function n$1(n,t){return n?t?4:3:t?3:2}", "function foo4(a /* : number */) /* : string => boolean => Foo */ {\n return s => b => ({\n moom: b,\n soup: s,\n nmb: a + 1\n })\n}", "function te(){var e;return Y(\"(\"),e=ge(),Y(\")\"),e}", "function cb_true_2(num) {\n print(\"element \" + num); // B3 B6 B9 B15 B18 B21 B27 B30 B33\n return true; // B4 B7 B10 B16 B19 B22 B28 B31 B34\n} // B5 B8 B11 B17 B20 B23 B29 B32 B35", "function P(a,c){return b.fn.format.call(a,c)}", "function example2 () {\n\n let sum = (a, b) => a + b\n \n function strParse (strings, ...params) {\n console.log(strings);\n console.log(strings.raw);\n console.log(params);\n }\n\n let a = 'test'\n let b = 13\n\n let s = strParse`Some ${a}\n string with another param ${b}\n and sum of 5 and 4, that is ${sum(5,4)}`\n}", "function process(tpl,state) {\n\tconst t = tpl.t, v = tpl.v, r = state.r;\n\tconst d = state.depth;\n\t// reset WS every time\n\tconst ws = state.ws;\n\tconst hasTag = state.hasTag;\n\t//console.log(t,v,ws,hasTag);\n\tstate.ws = false;\n\tstate.hasTag = 0;\n\t//console.log(t,v,tpl.o);\n\tif(t == 1) {\n\t\tif(v == 1) {\n\t\t\tconst last = r.lastChild();\n\t\t\tif(last && last.t === 2 && last.v == 2) {\n\t\t\t\t// 1. mark call\n\t\t\t\tstate.call[d] = true;\n\t\t\t\t//console.log(\"opencall\",d,_strip(r.peek()));\n\t\t\t\t// nest entire tree\n\t\t\t\t// 2. push comma\n\t\t\t\t// TODO add original position to comma\n\t\t\t\tr.mark(\"call\"+d).push(comma());\n\t\t\t} else {\n\t\t\t\tconst cur = r.peek();\n\t\t\t\tif(v == 1 && cur.t !== 6 && cur.t !== 10 && !(cur.t == 4 && (cur.v < 300 || cur.v > 2000))) {\n\t\t\t\t\t//console.log(cur.t,cur.v,cur.o);\n\t\t\t\t\tr.push(seq());\n\t\t\t\t}\n\t\t\t\tr.open(tpl);\n\t\t\t}\n\t\t} else if(v == 3 && state.xml) {\n\t\t\tr.open(tpl);\n\t\t} else {\n\t\t\tr.open(tpl);\n\t\t}\n\t} else if(t == 2) {\n\t\t// FIXME treat all infix-ops in same depth, not just on close\n\t\tstate.r.push(tpl).close();\n\t\tconst cd = d - 1;\n\t\tif(state.call[cd]) {\n\t\t\t// $(x)(2) => call($(x),2)\n\t\t\tstate.call[cd] = false;\n\t\t\t//console.log(\"call\",r.peek());\n\t\t\tr.unmark(\"call\"+cd).insertBefore(openParen()).openBefore({t:6,v:\"call\"}).close();\n\t\t}\n\t\t/*\n\t\t* 1 * 2 + 3\n\t\t* mult(1,2) + 3\n\t\t* 1 + 2 * 3\n\t\t* add(1,2) * 3 => pre, so nest in last\n\t\t* add(1,2 * 3))\n\t\t* add(1,mult(2,3)) => pre, so next in last (we're in subs, so openBefore )\n\t\t */\n\t\tif(state.infix[d]) {\n\t\t\t//console.log(\"peek-close\",_strip(r.peek()));\n\t\t\t// mark close so we can return to it\n\t\t\tr.mark(\"close\");\n\t\t\thandleInfix(state,d);\n\t\t\tr.unmark(\"close\");\n\t\t\tstate.infix[d] = null;\n\t\t}\n\t} else if(t == 4){\n\t\tif(v == 802 || v == 904 || v == 2005) {\n\t\t\tconst last = r.peek();\n\t\t\tconst test = last && (last.o || last.v);\n\t\t\tconst isEmpty = x => x && Triply.nextSibling(Triply.firstChild(x)) == Triply.lastChild(x);\n\t\t\tif(test && ((simpleTypes.includes(test) && isEmpty(last)) || complexTypes.includes(test) || kinds.includes(test))) {\n\t\t\t\ttpl.o = opMap[ v + 3000];\n\t\t\t\tstate.r.insertAfter(closeParen()).movePreviousSibling().insertBefore(openParen()).openBefore(tpl);\n\t\t\t\treturn state;\n\t\t\t} else if(last.t == 1 && last.v == 1) {\n\t\t\t\tconst prev = r.previous();\n\t\t\t\tconst test = prev && prev.o;\n\t\t\t\tif(test && complexTypes.includes(test)) {\n\t\t\t\t\tif(test == \"function\") {\n\t\t\t\t\t\t// convert function(*) to function((...),item()*)\n\t\t\t\t\t\tstate.r.push(seq()).open(openParen())\n\t\t\t\t\t\t\t.push({t:4,o:\"rest-params\"}).open(openParen()).push(closeParen()).close()\n\t\t\t\t\t\t\t.push(closeParen()).close().push(closeParen()).close()\n\t\t\t\t\t\t\t.push({t:4,o:\"any\"}).open(openParen()).push({t:4,o:\"item\"}).open(openParen()).push(closeParen()).close()\n\t\t\t\t\t\t\t.push(closeParen()).close();\n\t\t\t\t\t}\n\t\t\t\t\treturn state;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(v == 505 && hasTag) {\n\t\t\t// TODO replace with tag and flag XML at depth\n\t\t\tr.pop();\n\t\t\tconst qname = state.qname;\n\t\t\tstate.qname = null;\n\t\t\tif(hasTag == 1) {\n\t\t\t\tr.push(openTag(qname,state.attrs));\n\t\t\t\tstate.xml++;\n\t\t\t\tstate.attrs = [];\n\t\t\t} else if(hasTag == 3 || hasTag == 6) {\n\t\t\t\tr.push(closeTag(qname));//.close();\n\t\t\t}\n\t\t\tstate.infix[d]--;\n\t\t\treturn state;\n\t\t} else if(v == 1901) {\n\t\t\tconst last = r.peek();\n\t\t\tif(last.t == 4 && last.v == 507) {\n\t\t\t\t// close tag\n\t\t\t\tif(hasTag) {\n\t\t\t\t\tconst qname = state.qname;\n\t\t\t\t\tr.pop();\n\t\t\t\t\tr.push(openTag(qname,state.attrs));\n\t\t\t\t\tr.push(tpl);\n\t\t\t\t\tstate.attrs = [];\n\t\t\t\t}\n\t\t\t\tstate.hasTag = hasTag + 2;\n\t\t\t\treturn state;\n\t\t\t}\n\t\t} else if(v == 2600) {\n\t\t\tconst prev = r.previousSibling();\n\t\t\tif(prev && prev.t == 1 && prev.v == 3) {\n\t\t\t\tprev.v += 2000;\n\t\t\t}\n\t\t\tconst last = r.peek(1);\n\t\t\tr.pop();\n\t\t\ttpl.o = last.v;\n\t\t} else if(v == 509 && hasTag == 5) {\n\t\t\t// NOTE treat attrs as pairs\n\t\t\tstate.hasTag = hasTag + 1;\n\t\t\treturn state;\n\t\t}\n\t\tif(v == 119 || v == 2005) {\n\t\t\tif(opMap.hasOwnProperty(v)) tpl.o = opMap[v];\n\t\t\tr.push(tpl).open(openParen()).push(closeParen()).close();\n\t\t} else if(v >= 300 && v < 2000) {\n\t\t\t// NOTE always add prefix to distinguish between infix operators and equivalent functions\n\t\t\tconst last = r.peek();\n\t\t\tconst unaryOp = (v == 801 || v == 802) && (!last || !last.t || last.t == 1 || last.t == 4);\n\t\t\tconst v1 = unaryOp ? v + 900 : v;\n\t\t\ttpl.v = v1;\n\t\t\tconst mappedOp = opMap.hasOwnProperty(v1) ? opMap[v1] : \"n:\"+tpl.o;\n\t\t\ttpl.o = mappedOp;\n\t\t\tr.push(tpl);\n\t\t\tif(!state.infix[d]) state.infix[d] = 0;\n\t\t\tr.mark(d+\":\"+state.infix[d]++);\n\t\t} else {\n\t\t\tr.push(tpl);\n\t\t}\n\t} else if(t == 6) {\n\t\tif(/^\\$/.test(v)) {\n\t\t\t// var\n\t\t\ttpl.v = v.replace(/^\\$/,\"\");\n\t\t\tif(/[0-9]/.test(tpl.v)) tpl.t = 8;\n\t\t\tr.push({t:10,v:\"$\",o:\"$\"}).open(openParen()).push(tpl).push(closeParen()).close();\n\t\t} else {\n\t\t\tconst last = r.peek();\n\t\t\tif(last.t == 4 && last.v == 507 && !ws) {\n\t\t\t\tstate.qname = v;\n\t\t\t\tstate.hasTag = hasTag + 1;\n\t\t\t\treturn state;\n\t\t\t} else if(hasTag == 4) {\n\t\t\t\tstate.hasTag = hasTag + 1;\n\t\t\t\tif(!state.attrs) state.attrs = [];\n\t\t\t\tstate.attrs.push([v]);\n\t\t\t} else {\n\t\t\t\tr.push(tpl);\n\t\t\t}\n\t\t}\n\t} else if(t === 0) {\n\t\tr.push(tpl);\n\t\tif(state.infix[d]) {\n\t\t\t// mark close so we can return to it\n\t\t\tr.mark(\"EOS\");\n\t\t\thandleInfix(state,d);\n\t\t\tr.unmark(\"EOS\");\n\t\t\tstate.infix[d] = null;\n\t\t}\n\t} else if(t === 17){\n\t\t// mark WS\n\t\tstate.ws = true;\n\t\tif(hasTag) state.hasTag = 4;\n\t} else {\n\t\tif(hasTag == 6) {\n\t\t\tstate.attrs.lastItem.push(v);\n\t\t\tstate.hasTag = 1;\n\t\t} else {\n\t\t\tr.push(tpl);\n\t\t}\n\t}\n\tstate.depth = tpl.d;\n\treturn state;\n}", "function show() {\n return x => x + arguments[0];\n}", "function assert(count, name, test){\n if(!count || !Array.isArray(count) || count.length !== 2) {\n count = [0, '*'];\n } else {\n count[1]++;\n }\n\n var pass = 'false';\n try {\n if (test()) {\n pass = ' true';\n count[0]++;\n }\n } catch(e) {}\n console.log(' ' + (count[1] + ') ').slice(0,5) + pass + ' : ' + name);\n}", "function foo5(f) { f(1, 2, 3, 4); }", "function printer(value){\r\n return value; // => example of a function that can optionally take arguments \r\n}", "function tb(a, b) { var d, e; if (1 === b.length && c(b[0]) && (b = b[0]), !b.length) return sb(); for (d = b[0], e = 1; e < b.length; ++e) b[e].isValid() && !b[e][a](d) || (d = b[e]); return d }", "function assert(count, name, test){\n if(!count || !Array.isArray(count) || count.length !== 2) { \n count = [0, '*']; \n } else {\n count[1]++;\n }\n \n var pass = 'false';\n var errMsg = null;\n try {\n if (test()) { \n pass = ' true';\n count[0]++;\n } \n } catch(e) {\n errMsg = e;\n } \n console.log(' ' + (count[1] + ') ').slice(0,5) + pass + ' : ' + name);\n if (errMsg !== null) {\n console.log(' ' + errMsg + '\\n');\n }\n}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function X(a){for(var b,c=[],d=/\\[([^\\]]*)\\]|\\(([^\\)]*)\\)|(LT|(\\w)\\4*o?)|([^\\w\\[\\(]+)/g;b=d.exec(a);)b[1]?// a literal string inside [ ... ]\nc.push(b[1]):b[2]?// non-zero formatting inside ( ... )\nc.push({maybe:X(b[2])}):b[3]?// a formatting token\nc.push({token:b[3]}):b[5]&&// an unenclosed literal string\nc.push(b[5]);return c}", "function genTernaryExp(el){return el.once?genOnce(el):genElement(el);}", "function five(string){\n console.log(string);\n console.log(string);\n console.log(string);\n console.log(string);\n console.log(string);\n}", "prettyPrintCallback( cb ) {\n // get rid of \"function gen\" and start with parenthesis\n // const shortendCB = cb.toString().slice(9)\n const cbSplit = cb.toString().split('\\n')\n const cbTrim = cbSplit.slice( 3, -2 )\n const cbTabbed = cbTrim.map( v => ' ' + v ) \n \n return cbTabbed.join('\\n')\n }", "function\n// a\nf\n// b\n(\n// c\nx\n// d\n,\n// e\ny\n// f\n)\n// g\n{\n// h\n;\n// i\n;\n// j\n}", "function xt(t,e){return null===t||!1===t||void 0===t?S[e]:(\"number\"===typeof t&&(t=String(t)),t=i.format.from(t),t=T.toStepping(t),!1===t||isNaN(t)?S[e]:t)}", "function tF() {\n \n // 0\n let z = 0;\n let zVal = z ? 'is truthy': 'is falsey';\n console.log(`0 ${zVal} because 0 is a false value`);\n // \"zero\";\n let zS = \"zero\";\n let zSVal = zS ? 'is truthy': 'is falsey';\n console.log(`\"zero\" ${zSVal} because it is a filled string`);\n // const zero = 20;\n const zero = 20;\n let zeroVal = zero ? 'is truthy': 'is falsey';\n console.log(`20 ${zeroVal} because it is a number despite the variable name being zero`);\n // null\n let n = null;\n let nVal = n ? 'is truthy': 'is falsey';\n console.log(`null ${nVal} because it is lacks any value at all`);\n // \"0\"\n let zStrNum = \"0\";\n let zStrNumVal = zStrNum ? 'is truthy': 'is falsey';\n console.log(`\"0\" ${zStrNumVal} because it is a string that contains a character`);\n // !\"\"\n let excl = !\"\";\n let exclVal = excl? 'is truthy': 'is falsey';\n console.log(`!\"\" ${exclVal} because the \"!\" reverts the false value of the empty string to be true`);\n // {}\n let brack = {};\n let brackVal = brack? 'is truthy': 'is falsey';\n console.log(`{} ${brackVal} because JavaScript recognizes it as truthy (honestly i dont understand why it is this way, it seems it should be falsey since no value is contained)`);\n // () => {console.log(\"hello TEKcamp!\");\n let fun = () => {console.log(\"hello TEKcamp!\")};\n let funVal = fun? 'is truthy': 'is falsey';\n console.log(`() => {console.log(\"hello TEKcamp!\")} ${funVal} because the function contains contains a return (console)`);\n // 125\n let onetwofive = 125;\n let otfVal = onetwofive? 'is truthy': 'is falsey';\n console.log(`125 ${otfVal} because it is a number and numbers other than 0 are truthy`);\n // undefined\n let und = undefined;\n let undVal = und? 'is truthy': 'is falsey';\n console.log(`undefined ${undVal} because it doesnt recognize a value being assigned`);\n // \"\"\n let empt = \"\";\n let emptVal = empt? 'is truthy': 'is falsey';\n console.log(`\"\" ${emptVal} because it it is an empty string`);\n }", "function it(t, n) {\n return t + \" \" + n + (1 === t ? \"\" : \"s\");\n}", "function t$i(t,...n){let o=\"\";for(let r=0;r<n.length;r++)o+=t[r]+n[r];return o+=t[t.length-1],o}", "function t(e){if(e)return n(e)}", "function callString(f) {\n return '(' + f.toString() + ')()';\n}", "function n(n,t){return n?t?4:3:t?3:2}", "function parseExp5(state) {\n return lift(state)\n .then(parseExp6)\n .then(opt(alt([ parseExp5$times, parseExp5$div ])));\n}", "function genTernaryExp(el){return altGen?altGen(el,state):el.once?genOnce(el,state):genElement(el,state);}", "function genTernaryExp(el){return altGen?altGen(el,state):el.once?genOnce(el,state):genElement(el,state);}", "function foo4(f) { f(1, 2, 3); }", "function tagFunction(strings, ...values) {\n let name = values[0];\n let age = values[1];\n if (age > 80) {\n return `${strings[0]}${values[0]}`;\n }\n return `${strings[0]}${name}${strings[1]}${age}${strings[2]}`;\n}", "function test_one(x,y) {\n var sink = x;\n\n//CHECK-NEXT: %0 = BinaryOperatorInst '+', %x, 2 : number\n//CHECK-NEXT: %1 = CallInst %x, undefined : undefined, %0 : string|number\n sink(x + 2);\n\n//CHECK-NEXT: %2 = CallInst %x, undefined : undefined, 4 : number\n sink(2 + 2);\n\n//CHECK-NEXT: %3 = BinaryOperatorInst '*', %x, 2 : number\n//CHECK-NEXT: %4 = BinaryOperatorInst '*', %x, 2 : number\n//CHECK-NEXT: %5 = BinaryOperatorInst '+', %3 : number, %4 : number\n//CHECK-NEXT: %6 = CallInst %x, undefined : undefined, %5 : number\n sink(x * 2 + x * 2);\n\n//CHECK-NEXT: %7 = AsInt32Inst %x\n//CHECK-NEXT: %8 = AsInt32Inst %x\n//CHECK-NEXT: %9 = BinaryOperatorInst '+', %7 : number, %8 : number\n//CHECK-NEXT: %10 = CallInst %x, undefined : undefined, %9 : number\n sink((x|0) + (x|0));\n\n//CHECK-NEXT: %11 = CallInst %x, undefined : undefined, \"hibye\" : string\n sink(\"hi\" + \"bye\");\n\n//CHECK-NEXT: %12 = BinaryOperatorInst '+', %x, %y\n//CHECK-NEXT: %13 = CallInst %x, undefined : undefined, %12 : string|number\n sink(x + y);\n\n//CHECK-NEXT: %14 = BinaryOperatorInst '+', \"hi\" : string, %y\n//CHECK-NEXT: %15 = CallInst %x, undefined : undefined, %14 : string\n sink(\"hi\" + y);\n\n//CHECK-NEXT: %16 = CallInst %x, undefined : undefined, 0 : number\n sink(null + null);\n\n//CHECK-NEXT: %17 = AllocObjectInst 0 : number, empty\n//CHECK-NEXT: %18 = AllocObjectInst 0 : number, empty\n//CHECK-NEXT: %19 = BinaryOperatorInst '+', %17 : object, %18 : object\n//CHECK-NEXT: %20 = CallInst %x, undefined : undefined, %19 : string|number\n sink({} + {});\n\n//CHECK-NEXT: %21 = CallInst %x, undefined : undefined, NaN : number\n sink(undefined + undefined);\n//CHECK-NEXT: %22 = ReturnInst undefined : undefined\n}", "function one(a, onecb) {\n console.log(a);\n //Since it is a function\n onecb(a+1,(c,threecb)=>{\n console.log(c);\n threecb(c+1,(e)=>{\n console.log(e);\n console.log(a)\n console.log(c)\n });\n });\n}", "function TStylingTupleSummary() {}", "static fStr3(x) {\nreturn this.fStr(x, 3);\n}", "static fStr3(x) {\nreturn this.fStr(x, 3);\n}", "function Format() {}", "function Format() {}", "function f11(str) {\n const stack = [];\n for (let i = 0; i < str.length; i++) {\n if (str[i] === '(') stack.push(str[i]);\n else if (str[i] === ')') stack.pop();\n }\n return !stack.length;\n}", "function testChaining(val) {\n if (val < 5) return \"Tiny\";\n else if (val < 10) return \"Small\";\n else if (val < 15) return \"Medium\";\n else if (val < 20) return \"Large\";\n else return \"Huge\";\n}", "function test (func, input, expected) { console.log(func.name, \"\\n got:\", applyMaybeCurriedArgs(func, input), \"\\n exp:\", expected) }", "function fifth() {}", "next(num, format) {\n return getOccurrences.call(this, num, format, \"next\")\n }", "function v17(v18,v19) {\n function v23(v24,v25) {\n const v26 = 13.37;\n // v26 = .float\n const v27 = 0;\n // v27 = .integer\n const v28 = 1;\n // v28 = .integer\n const v29 = 13.37;\n // v29 = .float\n const v30 = 0;\n // v30 = .integer\n const v31 = 1;\n // v31 = .integer\n }\n const v33 = [13.37,13.37,13.37,13.37];\n // v33 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v36 = [1337];\n // v36 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v37 = [v36,arguments,arguments,\"65535\",arguments,13.37,13.37,1337,v33,1337];\n // v37 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v40 = v23(\"caller\",v37,...v37);\n // v40 = .unknown\n const v42 = [...v3,1337,-1.7976931348623157e+308];\n // v42 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n for (let v43 = 0; v43 < 1337; v43 = v43 + 1) {\n }\n}", "function i(e, t) {\n return e ? t ? 4 : 3 : t ? 3 : 2;\n }", "function logFive(sequence){\n\n for(var i =0;i<5;i++){\n if(!sequence.next()){\n break;\n \n }\n console.log(sequence.current());\n }\n\n}", "function TStylingTupleSummary(){}", "function TStylingTupleSummary() { }", "function be(t, n) {\n return t + \" \" + n + (1 === t ? \"\" : \"s\");\n}", "function isFive(input) {\n\n}", "function o0(o1,o2,o3)\n{\n try {\no4.o5(o39 === true + \" index:\" + o2 + \" Object:\" + o3);\n}catch(e){}\n try {\nreturn true;\n}catch(e){}\n}", "function a(n,t){0}", "function logFive(sequence) {\n for (var i = 0; i < 5; i++) {\n if (!sequence.next()) {\n break;\n } else {\n console.log(sequence.current());\n }\n }\n}", "function f(n1,n2,n3)\n{\nif (n1>n2 && n1>n3)\n{\n \n if(n2>n3)\n {\n \t document.write(n1 +\",\"+n2 +\",\"+n3 );\n\n }\n else{\n document.write(n1+ \",\"+n3+ \",\"+n2 );\n }\n}\nelse if (n2>n1 && n2>n3)\n{\n\n if(n1>n3)\n {\n \t document.write(n2+ \",\"+n1 +\",\"+n3 );\n\n }\n else\n {\n document.write(n2 +\",\"+n3+ \",\"+n1);\n }\n \n}\nelse if (n3>n1 && n3>n2) \n{\n if(n2>n1)\n {\n \t document.write(n3 +\",\"+n2+ \",\"+n1);\n\n }\n else\n {\n document.write(n3+ \",\"+n1+ \",\"+n2);\n }\n}\n}", "function fourth() {}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function v19(v20,v21,v22) {\n for (let v25 = 0; v25 < 100; v25 = v25 + 3) {\n let v26 = 0;\n function v27(v28,v29,v30,v31,v32) {\n for (let v35 = v26; v35 < 100; v35 = v35 + 1100861557) {\n }\n }\n for (let v39 = 0; v39 < 100; v39 = v39 + 1) {\n const v43 = [NaN,-2987865916,\"flags\"];\n // v43 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"reduce\", \"map\", \"forEach\", \"find\", \"keys\", \"indexOf\", \"copyWithin\", \"flatMap\", \"join\", \"reverse\", \"reduceRight\", \"unshift\", \"entries\", \"slice\", \"pop\", \"filter\", \"some\", \"lastIndexOf\", \"fill\", \"toLocaleString\", \"concat\", \"every\", \"values\", \"flat\", \"findIndex\", \"shift\", \"push\", \"sort\", \"splice\", \"includes\", \"toString\"])\n const v44 = v43.concat();\n // v44 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"reduce\", \"map\", \"forEach\", \"find\", \"keys\", \"indexOf\", \"copyWithin\", \"flatMap\", \"join\", \"reverse\", \"reduceRight\", \"unshift\", \"entries\", \"slice\", \"pop\", \"filter\", \"some\", \"lastIndexOf\", \"fill\", \"toLocaleString\", \"concat\", \"every\", \"values\", \"flat\", \"findIndex\", \"shift\", \"push\", \"sort\", \"splice\", \"includes\", \"toString\"])\n const v45 = v27(v26,v27,v27,v26,v27);\n // v45 = .unknown\n }\n }\n}" ]
[ "0.5453822", "0.5414574", "0.5402059", "0.53024715", "0.5250682", "0.51431453", "0.51302475", "0.50907373", "0.49966303", "0.49958006", "0.4973244", "0.4966433", "0.4916147", "0.4915344", "0.49099034", "0.49097955", "0.49097955", "0.49097955", "0.49097955", "0.49097955", "0.49097955", "0.49097955", "0.49097955", "0.49097955", "0.49097955", "0.49097955", "0.49097955", "0.49097955", "0.49097955", "0.49097955", "0.49097955", "0.48775113", "0.4874439", "0.48733592", "0.48515266", "0.4835626", "0.4829244", "0.48271018", "0.48134854", "0.48125312", "0.48053667", "0.47998875", "0.47889388", "0.47790033", "0.47605464", "0.47605464", "0.4752269", "0.47507638", "0.47499412", "0.4749083", "0.4744679", "0.47342944", "0.47342944", "0.47253126", "0.47253126", "0.4723766", "0.471528", "0.47100917", "0.46924528", "0.46879008", "0.46875155", "0.467781", "0.46768144", "0.4668938", "0.46622708", "0.46537542", "0.46476802", "0.46436182", "0.46414372", "0.46358877", "0.46355182", "0.46354038", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.46287677", "0.4618038" ]
0.0
-1
supports only 2.0style add(1, 's') or add(duration)
function add$1 (input, value) { return addSubtract$1(this, input, value, 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Duration(time) {\n var d = document.createElement('span');\n d.classList.add('duration');\n d.innerText = time;\n return d;\n}", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add(input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function addTwoSeconds(time){\n // Transform time to milliseconds\n var timeInMilliseconds = formattedTimeToMilliseconds(time);\n if (timeInMilliseconds == 0 || isNaN(timeInMilliseconds)){\n return 'ERROR';\n }\n // Add 2000 milliseconds\n var twoSecondsAdded = timeInMilliseconds + 2000;\n // Transform time to formatted time\n return millisecondsToFullTime(twoSecondsAdded);\n}", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "handleDurationChange() {\n this.setState({taskDuration: this.state.taskDuration.add(1, 's')});\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\r\n return duration_add_subtract__addSubtract(this, input, value, 1);\r\n }", "function duration_add_subtract__add (input, value) {\r\n return duration_add_subtract__addSubtract(this, input, value, 1);\r\n }", "setDuration(dur) {\nreturn this.duration = dur;\n}", "function duration_add_subtract__add(input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add(input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add(input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function formatDuration(duration) {\n if (duration < 1000) {\n duration += 'ms';\n } else if (duration > 1000) {\n duration /= 1000;\n duration += 's';\n }\n return duration;\n}", "parseDurationProp(newValue) {\n this.innerDuration = newValue ? newValue : \"2000ms\";\n }", "function add() {\n seconds++;\n if (seconds >= 60) {\n seconds = 0;\n minutes++;\n if (minutes >= 60) {\n minutes = 0;\n hours++;\n }\n }\n h2.textContent = (hours ? (hours > 9 ? hours : \"0\" + hours) : \"00\") + \":\" + (minutes ? (minutes > 9 ? minutes : \"0\" + minutes) : \"00\") + \":\" + (seconds > 9 ? seconds : \"0\" + seconds);\n timer();\n}", "addAttoseconds(value, createNew) {\n return this.addFractionsOfSecond(value, createNew, '_attosecond', '_femtosecond', 'addFemtoseconds');\n }", "function add(a,b) {\n\treturn a + b + new Date().getSeconds();\n}", "function add() {\n seconds++;\n if (seconds >= 60) {\n seconds = 0;\n minutes++;\n if (minutes >= 60) {\n minutes = 0;\n }\n }\n timer.textContent = (minutes ? (minutes > 9 ? minutes : \"0\" + minutes) : \"00\") +\n \":\" + (seconds > 9 ? seconds : \"0\" + seconds);\n startTimer();\n}", "function duration(s) {\n if (typeof(s) == 'number') return s;\n var units = {\n days: { rx:/(\\d+)\\s*d/, mul:86400 },\n hours: { rx:/(\\d+)\\s*h/, mul:3600 },\n minutes: { rx:/(\\d+)\\s*m/, mul:60 },\n seconds: { rx:/(\\d+)\\s*s/, mul:1 }\n };\n var result = 0, unit, match;\n if (typeof(s) == 'string') for (var key in units) {\n unit = units[key];\n match = s.match(unit.rx);\n if (match) result += parseInt(match[1])*unit.mul;\n }\n return result*1000;\n}", "function addOneSec() {\n sec += 1;\n updateTimer();\n waitOneSec();\n}", "function duration_ms(durations) {\n\n durations = durations.toString();\n durations = durations.replace(/ms/g, \"\");\n\n // result\n var duration = 0;\n var ms;\n\n // Is multi durations?\n if (durations.indexOf(\",\") != -1) {\n\n var durationsArray = durations.split(\",\");\n\n for (var i = 0; i < durationsArray.length; i++) {\n\n var val = durationsArray[i];\n\n // Has dot?\n if (val.indexOf(\".\") != -1) {\n\n ms = parseFloat(val).toString().split(\".\")[1].length;\n val = val.replace(\".\", \"\").toString();\n\n if (ms == 2) {\n val = val.replace(/s/g, \"0\");\n } else if (ms == 1) {\n val = val.replace(/s/g, \"00\");\n }\n\n } else {\n val = val.replace(/s/g, \"000\");\n }\n\n duration = parseFloat(duration) + parseFloat(val);\n\n }\n\n return duration;\n\n } else {\n\n // Has dot?\n if (durations.indexOf(\".\") != -1) {\n\n ms = parseFloat(durations).toString().split(\".\")[1].length;\n durations = durations.replace(\".\", \"\").toString();\n\n if (ms == 2) {\n durations = durations.replace(/s/g, \"0\");\n } else if (ms == 1) {\n durations = durations.replace(/s/g, \"00\");\n }\n\n } else {\n durations = durations.replace(/s/g, \"000\");\n }\n\n return durations;\n\n }\n\n }", "function timeAdd(element, start,stop){\n if(typeof(start)!=='number' && typeof(stop)!=='number' || start === stop){\n return;\n }\n start++;\n element.text(start);\n setTimeout(function(){timeAdd(element, start,stop);}, 25);\n}", "function parseDuration(duration) {\n if (!duration) {\n return {second: 1};\n } else if (typeof(duration) == \"string\") {\n var start = 0;\n var isReciprocal = false;\n if (duration.charAt(0) == \"/\") {\n isReciprocal = true;\n start = 1;\n }\n function complete(value) {\n if (isReciprocal)\n value.reciprocal = true;\n return value;\n }\n var type = duration.charAt(duration.length - 1);\n if (/\\d/.test(type)) {\n return complete({milli: Number(type)});\n } else {\n var count;\n if (start == duration.length - 1) {\n count = 1;\n } else {\n count = Number(duration.slice(start, duration.length - 1));\n }\n switch (type) {\n case \"s\":\n return complete({second: count});\n case \"m\":\n return complete({minute: count});\n case \"h\":\n return complete({hour: count});\n default:\n throw new Error(\"Couldn't parse duration \" + duration);\n }\n }\n } else {\n return duration;\n }\n }", "function Seconds() {\r\n}", "function getSecondsTime(duration) {\n if(typeof duration === \"number\") return duration;\n if(typeof duration !== \"string\") return 0;\n\n duration = duration.split(\":\");\n let time = 0;\n\n if(duration.length === 2) {\n time += Number(duration[0]) * 60;\n time += Number(duration[1]);\n } else if(duration.length === 3) {\n time += Number(duration[0]) * 3600;\n time += Number(duration[1]) * 60;\n time += Number(duration[2]);\n }\n\n return time;\n}", "addTime(s){\n if (timer.minutes === 59 && (timer.secondes + s) >= 60){\n timer.hours++\n timer.minutes = 0\n timer.secondes = (timer.secondes + s) - 60\n } else if (timer.secondes + s >= 60){\n timer.minutes++\n timer.secondes = (timer.secondes + s) - 60 \n } else {\n timer.secondes = timer.secondes + s\n }\n }", "set time(value) {}" ]
[ "0.6429438", "0.6106337", "0.6106337", "0.6106337", "0.6106337", "0.6106337", "0.6106337", "0.6106337", "0.6106337", "0.6106337", "0.6106337", "0.6106337", "0.6106337", "0.6082893", "0.6058429", "0.6012984", "0.6012984", "0.60103923", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58925086", "0.58862084", "0.58862084", "0.5884411", "0.5843616", "0.5843616", "0.5843616", "0.58144474", "0.5786891", "0.576428", "0.57608354", "0.5730649", "0.5716046", "0.56493485", "0.5638771", "0.56217736", "0.56157154", "0.56077266", "0.55909795", "0.55882025", "0.55578303", "0.5450182" ]
0.0
-1
supports only 2.0style subtract(1, 's') or subtract(duration)
function subtract$1 (input, value) { return addSubtract$1(this, input, value, -1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract(input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\r\n return duration_add_subtract__addSubtract(this, input, value, -1);\r\n }", "function duration_add_subtract__subtract (input, value) {\r\n return duration_add_subtract__addSubtract(this, input, value, -1);\r\n }", "function duration_add_subtract__subtract(input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract(input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract(input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add(input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\r\n return duration_add_subtract__addSubtract(this, input, value, 1);\r\n }", "function duration_add_subtract__add (input, value) {\r\n return duration_add_subtract__addSubtract(this, input, value, 1);\r\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }" ]
[ "0.7399754", "0.7399754", "0.7399754", "0.7399754", "0.7399754", "0.7399754", "0.7399754", "0.7399754", "0.7399754", "0.7399754", "0.7399754", "0.7399754", "0.73797023", "0.7362792", "0.7362792", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.72674763", "0.72674763", "0.7232514", "0.7232514", "0.7232514", "0.6682415", "0.6682415", "0.6675896", "0.6675896", "0.6675896", "0.6675896", "0.6675896", "0.6675896", "0.6675896", "0.6675896", "0.6675896", "0.6675896", "0.6675896", "0.6675896", "0.66123503", "0.6611645", "0.6611645", "0.658847", "0.658847" ]
0.0
-1
helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(vf=c)),vf._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(vf=c)),vf._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(vf=c)),vf._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(vf=c)),vf._abbr}", "function formatHuman(value) {\n var time = moment(value).fromNow();\n time = time === 'a few seconds ago' ? 'seconds ago' : time;\n return time;\n }", "labelFunction(date) {\n return moment(date).fromNow();\n }", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function humanizeDuration(duration) {\n const months = duration.months();\n const weeks = duration.weeks();\n let days = duration.days();\n const hours = duration.hours();\n const minutes = duration.minutes();\n const seconds = duration.seconds();\n\n // console.log(duration);\n\n const str = [];\n\n if (weeks > 0) {\n const weekTitle = pluralize('week', weeks);\n str.push(`${weeks} ${weekTitle}`);\n }\n\n if (days > 0) {\n if (weeks > 0) days -= 7 * weeks;\n\n const dayTitle = pluralize('day', days);\n str.push(`${days} ${dayTitle}`);\n }\n\n if (hours > 0 && (weeks < 1 && days < 2)) {\n const hourTitle = pluralize('hour', hours);\n str.push(`${hours} ${hourTitle}`);\n }\n\n if (minutes > 0 && (weeks < 1 && days < 1)) {\n const minuteTitle = pluralize('minute', minutes);\n str.push(`${minutes} ${minuteTitle}`);\n }\n\n if (seconds > 0 && (weeks < 1 && hours < 1)) {\n const secondTitle = pluralize('second', seconds);\n str.push(`${seconds} ${secondTitle}`);\n }\n\n return str.join(' ');\n}", "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(qf=c)),qf._abbr}", "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(qf=c)),qf._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\n return a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\n return a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\n return a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function T(a,b,c,d,e){var f;// works with moment-pre-2.8\n// Expand localized format strings, like \"LL\" -> \"MMMM D YYYY\"\n// BTW, this is not important for `formatDate` because it is impossible to put custom tokens\n// or non-zero areas in Moment's localized format strings.\nreturn a=Ia.moment.parseZone(a),b=Ia.moment.parseZone(b),f=(a.localeData||a.lang).call(a),c=f.longDateFormat(c)||c,d=d||\" - \",U(a,b,W(c),d,e)}// expose", "dateForHumans(item) {\n if (!item.date) return \"\";\n let startDate = DateTime.fromISO(item.date).toFormat(\"d LLLL yyyy\");\n if (!item.time && !item.enddate) return startDate;\n if (item.time) return `${startDate} at ${item.time}`;\n if (!item.enddate) return startDate;\n\n let endDate = DateTime.fromISO(item.enddate).toFormat(\"d LLLL yyyy\");\n return `${startDate} to ${endDate}`;\n }", "function humanizeStr(nd, s, en, o) {\n var r = Math.round,\n dir = en ? ' ago' : '前',\n pl = function(v, n) {\n return (s === undefined) ? n + (en ? ' ' : '') + v + (n > 1 && en ? 's' : '') + dir : n + v.substring(0, 1)\n },\n ts = Date.now() - new Date(nd).getTime(),\n ii;\n if( ts < 0 )\n {\n ts *= -1;\n dir = en ? ' from now' : '後';\n }\n for (var i in o) {\n if (r(ts) < o[i]) return pl(ii || 'm', r(ts / (o[ii] || 1)))\n ii = i;\n }\n return pl(i, r(ts / o[i]));\n}", "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "function oldMomentFormat(mom,formatStr){return oldMomentProto.format.call(mom,formatStr);// oldMomentProto defined in moment-ext.js\n}", "function relativeTimeWithPlural(number,withoutSuffix,key){var format={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},separator=\" \";return(number%100>=20||number>=100&&number%100===0)&&(separator=\" de \"),number+separator+format[key]}", "function humanizeDate(date) {\n return moment(date).format('lll');\n}", "fromNow(date /* , locale*/) {\n if (typeof date !== 'object') date = new Date(date);\n return moment(date).fromNow();\n }", "changeTimeFormatByTime(time) {\n if(time > moment().subtract(1, 'minutes')) {\n return time.startOf('second').fromNow();\n } else if(time > moment().subtract(1, 'hours')) {\n return time.startOf('minute').fromNow();\n } else if(time > moment().subtract(1, 'days')) {\n return time.format('h:mm:ss a');\n } else if(time > moment().subtract(1, 'years')) {\n return time.format(\"MMM Do\");\n } else {\n return time.format(\"MMM Do YYYY\");\n }\n }", "createdAgo(date) { return moment(date).fromNow() }", "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture);}", "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture);}", "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture);}", "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture);}", "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\n return a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number || 1,!!withoutSuffix,string,isFuture);}", "function relativeTimeWithMutation(number,withoutSuffix,key){var format={'mm':'munutenn','MM':'miz','dd':'devezh'};return number + ' ' + mutation(format[key],number);}", "function relativeTimeWithPlural$2(number,withoutSuffix,key){var format={'ss':'secunde','mm':'minute','hh':'ore','dd':'zile','MM':'luni','yy':'ani'},separator=' ';if(number % 100 >= 20 || number >= 100 && number % 100 === 0){separator = ' de ';}return number + separator + format[key];}", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n\t var result = number + ' ';\n\t switch (key) {\n\t case 's':\n\t return withoutSuffix || isFuture\n\t ? 'nekaj sekund'\n\t : 'nekaj sekundami';\n\t case 'ss':\n\t if (number === 1) {\n\t result += withoutSuffix ? 'sekundo' : 'sekundi';\n\t } else if (number === 2) {\n\t result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n\t } else if (number < 5) {\n\t result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n\t } else {\n\t result += 'sekund';\n\t }\n\t return result;\n\t case 'm':\n\t return withoutSuffix ? 'ena minuta' : 'eno minuto';\n\t case 'mm':\n\t if (number === 1) {\n\t result += withoutSuffix ? 'minuta' : 'minuto';\n\t } else if (number === 2) {\n\t result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n\t } else if (number < 5) {\n\t result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n\t } else {\n\t result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n\t }\n\t return result;\n\t case 'h':\n\t return withoutSuffix ? 'ena ura' : 'eno uro';\n\t case 'hh':\n\t if (number === 1) {\n\t result += withoutSuffix ? 'ura' : 'uro';\n\t } else if (number === 2) {\n\t result += withoutSuffix || isFuture ? 'uri' : 'urama';\n\t } else if (number < 5) {\n\t result += withoutSuffix || isFuture ? 'ure' : 'urami';\n\t } else {\n\t result += withoutSuffix || isFuture ? 'ur' : 'urami';\n\t }\n\t return result;\n\t case 'd':\n\t return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n\t case 'dd':\n\t if (number === 1) {\n\t result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n\t } else if (number === 2) {\n\t result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n\t } else {\n\t result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n\t }\n\t return result;\n\t case 'M':\n\t return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n\t case 'MM':\n\t if (number === 1) {\n\t result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n\t } else if (number === 2) {\n\t result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n\t } else if (number < 5) {\n\t result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n\t } else {\n\t result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n\t }\n\t return result;\n\t case 'y':\n\t return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n\t case 'yy':\n\t if (number === 1) {\n\t result += withoutSuffix || isFuture ? 'leto' : 'letom';\n\t } else if (number === 2) {\n\t result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n\t } else if (number < 5) {\n\t result += withoutSuffix || isFuture ? 'leta' : 'leti';\n\t } else {\n\t result += withoutSuffix || isFuture ? 'let' : 'leti';\n\t }\n\t return result;\n\t }\n\t }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture ?\n 'nekaj sekund' :\n 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;}\n\n }", "function formatMoment(m, inputString) {\n var currentMonth = m.month(),\n currentDate = m.date(),\n currentYear = m.year(),\n currentDay = m.day(),\n currentHours = m.hours(),\n currentMinutes = m.minutes(),\n currentSeconds = m.seconds(),\n currentMilliseconds = m.milliseconds(),\n currentZone = -m.zone(),\n ordinal = moment.ordinal,\n meridiem = moment.meridiem;\n // check if the character is a format\n // return formatted string or non string.\n //\n // uses switch/case instead of an object of named functions (like http://phpjs.org/functions/date:380)\n // for minification and performance\n // see http://jsperf.com/object-of-functions-vs-switch for performance comparison\n function replaceFunction(input) {\n // create a couple variables to be used later inside one of the cases.\n var a, b;\n switch (input) {\n // MONTH\n case 'M' :\n return currentMonth + 1;\n case 'Mo' :\n return (currentMonth + 1) + ordinal(currentMonth + 1);\n case 'MM' :\n return leftZeroFill(currentMonth + 1, 2);\n case 'MMM' :\n return moment.monthsShort[currentMonth];\n case 'MMMM' :\n return moment.months[currentMonth];\n // DAY OF MONTH\n case 'D' :\n return currentDate;\n case 'Do' :\n return currentDate + ordinal(currentDate);\n case 'DD' :\n return leftZeroFill(currentDate, 2);\n // DAY OF YEAR\n case 'DDD' :\n a = new Date(currentYear, currentMonth, currentDate);\n b = new Date(currentYear, 0, 1);\n return ~~ (((a - b) / 864e5) + 1.5);\n case 'DDDo' :\n a = replaceFunction('DDD');\n return a + ordinal(a);\n case 'DDDD' :\n return leftZeroFill(replaceFunction('DDD'), 3);\n // WEEKDAY\n case 'd' :\n return currentDay;\n case 'do' :\n return currentDay + ordinal(currentDay);\n case 'ddd' :\n return moment.weekdaysShort[currentDay];\n case 'dddd' :\n return moment.weekdays[currentDay];\n // WEEK OF YEAR\n case 'w' :\n a = new Date(currentYear, currentMonth, currentDate - currentDay + 5);\n b = new Date(a.getFullYear(), 0, 4);\n return ~~ ((a - b) / 864e5 / 7 + 1.5);\n case 'wo' :\n a = replaceFunction('w');\n return a + ordinal(a);\n case 'ww' :\n return leftZeroFill(replaceFunction('w'), 2);\n // YEAR\n case 'YY' :\n return leftZeroFill(currentYear % 100, 2);\n case 'YYYY' :\n return currentYear;\n // AM / PM\n case 'a' :\n return meridiem ? meridiem(currentHours, currentMinutes, false) : (currentHours > 11 ? 'pm' : 'am');\n case 'A' :\n return meridiem ? meridiem(currentHours, currentMinutes, true) : (currentHours > 11 ? 'PM' : 'AM');\n // 24 HOUR\n case 'H' :\n return currentHours;\n case 'HH' :\n return leftZeroFill(currentHours, 2);\n // 12 HOUR\n case 'h' :\n return currentHours % 12 || 12;\n case 'hh' :\n return leftZeroFill(currentHours % 12 || 12, 2);\n // MINUTE\n case 'm' :\n return currentMinutes;\n case 'mm' :\n return leftZeroFill(currentMinutes, 2);\n // SECOND\n case 's' :\n return currentSeconds;\n case 'ss' :\n return leftZeroFill(currentSeconds, 2);\n // MILLISECONDS\n case 'S' :\n return ~~ (currentMilliseconds / 100);\n case 'SS' :\n return leftZeroFill(~~(currentMilliseconds / 10), 2);\n case 'SSS' :\n return leftZeroFill(currentMilliseconds, 3);\n // TIMEZONE\n case 'Z' :\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~(Math.abs(currentZone) / 60), 2) + ':' + leftZeroFill(~~(Math.abs(currentZone) % 60), 2);\n case 'ZZ' :\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~(10 * Math.abs(currentZone) / 6), 4);\n // LONG DATES\n case 'L' :\n case 'LL' :\n case 'LLL' :\n case 'LLLL' :\n case 'LT' :\n return formatMoment(m, moment.longDateFormat[input]);\n // DEFAULT\n default :\n return input.replace(/(^\\[)|(\\\\)|\\]$/g, \"\");\n }\n }\n return inputString.replace(formattingTokens, replaceFunction);\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n\n switch (key) {\n case 's':\n return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';\n\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n\n return result;\n\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n\n return result;\n\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n\n return result;\n\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n\n return result;\n\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n\n return result;\n\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number,withoutSuffix,key,isFuture){var format={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return withoutSuffix?format[key][0]:format[key][1]}", "function toAgo(time){\n var strings = {\n suffixAgo: \"ago\",\n suffixFromNow: \"from now\",\n seconds: \"less than a minute\",\n minute: \"about a minute\",\n minutes: \"%d minutes\",\n hour: \"about an hour\",\n hours: \"about %d hours\",\n day: \"a day\",\n days: \"%d days\",\n month: \"about a month\",\n months: \"%d months\",\n year: \"about a year\",\n years: \"%d years\"\n };\n var $l = strings;\n var prefix = $l.prefixAgo;\n var suffix = $l.suffixAgo;\n\n var distanceMillis = new Date().getTime() - time;\n\n var seconds = distanceMillis / 1000;\n var minutes = seconds / 60;\n var hours = minutes / 60;\n var days = hours / 24;\n var years = days / 365;\n\n function substitute(string, number) {\n var value = ($l.numbers && $l.numbers[number]) || number;\n return string.replace(/%d/i, value);\n }\n\n var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) ||\n seconds < 90 && substitute($l.minute, 1) ||\n minutes < 45 && substitute($l.minutes, Math.round(minutes)) ||\n minutes < 90 && substitute($l.hour, 1) ||\n hours < 24 && substitute($l.hours, Math.round(hours)) ||\n hours < 48 && substitute($l.day, 1) ||\n days < 30 && substitute($l.days, Math.floor(days)) ||\n days < 60 && substitute($l.month, 1) ||\n days < 365 && substitute($l.months, Math.floor(days / 30)) ||\n years < 2 && substitute($l.year, 1) ||\n substitute($l.years, Math.floor(years));\n\n return [prefix, words, suffix].join(\" \").trim();\n}", "function formatMoment(m, inputString) {\n var currentMonth = m.month(),\n currentDate = m.date(),\n currentYear = m.year(),\n currentDay = m.day(),\n currentHours = m.hours(),\n currentMinutes = m.minutes(),\n currentSeconds = m.seconds(),\n currentZone = -m.zone(),\n ordinal = moment.ordinal,\n meridiem = moment.meridiem;\n // check if the character is a format\n // return formatted string or non string.\n //\n // uses switch/case instead of an object of named functions (like http://phpjs.org/functions/date:380)\n // for minification and performance\n // see http://jsperf.com/object-of-functions-vs-switch for performance comparison\n function replaceFunction(input) {\n // create a couple variables to be used later inside one of the cases.\n var a, b;\n switch (input) {\n // MONTH\n case 'M' :\n return currentMonth + 1;\n case 'Mo' :\n return (currentMonth + 1) + ordinal(currentMonth + 1);\n case 'MM' :\n return leftZeroFill(currentMonth + 1, 2);\n case 'MMM' :\n return moment.monthsShort[currentMonth];\n case 'MMMM' :\n return moment.months[currentMonth];\n // DAY OF MONTH\n case 'D' :\n return currentDate;\n case 'Do' :\n return currentDate + ordinal(currentDate);\n case 'DD' :\n return leftZeroFill(currentDate, 2);\n // DAY OF YEAR\n case 'DDD' :\n a = new Date(currentYear, currentMonth, currentDate);\n b = new Date(currentYear, 0, 1);\n return ~~ (((a - b) / 864e5) + 1.5);\n case 'DDDo' :\n a = replaceFunction('DDD');\n return a + ordinal(a);\n case 'DDDD' :\n return leftZeroFill(replaceFunction('DDD'), 3);\n // WEEKDAY\n case 'd' :\n return currentDay;\n case 'do' :\n return currentDay + ordinal(currentDay);\n case 'ddd' :\n return moment.weekdaysShort[currentDay];\n case 'dddd' :\n return moment.weekdays[currentDay];\n // WEEK OF YEAR\n case 'w' :\n a = new Date(currentYear, currentMonth, currentDate - currentDay + 5);\n b = new Date(a.getFullYear(), 0, 4);\n return ~~ ((a - b) / 864e5 / 7 + 1.5);\n case 'wo' :\n a = replaceFunction('w');\n return a + ordinal(a);\n case 'ww' :\n return leftZeroFill(replaceFunction('w'), 2);\n // YEAR\n case 'YY' :\n return leftZeroFill(currentYear % 100, 2);\n case 'YYYY' :\n return currentYear;\n // AM / PM\n case 'a' :\n return currentHours > 11 ? meridiem.pm : meridiem.am;\n case 'A' :\n return currentHours > 11 ? meridiem.PM : meridiem.AM;\n // 24 HOUR\n case 'H' :\n return currentHours;\n case 'HH' :\n return leftZeroFill(currentHours, 2);\n // 12 HOUR\n case 'h' :\n return currentHours % 12 || 12;\n case 'hh' :\n return leftZeroFill(currentHours % 12 || 12, 2);\n // MINUTE\n case 'm' :\n return currentMinutes;\n case 'mm' :\n return leftZeroFill(currentMinutes, 2);\n // SECOND\n case 's' :\n return currentSeconds;\n case 'ss' :\n return leftZeroFill(currentSeconds, 2);\n // TIMEZONE\n case 'zz' :\n // depreciating 'zz' fall through to 'z'\n case 'z' :\n return (m._d.toString().match(timezoneRegex) || [''])[0].replace(nonuppercaseLetters, '');\n case 'Z' :\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~(Math.abs(currentZone) / 60), 2) + ':' + leftZeroFill(~~(Math.abs(currentZone) % 60), 2);\n case 'ZZ' :\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~(10 * Math.abs(currentZone) / 6), 4);\n // LONG DATES\n case 'L' :\n case 'LL' :\n case 'LLL' :\n case 'LLLL' :\n case 'LT' :\n return formatMoment(m, moment.longDateFormat[input]);\n // DEFAULT\n default :\n return input.replace(/(^\\[)|(\\\\)|\\]$/g, \"\");\n }\n }\n return inputString.replace(charactersToReplace, replaceFunction);\n }", "function durationFormat() {\n\n var args = [].slice.call(arguments);\n var settings = extend({}, this.format.defaults);\n\n // Keep a shadow copy of this moment for calculating remainders.\n // Perform all calculations on positive duration value, handle negative\n // sign at the very end.\n var asMilliseconds = this.asMilliseconds();\n var asMonths = this.asMonths();\n\n // Treat invalid durations as having a value of 0 milliseconds.\n if (typeof this.isValid === \"function\" && this.isValid() === false) {\n asMilliseconds = 0;\n asMonths = 0;\n }\n\n var isNegative = asMilliseconds < 0;\n\n // Two shadow copies are needed because of the way moment.js handles\n // duration arithmetic for years/months and for weeks/days/hours/minutes/seconds.\n var remainder = moment.duration(Math.abs(asMilliseconds), \"milliseconds\");\n var remainderMonths = moment.duration(Math.abs(asMonths), \"months\");\n\n // Parse arguments.\n each(args, function (arg) {\n if (typeof arg === \"string\" || typeof arg === \"function\") {\n settings.template = arg;\n return;\n }\n\n if (typeof arg === \"number\") {\n settings.precision = arg;\n return;\n }\n\n if (isObject(arg)) {\n extend(settings, arg);\n }\n });\n\n var momentTokens = {\n years: \"y\",\n months: \"M\",\n weeks: \"w\",\n days: \"d\",\n hours: \"h\",\n minutes: \"m\",\n seconds: \"s\",\n milliseconds: \"S\"\n };\n\n var tokenDefs = {\n escape: /\\[(.+?)\\]/,\n years: /\\*?[Yy]+/,\n months: /\\*?M+/,\n weeks: /\\*?[Ww]+/,\n days: /\\*?[Dd]+/,\n hours: /\\*?[Hh]+/,\n minutes: /\\*?m+/,\n seconds: /\\*?s+/,\n milliseconds: /\\*?S+/,\n general: /.+?/\n };\n\n // Types array is available in the template function.\n settings.types = types;\n\n var typeMap = function (token) {\n return find(types, function (type) {\n return tokenDefs[type].test(token);\n });\n };\n\n var tokenizer = new RegExp(map(types, function (type) {\n return tokenDefs[type].source;\n }).join(\"|\"), \"g\");\n\n // Current duration object is available in the template function.\n settings.duration = this;\n\n // Eval template function and cache template string.\n var template = typeof settings.template === \"function\" ? settings.template.apply(settings) : settings.template;\n\n // outputTypes and returnMomentTypes are settings to support durationsFormat().\n\n // outputTypes is an array of moment token types that determines\n // the tokens returned in formatted output. This option overrides\n // trim, largest, stopTrim, etc.\n var outputTypes = settings.outputTypes;\n\n // returnMomentTypes is a boolean that sets durationFormat to return\n // the processed momentTypes instead of formatted output.\n var returnMomentTypes = settings.returnMomentTypes;\n\n var largest = settings.largest;\n\n // Setup stopTrim array of token types.\n var stopTrim = [];\n\n if (!outputTypes) {\n if (isArray(settings.stopTrim)) {\n settings.stopTrim = settings.stopTrim.join(\"\");\n }\n\n // Parse stopTrim string to create token types array.\n if (settings.stopTrim) {\n each(settings.stopTrim.match(tokenizer), function (token) {\n var type = typeMap(token);\n\n if (type === \"escape\" || type === \"general\") {\n return;\n }\n\n stopTrim.push(type);\n });\n }\n }\n\n // Cache moment's locale data.\n var localeData = moment.localeData();\n\n if (!localeData) {\n localeData = {};\n }\n\n // Fall back to this plugin's `eng` extension.\n each(keys(engLocale), function (key) {\n if (typeof engLocale[key] === \"function\") {\n if (!localeData[key]) {\n localeData[key] = engLocale[key];\n }\n\n return;\n }\n\n if (!localeData[\"_\" + key]) {\n localeData[\"_\" + key] = engLocale[key];\n }\n });\n\n // Replace Duration Time Template strings.\n // For locale `eng`: `_HMS_`, `_HM_`, and `_MS_`.\n each(keys(localeData._durationTimeTemplates), function (item) {\n template = template.replace(\"_\" + item + \"_\", localeData._durationTimeTemplates[item]);\n });\n\n // Determine user's locale.\n var userLocale = settings.userLocale || moment.locale();\n\n var useLeftUnits = settings.useLeftUnits;\n var usePlural = settings.usePlural;\n var precision = settings.precision;\n var forceLength = settings.forceLength;\n var useGrouping = settings.useGrouping;\n var trunc = settings.trunc;\n\n // Use significant digits only when precision is greater than 0.\n var useSignificantDigits = settings.useSignificantDigits && precision > 0;\n var significantDigits = useSignificantDigits ? settings.precision : 0;\n var significantDigitsCache = significantDigits;\n\n var minValue = settings.minValue;\n var isMinValue = false;\n\n var maxValue = settings.maxValue;\n var isMaxValue = false;\n\n // formatNumber fallback options.\n var useToLocaleString = settings.useToLocaleString;\n var groupingSeparator = settings.groupingSeparator;\n var decimalSeparator = settings.decimalSeparator;\n var grouping = settings.grouping;\n\n useToLocaleString = useToLocaleString && (toLocaleStringWorks || intlNumberFormatWorks);\n\n // Trim options.\n var trim = settings.trim;\n\n if (isArray(trim)) {\n trim = trim.join(\" \");\n }\n\n if (trim === null && (largest || maxValue || useSignificantDigits)) {\n trim = \"all\";\n }\n\n if (trim === null || trim === true || trim === \"left\" || trim === \"right\") {\n trim = \"large\";\n }\n\n if (trim === false) {\n trim = \"\";\n }\n\n var trimIncludes = function (item) {\n return item.test(trim);\n };\n\n var rLarge = /large/;\n var rSmall = /small/;\n var rBoth = /both/;\n var rMid = /mid/;\n var rAll = /^all|[^sm]all/;\n var rFinal = /final/;\n\n var trimLarge = largest > 0 || any([rLarge, rBoth, rAll], trimIncludes);\n var trimSmall = any([rSmall, rBoth, rAll], trimIncludes);\n var trimMid = any([rMid, rAll], trimIncludes);\n var trimFinal = any([rFinal, rAll], trimIncludes);\n\n // Parse format string to create raw tokens array.\n var rawTokens = map(template.match(tokenizer), function (token, index) {\n var type = typeMap(token);\n\n if (token.slice(0, 1) === \"*\") {\n token = token.slice(1);\n\n if (type !== \"escape\" && type !== \"general\") {\n stopTrim.push(type);\n }\n }\n\n return {\n index: index,\n length: token.length,\n text: \"\",\n\n // Replace escaped tokens with the non-escaped token text.\n token: (type === \"escape\" ? token.replace(tokenDefs.escape, \"$1\") : token),\n\n // Ignore type on non-moment tokens.\n type: ((type === \"escape\" || type === \"general\") ? null : type)\n };\n });\n\n // Associate text tokens with moment tokens.\n var currentToken = {\n index: 0,\n length: 0,\n token: \"\",\n text: \"\",\n type: null\n };\n\n var tokens = [];\n\n if (useLeftUnits) {\n rawTokens.reverse();\n }\n\n each(rawTokens, function (token) {\n if (token.type) {\n if (currentToken.type || currentToken.text) {\n tokens.push(currentToken);\n }\n\n currentToken = token;\n\n return;\n }\n\n if (useLeftUnits) {\n currentToken.text = token.token + currentToken.text;\n } else {\n currentToken.text += token.token;\n }\n });\n\n if (currentToken.type || currentToken.text) {\n tokens.push(currentToken);\n }\n\n if (useLeftUnits) {\n tokens.reverse();\n }\n\n // Find unique moment token types in the template in order of\n // descending magnitude.\n var momentTypes = intersection(types, unique(compact(pluck(tokens, \"type\"))));\n\n // Exit early if there are no moment token types.\n if (!momentTypes.length) {\n return pluck(tokens, \"text\").join(\"\");\n }\n\n // Calculate values for each moment type in the template.\n // For processing the settings, values are associated with moment types.\n // Values will be assigned to tokens at the last step in order to\n // assume nothing about frequency or order of tokens in the template.\n momentTypes = map(momentTypes, function (momentType, index) {\n // Is this the least-magnitude moment token found?\n var isSmallest = ((index + 1) === momentTypes.length);\n\n // Is this the greatest-magnitude moment token found?\n var isLargest = (!index);\n\n // Get the raw value in the current units.\n var rawValue;\n\n if (momentType === \"years\" || momentType === \"months\") {\n rawValue = remainderMonths.as(momentType);\n } else {\n rawValue = remainder.as(momentType);\n }\n\n var wholeValue = Math.floor(rawValue);\n var decimalValue = rawValue - wholeValue;\n\n var token = find(tokens, function (token) {\n return momentType === token.type;\n });\n\n if (isLargest && maxValue && rawValue > maxValue) {\n isMaxValue = true;\n }\n\n if (isSmallest && minValue && Math.abs(settings.duration.as(momentType)) < minValue) {\n isMinValue = true;\n }\n\n // Note the length of the largest-magnitude moment token:\n // if it is greater than one and forceLength is not set,\n // then default forceLength to `true`.\n //\n // Rationale is this: If the template is \"h:mm:ss\" and the\n // moment value is 5 minutes, the user-friendly output is\n // \"5:00\", not \"05:00\". We shouldn't pad the `minutes` token\n // even though it has length of two if the template is \"h:mm:ss\";\n //\n // If the minutes output should always include the leading zero\n // even when the hour is trimmed then set `{ forceLength: true }`\n // to output \"05:00\". If the template is \"hh:mm:ss\", the user\n // clearly wanted everything padded so we should output \"05:00\";\n //\n // If the user wants the full padded output, they can use\n // template \"hh:mm:ss\" and set `{ trim: false }` to output\n // \"00:05:00\".\n if (isLargest && forceLength === null && token.length > 1) {\n forceLength = true;\n }\n\n // Update remainder.\n remainder.subtract(wholeValue, momentType);\n remainderMonths.subtract(wholeValue, momentType);\n\n return {\n rawValue: rawValue,\n wholeValue: wholeValue,\n // Decimal value is only retained for the least-magnitude\n // moment type in the format template.\n decimalValue: isSmallest ? decimalValue : 0,\n isSmallest: isSmallest,\n isLargest: isLargest,\n type: momentType,\n // Tokens can appear multiple times in a template string,\n // but all instances must share the same length.\n tokenLength: token.length\n };\n });\n\n var truncMethod = trunc ? Math.floor : Math.round;\n var truncate = function (value, places) {\n var factor = Math.pow(10, places);\n return truncMethod(value * factor) / factor;\n };\n\n var foundFirst = false;\n var bubbled = false;\n\n var formatValue = function (momentType, index) {\n var formatOptions = {\n useGrouping: useGrouping,\n groupingSeparator: groupingSeparator,\n decimalSeparator: decimalSeparator,\n grouping: grouping,\n useToLocaleString: useToLocaleString\n };\n\n if (useSignificantDigits) {\n if (significantDigits <= 0) {\n momentType.rawValue = 0;\n momentType.wholeValue = 0;\n momentType.decimalValue = 0;\n } else {\n formatOptions.maximumSignificantDigits = significantDigits;\n momentType.significantDigits = significantDigits;\n }\n }\n\n if (isMaxValue && !bubbled) {\n if (momentType.isLargest) {\n momentType.wholeValue = maxValue;\n momentType.decimalValue = 0;\n } else {\n momentType.wholeValue = 0;\n momentType.decimalValue = 0;\n }\n }\n\n if (isMinValue && !bubbled) {\n if (momentType.isSmallest) {\n momentType.wholeValue = minValue;\n momentType.decimalValue = 0;\n } else {\n momentType.wholeValue = 0;\n momentType.decimalValue = 0;\n }\n }\n\n if (momentType.isSmallest || momentType.significantDigits && momentType.significantDigits - momentType.wholeValue.toString().length <= 0) {\n // Apply precision to least significant token value.\n if (precision < 0) {\n momentType.value = truncate(momentType.wholeValue, precision);\n } else if (precision === 0) {\n momentType.value = truncMethod(momentType.wholeValue + momentType.decimalValue);\n } else { // precision > 0\n if (useSignificantDigits) {\n if (trunc) {\n momentType.value = truncate(momentType.rawValue, significantDigits - momentType.wholeValue.toString().length);\n } else {\n momentType.value = momentType.rawValue;\n }\n\n if (momentType.wholeValue) {\n significantDigits -= momentType.wholeValue.toString().length;\n }\n } else {\n formatOptions.fractionDigits = precision;\n\n if (trunc) {\n momentType.value = momentType.wholeValue + truncate(momentType.decimalValue, precision);\n } else {\n momentType.value = momentType.wholeValue + momentType.decimalValue;\n }\n }\n }\n } else {\n if (useSignificantDigits && momentType.wholeValue) {\n // Outer Math.round required here to handle floating point errors.\n momentType.value = Math.round(truncate(momentType.wholeValue, momentType.significantDigits - momentType.wholeValue.toString().length));\n\n significantDigits -= momentType.wholeValue.toString().length;\n } else {\n momentType.value = momentType.wholeValue;\n }\n }\n\n if (momentType.tokenLength > 1 && (forceLength || foundFirst)) {\n formatOptions.minimumIntegerDigits = momentType.tokenLength;\n\n if (bubbled && formatOptions.maximumSignificantDigits < momentType.tokenLength) {\n delete formatOptions.maximumSignificantDigits;\n }\n }\n\n if (!foundFirst && (momentType.value > 0 || trim === \"\" /* trim: false */ || find(stopTrim, momentType.type) || find(outputTypes, momentType.type))) {\n foundFirst = true;\n }\n\n momentType.formattedValue = formatNumber(momentType.value, formatOptions, userLocale);\n\n formatOptions.useGrouping = false;\n formatOptions.decimalSeparator = \".\";\n momentType.formattedValueEn = formatNumber(momentType.value, formatOptions, \"en\");\n\n if (momentType.tokenLength === 2 && momentType.type === \"milliseconds\") {\n momentType.formattedValueMS = formatNumber(momentType.value, {\n minimumIntegerDigits: 3,\n useGrouping: false\n }, \"en\").slice(0, 2);\n }\n\n return momentType;\n };\n\n // Calculate formatted values.\n momentTypes = map(momentTypes, formatValue);\n momentTypes = compact(momentTypes);\n\n // Bubble rounded values.\n if (momentTypes.length > 1) {\n var findType = function (type) {\n return find(momentTypes, function (momentType) {\n return momentType.type === type;\n });\n };\n\n var bubbleTypes = function (bubble) {\n var bubbleMomentType = findType(bubble.type);\n\n if (!bubbleMomentType) {\n return;\n }\n\n each(bubble.targets, function (target) {\n var targetMomentType = findType(target.type);\n\n if (!targetMomentType) {\n return;\n }\n\n if (parseInt(bubbleMomentType.formattedValueEn, 10) === target.value) {\n bubbleMomentType.rawValue = 0;\n bubbleMomentType.wholeValue = 0;\n bubbleMomentType.decimalValue = 0;\n targetMomentType.rawValue += 1;\n targetMomentType.wholeValue += 1;\n targetMomentType.decimalValue = 0;\n targetMomentType.formattedValueEn = targetMomentType.wholeValue.toString();\n bubbled = true;\n }\n });\n };\n\n each(bubbles, bubbleTypes);\n }\n\n // Recalculate formatted values.\n if (bubbled) {\n foundFirst = false;\n significantDigits = significantDigitsCache;\n momentTypes = map(momentTypes, formatValue);\n momentTypes = compact(momentTypes);\n }\n\n if (outputTypes && !(isMaxValue && !settings.trim)) {\n momentTypes = map(momentTypes, function (momentType) {\n if (find(outputTypes, function (outputType) {\n return momentType.type === outputType;\n })) {\n return momentType;\n }\n\n return null;\n });\n\n momentTypes = compact(momentTypes);\n } else {\n // Trim Large.\n if (trimLarge) {\n momentTypes = rest(momentTypes, function (momentType) {\n // Stop trimming on:\n // - the smallest moment type\n // - a type marked for stopTrim\n // - a type that has a whole value\n return !momentType.isSmallest && !momentType.wholeValue && !find(stopTrim, momentType.type);\n });\n }\n\n // Largest.\n if (largest && momentTypes.length) {\n momentTypes = momentTypes.slice(0, largest);\n }\n\n // Trim Small.\n if (trimSmall && momentTypes.length > 1) {\n momentTypes = initial(momentTypes, function (momentType) {\n // Stop trimming on:\n // - a type marked for stopTrim\n // - a type that has a whole value\n // - the largest momentType\n return !momentType.wholeValue && !find(stopTrim, momentType.type) && !momentType.isLargest;\n });\n }\n\n // Trim Mid.\n if (trimMid) {\n momentTypes = map(momentTypes, function (momentType, index) {\n if (index > 0 && index < momentTypes.length - 1 && !momentType.wholeValue) {\n return null;\n }\n\n return momentType;\n });\n\n momentTypes = compact(momentTypes);\n }\n\n // Trim Final.\n if (trimFinal && momentTypes.length === 1 && !momentTypes[0].wholeValue && !(!trunc && momentTypes[0].isSmallest && momentTypes[0].rawValue < minValue)) {\n momentTypes = [];\n }\n }\n\n if (returnMomentTypes) {\n return momentTypes;\n }\n\n // Localize and pluralize unit labels.\n each(tokens, function (token) {\n var key = momentTokens[token.type];\n\n var momentType = find(momentTypes, function (momentType) {\n return momentType.type === token.type;\n });\n\n if (!key || !momentType) {\n return;\n }\n\n var values = momentType.formattedValueEn.split(\".\");\n\n values[0] = parseInt(values[0], 10);\n\n if (values[1]) {\n values[1] = parseFloat(\"0.\" + values[1], 10);\n } else {\n values[1] = null;\n }\n\n var pluralKey = localeData.durationPluralKey(key, values[0], values[1]);\n\n var labels = durationGetLabels(key, localeData);\n\n var autoLocalized = false;\n\n var pluralizedLabels = {};\n\n // Auto-Localized unit labels.\n each(localeData._durationLabelTypes, function (labelType) {\n var label = find(labels, function (label) {\n return label.type === labelType.type && label.key === pluralKey;\n });\n\n if (label) {\n pluralizedLabels[label.type] = label.label;\n\n if (stringIncludes(token.text, labelType.string)) {\n token.text = token.text.replace(labelType.string, label.label);\n autoLocalized = true;\n }\n }\n });\n\n // Auto-pluralized unit labels.\n if (usePlural && !autoLocalized) {\n labels.sort(durationLabelCompare);\n\n each(labels, function (label) {\n if (pluralizedLabels[label.type] === label.label) {\n if (stringIncludes(token.text, label.label)) {\n // Stop checking this token if its label is already\n // correctly pluralized.\n return false;\n }\n\n // Skip this label if it is correct, but not present in\n // the token's text.\n return;\n }\n\n if (stringIncludes(token.text, label.label)) {\n // Replece this token's label and stop checking.\n token.text = token.text.replace(label.label, pluralizedLabels[label.type]);\n return false;\n }\n });\n }\n });\n\n // Build ouptut.\n tokens = map(tokens, function (token) {\n if (!token.type) {\n return token.text;\n }\n\n var momentType = find(momentTypes, function (momentType) {\n return momentType.type === token.type;\n });\n\n if (!momentType) {\n return \"\";\n }\n\n var out = \"\";\n\n if (useLeftUnits) {\n out += token.text;\n }\n\n if (isNegative && isMaxValue || !isNegative && isMinValue) {\n out += \"< \";\n isMaxValue = false;\n isMinValue = false;\n }\n\n if (isNegative && isMinValue || !isNegative && isMaxValue) {\n out += \"> \";\n isMaxValue = false;\n isMinValue = false;\n }\n\n if (isNegative && (momentType.value > 0 || trim === \"\" || find(stopTrim, momentType.type) || find(outputTypes, momentType.type))) {\n out += \"-\";\n isNegative = false;\n }\n\n if (token.type === \"milliseconds\" && momentType.formattedValueMS) {\n out += momentType.formattedValueMS;\n } else {\n out += momentType.formattedValue;\n }\n\n if (!useLeftUnits) {\n out += token.text;\n }\n\n return out;\n });\n\n // Trim leading and trailing comma, space, colon, and dot.\n return tokens.join(\"\").replace(/(,| |:|\\.)*$/, \"\").replace(/^(,| |:|\\.)*/, \"\");\n }", "function millisecondsToStr(a){\"use strict\";function b(a){return a>1?\"s ago\":\" ago\"}var c=Math.floor(a/1e3),d=Math.floor(c/31536e3);if(d)return d+\" year\"+b(d);var e=Math.floor((c%=31536e3)/2592e3);if(e)return e+\" month\"+b(e);var f=Math.floor((c%=2592e3)/86400);if(f)return f+\" day\"+b(f);var g=Math.floor((c%=86400)/3600);if(g)return\"about \"+g+\" hour\"+b(g);var h=Math.floor((c%=3600)/60);if(h)return h+\" minute\"+b(h);var i=c%60;return i?i+\" second\"+b(i):\"just now\"}", "function processRelativeTime$5(number,withoutSuffix,key,isFuture){var format={'m':['eng Minutt','enger Minutt'],'h':['eng Stonn','enger Stonn'],'d':['een Dag','engem Dag'],'M':['ee Mount','engem Mount'],'y':['ee Joer','engem Joer']};return withoutSuffix?format[key][0]:format[key][1];}", "function relativeTimeWithMutation(number,withoutSuffix,key){var format={mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"};return number+\" \"+mutation(format[key],number)}", "function processRelativeTime(number,withoutSuffix,key,isFuture){var format={s:[\"mõne sekundi\",\"mõni sekund\",\"paar sekundit\"],ss:[number+\"sekundi\",number+\"sekundit\"],m:[\"ühe minuti\",\"üks minut\"],mm:[number+\" minuti\",number+\" minutit\"],h:[\"ühe tunni\",\"tund aega\",\"üks tund\"],hh:[number+\" tunni\",number+\" tundi\"],d:[\"ühe päeva\",\"üks päev\"],M:[\"kuu aja\",\"kuu aega\",\"üks kuu\"],MM:[number+\" kuu\",number+\" kuud\"],y:[\"ühe aasta\",\"aasta\",\"üks aasta\"],yy:[number+\" aasta\",number+\" aastat\"]};return withoutSuffix?format[key][2]?format[key][2]:format[key][1]:isFuture?format[key][0]:format[key][1]}", "function processRelativeTime$6(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += withoutSuffix || isFuture ? 'sekund' : 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function humanizer(passedOptions) {\n\n var result = function humanizer(ms, humanizerOptions) {\n var options = extend({}, result, humanizerOptions || {});\n return doHumanization(ms, options);\n };\n\n return extend(result, {\n language: \"en\",\n delimiter: \", \",\n spacer: \" \",\n units: [\"year\", \"month\", \"week\", \"day\", \"hour\", \"minute\", \"second\"],\n languages: {},\n halfUnit: true,\n round: false\n }, passedOptions);\n\n }", "function momentify(value, options) {\n\t\tvar parser = options.parser;\n\t\tvar format = options.parser || options.format;\n\n\t\tif (typeof parser === 'function') {\n\t\t\treturn parser(value);\n\t\t}\n\n\t\tif (typeof value === 'string' && typeof format === 'string') {\n\t\t\treturn moment(value, format);\n\t\t}\n\n\t\tif (!(value instanceof moment)) {\n\t\t\tvalue = moment(value);\n\t\t}\n\n\t\tif (value.isValid()) {\n\t\t\treturn value;\n\t\t}\n\n\t\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t\t// The user might still use the deprecated `format` option to convert his inputs.\n\t\tif (typeof format === 'function') {\n\t\t\treturn format(value);\n\t\t}\n\n\t\treturn value;\n\t}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}" ]
[ "0.6559295", "0.6559295", "0.6559295", "0.6559295", "0.6475756", "0.63828397", "0.6327027", "0.6327027", "0.6327027", "0.6327027", "0.6327027", "0.6327027", "0.6327027", "0.6327027", "0.6327027", "0.6212658", "0.6122627", "0.6122627", "0.60974634", "0.60974634", "0.60974634", "0.60867417", "0.603169", "0.60202247", "0.6011621", "0.6011621", "0.6011621", "0.6011621", "0.6011621", "0.60068107", "0.5949981", "0.58938354", "0.5883391", "0.58647114", "0.58393073", "0.5814529", "0.5814529", "0.5814529", "0.5814529", "0.5811042", "0.5779606", "0.576741", "0.57631105", "0.573369", "0.5720208", "0.5695009", "0.5689666", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.56832135", "0.5680284", "0.56465185", "0.5621929", "0.5621409", "0.56073344", "0.56028676", "0.5574657", "0.55633384", "0.5537796", "0.5537475", "0.55222905", "0.5520578", "0.5520578", "0.5520578", "0.5520578", "0.5520578", "0.5520578", "0.5520578", "0.5520578", "0.5520578", "0.5520578", "0.5520578", "0.5520578" ]
0.0
-1
This function allows you to set the rounding function for relative time strings
function getSetRelativeTimeRounding (roundingFunction) { if (roundingFunction === undefined) { return round; } if (typeof(roundingFunction) === 'function') { round = roundingFunction; return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof roundingFunction === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding(roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof roundingFunction === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function getSetRelativeTimeRounding(roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof roundingFunction === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function getSetRelativeTimeRounding(roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof roundingFunction === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding (roundingFunction) {\n\tif (roundingFunction === undefined) {\n\t\treturn round;\n\t}\n\tif (typeof(roundingFunction) === 'function') {\n\t\tround = roundingFunction;\n\t\treturn true;\n\t}\n\treturn false;\n}", "function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding (roundingFunction) {\r\n if (roundingFunction === undefined) {\r\n return round;\r\n }\r\n if (typeof(roundingFunction) === 'function') {\r\n round = roundingFunction;\r\n return true;\r\n }\r\n return false;\r\n }", "function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof roundingFunction === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof roundingFunction === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }" ]
[ "0.72622484", "0.72409254", "0.72409254", "0.72409254", "0.72409254", "0.72409254", "0.72409254", "0.72409254", "0.70998174", "0.70998174", "0.70998174", "0.70998174", "0.70998174", "0.70998174", "0.70998174", "0.70998174", "0.70998174", "0.70998174", "0.70998174", "0.70998174", "0.70998174", "0.70998174", "0.70998174", "0.70998174", "0.70316243", "0.6977638", "0.6977638", "0.6977638", "0.6977638", "0.6977638", "0.6977638", "0.69598234", "0.6958744", "0.6947806", "0.6909664", "0.6909664", "0.6909664", "0.6909664", "0.6909664", "0.6909664", "0.6909664", "0.6909664", "0.6909664", "0.6909664", "0.6909664", "0.6909664", "0.6909664", "0.6909664", "0.6895281", "0.6895281", "0.6895281", "0.68885976", "0.6886316", "0.68665904", "0.6859235", "0.6822068", "0.6822068" ]
0.0
-1
This function allows you to set a threshold for relative time strings
function getSetRelativeTimeThreshold (threshold, limit) { if (thresholds[threshold] === undefined) { return false; } if (limit === undefined) { return thresholds[threshold]; } thresholds[threshold] = limit; if (threshold === 's') { thresholds.ss = limit - 1; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSetRelativeTimeThreshold (threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }", "function getSetRelativeTimeThreshold (threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t }", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t }", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t }", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t }", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t }", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t }", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t}", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t}", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t}", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t}", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t}", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t}", "function getSetRelativeTimeThreshold(threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }", "function getSetRelativeTimeThreshold (threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n return true;\n }", "function getSetRelativeTimeThreshold (threshold, limit) {\n\tif (thresholds[threshold] === undefined) {\n\t\treturn false;\n\t}\n\tif (limit === undefined) {\n\t\treturn thresholds[threshold];\n\t}\n\tthresholds[threshold] = limit;\n\tif (threshold === 's') {\n\t\tthresholds.ss = limit - 1;\n\t}\n\treturn true;\n}", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function getSetRelativeTimeThreshold(threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t }", "function getSetRelativeTimeThreshold(threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t }", "function getSetRelativeTimeThreshold(threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t }", "function getSetRelativeTimeThreshold (threshold, limit) {\r\n if (thresholds[threshold] === undefined) {\r\n return false;\r\n }\r\n if (limit === undefined) {\r\n return thresholds[threshold];\r\n }\r\n thresholds[threshold] = limit;\r\n if (threshold === 's') {\r\n thresholds.ss = limit - 1;\r\n }\r\n return true;\r\n }", "function getSetRelativeTimeThreshold(threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }", "function getSetRelativeTimeThreshold(threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }", "function getSetRelativeTimeThreshold(threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }" ]
[ "0.6979532", "0.6935547", "0.69083905", "0.69083905", "0.69083905", "0.69083905", "0.69083905", "0.69083905", "0.69026154", "0.69026154", "0.69026154", "0.69026154", "0.69026154", "0.69026154", "0.6896398", "0.6887791", "0.6873328", "0.68426573", "0.68257725", "0.68257725", "0.68257725", "0.68257725", "0.68257725", "0.68257725", "0.68257725", "0.68257725", "0.68257725", "0.68257725", "0.68257725", "0.68257725", "0.682183", "0.682183", "0.682183", "0.68166876", "0.6813914", "0.6802157", "0.6802157" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. TODO Parse shadow style TODO Only shallow path support
function _default(properties) { // Normalize for (var i = 0; i < properties.length; i++) { if (!properties[i][1]) { properties[i][1] = properties[i][0]; } } return function (model, excludes, includes) { var style = {}; for (var i = 0; i < properties.length; i++) { var propName = properties[i][1]; if (excludes && zrUtil.indexOf(excludes, propName) >= 0 || includes && zrUtil.indexOf(includes, propName) < 0) { continue; } var val = model.getShallow(propName); if (val != null) { style[properties[i][0]] = val; } } return style; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get path()\t\t{ return this.match[7] || \"\" }", "_getDirectMatchProps() {\n return ['file'];\n }", "function PathMapper() {\n\t}", "function PathMapper() {\n\t}", "resolveAsPath() { }", "get fullpath()\t{ return \"\" + this.prefix + this.path }", "function segment(WrappedComponent, mapping) {\n // pathMatch;\n return class extends Component {\n constructor(props) {\n super(props);\n\n this.state = {};\n }\n\n render() {\n const {\n path,\n currentPath,\n isRelative = true,\n basePath,\n exact = false,\n ...rest\n } = this.props;\n\n // currentPath /bbb/aaa/123/ccc/ddd\n // currentPath /bbb/aaa/123/ccc\n\n // base /bbb\n // path /aaa/{id}/ccc\n // path aaa/{id}/ccc\n\n // to /bbb/aaa/{id}/ccc\n\n // last '/' to ''\n // console.log(currentPath, path, isRelative, basePath);\n if (isRelative) {\n const result = relativeMatch(currentPath, basePath, path, exact);\n if (result) {\n return (\n <WrappedComponent\n currentPath={currentPath}\n // basePath={xxx} // this is in result\n {...result}\n {...rest}\n />\n );\n }\n return null;\n }\n const result = pathMatch(currentPath, path);\n if (result) {\n return (\n <WrappedComponent\n currentPath={currentPath}\n basePath={basePath}\n {...result}\n {...rest}\n />\n );\n }\n return null;\n }\n };\n}", "function PathSearchResultCollector() {\n\n}", "function parsePath(scope, path, origPath) {\n trace('parsePath: ' + path);\n var m = path.match(/^([$a-zA-Z][a-zA-Z0-9_-]*)\\.(.*)$/);\n if (m) {\n var namespace = m[1];\n var rest = m[2];\n\n trace('parsePath: ' + namespace + ', ' + rest);\n return parsePath(scope[namespace], rest, origPath);\n } else {\n return parseLeaf(scope, path, origPath);\n }\n }", "function PathContestProvider() {\n\n}", "get(path){\n if (typeof path === 'string') {\n let array = path.split('.');\n return this.get(array);\n }\n let data = this.data;\n let len = path ? path.length : 0;\n let i;\n for (i = 0; data && i < len; i++) {\n let segment = path[i];\n data = data[segment];\n }\n return i === len ? data : null;\n }", "node(depth) {\n return this.path[this.resolveDepth(depth) * 3];\n }", "function splitPath(p) {\n if (typeof p === 'string') {\n return splitPath({'path' : p});\n }\n\n var a = p.path.split(\"/\");\n p.name = a.pop();\n // console.log(a);\n p.cpath = a.join(\"/\");\n // a.shift();\n // console.log(a);\n p.topname = a.shift(); // get the name of the top dir\n // console.log(a);\n a.unshift(\"\");\n // console.log(a);\n p.cpath1 = a.join(\"/\"); // remove the topdir\n\n var e = p.name.split(\".\");\n if (e.length < 2) {\n p.ext = \"\";\n p.bname = p.name;\n } else {\n p.ext = e.pop();\n p.bname = e.join(\".\");\n }\n return p;\n}", "get path() {\n return parse(this).pathname\n }", "get(name){\n var result=this.getPath(name);\n return result!=undefined?result[1]:undefined;\n }", "constructor(path: string) {\n this.path = path;\n this.absolutePath = null;\n }", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"b\" /* isBlank */])(path) ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "get path() {}", "collectMetadata(stack) {\n const output = {};\n visit(stack);\n // add app-level metadata under \".\"\n if (this.metadata.length > 0) {\n output[construct_1.PATH_SEP] = this.metadata;\n }\n return output;\n function visit(node) {\n if (node.metadata.length > 0) {\n // Make the path absolute\n output[construct_1.PATH_SEP + node.path] = node.metadata.map(md => tokens_1.resolve(md));\n }\n for (const child of node.children) {\n visit(child);\n }\n }\n }", "resolveProp(obj, path) {\n return path.split('.').reduce((prev, curr) => {\n return prev ? prev[curr] : null;\n }, obj);\n }", "build_paths() {\n return {\n items: {\n list: { // Returns a list of items\n method: \"GET\",\n path: \"items\", \n }, \n item: { // Returns a single item with ID %%\n method: \"GET\",\n path: \"items/%%\"\n }, \n item_metadata: { // Returns metadata for item %%\n method: \"GET\",\n path: \"items/%%/metadata\", \n }, \n item_bitstreams: { // Returns available bitstreams for item %%\n method: \"GET\",\n path: \"items/%%/bitstreams\" \n },\n find_by_metadata: { // Returns items based on specified metadata value\n method: \"POST\",\n path: \"items/find-by-metadata-field\"\n } \n },\n query: { \n filtered_items: { // Returns items based on chosen filters\n method: \"GET\",\n path: \"filtered-items\", \n }, \n filtered_collections: { // Returns collections based on chosen filters\n method: \"GET\",\n path: \"filtered-collections\",\n }, \n collection: { // Returns collection with ID %%\n method: \"GET\",\n path: \"filtered-collections/%%\",\n } \n },\n bitstreams: { \n list: { // Returns all bitstreams in DSpace\n method: \"GET\",\n path: \"bitsreams\"\n },\n item: { // Returns an item with bitstream ID %%\n method: \"GET\",\n path: \"bitstreams/{%%}\"\n },\n item_policy: { // Returns the policy for a bitstream with ID %%\n method: \"GET\",\n path: \"bitstreams/%%/policy\"\n },\n content: { // Retrieve content for a bitstream with ID %%\n method: \"GET\",\n path: \"bitstreams/%%/retrieve\"\n }\n },\n schemas: {\n list: { // Returns a list of all schemas\n method: \"GET\",\n path: \"registries/schema\"\n },\n item: { // Returns a metadata schema with schema prefix %%\n method: \"GET\",\n path: \"registries/schema/%%\"\n },\n field: { // Returns a metadata schema with field ID %%\n method: \"GET\",\n path: \"registries/metadata-fields/%%\"\n }\n }\n };\n }", "function _joinAndCanonicalizePath(parts){var path=parts[_ComponentIndex.Path];path=path==null?'':_removeDotSegments(path);parts[_ComponentIndex.Path]=path;return _buildFromEncodedParts(parts[_ComponentIndex.Scheme],parts[_ComponentIndex.UserInfo],parts[_ComponentIndex.Domain],parts[_ComponentIndex.Port],path,parts[_ComponentIndex.QueryData],parts[_ComponentIndex.Fragment]);}", "static GetAtPath() {}", "function ParsedSoak(path) {\n var pathComponents;\n\n if (_.isString(path)) {\n pathComponents = path.split('.');\n } else {\n pathComponents = path;\n }\n\n this.nodes = pathComponents.map(makeSoakNode);\n}", "_resolveObjectPath(path, obj) {\n return path.split(\".\").reduce(function(prev, curr) {\n return prev ? prev[curr] : null;\n }, obj || self);\n }", "function GetNormalizedPath() {\n}", "_resolveReactStyleFile(parsedName) {\n const originalName = parsedName.fullNameWithoutType;\n\n // Convert the compnent name while preserving namespaces\n const parts = originalName.split('/');\n parts[parts.length - 1] = Ember.String.classify(parts[parts.length - 1]);\n const newName = parts.join('/');\n\n const parsedNameWithPascalCase = Object.assign({}, parsedName, {\n fullNameWithoutType: newName,\n });\n const result = this.resolveOther(parsedNameWithPascalCase);\n return result;\n }", "function Path(absolute_path) {\n absolute_path = typeof absolute_path !== 'undefined' ? absolute_path : \"/\";\n\n this.root = new PathNode(\"\", null);\n\n // Initialise to path provided in argument\n var path_parts = absolute_path.split('/');\n for(var i = 0; i < path_parts.length; i++) {\n if(path_parts[i] == \"\") {\n continue;\n }\n\n this.append(path_parts[i]);\n }\n\n this.append = function(name) {\n switch(name) {\n case '..':\n this.truncate();\n return;\n case '.':\n return; // Do nothing\n default:\n var last = this.last();\n last.child = new PathNode(name, last);\n } \n }\n\n // Chop off the last element of the path. Usually used to handle '..'\n this.truncate = function() {\n this.last().parent.child = null;\n }\n\n this.last = function() {\n var cursor = this.root;\n\n while(cursor.child != null) {\n cursor = cursor.child;\n }\n\n return cursor;\n }\n\n this.getIterator = function() {\n return new PathIterator(this);\n }\n\n function PathNode(name, parent, child) {\n child = typeof child !== 'undefined' ? child : null;\n\n this.name = name;\n this.child = child;\n this.parent = parent;\n }\n\n function PathIterator(path) {\n this.next = path.root;\n\n this.getNext = function() {\n if(this.hasNext()) {\n var next = this.next;\n this.next = next.child;\n return next;\n } else {\n return null;\n }\n }\n\n this.hasNext = function() {\n return (this.next != null)\n }\n }\n}", "function fromDotSeparatedString(path){var found=path.search(RESERVED);if(found>=0){throw new index_esm_FirestoreError(Code.INVALID_ARGUMENT,\"Invalid field path (\"+path+\"). Paths must not contain \"+\"'~', '*', '/', '[', or ']'\");}try{return new(FieldPath$1.bind.apply(FieldPath$1,[void 0].concat(path.split('.'))))();}catch(e){throw new index_esm_FirestoreError(Code.INVALID_ARGUMENT,\"Invalid field path (\"+path+\"). Paths must not be empty, \"+\"begin with '.', end with '.', or contain '..'\");}}", "function parse(fileName) {\n\n var baseDir = path.dirname(fileName);\n\n var jsonData = parseFile(fileName);\n if (!jsonData) {\n return null;\n }\n\n jsonData = replace(baseDir, jsonData, 'segment');\n if (!jsonData) {\n return null;\n }\n\n\n if (jsonData.hasOwnProperty('segment')) {\n if (!Array.isArray(jsonData.segment)) {\n console.error('segment must be array');\n return null;\n }\n for (var i = 0; i < jsonData.segment.length; i++) {\n\n var segment = jsonData.segment[i];\n segment = replace(baseDir, segment, 'host');\n if (!segment) {\n return null;\n }\n segment = replace(baseDir, segment, 'gateway');\n if (!segment) {\n return null;\n }\n jsonData.segment[i] = segment;\n }\n }\n\n jsonData = replace(baseDir, jsonData, 'event');\n\n //console.log(JSON.stringify(jsonData));\n return jsonData;\n}", "FindPropertyRelative() {}", "static _materializePath(path) {\n let parts = path.split('.');\n let leaf = parts.slice(-1);\n //dereference the parent path so that its materialized.\n let parent_path = ApplicationState._dereferencePath(parts.slice(0, -1).join('.'));\n return parent_path + '.' + leaf;\n }", "function parse(src) {\n return new recast.types.NodePath(recast.parse(stringify(src)).program);\n}", "function parsePath (path) {\n var hit = pathCache[path];\n if (!hit) {\n hit = parse(path);\n if (hit) {\n pathCache[path] = hit;\n }\n }\n return hit || []\n}", "function absoluteLocationPath(stream, a) {\n var op = stream.peek();\n if ('/' === op || '//' === op) {\n var lhs = a.node('Root');\n return relativeLocationPath(lhs, stream, a, true);\n } else {\n return null;\n }\n }", "function absoluteLocationPath(stream, a) {\n var op = stream.peek();\n if ('/' === op || '//' === op) {\n var lhs = a.node('Root');\n return relativeLocationPath(lhs, stream, a, true);\n } else {\n return null;\n }\n }", "function R(t,e){var r=e.split(/\\.(\\d+)\\.|\\.(\\d+)$/).filter(Boolean);if(r.length<2)return t.paths.hasOwnProperty(r[0])?t.paths[r[0]]:\"adhocOrUndefined\";var n=t.path(r[0]),o=!1;if(!n)return\"adhocOrUndefined\";for(var i=r.length-1,s=1;s<r.length;++s){o=!1;var a=r[s];if(s===i&&n&&!/\\D/.test(a)){n=n.$isMongooseDocumentArray?n.$embeddedSchemaType:n instanceof u.Array?n.caster:void 0;break}if(/\\D/.test(a)){if(!n||!n.schema){n=void 0;break}o=\"nested\"===n.schema.pathType(a),n=n.schema.path(a)}else n instanceof u.Array&&s!==i&&(n=n.caster)}return t.subpaths[e]=n,n?\"real\":o?\"nested\":\"adhocOrUndefined\"}", "function parseLine(line) {\n const groups = line.match(RE_LINE);\n if (groups === null) {\n return undefined;\n }\n const name = groups[21];\n if (name === \".\" || name === \"..\") { // Ignore parent directory links\n return undefined;\n }\n const file = new FileInfo_1.FileInfo(name);\n file.size = parseInt(groups[18], 10);\n file.user = groups[16];\n file.group = groups[17];\n file.hardLinkCount = parseInt(groups[15], 10);\n file.rawModifiedAt = groups[19] + \" \" + groups[20];\n file.permissions = {\n user: parseMode(groups[4], groups[5], groups[6]),\n group: parseMode(groups[8], groups[9], groups[10]),\n world: parseMode(groups[12], groups[13], groups[14]),\n };\n // Set file type\n switch (groups[1].charAt(0)) {\n case \"d\":\n file.type = FileInfo_1.FileType.Directory;\n break;\n case \"e\": // NET-39 => z/OS external link\n file.type = FileInfo_1.FileType.SymbolicLink;\n break;\n case \"l\":\n file.type = FileInfo_1.FileType.SymbolicLink;\n break;\n case \"b\":\n case \"c\":\n file.type = FileInfo_1.FileType.File; // TODO change this if DEVICE_TYPE implemented\n break;\n case \"f\":\n case \"-\":\n file.type = FileInfo_1.FileType.File;\n break;\n default:\n // A 'whiteout' file is an ARTIFICIAL entry in any of several types of\n // 'translucent' filesystems, of which a 'union' filesystem is one.\n file.type = FileInfo_1.FileType.Unknown;\n }\n // Separate out the link name for symbolic links\n if (file.isSymbolicLink) {\n const end = name.indexOf(\" -> \");\n if (end !== -1) {\n file.name = name.substring(0, end);\n file.link = name.substring(end + 4);\n }\n }\n return file;\n}", "constructor( aPath ) {\n this.fullpath = aPath;\n }", "set path(value) {}", "normalize(...variants) {\n\n if (variants.length <= 0)\n return null;\n if (variants.length > 0\n && !Object.usable(variants[0]))\n return null;\n if (variants.length > 1\n && !Object.usable(variants[1]))\n return null;\n\n if (variants.length > 1\n && typeof variants[0] !== \"string\")\n throw new TypeError(\"Invalid root: \" + typeof variants[0]);\n let root = \"#\";\n if (variants.length > 1) {\n root = variants[0];\n try {root = Path.normalize(root);\n } catch (error) {\n root = (root || \"\").trim();\n throw new TypeError(`Invalid root${root ? \": \" + root : \"\"}`);\n }\n }\n\n if (variants.length > 1\n && typeof variants[1] !== \"string\")\n throw new TypeError(\"Invalid path: \" + typeof variants[1]);\n if (variants.length > 0\n && typeof variants[0] !== \"string\")\n throw new TypeError(\"Invalid path: \" + typeof variants[0]);\n let path = \"\";\n if (variants.length === 1)\n path = variants[0];\n if (variants.length === 1\n && path.match(PATTERN_URL))\n path = path.replace(PATTERN_URL, \"$1\");\n else if (variants.length > 1)\n path = variants[1];\n path = (path || \"\").trim();\n\n if (!path.match(PATTERN_PATH))\n throw new TypeError(`Invalid path${String(path).trim() ? \": \" + path : \"\"}`);\n\n path = path.replace(/([^#])#$/, \"$1\");\n path = path.replace(/^([^#])/, \"#$1\");\n\n // Functional paths are detected.\n if (path.match(PATTERN_PATH_FUNCTIONAL))\n return \"###\";\n\n path = root + path;\n path = path.toLowerCase();\n\n // Path will be balanced\n const pattern = /#[^#]+#{2}/;\n while (path.match(pattern))\n path = path.replace(pattern, \"#\");\n path = \"#\" + path.replace(/(^#+)|(#+)$/g, \"\");\n\n return path;\n }", "function extraSrc(src){\r\n if(!path.isAbsolute(src)){\r\n src = path.join(__dirname, src);\r\n }\r\n let basename = path.basename(src);\r\n let basedir = path.dirname(src);\r\n if(!fs.existsSync(basedir)){\r\n throw new Error('path not exists');\r\n }\r\n\r\n if(hasMatchOP(basename)){\r\n return {\r\n fullPath: true,\r\n baseDir: basedir,\r\n matcher: getMatcher(basename),\r\n };\r\n }else {\r\n let stats = fs.lstatSync(src);\r\n if(stats.isDirectory()){\r\n return {\r\n fullPath: false,\r\n baseDir: src,\r\n matcher: /.*/,\r\n }\r\n }else{\r\n return {\r\n fullPath: false,\r\n baseDir: basedir,\r\n matcher: getMatcher(basename),\r\n };\r\n }\r\n }\r\n\r\n function hasMatchOP(s) {\r\n return s.indexOf(\"*\") > -1;\r\n }\r\n \r\n function getMatcher(s) {\r\n let reg = s.replace(/\\./g, \"\\.\").replace(/\\*/g, \".\") + \"$\";\r\n return new RegExp(reg);\r\n }\r\n}", "getFileSystemEntries(path) {\n const ret = { files: [], directories: [] };\n let node = this.rootNode;\n const components = path.split(\"/\").filter(c => c);\n if (components.length !== 1 || components[0]) {\n for (const component of components) {\n const n = node.children.get(component);\n if (!n) {\n return ret;\n }\n node = n;\n }\n }\n node.children.forEach((value, name) => {\n if (value.file) {\n ret.files.push(name);\n }\n else {\n ret.directories.push(name);\n }\n });\n return ret;\n }", "forPathString(path) {\n const pathArray = this.pathUtilService.toPathArray(path);\n return this.forPathArray(pathArray);\n }", "function parsePath (pathstr, fileScope) {\n if (!pathstr)\n return [ [ ] ];\n var pathMatch;\n var path = [];\n var offset = 0;\n while (\n offset < pathstr.length\n && (pathMatch = Patterns.word.exec (pathstr.slice (offset)))\n ) {\n if (!pathMatch[0]) {\n if (!pathMatch.length)\n path.push ([]);\n break;\n }\n offset += pathMatch[0].length;\n\n var fragName = pathMatch[2];\n if (fragName[0] == '`') {\n path.push ([\n pathMatch[1],\n fragName\n .slice (1, -1)\n .replace (/([^\\\\](?:\\\\\\\\)*)\\\\`/g, function (substr, group) {\n return group.replace ('\\\\\\\\', '\\\\') + '`';\n })\n ]);\n continue;\n }\n if (fragName[0] != '[') {\n var delimit = pathMatch[1];\n if (delimit == ':')\n delimit = '/';\n path.push ([ delimit, fragName ]);\n continue;\n }\n\n // Symbol\n path.push ((function parseSymbol (symbolName) {\n var symbolPath = [];\n var symbolMatch;\n var symbolRegex = new RegExp (Patterns.word);\n var symbolOffset = 0;\n while (\n symbolOffset < symbolName.length\n && (symbolMatch = symbolRegex.exec (symbolName.slice (symbolOffset)))\n ) {\n if (!symbolMatch[0])\n break;\n symbolOffset += symbolMatch[0].length;\n var symbolFrag = symbolMatch[2];\n\n if (symbolFrag[0] == '[') {\n // recurse!\n var innerLevel = parseSymbol (symbolFrag.slice (1, -1));\n if (innerLevel[0] === undefined)\n innerLevel[0] = '.';\n symbolPath.push (innerLevel);\n continue;\n }\n if (symbolFrag[0] == '`')\n symbolFrag = symbolFrag\n .slice (1, -1)\n .replace (/([^\\\\](?:\\\\\\\\)*)`/g, function (substr, group) {\n return group.replace ('\\\\\\\\', '\\\\') + '`';\n })\n ;\n var delimit = symbolMatch[1];\n if (delimit == ':')\n delimit = '/';\n symbolPath.push ([ delimit, symbolFrag ]);\n }\n\n if (!symbolPath.length)\n symbolPath.push ([ '.', undefined ]);\n else if (symbolPath[0][0] === undefined)\n symbolPath[0][0] = '.';\n else\n symbolPath = fileScope.concat (symbolPath);\n // symbolPath = concatPaths (fileScope, symbolPath);\n\n var fullPathName = symbolPath\n .map (function (item) { return item[0] + item[1]; })\n .join ('')\n ;\n\n var delimit = pathMatch[1];\n if (delimit == ':')\n delimit = '/';\n return [ delimit, '['+fullPathName.slice (1)+']', symbolPath ];\n }) (fragName.slice (1, -1)));\n }\n if (!path.length)\n path.push ([]);\n return path;\n}", "function R(t,e){var r=e.split(/\\.(\\d+)\\.|\\.(\\d+)$/).filter(Boolean);if(r.length<2)return t.paths.hasOwnProperty(r[0])?t.paths[r[0]]:\"adhocOrUndefined\";var n=t.path(r[0]),i=!1;if(!n)return\"adhocOrUndefined\";for(var o=r.length-1,s=1;s<r.length;++s){i=!1;var a=r[s];if(s===o&&n&&!/\\D/.test(a)){n=n.$isMongooseDocumentArray?n.$embeddedSchemaType:n instanceof $.Array?n.caster:void 0;break}if(/\\D/.test(a)){if(!n||!n.schema){n=void 0;break}i=\"nested\"===n.schema.pathType(a),n=n.schema.path(a)}else n instanceof $.Array&&s!==o&&(n=n.caster)}return t.subpaths[e]=n,n?\"real\":i?\"nested\":\"adhocOrUndefined\"}", "normalizePath() {\n const {path} = options;\n switch (typeof path) {\n case 'function': return path(this.props);\n case 'string': return [path];\n default: return path;\n }\n }", "function nestData(paths, pageFileCache, start = ['']) {\n // output = {\n // type: 'folder',\n // id: '',\n // path: 'fullpath',\n // matter: {frontmatter YAML}\n // files: [\n // {\n // type: 'file',\n // path: 'fullpath'\n // id: 'slug/id'\n // matter: ...\n // },\n // {\n // type: 'file',\n // ...\n // },\n // {\n // type: 'folder',\n // ...\n // files: [\n // ...\n // ],\n // },\n // ]\n // }\n let files = [];\n let startPath = pageFileCache[start.join('/')];\n\n // Remove the element start by compairing ID array\n paths = paths.filter((p) => {\n return (\n Array.isArray(p) ||\n !(\n p.params.id.length === start.length &&\n p.params.id.every((value, index) => value === start[index])\n )\n );\n });\n\n for (let path of paths) {\n if (!Array.isArray(path)) {\n let id = path.params.id.join('/');\n let fullPath = pageFileCache[id];\n\n // Use gray-matter to parse the post metadata section\n const fileContents = fs.readFileSync(fullPath, 'utf8');\n const matterResult = matter(fileContents);\n\n files.push({\n type: 'file',\n id: id,\n path: pageFileCache[id],\n matter: matterResult.data,\n });\n } else {\n // New start will have smallest id length\n let newStart = path.reduce((str, p) => {\n if (!Array.isArray(p)) {\n if (Array.isArray(str)) {\n return p;\n }\n return str.params.id.length < p.params.id.length ? str : p;\n }\n return str;\n }).params.id;\n\n files.push(nestData(path, pageFileCache, newStart));\n }\n }\n\n // Use gray-matter to parse the post metadata section\n const fileContents = fs.readFileSync(startPath, 'utf8');\n const matterResult = matter(fileContents);\n\n return {\n type: 'folder',\n id: start.join('/'),\n path: startPath,\n matter: matterResult.data,\n files: files,\n };\n}", "static _resolvePath(path, object) {\n if (typeof path !== 'string') throw Error(\"Requires a string, got an \" + typeof path + \" that \" + Array.isArray(path) ? \"is\" : \"isn't\" + \" an array\");\n\n object = object || ApplicationState._state;\n const nodes = ApplicationState.walk(path);\n\n for (let index = 0; index < nodes.length; index++) {\n const node = nodes[index];\n object = object[node.name];\n if (typeof object === 'undefined') return undefined;\n if (object === null) return null;\n }\n\n return object;\n }", "static mount(path) {\n if (path.startsWith(\"/\")) {\n const i = path.indexOf(\"/\", 1);\n if (i >= 0) {\n return path.substring(1, i).toLowerCase();\n } else {\n return path.substring(1).toLowerCase();\n }\n } else {\n return \"\";\n }\n }", "function createInspector(path) {\n return () => `[object JXAReference => ${dereference(path+'.toString')}]`;\n}", "constructor(cwd = process.cwd(), pathImpl, sep, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS, } = {}) {\n this.#fs = fsFromOption(fs);\n if (cwd instanceof URL || cwd.startsWith('file://')) {\n cwd = (0, url_1.fileURLToPath)(cwd);\n }\n // resolve and split root, and then add to the store.\n // this is the only time we call path.resolve()\n const cwdPath = pathImpl.resolve(cwd);\n this.roots = Object.create(null);\n this.rootPath = this.parseRootPath(cwdPath);\n this.#resolveCache = new ResolveCache();\n this.#resolvePosixCache = new ResolveCache();\n this.#children = new ChildrenCache(childrenCacheSize);\n const split = cwdPath.substring(this.rootPath.length).split(sep);\n // resolve('/') leaves '', splits to [''], we don't want that.\n if (split.length === 1 && !split[0]) {\n split.pop();\n }\n /* c8 ignore start */\n if (nocase === undefined) {\n throw new TypeError('must provide nocase setting to PathScurryBase ctor');\n }\n /* c8 ignore stop */\n this.nocase = nocase;\n this.root = this.newRoot(this.#fs);\n this.roots[this.rootPath] = this.root;\n let prev = this.root;\n let len = split.length - 1;\n const joinSep = pathImpl.sep;\n let abs = this.rootPath;\n let sawFirst = false;\n for (const part of split) {\n const l = len--;\n prev = prev.child(part, {\n relative: new Array(l).fill('..').join(joinSep),\n relativePosix: new Array(l).fill('..').join('/'),\n fullpath: (abs += (sawFirst ? '' : joinSep) + part),\n });\n sawFirst = true;\n }\n this.cwd = prev;\n }", "function _joinAndCanonicalizePath(parts) {\n\t var path = parts[_ComponentIndex.Path];\n\t path = lang_1.isBlank(path) ? '' : _removeDotSegments(path);\n\t parts[_ComponentIndex.Path] = path;\n\t return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n\t}", "function refFromPath(ref, path) {\n if (ref instanceof StorageService) {\n var service = ref;\n if (service._bucket == null) {\n throw noDefaultBucket();\n }\n var reference = new Reference(service, service._bucket);\n if (path != null) {\n return refFromPath(reference, path);\n }\n else {\n return reference;\n }\n }\n else {\n // ref is a Reference\n if (path !== undefined) {\n if (path.includes('..')) {\n throw invalidArgument('`path` param cannot contain \"..\"');\n }\n return _getChild(ref, path);\n }\n else {\n return ref;\n }\n }\n}", "function refFromPath(ref, path) {\n if (ref instanceof StorageService) {\n var service = ref;\n if (service._bucket == null) {\n throw noDefaultBucket();\n }\n var reference = new Reference(service, service._bucket);\n if (path != null) {\n return refFromPath(reference, path);\n }\n else {\n return reference;\n }\n }\n else {\n // ref is a Reference\n if (path !== undefined) {\n if (path.includes('..')) {\n throw invalidArgument('`path` param cannot contain \"..\"');\n }\n return _getChild(ref, path);\n }\n else {\n return ref;\n }\n }\n}", "function refFromPath(ref, path) {\n if (ref instanceof StorageService) {\n var service = ref;\n if (service._bucket == null) {\n throw noDefaultBucket();\n }\n var reference = new Reference(service, service._bucket);\n if (path != null) {\n return refFromPath(reference, path);\n }\n else {\n return reference;\n }\n }\n else {\n // ref is a Reference\n if (path !== undefined) {\n if (path.includes('..')) {\n throw invalidArgument('`path` param cannot contain \"..\"');\n }\n return _getChild(ref, path);\n }\n else {\n return ref;\n }\n }\n}", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n }", "match(path,pathname) {\n let keys=[];\n if(path instanceof RegExp){\n let match = pathname.match(path);\n return !match ? null : {\n token:match,\n keys:[]\n }\n } else {\n let token = pathToRegexp(path,keys).exec(pathname);\n return token == null ? null: {\n token:token,\n keys:keys\n }\n }\n }", "function UriUtils() {}", "beforeMount() {\n // Parse l'URL actuelle\n this.parseURL();\n }", "static _dereferencePath(path) {\n if (!ApplicationState._symlinks)\n return path;\n\n const nodes = ApplicationState.walk(path);\n\n for (let index = 0; index < nodes.length; index++) {\n const node = nodes[index];\n if (ApplicationState._symlinks[node.path]) {\n path = path.replace(node.path, ApplicationState._symlinks[node.path]);\n return ApplicationState._dereferencePath(path);\n }\n }\n\n return path;\n }", "getPath() {\n return this.props.path;\n }", "function splitPath(path)\n{\n var parts = path.split(\"/\");\n var idx = -1;\n for (var i = parts.length - 2; i >= 0; --i)\n {\n var lcpath = parts[i].toLowerCase();\n if (lcpath.endsWith(\".zip\") ||\n lcpath.endsWith(\".tgz\"))\n {\n idx = i;\n break;\n }\n }\n \n if (idx != -1)\n {\n var outerPath = parts.slice(0, idx + 1).join(\"/\");\n var innerPath = parts.slice(idx + 1).join(\"/\");\n //console.log(\"vfs.splitPath: \" + path + \" -> \" + outerPath + \"#\" + innerPath);\n return [outerPath, innerPath];\n }\n else\n {\n return [\"\", \"\"];\n }\n}", "getDepth(obj, path) {\n return path.split('.').reduce((value, tag) => {\n return value[tag];\n }, obj);\n }", "function createPathProxyFromString(data) {\n if (!data) {\n return new PathProxy();\n } // var data = data.replace(/-/g, ' -')\n // .replace(/ /g, ' ')\n // .replace(/ /g, ',')\n // .replace(/,,/g, ',');\n // var n;\n // create pipes so that we can split the data\n // for (n = 0; n < cc.length; n++) {\n // cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]);\n // }\n // data = data.replace(/-/g, ',-');\n // create array\n // var arr = cs.split('|');\n // init context point\n\n\n var cpx = 0;\n var cpy = 0;\n var subpathX = cpx;\n var subpathY = cpy;\n var prevCmd;\n var path = new PathProxy();\n var CMD = PathProxy.CMD; // commandReg.lastIndex = 0;\n // var cmdResult;\n // while ((cmdResult = commandReg.exec(data)) != null) {\n // var cmdStr = cmdResult[1];\n // var cmdContent = cmdResult[2];\n\n var cmdList = data.match(commandReg);\n\n for (var l = 0; l < cmdList.length; l++) {\n var cmdText = cmdList[l];\n var cmdStr = cmdText.charAt(0);\n var cmd; // String#split is faster a little bit than String#replace or RegExp#exec.\n // var p = cmdContent.split(valueSplitReg);\n // var pLen = 0;\n // for (var i = 0; i < p.length; i++) {\n // // '' and other invalid str => NaN\n // var val = parseFloat(p[i]);\n // !isNaN(val) && (p[pLen++] = val);\n // }\n\n var p = cmdText.match(numberReg) || [];\n var pLen = p.length;\n\n for (var i = 0; i < pLen; i++) {\n p[i] = parseFloat(p[i]);\n }\n\n var off = 0;\n\n while (off < pLen) {\n var ctlPtx;\n var ctlPty;\n var rx;\n var ry;\n var psi;\n var fa;\n var fs;\n var x1 = cpx;\n var y1 = cpy; // convert l, H, h, V, and v to L\n\n switch (cmdStr) {\n case 'l':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'L':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'm':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'l';\n break;\n\n case 'M':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'L';\n break;\n\n case 'h':\n cpx += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'H':\n cpx = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'v':\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'V':\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'C':\n cmd = CMD.C;\n path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\n cpx = p[off - 2];\n cpy = p[off - 1];\n break;\n\n case 'c':\n cmd = CMD.C;\n path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\n cpx += p[off - 2];\n cpy += p[off - 1];\n break;\n\n case 'S':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 's':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = cpx + p[off++];\n y1 = cpy + p[off++];\n cpx += p[off++];\n cpy += p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 'Q':\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'q':\n x1 = p[off++] + cpx;\n y1 = p[off++] + cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'T':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 't':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 'A':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n\n case 'a':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n }\n }\n\n if (cmdStr === 'z' || cmdStr === 'Z') {\n cmd = CMD.Z;\n path.addData(cmd); // z may be in the middle of the path.\n\n cpx = subpathX;\n cpy = subpathY;\n }\n\n prevCmd = cmd;\n }\n\n path.toStatic();\n return path;\n} // TODO Optimize double memory cost problem", "function createPathProxyFromString(data) {\n if (!data) {\n return new PathProxy();\n } // var data = data.replace(/-/g, ' -')\n // .replace(/ /g, ' ')\n // .replace(/ /g, ',')\n // .replace(/,,/g, ',');\n // var n;\n // create pipes so that we can split the data\n // for (n = 0; n < cc.length; n++) {\n // cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]);\n // }\n // data = data.replace(/-/g, ',-');\n // create array\n // var arr = cs.split('|');\n // init context point\n\n\n var cpx = 0;\n var cpy = 0;\n var subpathX = cpx;\n var subpathY = cpy;\n var prevCmd;\n var path = new PathProxy();\n var CMD = PathProxy.CMD; // commandReg.lastIndex = 0;\n // var cmdResult;\n // while ((cmdResult = commandReg.exec(data)) != null) {\n // var cmdStr = cmdResult[1];\n // var cmdContent = cmdResult[2];\n\n var cmdList = data.match(commandReg);\n\n for (var l = 0; l < cmdList.length; l++) {\n var cmdText = cmdList[l];\n var cmdStr = cmdText.charAt(0);\n var cmd; // String#split is faster a little bit than String#replace or RegExp#exec.\n // var p = cmdContent.split(valueSplitReg);\n // var pLen = 0;\n // for (var i = 0; i < p.length; i++) {\n // // '' and other invalid str => NaN\n // var val = parseFloat(p[i]);\n // !isNaN(val) && (p[pLen++] = val);\n // }\n\n var p = cmdText.match(numberReg) || [];\n var pLen = p.length;\n\n for (var i = 0; i < pLen; i++) {\n p[i] = parseFloat(p[i]);\n }\n\n var off = 0;\n\n while (off < pLen) {\n var ctlPtx;\n var ctlPty;\n var rx;\n var ry;\n var psi;\n var fa;\n var fs;\n var x1 = cpx;\n var y1 = cpy; // convert l, H, h, V, and v to L\n\n switch (cmdStr) {\n case 'l':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'L':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'm':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'l';\n break;\n\n case 'M':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'L';\n break;\n\n case 'h':\n cpx += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'H':\n cpx = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'v':\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'V':\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'C':\n cmd = CMD.C;\n path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\n cpx = p[off - 2];\n cpy = p[off - 1];\n break;\n\n case 'c':\n cmd = CMD.C;\n path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\n cpx += p[off - 2];\n cpy += p[off - 1];\n break;\n\n case 'S':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 's':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = cpx + p[off++];\n y1 = cpy + p[off++];\n cpx += p[off++];\n cpy += p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 'Q':\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'q':\n x1 = p[off++] + cpx;\n y1 = p[off++] + cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'T':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 't':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 'A':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n\n case 'a':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n }\n }\n\n if (cmdStr === 'z' || cmdStr === 'Z') {\n cmd = CMD.Z;\n path.addData(cmd); // z may be in the middle of the path.\n\n cpx = subpathX;\n cpy = subpathY;\n }\n\n prevCmd = cmd;\n }\n\n path.toStatic();\n return path;\n} // TODO Optimize double memory cost problem", "function createPathProxyFromString(data) {\n if (!data) {\n return new PathProxy();\n } // var data = data.replace(/-/g, ' -')\n // .replace(/ /g, ' ')\n // .replace(/ /g, ',')\n // .replace(/,,/g, ',');\n // var n;\n // create pipes so that we can split the data\n // for (n = 0; n < cc.length; n++) {\n // cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]);\n // }\n // data = data.replace(/-/g, ',-');\n // create array\n // var arr = cs.split('|');\n // init context point\n\n\n var cpx = 0;\n var cpy = 0;\n var subpathX = cpx;\n var subpathY = cpy;\n var prevCmd;\n var path = new PathProxy();\n var CMD = PathProxy.CMD; // commandReg.lastIndex = 0;\n // var cmdResult;\n // while ((cmdResult = commandReg.exec(data)) != null) {\n // var cmdStr = cmdResult[1];\n // var cmdContent = cmdResult[2];\n\n var cmdList = data.match(commandReg);\n\n for (var l = 0; l < cmdList.length; l++) {\n var cmdText = cmdList[l];\n var cmdStr = cmdText.charAt(0);\n var cmd; // String#split is faster a little bit than String#replace or RegExp#exec.\n // var p = cmdContent.split(valueSplitReg);\n // var pLen = 0;\n // for (var i = 0; i < p.length; i++) {\n // // '' and other invalid str => NaN\n // var val = parseFloat(p[i]);\n // !isNaN(val) && (p[pLen++] = val);\n // }\n\n var p = cmdText.match(numberReg) || [];\n var pLen = p.length;\n\n for (var i = 0; i < pLen; i++) {\n p[i] = parseFloat(p[i]);\n }\n\n var off = 0;\n\n while (off < pLen) {\n var ctlPtx;\n var ctlPty;\n var rx;\n var ry;\n var psi;\n var fa;\n var fs;\n var x1 = cpx;\n var y1 = cpy; // convert l, H, h, V, and v to L\n\n switch (cmdStr) {\n case 'l':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'L':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'm':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'l';\n break;\n\n case 'M':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'L';\n break;\n\n case 'h':\n cpx += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'H':\n cpx = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'v':\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'V':\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'C':\n cmd = CMD.C;\n path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\n cpx = p[off - 2];\n cpy = p[off - 1];\n break;\n\n case 'c':\n cmd = CMD.C;\n path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\n cpx += p[off - 2];\n cpy += p[off - 1];\n break;\n\n case 'S':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 's':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = cpx + p[off++];\n y1 = cpy + p[off++];\n cpx += p[off++];\n cpy += p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 'Q':\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'q':\n x1 = p[off++] + cpx;\n y1 = p[off++] + cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'T':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 't':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 'A':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n\n case 'a':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n }\n }\n\n if (cmdStr === 'z' || cmdStr === 'Z') {\n cmd = CMD.Z;\n path.addData(cmd); // z may be in the middle of the path.\n\n cpx = subpathX;\n cpy = subpathY;\n }\n\n prevCmd = cmd;\n }\n\n path.toStatic();\n return path;\n} // TODO Optimize double memory cost problem", "function createPathProxyFromString(data) {\n if (!data) {\n return new PathProxy();\n } // var data = data.replace(/-/g, ' -')\n // .replace(/ /g, ' ')\n // .replace(/ /g, ',')\n // .replace(/,,/g, ',');\n // var n;\n // create pipes so that we can split the data\n // for (n = 0; n < cc.length; n++) {\n // cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]);\n // }\n // data = data.replace(/-/g, ',-');\n // create array\n // var arr = cs.split('|');\n // init context point\n\n\n var cpx = 0;\n var cpy = 0;\n var subpathX = cpx;\n var subpathY = cpy;\n var prevCmd;\n var path = new PathProxy();\n var CMD = PathProxy.CMD; // commandReg.lastIndex = 0;\n // var cmdResult;\n // while ((cmdResult = commandReg.exec(data)) != null) {\n // var cmdStr = cmdResult[1];\n // var cmdContent = cmdResult[2];\n\n var cmdList = data.match(commandReg);\n\n for (var l = 0; l < cmdList.length; l++) {\n var cmdText = cmdList[l];\n var cmdStr = cmdText.charAt(0);\n var cmd; // String#split is faster a little bit than String#replace or RegExp#exec.\n // var p = cmdContent.split(valueSplitReg);\n // var pLen = 0;\n // for (var i = 0; i < p.length; i++) {\n // // '' and other invalid str => NaN\n // var val = parseFloat(p[i]);\n // !isNaN(val) && (p[pLen++] = val);\n // }\n\n var p = cmdText.match(numberReg) || [];\n var pLen = p.length;\n\n for (var i = 0; i < pLen; i++) {\n p[i] = parseFloat(p[i]);\n }\n\n var off = 0;\n\n while (off < pLen) {\n var ctlPtx;\n var ctlPty;\n var rx;\n var ry;\n var psi;\n var fa;\n var fs;\n var x1 = cpx;\n var y1 = cpy; // convert l, H, h, V, and v to L\n\n switch (cmdStr) {\n case 'l':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'L':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'm':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'l';\n break;\n\n case 'M':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'L';\n break;\n\n case 'h':\n cpx += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'H':\n cpx = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'v':\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'V':\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'C':\n cmd = CMD.C;\n path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\n cpx = p[off - 2];\n cpy = p[off - 1];\n break;\n\n case 'c':\n cmd = CMD.C;\n path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\n cpx += p[off - 2];\n cpy += p[off - 1];\n break;\n\n case 'S':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 's':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = cpx + p[off++];\n y1 = cpy + p[off++];\n cpx += p[off++];\n cpy += p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 'Q':\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'q':\n x1 = p[off++] + cpx;\n y1 = p[off++] + cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'T':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 't':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 'A':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n\n case 'a':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n }\n }\n\n if (cmdStr === 'z' || cmdStr === 'Z') {\n cmd = CMD.Z;\n path.addData(cmd); // z may be in the middle of the path.\n\n cpx = subpathX;\n cpy = subpathY;\n }\n\n prevCmd = cmd;\n }\n\n path.toStatic();\n return path;\n} // TODO Optimize double memory cost problem", "get _readAttributeGroupPathProps() {\n if (this._readAttributeGroupPathProps_cached === undefined) {\n var allOutBounds = this.activeList.allOutBounds;\n this._readAttributeGroupPathProps_cached = this._location.computeERMrestCompactPath(allOutBounds.map(function (ao) {\n return ao.sourceObject;\n }));\n }\n return this._readAttributeGroupPathProps_cached;\n }", "remap(accessPath) {\n if (!this.$nspEnabled) {\n return accessPath;\n }\n return new mona_dish_1.Es2019Array(...accessPath).map(key => (0, Const_1.$nsp)(key));\n }", "function resolveObjectFromPath(object, path) {\n path = path.replace(/\\[(\\w+)\\]/g, '.$1'); // convert indexes to properties\n path = path.replace(/^\\./, ''); // strip a leading dot\n var a = path.split('.');\n while (a.length) {\n var n = a.shift();\n if (n in object) {\n object = object[n];\n } else {\n return;\n }\n }\n return object;\n }", "traverse(obj, path) {\n if (path == null) return undefined;\n let pelems = path.split('.');\n let res = obj;\n pelems.forEach(function (item) {\n res = item === 'this' ? obj : res[item];\n });\n return res;\n }", "constructor(inputPath /*: string */) {\n this._inputPath = inputPath;\n }", "function parsePath(p) {\n var extname = path.extname(p);\n return {\n dirname: path.dirname(p),\n basename: path.basename(p, extname),\n extname: extname\n };\n}", "function l(e,t){\"\"===e&&(e=\".\"),e=e.replace(/\\/$/,\"\");\n// XXX: It is possible to remove this block, and the tests still pass!\nvar n=o(e);return\"/\"==t.charAt(0)&&n&&\"/\"==n.path?t.slice(1):0===t.indexOf(e+\"/\")?t.substr(e.length+1):t}", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "build_paths() {\n return {\n items: {\n list: { // Returns a list of items\n method: \"GET\",\n path: \"[path]\", \n }, \n item: { // Returns a single item with ID %%\n method: \"GET\",\n path: \"[path]/%%\"\n }, \n item_metadata: { // Returns metadata for item %%\n method: \"GET\",\n path: \"[path]/%%/[key]\", \n }, \n find_by_metadata: { // Returns items based on specified metadata value\n method: \"POST\",\n path: \"[path]\"\n } \n },\n query: { \n filtered_items: { // Returns items based on chosen filters\n method: \"GET\",\n path: \"[path]\", \n }, \n filtered_collections: { // Returns collections based on chosen filters\n method: \"GET\",\n path: \"[path]\",\n }, \n collection: { // Returns collection with ID %%\n method: \"GET\",\n path: \"[path]/%%\",\n } \n }\n };\n }", "getParsedAttribute(input) {\n return input.substring(input.indexOf(\"{\") + 1, input.indexOf(\"/\"));\n }", "get pathLength() {\n return 0;\n }", "_getFullyQualifiedNameFromPath(absolutePath) {\n const sourceName = (0, source_names_1.replaceBackslashes)(path.relative(this._artifactsPath, path.dirname(absolutePath)));\n const contractName = path.basename(absolutePath).replace(\".json\", \"\");\n return (0, contract_names_1.getFullyQualifiedName)(sourceName, contractName);\n }", "rel (relativePath) {\n return nodePath.normalize(relativePath);\n }", "get path () {\n return __dirname\n }", "function _joinAndCanonicalizePath(parts) {\n let path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function _joinAndCanonicalizePath(parts) {\n let path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function _joinAndCanonicalizePath(parts) {\n let path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function _joinAndCanonicalizePath(parts) {\n let path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "get propertyPath() {}", "resolve(prefix) {\n var _a, _b;\n let uri = this.topNS[prefix];\n if (uri !== undefined) {\n return uri;\n }\n const { tags } = this;\n for (let index = tags.length - 1; index >= 0; index--) {\n uri = tags[index].ns[prefix];\n if (uri !== undefined) {\n return uri;\n }\n }\n uri = this.ns[prefix];\n if (uri !== undefined) {\n return uri;\n }\n return (_b = (_a = this.opt).resolvePrefix) === null || _b === void 0 ? void 0 : _b.call(_a, prefix);\n }", "toString() {\n this.path\n }", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "_$memberof() {\n super._$memberof();\n this._value.memberof = this._pathResolver.filePath;\n }", "function PathBuffer() {\n var buffer = \"\";\n var match_id = 1;\n\n this.toMatch = function (params, useSeparator) {\n useSeparator = (useSeparator === false) ? false : true;\n var b = buffer;\n this.flush();\n if (b[0] == \":\") {\n params[b.substring(1)] = match_id++;\n return useSeparator ? \"([^/;.]+)\" : \"(.+)\";\n } else {\n return b;\n }\n }\n\n this.append = function (str) {\n buffer += str;\n }\n\n this.flush = function () {\n buffer = \"\";\n }\n}", "_removeDotSegments(iri) {\n // Don't modify the IRI if it does not contain any dot segments\n if (!/(^|\\/)\\.\\.?($|[/#?])/.test(iri)) return iri; // Start with an imaginary slash before the IRI in order to resolve trailing './' and '../'\n\n var result = '',\n length = iri.length,\n i = -1,\n pathStart = -1,\n segmentStart = 0,\n next = '/';\n\n while (i < length) {\n switch (next) {\n // The path starts with the first slash after the authority\n case ':':\n if (pathStart < 0) {\n // Skip two slashes before the authority\n if (iri[++i] === '/' && iri[++i] === '/') // Skip to slash after the authority\n while ((pathStart = i + 1) < length && iri[pathStart] !== '/') i = pathStart;\n }\n\n break;\n // Don't modify a query string or fragment\n\n case '?':\n case '#':\n i = length;\n break;\n // Handle '/.' or '/..' path segments\n\n case '/':\n if (iri[i + 1] === '.') {\n next = iri[++i + 1];\n\n switch (next) {\n // Remove a '/.' segment\n case '/':\n result += iri.substring(segmentStart, i - 1);\n segmentStart = i + 1;\n break;\n // Remove a trailing '/.' segment\n\n case undefined:\n case '?':\n case '#':\n return result + iri.substring(segmentStart, i) + iri.substr(i + 1);\n // Remove a '/..' segment\n\n case '.':\n next = iri[++i + 1];\n\n if (next === undefined || next === '/' || next === '?' || next === '#') {\n result += iri.substring(segmentStart, i - 2); // Try to remove the parent path from result\n\n if ((segmentStart = result.lastIndexOf('/')) >= pathStart) result = result.substr(0, segmentStart); // Remove a trailing '/..' segment\n\n if (next !== '/') return result + '/' + iri.substr(i + 1);\n segmentStart = i + 1;\n }\n\n }\n }\n\n }\n\n next = iri[++i];\n }\n\n return result + iri.substring(segmentStart);\n }", "function lookup(connection, path, callback) {\n\tpath = paths.resolve(path);\n\tvar comps = paths.resolve(path).split('/');\n\twhile (comps[0] === '') comps.shift();\n\tvar currentNode = fileTree[\"/\"];\n\twhile (currentName = comps.shift()) {\n\t\tcurrentNode = currentNode.children[currentName];\n\t}\n\tconsole.log(currentNode);\n\treturn callback(currentNode);\n\tif (comps.length === 0) {\n\t\treturn callback({ \"type\":\"folder\", \"id\":0, \"name\":'/' });\n\t}\n\tgfi({'id':0,'type':'folder'}, comps, callback);\n}", "function parse (path: Path): ?Array<string> {\n const keys: Array<string> = []\n let index: number = -1\n let mode: number = BEFORE_PATH\n let subPathDepth: number = 0\n let c: ?string\n let key: any\n let newChar: any\n let type: string\n let transition: number\n let action: Function\n let typeMap: any\n const actions: Array<Function> = []\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key)\n key = undefined\n }\n }\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar\n } else {\n key += newChar\n }\n }\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]()\n subPathDepth++\n }\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--\n mode = IN_SUB_PATH\n actions[APPEND]()\n } else {\n subPathDepth = 0\n if (key === undefined) { return false }\n key = formatSubPath(key)\n if (key === false) {\n return false\n } else {\n actions[PUSH]()\n }\n }\n }\n\n function maybeUnescapeQuote (): ?boolean {\n const nextChar: string = path[index + 1]\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++\n newChar = '\\\\' + nextChar\n actions[APPEND]()\n return true\n }\n }\n\n while (mode !== null) {\n index++\n c = path[index]\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c)\n typeMap = pathStateMachine[mode]\n transition = typeMap[type] || typeMap['else'] || ERROR\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0]\n action = actions[transition[1]]\n if (action) {\n newChar = transition[2]\n newChar = newChar === undefined\n ? c\n : newChar\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}\n\nexport type PathValue = PathValueObject | PathValueArray | Function | string | number | boolean | null\nexport type PathValueObject = { [key: string]: PathValue }\nexport type PathValueArray = Array<PathValue>\n\nexport default class I18nPath {\n _cache: Object\n\n constructor () {\n this._cache = Object.create(null)\n }\n\n /**\n * External parse that check for a cache hit first\n */\n parsePath (path: Path): Array<string> {\n let hit: ?Array<string> = this._cache[path]\n if (!hit) {\n hit = parse(path)\n if (hit) {\n this._cache[path] = hit\n }\n }\n return hit || []\n }\n\n /**\n * Get path value from path string\n */\n getPathValue (obj: mixed, path: Path): PathValue {\n if (!isObject(obj)) { return null }\n\n const paths: Array<string> = this.parsePath(path)\n if (paths.length === 0) {\n return null\n } else {\n const length: number = paths.length\n let last: any = obj\n let i: number = 0\n while (i < length) {\n const value: any = last[paths[i]]\n if (value === undefined || value === null) {\n return null\n }\n last = value\n i++\n }\n\n return last\n }\n }\n}", "function fastpathRead(obj, name) {\n if (name === 'toString') { fail(\"internal: Can't fastpath .toString\"); }\n obj[name + '_canRead___'] = obj;\n }", "function processPath(path) {\n var query;\n if (path && path.pop && path.length) {\n if (typeof path[path.length-1] === 'object') {\n path.query = path.pop();\n }\n return path;\n } else if (typeof path === \"object\") { // options\n var empty = [];\n empty.query = path;\n return empty;\n } else if (path) { // string\n return [path];\n } else {\n return [];\n }\n}", "function getPathValue(path, ctx) {\n\t\t'use strict';\n\n\t\tif (path.length === 1 && path[0].length !== 0) {\n\t\t\treturn ctx.get(path[0]);\n\t\t}\n\t\t// anchor = false;\n\t\tif (path[0].length === 0) {\n\t\t\treturn ctx.getPath(true, path.slice(1));\n\t\t}\n\t\treturn ctx.getPath(false, path);\n\t}", "get pathname()\t{ return \"\" + this.path + this.file}" ]
[ "0.5330813", "0.52984315", "0.529492", "0.529492", "0.5274405", "0.5143759", "0.5018973", "0.501283", "0.4958384", "0.49160057", "0.49114686", "0.49084407", "0.48925844", "0.48905814", "0.4841846", "0.48293707", "0.4828044", "0.48060423", "0.47611177", "0.4760366", "0.4759058", "0.4723093", "0.47184458", "0.47044343", "0.46913365", "0.46846738", "0.46832794", "0.46801093", "0.4678943", "0.4677507", "0.46505973", "0.4633651", "0.46086505", "0.4606106", "0.45933717", "0.45933717", "0.4589851", "0.45864376", "0.4586357", "0.45834827", "0.45714527", "0.4571108", "0.4567635", "0.45544946", "0.45452327", "0.4539719", "0.4537815", "0.45328972", "0.45209765", "0.45204374", "0.4517013", "0.4511796", "0.44965598", "0.4491481", "0.4491481", "0.4491481", "0.44800153", "0.44797647", "0.4479611", "0.44770712", "0.4475703", "0.4474753", "0.4471225", "0.44687673", "0.44676766", "0.44676766", "0.44676766", "0.44676766", "0.44640303", "0.44625834", "0.44553053", "0.44531232", "0.44468248", "0.44462797", "0.44381744", "0.44372645", "0.44363186", "0.44308856", "0.44292757", "0.44177955", "0.44171482", "0.44113973", "0.44105452", "0.44105452", "0.44105452", "0.44105452", "0.44095418", "0.4407351", "0.44016948", "0.43977", "0.43977", "0.43977", "0.4395049", "0.43846282", "0.43817782", "0.43799496", "0.43782827", "0.43771586", "0.43770137", "0.4372343", "0.4371685" ]
0.0
-1
which is reasonable. But dimension name is duplicated. Returns undefined or an array contains only object without null/undefiend or string.
function normalizeDimensionsDefine(dimensionsDefine) { if (!dimensionsDefine) { // The meaning of null/undefined is different from empty array. return; } var nameMap = createHashMap(); return map(dimensionsDefine, function (item, index) { item = extend({}, isObject(item) ? item : { name: item }); // User can set null in dimensions. // We dont auto specify name, othewise a given name may // cause it be refered unexpectedly. if (item.name == null) { return item; } // Also consider number form like 2012. item.name += ''; // User may also specify displayName. // displayName will always exists except user not // specified or dim name is not specified or detected. // (A auto generated dim name will not be used as // displayName). if (item.displayName == null) { item.displayName = item.name; } var exist = nameMap.get(item.name); if (!exist) { nameMap.set(item.name, { count: 1 }); } else { item.name += '-' + exist.count++; } return item; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDimensionName() {\n var dummyRecord = {};\n Object.keys(dimensions).forEach(function(d) {\n dummyRecord[d] = d;\n });\n\n return dimensionFct(dummyRecord);\n }", "parseArrayDimension () {\n const dimToken = this.getToken();\n if(dimToken.type === this.lexerClass.INTEGER) {\n //parse as int literal\n this.pos++;\n return this.getIntLiteral(dimToken);\n } else if(dimToken.type === this.lexerClass.ID) {\n //parse as variable\n this.pos++;\n return this.parseVariable(dimToken);\n } else {\n throw SyntaxErrorFactory.invalid_array_dimension(this.lexer.literalNames[this.lexerClass.RK_INTEGER], dimToken);\n }\n }", "function getSlice(dimensionName) {\n if (typeof filters[dimensionName] != \"undefined\") {\n return filters[dimensionName];\n }\n else {\n return dimensions[dimensionName].members;\n }\n }", "_returnEmptyArray() {\n const that = this,\n emptyArray = [];\n let current = emptyArray;\n\n if (that.dimensions > 1) {\n for (let i = 1; i < that.dimensions; i++) {\n current[0] = [];\n current = current[0];\n }\n }\n\n return emptyArray;\n }", "getDimensions() {\n return { x: 1, y: 1, z: 1 };\n }", "_validateValueArrayDimensions() {\n const that = this;\n let dimensions = 0,\n tempArray = that.value,\n emptyArray = false;\n\n while (tempArray.constructor === Array) {\n dimensions++;\n tempArray = tempArray[0];\n\n if (tempArray === undefined) {\n emptyArray = true;\n break;\n }\n }\n\n if (that.dimensions > dimensions) {\n if (emptyArray) {\n that.value = that._returnEmptyArray();\n return;\n }\n\n while (that.dimensions > dimensions) {\n that._addDimensionToJSArray(dimensions);\n dimensions++;\n }\n }\n }", "function GetDimension()\n{\n\treturn m_dimension;\n}", "function normalizeDimensionsOption(dimensionsDefine) {\n\t if (!dimensionsDefine) {\n\t // The meaning of null/undefined is different from empty array.\n\t return;\n\t }\n\t\n\t var nameMap = createHashMap();\n\t return map(dimensionsDefine, function (rawItem, index) {\n\t rawItem = isObject(rawItem) ? rawItem : {\n\t name: rawItem\n\t }; // Other fields will be discarded.\n\t\n\t var item = {\n\t name: rawItem.name,\n\t displayName: rawItem.displayName,\n\t type: rawItem.type\n\t }; // User can set null in dimensions.\n\t // We dont auto specify name, othewise a given name may\n\t // cause it be refered unexpectedly.\n\t\n\t if (item.name == null) {\n\t return item;\n\t } // Also consider number form like 2012.\n\t\n\t\n\t item.name += ''; // User may also specify displayName.\n\t // displayName will always exists except user not\n\t // specified or dim name is not specified or detected.\n\t // (A auto generated dim name will not be used as\n\t // displayName).\n\t\n\t if (item.displayName == null) {\n\t item.displayName = item.name;\n\t }\n\t\n\t var exist = nameMap.get(item.name);\n\t\n\t if (!exist) {\n\t nameMap.set(item.name, {\n\t count: 1\n\t });\n\t } else {\n\t item.name += '-' + exist.count++;\n\t }\n\t\n\t return item;\n\t });\n\t }", "_removeDimensionFromJSArray() {\n const that = this;\n\n if (that.arrayIndexingMode === 'LabVIEW') {\n that.value = that.value[0];\n }\n else {\n const dimensions = that.dimensions + 1,\n recursion = function (arr, level, parent, index) {\n for (let i = 0; i < arr.length; i++) {\n if (level !== dimensions && arr[i].length > 0) {\n recursion(arr[i], level + 1, arr, i);\n }\n else {\n if (parent !== undefined) {\n parent[index] = arr[0];\n }\n else {\n that.value = that.value[0];\n }\n }\n }\n };\n\n recursion(that.value, 1);\n }\n }", "function normalizeDimensionsOption(dimensionsDefine) {\n if (!dimensionsDefine) {\n // The meaning of null/undefined is different from empty array.\n return;\n }\n\n var nameMap = createHashMap();\n return map(dimensionsDefine, function (rawItem, index) {\n rawItem = isObject(rawItem) ? rawItem : {\n name: rawItem\n }; // Other fields will be discarded.\n\n var item = {\n name: rawItem.name,\n displayName: rawItem.displayName,\n type: rawItem.type\n }; // User can set null in dimensions.\n // We dont auto specify name, othewise a given name may\n // cause it be refered unexpectedly.\n\n if (item.name == null) {\n return item;\n } // Also consider number form like 2012.\n\n\n item.name += ''; // User may also specify displayName.\n // displayName will always exists except user not\n // specified or dim name is not specified or detected.\n // (A auto generated dim name will not be used as\n // displayName).\n\n if (item.displayName == null) {\n item.displayName = item.name;\n }\n\n var exist = nameMap.get(item.name);\n\n if (!exist) {\n nameMap.set(item.name, {\n count: 1\n });\n } else {\n item.name += '-' + exist.count++;\n }\n\n return item;\n });\n}", "function getDimension(unit, ID) {\n var index = 0;\n // Declare a local dimension object\n var selectedDim = new Dimension();\n\n while (index < unit.Dimensions.length) {\n if (ID == unit.Dimensions[index].ID) {\n selectedDim = unit.Dimensions[index];\n break;\n }\n index++;\n\n }\n return (selectedDim);\n }", "function isArray(e){return e!=null&&typeof e==\"object\"&&typeof e.length==\"number\"&&(e.length==0||defined(e[0]))}", "function normalizeDimensionsOption(dimensionsDefine) {\n if (!dimensionsDefine) {\n // The meaning of null/undefined is different from empty array.\n return;\n }\n\n var nameMap = Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_0__[/* createHashMap */ \"g\"])();\n return Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_0__[/* map */ \"H\"])(dimensionsDefine, function (rawItem, index) {\n rawItem = Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_0__[/* isObject */ \"z\"])(rawItem) ? rawItem : {\n name: rawItem\n }; // Other fields will be discarded.\n\n var item = {\n name: rawItem.name,\n displayName: rawItem.displayName,\n type: rawItem.type\n }; // User can set null in dimensions.\n // We dont auto specify name, othewise a given name may\n // cause it be refered unexpectedly.\n\n if (item.name == null) {\n return item;\n } // Also consider number form like 2012.\n\n\n item.name += ''; // User may also specify displayName.\n // displayName will always exists except user not\n // specified or dim name is not specified or detected.\n // (A auto generated dim name will not be used as\n // displayName).\n\n if (item.displayName == null) {\n item.displayName = item.name;\n }\n\n var exist = nameMap.get(item.name);\n\n if (!exist) {\n nameMap.set(item.name, {\n count: 1\n });\n } else {\n item.name += '-' + exist.count++;\n }\n\n return item;\n });\n}", "get ndim() {\n if (this.$isSeries) {\n return 1;\n } else {\n return 2;\n }\n }", "get dimension() {\r\n return this.cpoints.shape[1];\r\n }", "get dimension() {\r\n return this.cpoints.shape[1];\r\n }", "function buildOneHeader(index, startDim, dimNum)\r\n {\r\n var result = [];\r\n for(var i = startDim; i < startDim + dimNum; ++i)\r\n {\r\n // push null value doesn't work so we use empty object instead\r\n if(data_.values[i].rows[index].val === null || data_.values[i].rows[index].val === undefined){\r\n result.push({}); \r\n }else{\r\n result.push(data_.values[i].rows[index].val);\r\n }\r\n }\r\n return result;\r\n }", "function n(e){return null!=e&&\"object\"==typeof e&&!1===Array.isArray(e)}", "function n(e){return null!=e&&\"object\"==typeof e&&!1===Array.isArray(e)}", "_addDimensionToJSArray(dimensions) {\n const that = this;\n\n if (that.arrayIndexingMode === 'LabVIEW') {\n that.value = [that.value];\n }\n else {\n if (dimensions === undefined) {\n dimensions = that.dimensions - 1;\n }\n\n const recursion = function (arr, level) {\n for (let i = 0; i < arr.length; i++) {\n if (level !== dimensions) {\n recursion(arr[i], level + 1);\n }\n else {\n arr[i] = [arr[i]];\n }\n }\n };\n\n recursion(that.value, 1);\n }\n }", "getDimensions () {\n return this.properties.length\n }", "get shape() {\n if (this.$data.length === 0) return [0, 0];\n if (this.$isSeries) {\n return [this.$data.length, 1];\n } else {\n const rowLen = (this.$data).length;\n const colLen = (this.$data[0]).length;\n return [rowLen, colLen];\n }\n\n }", "function summarizeDimensions(data) {\n var summary = {};\n var encode = summary.encode = {};\n var notExtraCoordDimMap = Object(util[\"g\" /* createHashMap */])();\n var defaultedLabel = [];\n var defaultedTooltip = []; // See the comment of `List.js#userOutput`.\n\n var userOutput = summary.userOutput = {\n dimensionNames: data.dimensions.slice(),\n encode: {}\n };\n Object(util[\"k\" /* each */])(data.dimensions, function (dimName) {\n var dimItem = data.getDimensionInfo(dimName);\n var coordDim = dimItem.coordDim;\n\n if (coordDim) {\n if (false) {}\n\n var coordDimIndex = dimItem.coordDimIndex;\n getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName;\n\n if (!dimItem.isExtraCoord) {\n notExtraCoordDimMap.set(coordDim, 1); // Use the last coord dim (and label friendly) as default label,\n // because when dataset is used, it is hard to guess which dimension\n // can be value dimension. If both show x, y on label is not look good,\n // and conventionally y axis is focused more.\n\n if (mayLabelDimType(dimItem.type)) {\n defaultedLabel[0] = dimName;\n } // User output encode do not contain generated coords.\n // And it only has index. User can use index to retrieve value from the raw item array.\n\n\n getOrCreateEncodeArr(userOutput.encode, coordDim)[coordDimIndex] = dimItem.index;\n }\n\n if (dimItem.defaultTooltip) {\n defaultedTooltip.push(dimName);\n }\n }\n\n util_types[\"i\" /* VISUAL_DIMENSIONS */].each(function (v, otherDim) {\n var encodeArr = getOrCreateEncodeArr(encode, otherDim);\n var dimIndex = dimItem.otherDims[otherDim];\n\n if (dimIndex != null && dimIndex !== false) {\n encodeArr[dimIndex] = dimItem.name;\n }\n });\n });\n var dataDimsOnCoord = [];\n var encodeFirstDimNotExtra = {};\n notExtraCoordDimMap.each(function (v, coordDim) {\n var dimArr = encode[coordDim];\n encodeFirstDimNotExtra[coordDim] = dimArr[0]; // Not necessary to remove duplicate, because a data\n // dim canot on more than one coordDim.\n\n dataDimsOnCoord = dataDimsOnCoord.concat(dimArr);\n });\n summary.dataDimsOnCoord = dataDimsOnCoord;\n summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra;\n var encodeLabel = encode.label; // FIXME `encode.label` is not recommanded, because formatter can not be set\n // in this way. Use label.formatter instead. May be remove this approach someday.\n\n if (encodeLabel && encodeLabel.length) {\n defaultedLabel = encodeLabel.slice();\n }\n\n var encodeTooltip = encode.tooltip;\n\n if (encodeTooltip && encodeTooltip.length) {\n defaultedTooltip = encodeTooltip.slice();\n } else if (!defaultedTooltip.length) {\n defaultedTooltip = defaultedLabel.slice();\n }\n\n encode.defaultedLabel = defaultedLabel;\n encode.defaultedTooltip = defaultedTooltip;\n return summary;\n}", "getDimensions(data){\n const n = data.length;\n const p = data[0].length ? data[0].length: 1;\n return {rows: n,cols: p}\n }", "function getDataArray(obj) {\n\t if (obj.rows) {\n\t return obj.rows;\n\t } else if (obj.columns) {\n\t return obj.columns;\n\t } else if (obj.series) {\n\t return [obj];\n\t }\n\t }", "function getCustomDims() {\n var dims = [];\n \n // client id\n \n var tracker = ga.getByName('t0');\n \n dims.push( {slot: 11, value: tracker.get('clientId')} );\n \n if (typeof dataLayer.user === 'object') {\n \n var loggedIn = 'not logged in';\n var ban = 'not set';\n var userID = 'not set';\n \n if (dataLayer.user.userid) {\n userID = dataLayer.user.userid;\n loggedIn = 'logged in';\n \n }\n \n dims.push( {slot: 1, value: userID},\n {slot: 4, value: loggedIn});\n \n if (dataLayer.user.ban) {\n ban = dataLayer.user.ban;\n }\n \n dims.push({slot: 2, value: ban});\n \n }\n \n // FlashTalking parameters\n var ft_paramid = self.getQueryParam('FT_ParamIDs');\n\n // check if FT parameters exist but missing '?' so it's a part of the pathname\n if (ft_paramid === null) {\n ft_paramid = self.pathname.match(/FT_ParamIDs=([^&]*)/);\n \n if (ft_paramid)\n ft_paramid = ft_paramid[1];\n }\n \n if (ft_paramid !== null) {\n dims.push( {slot: 8, value: ft_paramid},\n {slot: 9, value: ft_paramid});\n }\n \n // Internal promos\n \n var cm_re = self.getQueryParam('cm_re');\n if (cm_re !== null)\n dims.push({slot: 3, value: cm_re});\n \n var purchaser = 'no';\n \n // purchaser - set on confirmation pages\n if (dataLayer.page && dataLayer.page.type === 'order_receipt_page') {\n purchaser = 'yes';\n }\n \n dims.push({slot: 5, value: purchaser});\n \n // page tracking\n dims.push({slot: 17, value: self.pathname + self.query + self.anchor});\n \n return dims;\n }", "function getReferenceDimension(ID) {\n var index = 0;\n var selectedDim = new Dimension();\n\n while (index < currentOrg.Dimensions.length) {\n if (ID == currentOrg.Dimensions[index].ID) {\n selectedDim = currentOrg.Dimensions[index];\n break;\n }\n index++;\n }\n return (selectedDim);\n }", "function _dim() {\r\n var d = _dfa(arguments);\r\n if (d) {\r\n this.d = objDim(this, d);\r\n }\r\n return objCss(this, \"position\") == \"absolute\" ? this.d : objDim(this);\r\n}", "function jdcDataProvider(o){\n\t//Too many characters/values set\n\tvar ret = {};\n\tvar cache = {}; //= dataArray; //cached slices\n\tvar calc = {}; //calculated definitions\n\tvar o;\n\n\tvar def = {\n\t\tall : '_', //used for where no filter on dimension\n\t\tfn : 'fn', //used for function branching\n\t\tresult : function(){ return 0; }, //to be a function - called for default result and map reduce\n\t\tindices : []\n\t}\n\n\tret.init = function(options){\n\t // Extend defaults\n\t var extended = def;\n\t for (var prop in options) {\n\t if (options.hasOwnProperty(prop)) {\n\t extended[prop] = options[prop];\n\t }\n\t }\n\t\to = ret.options = extended; //var o used for shorthand - will this lead to trouble later overriding o?\n\n\t\tret.dims={};\n\n\t\tfor(var i=0;i<o.dims.length;i++){\n\t\t\tconsole.log(i);\n\t\t\tvar d = o.dims[i];\n\t\t\tconsole.log(d);\n\t\t\tret.dims[i] = {}; //ordered map\n\t\t\tret.dims[d] = {}; //associative map\n\t\t\tret.dims[i].val=d; //e.g. [0].val = \"dim 1 Name\"\n\t\t\tret.dims[d].val=i; //e.g. [name].val = order\n\t\t\tret.dims[i].range = [];\n\t\t}\n\t\tconsole.log(o.dims.length);\n\t\t//New version - iterates over population once\n\t\tvar res={}, mre, val;\n\t\tfor(var j=0;j<o.dims.length;j++){\n\t\t\tres[o.dims[j]]={};\n\t\t}\n\t\tvar vals = o.data.reduce(function(res,e,i,a){\n\t\t\tfor(var j=0;j<o.dims.length;j++){\n\t\t\t\tmre=o.dims[j];\n\t\t\t\tval=wlk(e,mre);\n\t\t\t\tif(!res[mre][val]){\n\t\t\t\t\tres[mre][val]={ \"n\":0, \"val\":0.0 };\n\t\t\t\t\tret.dims[j].range.push(val);\n\t\t\t\t}\n\t\t\t\tres[mre][val][\"n\"]++;\n\t\t\t\tres[mre][val][\"val\"]+=e[\"Price\"];\n\t\t\t}\n\t\t\treturn res;\n\t\t},res);\n\t\tfor(var j=0;j<o.dims.length;j++){\n\t\t\tret.dims[j].range.sort();\n\t\t}\n\t\tconsole.log(res);\n\t\tif(o.cache){\n\t\t\tcache = o.cache;\n\t\t}\n\n\t\treturn ret;\n\t}\n\n\t//Where should order of keys be controlled?\n\tret.idString = function(keys){\n\t\tvar res = [];\n\t\tfor(var i=0;i<o.dims.length;i++){\n\t\t\tres.push(def.all); //Push blank for no filter\n\t\t}\n\t\tfor(k in keys){\n\t\t\tif(ret.dims[k]){\n\t\t\t\tvar r = f(keys[k]);\n\t\t\t\tres[ret.dims[k].val] = r.label || r; //use f to resolve function here - need to make this generic\n\t\t\t} else {\n\t\t\t\tif(k.indexOf(def.fn)<1){\n\t\t\t\t\tconsole.log(\"Invalid key: \" + k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tres[ret.dims[\"mre\"].val]=def.all; //Set mre to all as measures in object\n\t\treturn res.join('|');\n\t}\n\n\t//Key expanded to include all dimensions\n\tret.fullKey = function(keys){\n\t\tvar res = {};\n\t\tfor(var i=0;i<o.dims.length;i++){\n\t\t\tres[o.dims[i]]=def.all; //using '' causes problems - don't know why\n\t\t}\n\t\tfor(k in keys){ //would $.extend be better? - check k is in result\n\t\t\tif(ret.dims[k]){\n\t\t\t\tres[k] = f(keys[k]); //use f to resolve function here - need to make this generic\n\t\t\t} else {\n\t\t\t\tif(k.indexOf(def.fn)<1){\n\t\t\t\t\tconsole.log(\"Invalid key: \" + k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}\n\n\t//New Reduce Functionality\n\tfunction objInKey(obj,key){\n\t\tres=true;\n\t\tfor(k in key){\n\t\t\tvar v=key[k];\n\t\t\tvar o=wlk(obj,k); // walks if nested\n\t\t\tif(typeof(v)==='object'){ //allDims firing initial function\n\t\t\t\tif(v.fn){\n\t\t\t\t\tres=v.fn(o);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(v!==\"_\"){\n\t\t\t\t\tif(o){\n\t\t\t\t\t\tres=((o===v)||(+o===+v));\n\t\t\t\t\t//console.log(\"fn objInKey - value comparison - \" + obj[k] + \" with \" + v);\n\t\t\t\t\t} else { return false; } //value key with no corresponding key in object\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(res===false){ return false };\n\t\t}\n\t\treturn true;\n\t}\n\n\tfunction keyFilter(key,field){\n\t\treturn function(obj,i,a){\n\t\t\tif(objInKey(obj,key)){\n\t\t\t\tif(!field) return obj;\n\t\t\t\treturn wlk(obj,field); //return the target field\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction keyFilterReduce(key,field){\n\t\treturn function(res,obj,i,a){\n\t\t\tres.push(wlk(obj,field)); //return the target field\n\t\t\treturn res;\n\t\t}\n\t}\n\n\tfunction kFilter(key){\n\t\treturn function(obj,i,a){\n\t\t\treturn objInKey(obj,key);\n\t\t}\n\t}\n\n\tfunction keyReduce(key){ //want this to be the stats\n\t\treturn function(res, obj) {\n\t\t\tif(objInKey(obj,key)){\n\t\t\t\tvar v=obj.values;\n\t\t\t\tfor(var i=0;i<v.length;i++){\n\t\t\t\t\tres[i]+=v[i];\n\t\t\t\t}\n\t\t\t}\n\t\t return res;\n\t\t}\n\t}\n\n\tfunction fillArray(value, len) {\n\t var arr = [];\n\t for (var i=0; i<len; i++) {\n\t arr.push(value);\n\t };\n\t return arr;\n\t}\n\n\tfunction filterData(key){ //should always be a full key\n\t\t//return a filtered set of data based on ordered indices supplied\n\t\t//if(o.indices.length>0){ //need to ensure default value\n\t\t//o.indices.each(function(index,i,a)){ //object with indices - confirmed can rely on ordering - won't work as return won't exit loop\n\t\tfor (var i=0; i<o.indices.length; i++) {\n\t\t\tvar index = o.indices[i];\n\t\t\tif(index[\"field\"]){\n\t\t\t\tif(index[\"field\"] in key){ //should maybe use hasOwnProperty\n\t\t\t\t\tvar v=key[index[\"field\"]]; //index used\n\t\t\t\t\tif(v!==\"_\" && typeof(v)!=='object'){ //not all and not an object\n\t\t\t\t\t\treturn index[\"index\"][v].map(function(e,i,a){\n\t\t\t\t\t\t\tindex[\"indexMap\"][e]; //iterate through index to return array of objects\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn o.data;\n\t}\n\n\t//may rename to get measures\n\tret.getValues = function(key){ //same interface as previous - key has already been processed though fullkey function\n\t\t//var population = filterData(ret.fullKey(key)).filter(kFilter(key));\n\t\tvar keyAllMre = ret.fullKey(key);\n\t\tkeyAllMre[\"mre\"] = def.all;\n\t\t//console.log(ret.idString(keyAllMre));\n\t\tvar pop = filterData(keyAllMre).filter(kFilter(keyAllMre));\n\t\t//console.log(pop[0]);\n\t\t//console.log(pop.length);\n\t\t//population = population.reduce(keyFilterReduce(key,\"Price\"),[]);\n\t\tvar population = pop.reduce(function(r,e,i,a){ if(e[\"Price\"]) { r.push(e[\"Price\"]);} return r; },[]);\n\t\t//console.log(population[0]);\n\t\t//console.log(population.length);\n\t\tvar r = population.stats();\n\t\t//console.log(r);\n\t\treturn {\n\t\t\tid : ret.idString(key),\n\t\t\tkey : key,\n\t\t\tvalue : population.stats() //introduces filter on an index - need to parameterise\n\t\t}\n\t}\n\n\t//function to return population of array objects without summarisation\n\tret.getPopulation = function(key){ //same interface as previous - key has already been processed though fullkey function\n\t\tconsole.log(\"getPopulation\");\n\t\treturn {\n\t\t\tid : ret.idString(key), //arguable this is not required\n\t\t\tkey : key,\n\t\t\tvalue : filterData(ret.fullKey(key)).filter(kFilter(key)) //introduces filter on an index\n\t\t}\n\t}\n\n\tret.segmentSum = function(key,range){ //this should be accessible as string or object key\n\t\treturn ret.segmentRange(key,range).reduce( function(previousValue, currentValue, index, array){\n\t\t\t\treturn previousValue + currentValue;\n\t\t\t});\n\t}\n\n\tret.segment = function(key,range){ //range can be single value or array with 2 values - index and offset\n\t\tvar res = ret.segmentFromCache(key);\n\t\t/*var r = range;\n\t\tvar r0, r1;\n\t\tif(r){\n\t\t\tr0 = r[0] || r; r0 = f(r0);\n\t\t\tr1 = r[1] || r0+1; r1 = f(r1);\n\t\t\tif(r1<r0){\n\t\t\t\tif(r1<0) {\n\t\t\t\t\tr0 += r1+1;\n\t\t\t\t\tr1 = r0-r1;\n\t\t\t\t} else {\n\t\t\t\t\tr1 += r0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn (!range ? res : res.slice(r0,r1));*/\n\t\treturn res;\n\t}\n\n\tret.segmentFromCache = function(key){ //cache will use string key\n\t\t//console.log(ret.idString(key));\n\t\treturn (cache[ret.idString(key)] ? cache[ret.idString(key)][key[\"mre\"]] : ret.fillCache(key));\n\t}\n\n\tret.fillCache = function(key){ //should be a private function\n\t\tvar res;\n\t\tif(key.xfn){\n\t\t\tif(key.xfn.fn){\n\t\t\t\tif(key.xfn.fn){ //is it a calculated field - check definitions?\n\t\t\t\t\tres = calc[key.xfn.fn](key);\n\t\t\t\t\tcache[res.id] = res.value;\n\t\t\t\t}\n\t\t\t} else if(calc[key.xfn]){ //is it a calculated field - check definitions?\n\t\t\t\tres = calc[key.xfn](key);\n\t\t\t\tcache[res.id] = res.value;\n\t\t\t} else {\n\t\t\t\tconsole.log(\"Error - transform function not logged\");\n\t\t\t}\n\t\t} else {\n\t\t\tres = ret.getValues(ret.fullKey(key));\n\t\t\tcache[res.id] = res.value;\n\t\t}\n\t\treturn cache[res.id][key[\"mre\"]]; //different as now returning a measure within an object of measures - not presently an array - this may need to change\n\t}\n\n\tfunction preCalculated(key){\n\t\t//console.log(\"preCalc Fired\");\n\t\t//console.log(ret.idString(key));\n\t\tfor(k in key){\n\t\t\tif(!preCalc[k][key[k]]){\n\t\t\t\treturn false; //return as soon as failed\n\t\t\t}\n\t\t}\n\t\t//console.log(\"preCalc Fired - & short circuited\");\n\t\treturn true;\n\t}\n\n\tvar measureChange = function(key){\n\t\tvar newKey=$.extend({},key);\n\t\tnewKey.mre = f(newKey.mre).replace('Chg','');\n\t\tdelete newKey.xfn; //need to delete or\n\t\tvar values = ret.segment(newKey);\n\t\tvar res=[0];\n\t\tfor(var i=1;i<values.length;i++){\n\t\t\tres.push(values[i]-values[i-1]);\n\t\t}\n\t\treturn { id : ret.idString(key), key : key, value : res }\n\t}\n\n\tvar chg = function(dim,suffix,transform){\n\t\treturn function(key){\n\t\t\tvar base = $.extend({},key);\n\t\t\tbase[dim] = f(base[dim]).replace(suffix,'');\n\t\t\tdelete base[transform]; //necessary to stop looking in calc\n\t\t\tvar values = ret.segment(base);\n\t\t\tvar res=[0];\n\t\t\tfor(var i=1;i<values.length;i++){\n\t\t\t\tres.push(values[i]-values[i-1]);\n\t\t\t}\n\t\t\treturn { id : ret.idString(key), key : key, value : res }\n\t\t}\n\t}\n\n\tvar ofTotal = function(dim,suffix,transform,total){\n\t\treturn function(key){\n\t\t\tvar base = $.extend({},key);\n\t\t\tbase[dim] = f(base[dim]).replace(suffix,''); //Change this to add suffix later & output\n\t\t\tdelete base[transform];\n\t\t\tvar values = ret.segment(base);\n\t\t\tfor(k in total){\n\t\t\t\tif(base[k]){\n\t\t\t\t\tbase[k]=total[k];\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar div = ret.segment(base);\n\t\t\tvar res = [];\n\t\t\tfor(var i=0;i<values.length;i++){\n\t\t\t\tres.push(div[i]===0 ? 0 : values[i]/div[i] );\n\t\t\t}\n\t\t\treturn { id : ret.idString(key), key : key, value : res }\n\t\t}\n\t}\n\n\tvar ofTot = function(transform){\n\t\treturn function(key){\n\t\t\tvar tfm = $.extend({},key[transform]);\n\t\t\tvar base = $.extend({},key,tfm.args[0]);\n\t\t\tdelete base[transform];\n\t\t\tvar divKey = $.extend({},base,tfm.args[1]);\n\t\t\t//console.log(divKey);\n\t\t\tvar val = ret.segment(base);\n\t\t\tvar div = ret.segment(divKey);\n\t\t\tvar vals = [];\n\t\t\tfor(var i=0;i<val.length;i++){\n\t\t\t\tvals.push(div[i]===0 ? 0 : val[i]/div[i] );\n\t\t\t}\n\t\t\treturn { id : ret.idString(key), key : key, value : vals }\n\t\t}\n\t}\n\n\t//calc['Chg'] = measureChange;\n\tcalc['Chg'] = chg('mre','Chg','xfn');\n\tcalc['ofTotalArr'] = ofTotal('uom','OfTotal','xfn', {arr : xfFilter('arr','All',function(){ return d>0; })});\n\tcalc['ofTotalEnt'] = ofTotal('uom','OfTotal','xfn', {ent : '_'});\n\tcalc['rate'] = ofTotal('mre','Rate','xfn', {mre : 'Bal'});//This will change to the following\n\t//calc['rate'] = ofTotal('mre','Rate','xfn', {mre : 'Bal'});\n\tcalc['ofTotal'] = ofTot('xfn');\n\n\treturn ret.init(o);\n}", "function r(e){return null!=e&&\"object\"==typeof e&&!1===Array.isArray(e)}", "function r(e){return null!=e&&\"object\"==typeof e&&!1===Array.isArray(e)}", "function r(e){return null!=e&&\"object\"==typeof e&&!1===Array.isArray(e)}", "function unit(x) {\n return !exists(x) ? [] : !exists(x.length) ? [x] : toArray(x);\n}", "get dimensions() { return this._dimensions; }", "function r(t){return t&&Object(i[\"l\"])(t.getArray)}", "function isDataArray(val, key) {\n\t\n\t var containers = ['annotations', 'shapes', 'range', 'domain', 'buttons'],\n\t isNotAContainer = containers.indexOf(key) === -1;\n\t\n\t return Array.isArray(val) && isNotAContainer;\n\t}", "function dt(t) {\n return !!t && \"arrayValue\" in t;\n}", "function dt(t) {\n return !!t && \"arrayValue\" in t;\n}", "get flexibleDimensions() { return this._flexibleDimensions; }", "function w$(e){return Array.isArray(e)}", "stats (propertyName) {\n const { dimension } = this._dimensionInfo(propertyName);\n if (dimension && dimension.grouping) {\n return dimension;\n }\n return super.stats(propertyName);\n }", "function _dfa(a) {\r\n if (a.length) {\r\n // XXX: How should we flag an error?\r\n if (a.length > 2) return null;\r\n // Assume that 2 array elements specify width and height.\r\n if (a.length > 1) return new Dim(a[0], a[1]);\r\n // Assume a[0] is a valid Dim object.\r\n return a[0];\r\n }\r\n return null;\r\n}", "function isArray1D(a) {\n return !isArrayOrTypedArray(a[0]);\n}", "_getNonTransformedDimensions() {\n // Object dimensions\n return new fabric.Point(this.width, this.height).scalarAdd(\n this.padding + boundingBoxPadding\n )\n }", "function visible(dimension) {return !('visible' in dimension) || dimension.visible;}", "function visible(dimension) {return !('visible' in dimension) || dimension.visible;}", "function X(t) {\n return !!t && \"arrayValue\" in t;\n}", "function isDataArray(x) {\n return Array.isArray(x);\n}", "function isDataArray(x) {\n return Array.isArray(x);\n}", "function isDataArray(x) {\n return Array.isArray(x);\n}", "function isArray(obj){return(typeof(obj.length)==\"undefined\")?false:true;}", "function getSillyShape(arr) {\n for (var i = 0; i < arr.length; i++) {\n return arr[i].getInfo();\n }\n }", "function availableShape() {\n let shapes = [];\n Object.values(tdata).forEach(value => {\n let shape = value.shape;\n shape = shape[0].toUpperCase() + shape.substring(1);\n if(shapes.indexOf(shape) !== -1) {\n\n }\n else {\n shapes.push(shape);\n }\n });\n return shapes;\n}", "function isArrayOfShapes(x) {\n return Array.isArray(x) && Array.isArray(x[0]);\n}", "function isArrayOfShapes(x) {\n return Array.isArray(x) && Array.isArray(x[0]);\n}", "function r(e){return null!=e&&\"object\"===a(e)&&!1===Array.isArray(e)}", "function s(t){return null!=t&&\"object\"===typeof t&&!1===Array.isArray(t)}", "function dimensionConstructor(driver){\n var driver = driver;\n return $rootScope.dataMeta.crossFilterData.dimension(function(d) { return d[driver]; });\n }", "function getDimension(dimension) {\n var imgIndex = param.imgN.indexOf(iName),\n imgW = param.imgW[imgIndex],\n imgH = param.imgH[imgIndex];\n return dimension == \"w\" ? imgW : imgH;\n }", "getByName(name) {\n const unknown = { name: 'unknown', width: NaN };\n const breakpoints = this.getBreakpoints();\n return breakpoints.find((point) => name === point.name) || unknown;\n }", "function buildNullArray() {\n return { __proto__: null };\n }", "function buildNullArray() {\n return { __proto__: null };\n }", "function Nt(t) {\n return !!t && \"arrayValue\" in t;\n}", "function n(e){return e&&\"object\"==typeof e&&!Array.isArray(e)}", "function n(e){return e&&\"object\"==typeof e&&!Array.isArray(e)}", "function buildNullArray() {\n return { __proto__: null };\n}", "function j(n){return\"[object Array]\"===x.call(n)}", "function getDimensionPartInfo(dimensionNamePart) {\n var result = {};\n var key = dimensionNamePart.substr(0, 1);\n var value = dimensionNamePart.substr(1);\n\n result['value'] = value;\n switch (key) {\n case 'w':\n result['key'] ='width';\n break;\n case 'h':\n result['key'] ='height';\n break;\n case 'p':\n result['key'] ='platform';\n break;\n default:\n result = null;\n break;\n }\n\n return result;\n }", "function a$k(a)\n{\n if (a===undefined) return [];\n if (a.constructor!=Array || a.length<2) return [a];\n return a;\n}", "function names(arr) {\n return names.name;\n}", "get dimensions() {\n var dimensions = new Range();\n this._rows.forEach(function (row) {\n if (row) {\n var rowDims = row.dimensions;\n if (rowDims) {\n dimensions.expand(row.number, rowDims.min, row.number, rowDims.max);\n }\n }\n });\n return dimensions;\n }", "function n(t){return t&&\"object\"==typeof t&&!Array.isArray(t)}", "getIndex(name){\n var result;\n if(isNaN(name)){\n result=this.layerNames[name];\n if(result)\n return result.id;\n }else return name;\n return undefined;\n //return (isNaN(name))? this.layerNames[name].id:name;\n }", "function typeIsArray(instance_var) {\n return getType(instance_var).includes(\"[]\") || getName(instance_var).includes(\"[]\");\n}", "function createDimensions( // TODO: TYPE completeDimensions type\nsource, opt) {\n opt = opt || {};\n return helper_completeDimensions(opt.coordDimensions || [], source, {\n // FIXME:TS detect whether source then call `.dimensionsDefine` and `.encodeDefine`?\n dimsDef: opt.dimensionsDefine || source.dimensionsDefine,\n encodeDef: opt.encodeDefine || source.encodeDefine,\n dimCount: opt.dimensionsCount,\n encodeDefaulter: opt.encodeDefaulter,\n generateCoord: opt.generateCoord,\n generateCoordCount: opt.generateCoordCount\n });\n}", "static is_data_array_ok(data){\n return this.is_1d_array(data) ||\n this.is_2d_array(data) ||\n this.is_3d_array(data) ||\n this.is_heat_map_suitable_data(data)\n }", "function getDrumArray(drumArrayName){\n\tswitch (drumArrayName) {\n\t\tcase 'kicks':\n\t\t\treturn kicks;\n\t\tcase 'snares':\n\t\t\treturn snares;\n\t\tcase 'hiHats':\n\t\t\treturn hiHats;\n\t\tcase 'rideCymbals':\n\t\t\treturn rideCymbals;\n\t\tdefault:\n\t\t\treturn;\n\t}\n}", "function getElementDimension(Element, dim) {\n oElement = createReference(Element)\n if (isIE) {\t\t\t\t\t\t\t\t\t\t\t\t//String manip: Make sure side is Left or Top...IE doesn't understand all lower case.\n\t\telementDim = eval('oElement.pixel' + (dim.toUpperCase()).substring(0,1) + (dim.toLowerCase()).substring(1,dim.length))\n\t} else if (isDOM) {\n elementDim = parseInt(eval('oElement.' + dim.toLowerCase()))\n } else {\n\t\telementDim = eval('oElement.document.' + dim.toLowerCase())\n\t}\n return elementDim\n}", "__is_1D_array(arr) {\n if ((typeof (arr[0]) == \"number\") || (typeof (arr[0]) == \"string\") || (typeof (arr[0]) == \"boolean\")) {\n return true\n } else {\n return false\n }\n }", "function size() {\n out = 1;\n for (var dim in dimensions) {\n out *= dimensions[dim].members.length;\n }\n return out;\n }", "getEmptyBitmap(dimension, figures){\r\n var bitmap = Array(dimension)\r\n\r\n for(let x=0; x<dimension;x++){\r\n bitmap[x] = Array(dimension)\r\n for(let y=0; y<dimension; y++){\r\n bitmap[x][y] = Array(figures)\r\n for(let z=0; z< figures; z++){\r\n bitmap[x][y][z] = 0; // fill all with zero = no piece present\r\n }\r\n }\r\n }\r\n return bitmap\r\n }", "function defaultGetter() {\r\n return defaultUnidimensionalValue;\r\n }", "function defaultGetter() {\r\n return defaultUnidimensionalValue;\r\n }", "function data(){\n return [1,2]; //undefined\n}", "function r(e){return e&&\"object\"==typeof e&&!Array.isArray(e)}", "function r(e){return e&&\"object\"==typeof e&&!Array.isArray(e)}", "function r(e){return e&&\"object\"==typeof e&&!Array.isArray(e)}", "function jt(t){return\"[object Array]\"===Rt.call(t)}", "getDim() {\n var width, height;\n\n // If the particle only has a set size (not width/height)\n if (this.size) {\n width = this.size;\n height = this.size;\n } else {\n width = this.width;\n height = this.height;\n }\n\n return {\n width: width,\n height: height\n };\n }", "shape() {\n return [this.grid.length, this.grid[0].length];\n }", "'has'(item_name) {\n\t\tvar arr = item_name.split('.');\n\t\t//console.log('arr ' + arr);\n\t\tvar c = 0,\n\t\t\tl = arr.length;\n\t\tvar i = this;\n\t\tvar s;\n\t\twhile (c < l) {\n\t\t\ts = arr[c];\n\t\t\t//console.log('s ' + s);\n\t\t\tif (typeof i[s] == 'undefined') {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\ti = i[s];\n\t\t\tc++;\n\t\t};\n\t\treturn i;\n\t}", "function getArrayDimensions(arr) {\n // We assume that it's a rectangular array\n var dim = [];\n dim.push(arr.length);\n\n if (arr.length > 0 && Array.isArray(arr[0])) {\n var inner_dim = getArrayDimensions(arr[0]);\n dim = dim.concat(inner_dim);\n }\n\n return dim;\n}", "function defaultGetter() {\n return defaultUnidimensionalValue;\n }", "function getElementUNPOSDimension(Element, dim) {\n\toElement = createReference(Element)\n if (isIE && !isMac) {\t\n\t\tif (dim == \"width\") {\n\t\t\tdim = \"scrollWidth\"\n\t\t} else {\n\t\t\tdim = \"scrollHeight\"\n\t\t}\t\t\t\t\t\t\n\t\telementDim = eval('document.all.' + Element + '.' + dim);\n\t} else {\n\t\tif (dim == \"width\") {\n\t\t\tdim = \"offsetWidth\"\n\t\t} else {\n\t\t\tdim = \"offsetHeight\"\n\t\t}\t\n\t\telementDim = eval('document.getElementById(\"' + Element + '\").' + dim);\t\n }\n return elementDim\n}", "function arrayDefined(array) {\n return array.filter(function (item) { return item != null; });\n}", "function is(arr){\n return typeof(arr) == \"object\" && arr.length >= 0;\n }" ]
[ "0.68834513", "0.61371076", "0.5990806", "0.59609914", "0.586945", "0.5856131", "0.57627916", "0.575407", "0.57120514", "0.55914956", "0.5591027", "0.55378836", "0.5502637", "0.5488591", "0.54847807", "0.54847807", "0.5290612", "0.52511287", "0.52511287", "0.5245239", "0.52337915", "0.5230481", "0.5227236", "0.5224828", "0.521542", "0.52138865", "0.5191336", "0.5187129", "0.5185982", "0.51856226", "0.51856226", "0.51856226", "0.51482886", "0.5136437", "0.51275164", "0.512368", "0.5105632", "0.5105632", "0.5099621", "0.50933135", "0.5082011", "0.50717944", "0.50677997", "0.50466526", "0.5035171", "0.5035171", "0.5027725", "0.50233763", "0.50233763", "0.50233763", "0.50161093", "0.50149757", "0.50136876", "0.5011065", "0.5011065", "0.5006437", "0.49960095", "0.499389", "0.49831125", "0.4981055", "0.49684873", "0.49684873", "0.49507296", "0.49395138", "0.49395138", "0.49394602", "0.4939111", "0.49280712", "0.49211466", "0.49210152", "0.49204493", "0.49012136", "0.48989597", "0.48912743", "0.48764938", "0.48549327", "0.48539814", "0.48484728", "0.48464057", "0.48448786", "0.48262516", "0.4823942", "0.4823942", "0.48147094", "0.48132643", "0.48132643", "0.48132643", "0.4804864", "0.4804165", "0.4795094", "0.47863778", "0.47782987", "0.4777099", "0.47751215", "0.47748917", "0.4753962" ]
0.5711538
13
default encode making logic. And the default rule should depends on series? consider 'map'.
function makeDefaultEncode(seriesModel, datasetModel, data, sourceFormat, seriesLayoutBy, completeResult) { var coordSysDefine = getCoordSysDefineBySeries(seriesModel); var encode = {}; // var encodeTooltip = []; // var encodeLabel = []; var encodeItemName = []; var encodeSeriesName = []; var seriesType = seriesModel.subType; // ??? TODO refactor: provide by series itself. // Consider the case: 'map' series is based on geo coordSys, // 'graph', 'heatmap' can be based on cartesian. But can not // give default rule simply here. var nSeriesMap = createHashMap(['pie', 'map', 'funnel']); var cSeriesMap = createHashMap(['line', 'bar', 'pictorialBar', 'scatter', 'effectScatter', 'candlestick', 'boxplot']); // Usually in this case series will use the first data // dimension as the "value" dimension, or other default // processes respectively. if (coordSysDefine && cSeriesMap.get(seriesType) != null) { var ecModel = seriesModel.ecModel; var datasetMap = inner(ecModel).datasetMap; var key = datasetModel.uid + '_' + seriesLayoutBy; var datasetRecord = datasetMap.get(key) || datasetMap.set(key, { categoryWayDim: 1, valueWayDim: 0 }); // TODO // Auto detect first time axis and do arrangement. each(coordSysDefine.coordSysDims, function (coordDim) { // In value way. if (coordSysDefine.firstCategoryDimIndex == null) { var dataDim = datasetRecord.valueWayDim++; encode[coordDim] = dataDim; // ??? TODO give a better default series name rule? // especially when encode x y specified. // consider: when mutiple series share one dimension // category axis, series name should better use // the other dimsion name. On the other hand, use // both dimensions name. encodeSeriesName.push(dataDim); // encodeTooltip.push(dataDim); // encodeLabel.push(dataDim); } // In category way, category axis. else if (coordSysDefine.categoryAxisMap.get(coordDim)) { encode[coordDim] = 0; encodeItemName.push(0); } // In category way, non-category axis. else { var dataDim = datasetRecord.categoryWayDim++; encode[coordDim] = dataDim; // encodeTooltip.push(dataDim); // encodeLabel.push(dataDim); encodeSeriesName.push(dataDim); } }); } // Do not make a complex rule! Hard to code maintain and not necessary. // ??? TODO refactor: provide by series itself. // [{name: ..., value: ...}, ...] like: else if (nSeriesMap.get(seriesType) != null) { // Find the first not ordinal. (5 is an experience value) var firstNotOrdinal; for (var i = 0; i < 5 && firstNotOrdinal == null; i++) { if (!doGuessOrdinal(data, sourceFormat, seriesLayoutBy, completeResult.dimensionsDefine, completeResult.startIndex, i)) { firstNotOrdinal = i; } } if (firstNotOrdinal != null) { encode.value = firstNotOrdinal; var nameDimIndex = completeResult.potentialNameDimIndex || Math.max(firstNotOrdinal - 1, 0); // By default, label use itemName in charts. // So we dont set encodeLabel here. encodeSeriesName.push(nameDimIndex); encodeItemName.push(nameDimIndex); // encodeTooltip.push(firstNotOrdinal); } } // encodeTooltip.length && (encode.tooltip = encodeTooltip); // encodeLabel.length && (encode.label = encodeLabel); encodeItemName.length && (encode.itemName = encodeItemName); encodeSeriesName.length && (encode.seriesName = encodeSeriesName); return encode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "encode(ctx, encode) {\n const {marktype, channels} = encode,\n fn = ctx.functions,\n swap = marktype === 'group'\n || marktype === 'image'\n || marktype === 'rect';\n\n return (item, _) => {\n const datum = item.datum;\n let m = 0, v;\n\n for (const name in channels) {\n v = interpret(channels[name].ast, fn, _, datum, undefined, item);\n if (item[name] !== v) {\n item[name] = v;\n m = 1;\n }\n }\n\n if (marktype !== 'rule') {\n adjustSpatial(item, channels, swap);\n }\n return m;\n };\n }", "function encode(freqs,s) {\n \n}", "function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {\n\t var encode = {};\n\t var datasetModel = querySeriesUpstreamDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur.\n\t\n\t if (!datasetModel || !coordDimensions) {\n\t return encode;\n\t }\n\t\n\t var encodeItemName = [];\n\t var encodeSeriesName = [];\n\t var ecModel = seriesModel.ecModel;\n\t var datasetMap = innerGlobalModel(ecModel).datasetMap;\n\t var key = datasetModel.uid + '_' + source.seriesLayoutBy;\n\t var baseCategoryDimIndex;\n\t var categoryWayValueDimStart;\n\t coordDimensions = coordDimensions.slice();\n\t each(coordDimensions, function (coordDimInfoLoose, coordDimIdx) {\n\t var coordDimInfo = isObject(coordDimInfoLoose) ? coordDimInfoLoose : coordDimensions[coordDimIdx] = {\n\t name: coordDimInfoLoose\n\t };\n\t\n\t if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\n\t baseCategoryDimIndex = coordDimIdx;\n\t categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);\n\t }\n\t\n\t encode[coordDimInfo.name] = [];\n\t });\n\t var datasetRecord = datasetMap.get(key) || datasetMap.set(key, {\n\t categoryWayDim: categoryWayValueDimStart,\n\t valueWayDim: 0\n\t }); // TODO\n\t // Auto detect first time axis and do arrangement.\n\t\n\t each(coordDimensions, function (coordDimInfo, coordDimIdx) {\n\t var coordDimName = coordDimInfo.name;\n\t var count = getDataDimCountOnCoordDim(coordDimInfo); // In value way.\n\t\n\t if (baseCategoryDimIndex == null) {\n\t var start = datasetRecord.valueWayDim;\n\t pushDim(encode[coordDimName], start, count);\n\t pushDim(encodeSeriesName, start, count);\n\t datasetRecord.valueWayDim += count; // ??? TODO give a better default series name rule?\n\t // especially when encode x y specified.\n\t // consider: when mutiple series share one dimension\n\t // category axis, series name should better use\n\t // the other dimsion name. On the other hand, use\n\t // both dimensions name.\n\t } // In category way, the first category axis.\n\t else if (baseCategoryDimIndex === coordDimIdx) {\n\t pushDim(encode[coordDimName], 0, count);\n\t pushDim(encodeItemName, 0, count);\n\t } // In category way, the other axis.\n\t else {\n\t var start = datasetRecord.categoryWayDim;\n\t pushDim(encode[coordDimName], start, count);\n\t pushDim(encodeSeriesName, start, count);\n\t datasetRecord.categoryWayDim += count;\n\t }\n\t });\n\t\n\t function pushDim(dimIdxArr, idxFrom, idxCount) {\n\t for (var i = 0; i < idxCount; i++) {\n\t dimIdxArr.push(idxFrom + i);\n\t }\n\t }\n\t\n\t function getDataDimCountOnCoordDim(coordDimInfo) {\n\t var dimsDef = coordDimInfo.dimsDef;\n\t return dimsDef ? dimsDef.length : 1;\n\t }\n\t\n\t encodeItemName.length && (encode.itemName = encodeItemName);\n\t encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\n\t return encode;\n\t }", "function getEncode(_, ctx) {\n var spec = _.$encode,\n encode = {}, name, enc;\n\n for (name in spec) {\n enc = spec[name];\n encode[name] = (0,vega_util__WEBPACK_IMPORTED_MODULE_3__.accessor)((0,_expression__WEBPACK_IMPORTED_MODULE_1__.encodeExpression)(enc.$expr, ctx), enc.$fields);\n encode[name].output = enc.$output;\n }\n return encode;\n}", "function getEncode(_, ctx) {\n var spec = _.$encode,\n encode = {}, name, enc;\n\n for (name in spec) {\n enc = spec[name];\n encode[name] = vegaUtil.accessor(encodeExpression(enc.$expr, ctx), enc.$fields);\n encode[name].output = enc.$output;\n }\n return encode;\n }", "function encodeMappingKey(input) {\n if (input.type.typeClass === \"string\" ||\n (input.type.typeClass === \"bytes\" && input.type.kind === \"dynamic\")) {\n return BytesEncode.encodeBytes(input);\n }\n else {\n return BasicEncode.encodeBasic(input);\n }\n}", "function getEncode(_, ctx) {\n var spec = _.$encode,\n encode = {}, name, enc;\n\n for (name in spec) {\n enc = spec[name];\n encode[name] = Object(__WEBPACK_IMPORTED_MODULE_3_vega_util__[\"d\" /* accessor */])(Object(__WEBPACK_IMPORTED_MODULE_1__expression__[\"a\" /* encodeExpression */])(enc.$expr, ctx), enc.$fields);\n encode[name].output = enc.$output;\n }\n return encode;\n}", "function getEncode(_, ctx) {\n var spec = _.$encode,\n encode = {}, name, enc;\n\n for (name in spec) {\n enc = spec[name];\n encode[name] = accessor(encodeExpression(enc.$expr, ctx), enc.$fields);\n encode[name].output = enc.$output;\n }\n return encode;\n }", "encode() {\n let encoder = new Encoder(this.store);\n encoder.encode(this);\n return encoder.output();\n }", "function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {\n var encode = {};\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur.\n\n if (!datasetModel || !coordDimensions) {\n return encode;\n }\n\n var encodeItemName = [];\n var encodeSeriesName = [];\n var ecModel = seriesModel.ecModel;\n var datasetMap = innerGlobalModel(ecModel).datasetMap;\n var key = datasetModel.uid + '_' + source.seriesLayoutBy;\n var baseCategoryDimIndex;\n var categoryWayValueDimStart;\n coordDimensions = coordDimensions.slice();\n Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_1__[/* each */ \"k\"])(coordDimensions, function (coordDimInfoLoose, coordDimIdx) {\n var coordDimInfo = Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_1__[/* isObject */ \"z\"])(coordDimInfoLoose) ? coordDimInfoLoose : coordDimensions[coordDimIdx] = {\n name: coordDimInfoLoose\n };\n\n if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\n baseCategoryDimIndex = coordDimIdx;\n categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);\n }\n\n encode[coordDimInfo.name] = [];\n });\n var datasetRecord = datasetMap.get(key) || datasetMap.set(key, {\n categoryWayDim: categoryWayValueDimStart,\n valueWayDim: 0\n }); // TODO\n // Auto detect first time axis and do arrangement.\n\n Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_1__[/* each */ \"k\"])(coordDimensions, function (coordDimInfo, coordDimIdx) {\n var coordDimName = coordDimInfo.name;\n var count = getDataDimCountOnCoordDim(coordDimInfo); // In value way.\n\n if (baseCategoryDimIndex == null) {\n var start = datasetRecord.valueWayDim;\n pushDim(encode[coordDimName], start, count);\n pushDim(encodeSeriesName, start, count);\n datasetRecord.valueWayDim += count; // ??? TODO give a better default series name rule?\n // especially when encode x y specified.\n // consider: when mutiple series share one dimension\n // category axis, series name should better use\n // the other dimsion name. On the other hand, use\n // both dimensions name.\n } // In category way, the first category axis.\n else if (baseCategoryDimIndex === coordDimIdx) {\n pushDim(encode[coordDimName], 0, count);\n pushDim(encodeItemName, 0, count);\n } // In category way, the other axis.\n else {\n var start = datasetRecord.categoryWayDim;\n pushDim(encode[coordDimName], start, count);\n pushDim(encodeSeriesName, start, count);\n datasetRecord.categoryWayDim += count;\n }\n });\n\n function pushDim(dimIdxArr, idxFrom, idxCount) {\n for (var i = 0; i < idxCount; i++) {\n dimIdxArr.push(idxFrom + i);\n }\n }\n\n function getDataDimCountOnCoordDim(coordDimInfo) {\n var dimsDef = coordDimInfo.dimsDef;\n return dimsDef ? dimsDef.length : 1;\n }\n\n encodeItemName.length && (encode.itemName = encodeItemName);\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\n return encode;\n}", "function _encoder(input) {\n let encodeArr = [];\n for (let char of input) {\n let lowerChar = char.toLowerCase();\n //accounting for special case of 'i' and 'j' as they are a shared key\n if (lowerChar === \"i\" || lowerChar === \"j\") {\n encodeArr.push(\"42\");\n //checking to ensure the current character is alphabetic\n } else if (lowerChar.match(/[a-z]/)) {\n encodeArr.push(encodeAlphabet[lowerChar]);\n //accounting for any non-alphabetic character and pushing them to encodeArr\n } else {\n encodeArr.push(lowerChar);\n }\n }\n return encodeArr.join(\"\");\n }", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function InternalEncoder(options, codec) {\n }", "function map(o) {\n return format(o, true);\n}", "encode(obj) {\n let encoder = new Encoder(this);\n encoder.encode(obj);\n return encoder.output();\n }", "encodeValue(value) {\n return standardEncoding(value);\n }", "encodeValue(value) {\n return standardEncoding(value);\n }", "encodeValue(value) {\n return standardEncoding(value);\n }", "encodeValue(value) {\n return standardEncoding(value);\n }", "encodeValue(value) {\n return standardEncoding(value);\n }", "function Encoder(){}", "encodeValue(value) {\n return standardEncoding(value);\n }", "applyEncoder(){\n\t\t// creating the LAYER\n\t\tlet layer = new Konva.Layer();\n\t\t// get the selected language\n\t\tlet lang = this.lang.gn;\n\n\t\t// creating the INFORMATION REGISTER //////////////////////////////////////////////\n\t\tlet ir = new REGISTER({\n\t\t\tid: 'ir',\n\t\t\tname: lang.irLabel,\n\t\t\tbitsNum: this.m,\n\t\t\tshiftHoverTxt: lang.shiftHover,\n\t\t\tflipHoverTxt: lang.flipHover,\n\t\t\trandHoverTxt: lang.randHover,\n\t\t\trandBtnLabel: lang.randBitsLabel,\n\t\t\tflipBtnLabel: lang.flipBtnLabel,\n\t\t\tbit: {name: 'IR Bit', hover: lang.regBitHover, enabled: true},\n\t\t});\n\t\tlayer.add(ir);\n\t\tir.dragmove(false);\n\t\tir.S.visible(false);\n\n\t\t// creating the CODEWORD REGISTER ////////////////////////////////////////////////\n\t\tlet cr = new REGISTER({\n\t\t\tid: 'cw',\n\t\t\tname: lang.crLabel,\n\t\t\tbitsNum: this.n,\n\t\t\tbit : {name: 'CR Bit', enabled: false},\n\t\t\tshiftHoverTxt: lang.shiftHover,\n\t\t\tflipHoverTxt: lang.flipHover,\n\t\t\trandHoverTxt: lang.randHover,\n\t\t\trandBtnLabel: lang.randBitsLabel,\n\t\t\tflipBtnLabel: lang.flipBtnLabel,\n\t\t});\n\t\tlayer.add(cr);\n\t\tcr.empty();\n\t\tcr.dragmove(false);\n\t\tcr.writeBtn.visible(false);\n\n\t\t// creating the LFSR ENCODER //////////////////////////////////////////////\n\t\tlet en = new LFSR({\n\t\t\t\tname: lang.ccLFSRLabel,\n\t\t\t\tbitsNum: this.k,\n\t\t\t\txorIds: this.xorIds,\n\t\t\t\tpoly: 'P(x)='+this.genPoly.txt.toLowerCase(),\n\t\t\t\tsHover: lang.sHover,\n\t\t\t\tfHover: lang.fHover,\n\t\t\t\tsw: {hoverTxt: lang.swHover},\n\t\t\t\txor:{hoverTxt:lang.xorHover,\n\t\t\t\t\tfbHover:lang.fbHover}\n\t\t}, ir, cr, this.algorithm, this.stat);\n\t\ten.position({x:20, y:40});\n\t\tlayer.add(en);\n\t\ten.dragmove(false);\n\t\ten.fb.txtFb.text(lang.fbLabel);\n\n\t\t// creating the INFORMATION REGISTER //////////////////////////////////////////////\n\t\tlet pos={};\n\t\tpos.x = en.rect.absolutePosition().x;\n\t\tpos.y = en.rect.absolutePosition().y + en.rect.height() + 40;\n\n\t\tir.position(pos);\n\t\tir.inBit = function(){return '';};\n\t\t// IR 'Bit' click event\n\t\tir.bits.forEach(bit =>{\n\t\t\tbit.on('click touchstart', function(){\n\t\t\t\tlet check = model.algorithm.validStep('setBits');\n\t\t\t\tif (check === true) {\n\t\t\t\t\tbit.setBit();\n\t\t\t\t\tif(ir.areAllBitsSetted()) model.algorithm.markCurrStep('past');\n\t\t\t\t\telse model.algorithm.markCurrStep('curr');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tbit.hover.show('e', check);\n\t\t\t\t\t//model.stat.error.add(check+' ('+model.algorithm.getCurrStep().description+')');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\t// IR 'F' click event\n\t\tir.F.on('click touchstart', function(){\n\t\t\tlet currStep = model.algorithm.getCurrStep().name;\n\t\t\tif (currStep === 'setBits'){\n\t\t\t\tlet check;\n\t\t\t\tir.bits.forEach(bit => {\n\t\t\t\t\tif (bit.txt.text() === '') return check = 'emptyBit';\n\t\t\t\t});\n\t\t\t\tif (check === 'emptyBit'){\n\t\t\t\t\tthis.hover.show('e', lang.setAllBit);\n\t\t\t\t\t//model.stat.error.add(lang.setAllBit);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmodel.algorithm.increment(); // enable flipIR\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet check = model.algorithm.validStep('flipIR');\n\t\t\tif (check === true) {\n\t\t\t\tir.valsBack = [...ir.vals]; // backup the register's values\n\t\t\t\tir.flip();\n\t\t\t\tconsole.log(model.algorithm.getCurrStep().description);\n\t\t\t\tmodel.algorithm.increment(); // enabling the next step\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.hover.show('e', check);\n\t\t\t\tmodel.stat.error.add(check);\n\t\t\t\treturn;\n\t\t\t}\n\t\t});\n\n\t\t// IR 'Random' click event\n\t\tir.rand.on('click touchstart', function(){\n\t\t\tlet check = model.algorithm.validStep('setBits');\n\t\t\tif (check === true) {\n\t\t\t\tmodel.algorithm.markCurrStep('curr');\n\t\t\t\tir.randGen();\n\t\t\t\t//this.fill('red');\n\t\t\t\tconsole.log(model.algorithm.getCurrStep().description);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//ir.info.show('e', check);\n\t\t\t\tthis.hover.show('e', check);\n\t\t\t\tmodel.stat.error.add(check);\n\t\t\t\treturn;\n\t\t\t}\n\t\t});\n\t\t// IR '>>>' click event\n\t\t// ir.S.on('click touchstart', function(){\n\t\t// \tlet check = model.algorithm.validStep('shiftIR');\n\t\t// \tif (check === true) {\n\t\t// \t\tir.shiftR('', '', 2);\n\t\t// \t\tconsole.log(model.algorithm.getCurrStep().description);\n\t\t// \t\tmodel.algorithm.increment(); // enable set1SW or set2SW\n\t\t// \t}\n\t\t// \telse {\n\t\t// \t\t//ir.info.show('e', check);\n\t\t// \t\tthis.hover.show('e', check);\n\t\t// \t\tmodel.stat.error.add(check);\n\t\t// \t\treturn;\n\t\t// \t}\n\t\t// });\n\n\t\t// codeword register position set\n\t\tcr.position({x: en.x()+en.width() + 40, y: en.soket('abs').connO.y - cr.rect.height()/2});\n\n\t\t// connection between IR and Encoder\n\t\tir.connectTo(en.soket('abs').connI);\n\n\t\t// connection between Encoder and CR\n\t\tcr.connectFrom(en.soket('abs').connO);\n\n\t\t// cr.inBit = function(){\n\t\t// \treturn en.sw2.pos === 1 ? ir.vals[ir.vals.length - 1]: en.vals[en.vals.length - 1];\n\t\t// };\n\n\t\t// CR '>>>' click event\n\t\tcr.S.on('click touchstart', function(){\n\t\t\t// check SW's position if current step is 'set2SW'\n\t\t\tlet currStep = model.algorithm.getCurrStep();\n\t\t\tif(currStep.name === 'set2SW') {\n\t\t\t\tif (model.en.sw1.pos !== 0){\n\t\t\t\t\tthis.hover.show('e', lang.wrongSw);\n\t\t\t\t\tmodel.stat.error.add(lang.wrongSw);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (model.en.sw2.pos !== 2){\n\t\t\t\t\tthis.hover.show('e', lang.wrongSw);\n\t\t\t\t\tmodel.stat.error.add(lang.lang.wrongSw);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tmodel.algorithm.increment(); // enable shiftEN (shiftParity)\n\t\t\t}\n\n\t\t\tlet check = model.algorithm.validStep('shiftCR');\n\t\t\tif (check === true){\n\t\t\t\tlet endFunc = function(){ir.shiftR('', '', 2);};\n\t\t\t\tif(model.en.sw2.pos === 1) cr.shiftR(ir.bits[ir.bits.length -1], ir.vals[ir.vals.length -1], 1, function(){ir.shiftR('', '', 2);});\n\t\t\t\telse if(model.en.sw2.pos === 2) cr.shiftR(en.bits[en.bits.length -1], en.vals[en.vals.length -1], 1, function(){en.shiftR(2);});\n\t\t\t\tconsole.log(model.algorithm.getCurrStep().description);\n\t\t\t\tmodel.algorithm.increment(); // enable shiftIR\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//cr.info.show('e', check);\n\t\t\t\tthis.hover.show('e', check);\n\t\t\t\tmodel.stat.error.add(check);\n\t\t\t\treturn;\n\t\t\t}\n\t\t});\n\t\t// CR 'R' click event\n\t\tcr.F.on('click touchstart', function(){\n\t\t\tlet check = model.algorithm.validStep('flipCR');\n\t\t\tif (check === true){\n\t\t\t\tcr.flip();\n\t\t\t\tconsole.log(model.algorithm.getCurrStep().description);\n\t\t\t\tmodel.algorithm.increment(); // last operation\n\t\t\t\tmodel.finish();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//cr.info.show('e', check);\n\t\t\t\tthis.hover.show('e', check);\n\t\t\t\tmodel.stat.error.add(check);\n\t\t\t\treturn;\n\t\t\t}\n\t\t});\n\n\t\tlet gr = new Konva.Group();\n\t\tgr.draggable(true);\n\t\tgr.add(ir,cr,en);\n\t\tlayer.add(gr);\n\n\t\tthis.en = en;\n\t\tthis.ir = ir;\n\t\tthis.cr = cr;\n\n\t\treturn layer;\n\n\t}", "function encode(string){\n\n}", "function encode(input) {\n var encoder = new Encoder()\n var output = encoder.update(input, true)\n return output\n}" ]
[ "0.6003305", "0.54790604", "0.5398591", "0.53889954", "0.53614396", "0.531016", "0.5245948", "0.5194732", "0.5176595", "0.51000935", "0.5093149", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5036385", "0.49886253", "0.4982168", "0.49503273", "0.49503273", "0.49503273", "0.49503273", "0.49503273", "0.49363345", "0.49319103", "0.48127794", "0.48061916", "0.48012742" ]
0.69167316
2
If return null/undefined, indicate that should not use datasetModel.
function getDatasetModel(seriesModel) { var option = seriesModel.option; // Caution: consider the scenario: // A dataset is declared and a series is not expected to use the dataset, // and at the beginning `setOption({series: { noData })` (just prepare other // option but no data), then `setOption({series: {data: [...]}); In this case, // the user should set an empty array to avoid that dataset is used by default. var thisData = option.data; if (!thisData) { return seriesModel.ecModel.getComponent('dataset', option.datasetIndex || 0); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function datasetDangerously () {}", "function useSelectedDataset() {\n let modUrl = \"/models-for-dataset?dataset=\" + getSelectedDatasetName();\n let imgUrl = \"/dataset-details?dataset=\" + getSelectedDatasetName();\n\n populateModels(modUrl);\n populateStaticImages(imgUrl);\n}", "get dataset() {\n return this.#el?.dataset ?? this.#dataset;\n }", "modelCanExist () {\n\t\treturn true;\n\t}", "function ifDataset(string) {\n return string === 'Dataset'\n}", "load_dataset(dataset, dataset_elec) {\n if (dataset === undefined || dataset_elec === undefined) {\n // console.log('dataset:', dataset);\n // console.log('dataset_elect:', dataset_elec);\n }\n this.dataset = dataset;\n this.dataset_elec = dataset_elec;\n }", "function useDataLayer() {\n return {};\n}", "modelCanExist (/*model*/) {\n\t\treturn false;\n\t}", "function hasCustomDataProvider(object) {\n return object.dataProvider !== undefined;\n}", "function isDatasetObject(dataset) {\n return (typeof dataset.iterator === 'function');\n}", "function isDatasetObject(dataset) {\n return (typeof dataset.iterator === 'function');\n}", "function isDatasetObject(dataset) {\n return (typeof dataset.iterator === 'function');\n}", "_hasTableData() {\n return this.props.source || !ObjectUtils.isNull(this.props.source);\n }", "function createSolidDataset() {\n return dataset();\n}", "validateDatasetForm() {\n if(this.nameValidationState != undefined && this.descValidationState != undefined && this.attribValidationState != undefined) {\n if(this.nameValidationState == 'error' || this.descValidationState == 'error' || this.attribValidationState == 'error') {\n return true;\n } else {\n return false;\n }\n } else {\n return true;\n }\n }", "function ISDataSet(){ this._Type=\"ISDataSet\"; ISObject.call(this); this.Name=null; this.DataSetName=null; this.Tables=new ISArray(); }", "function getDefault() {\n getData(getInputs);\n}", "function DefaultGraphModel(domain) \r\n{\r\n if (arguments.length > 0) {\r\n\tthis.init(domain);\r\n }\r\n}", "static get isResourceModel() {\n return true;\n }", "function createSolidDataset() {\n return freeze({\n type: \"Dataset\",\n graphs: {\n default: {}\n }\n });\n}", "_newDataSet(...params){\n const Type = this.options.DataSetType || DataSet;\n return new Type(...params); \n }", "function configureDataset() {\n const response = SpreadsheetApp.getUi().prompt('BigQuery dataset name:');\n if (response.getSelectedButton() == SpreadsheetApp.getUi().Button.OK) {\n const dataset = response.getResponseText();\n PropertiesService.getUserProperties().\n setProperty(DATASET_PROPERTY, dataset);\n Logger.log('Dataset configured: ' + dataset);\n return dataset;\n }\n\n Logger.log('Dataset was not configured.');\n return null;\n}", "static getModel() {\n return routineModel;\n }", "function isEmpty() {\n return ( 0 === dataset.length );\n }", "function basicModel() {\n \n }", "function createDatasetIfNotExists() {\n [projectId, datasetId] = getConfiguration();\n\n try {\n BigQuery.Datasets.get(projectId, datasetId);\n } catch (e) {\n Logger.log('Dataset does not exist. Creating new dataset with ID: ' +\n datasetId);\n const dataset = BigQuery.newDataset();\n const reference = BigQuery.newDatasetReference();\n reference.datasetId = datasetId;\n dataset.datasetReference = reference;\n BigQuery.Datasets.insert(dataset, projectId);\n }\n return datasetId;\n}", "notARealComplexDataType(user, args, context) {\n return null;\n }", "checkTrainableWeightsConsistency() {\n if (this.collectedTrainableWeights == null) {\n return;\n }\n if (this.trainableWeights.length !==\n this.collectedTrainableWeights.length) {\n console.warn('Discrepancy between trainableweights and collected trainable ' +\n 'weights. Did you set `model.trainable` without calling ' +\n '`model.compile()` afterwards?');\n }\n }", "function init(datasets) {\n /* jshint unused: false */\n }", "modelCanExist () {\n\t\t// we match on a New Relic object ID and object type, in which case we add a new stack trace as needed\n\t\treturn true;\n\t}", "function loadNothing() {\n return null;\n }", "get dataRequirement() {\n\t\treturn this.__dataRequirement;\n\t}", "all() {\n return Util_1.default.toDataset(this.data);\n }", "safeReplaceDataset(oldDataset, newDataset) {\n oldDataset.data = newDataset.data\n oldDataset.labels = newDataset.labels\n }", "function CMLayerDataset() \r\n{\r\n\tCMLayer.call(this);\r\n\tthis.TheDataset=null; // default\r\n}", "function getModel(cb) {\n dataModel.getModel(function (err, model) {\n if (err) {\n console.error('Error getting model');\n } else {\n // TODO: at this point we are just getting the default model but we\n // need to extend this to include overrides in the model\n cb(model.default);\n }\n });\n}", "function inputDataUndef(states, lastOutput) { \n if (_.isArray(states)) {\n return _.reduce(states, function(result, state) {\n return ((_.isUndefined( state) || _.isUndefined(state.data)) && ! _.isUndefined(lastOutput.lm));\n }, false);\n } else {\n return ((_.isUndefined(states) || _.isUndefined(states.data)) && ! _.isUndefined(lastOutput.lm));\n }\n}", "function setEntityTypeDefault() {\n entityTypeDefault = $(this).attr('label');\n return false;\n }", "function getDataModel(name){\n\t\treturn dataList[name];\n\t}", "getDatasetName() {\n return this.options.datasetName || '';\n }", "function modelReady() \n{\n print(\"Model REady\");\n loadData(); \n}", "function d3_true() {\n return true;\n}", "getDataModel(name){\n\t\t\treturn this[dataSymbol][name].model;\n\t\t}", "model() {}", "isPersistentModel () {\n let connectionCount = this.model.connection.length\n\n if (connectionCount > 2) {\n console.error(`Persistent connection is ambiguous for model ${this.model.identity}`)\n }\n\n return connectionCount === 2\n }", "train() {\n\t\tif (!this.model) {\n\t\t\tthis.model = this.buildModel();\n\t\t}\n\t}", "autoSaveHasMinimumData() {\n return false;\n }", "function FalseSpecification() {}", "get noRecordsToDisplay(){\n if(this.recordToDisplay == ''){\n return true;\n }\n }", "function MissingModelCompatibilityDecorator(api, modelService) {\n this.api = api;\n this.modelService = modelService;\n this.apiFetching = {}; // to prevent loops, if we have already\n }", "get _inDefaultGraph() {\n return DEFAULTGRAPH.equals(this._graph);\n }", "get _inDefaultGraph() {\n return DEFAULTGRAPH.equals(this._graph);\n }", "function _default(ecModel, api) {\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var layout = seriesModel.get('layout');\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n var data = seriesModel.getData();\n var dimensions = [];\n each(coordSys.dimensions, function (coordDim) {\n dimensions = dimensions.concat(data.mapDimension(coordDim, true));\n });\n\n for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) {\n var value = [];\n var hasValue = false;\n\n for (var i = 0; i < dimensions.length; i++) {\n var val = data.get(dimensions[i], dataIndex);\n\n if (!isNaN(val)) {\n hasValue = true;\n }\n\n value.push(val);\n }\n\n if (hasValue) {\n data.setItemLayout(dataIndex, coordSys.dataToPoint(value));\n } else {\n // Also {Array.<number>}, not undefined to avoid if...else... statement\n data.setItemLayout(dataIndex, [NaN, NaN]);\n }\n }\n\n simpleLayoutEdge(data.graph);\n } else if (!layout || layout === 'none') {\n simpleLayout(seriesModel);\n }\n });\n}", "function _default(ecModel, api) {\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var layout = seriesModel.get('layout');\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n var data = seriesModel.getData();\n var dimensions = [];\n each(coordSys.dimensions, function (coordDim) {\n dimensions = dimensions.concat(data.mapDimension(coordDim, true));\n });\n\n for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) {\n var value = [];\n var hasValue = false;\n\n for (var i = 0; i < dimensions.length; i++) {\n var val = data.get(dimensions[i], dataIndex);\n\n if (!isNaN(val)) {\n hasValue = true;\n }\n\n value.push(val);\n }\n\n if (hasValue) {\n data.setItemLayout(dataIndex, coordSys.dataToPoint(value));\n } else {\n // Also {Array.<number>}, not undefined to avoid if...else... statement\n data.setItemLayout(dataIndex, [NaN, NaN]);\n }\n }\n\n simpleLayoutEdge(data.graph);\n } else if (!layout || layout === 'none') {\n simpleLayout(seriesModel);\n }\n });\n}", "applyDefaultToUndefined(field, data) {\n if(data[field] === undefined && this.model[field].default !== undefined)\n data[field] = this.model[field].default;\n }", "getModel() {\n }", "function _default(ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n\n if (legendModels && legendModels.length) {\n ecModel.filterSeries(function (series) {\n // If in any legend component the status is not selected.\n // Because in legend series is assumed selected when it is not in the legend data.\n for (var i = 0; i < legendModels.length; i++) {\n if (!legendModels[i].isSelected(series.name)) {\n return false;\n }\n }\n\n return true;\n });\n }\n}", "function _default(ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n\n if (legendModels && legendModels.length) {\n ecModel.filterSeries(function (series) {\n // If in any legend component the status is not selected.\n // Because in legend series is assumed selected when it is not in the legend data.\n for (var i = 0; i < legendModels.length; i++) {\n if (!legendModels[i].isSelected(series.name)) {\n return false;\n }\n }\n\n return true;\n });\n }\n}", "function _default(ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n\n if (legendModels && legendModels.length) {\n ecModel.filterSeries(function (series) {\n // If in any legend component the status is not selected.\n // Because in legend series is assumed selected when it is not in the legend data.\n for (var i = 0; i < legendModels.length; i++) {\n if (!legendModels[i].isSelected(series.name)) {\n return false;\n }\n }\n\n return true;\n });\n }\n}", "function _default(ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n\n if (legendModels && legendModels.length) {\n ecModel.filterSeries(function (series) {\n // If in any legend component the status is not selected.\n // Because in legend series is assumed selected when it is not in the legend data.\n for (var i = 0; i < legendModels.length; i++) {\n if (!legendModels[i].isSelected(series.name)) {\n return false;\n }\n }\n\n return true;\n });\n }\n}", "function _default(ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n\n if (legendModels && legendModels.length) {\n ecModel.filterSeries(function (series) {\n // If in any legend component the status is not selected.\n // Because in legend series is assumed selected when it is not in the legend data.\n for (var i = 0; i < legendModels.length; i++) {\n if (!legendModels[i].isSelected(series.name)) {\n return false;\n }\n }\n\n return true;\n });\n }\n}", "get nonTrainableWeights() {\n return this.layer.nonTrainableWeights;\n }", "get nonTrainableWeights() {\n return this.layer.nonTrainableWeights;\n }", "getMetamodel() {\n return Common.assertInstanceOf(this.metamodel, Metamodel);\n }", "initRunEntity () {\n if (!this.checkRunEntity()) return false // return error if model, run or entity name is empty\n\n this.runText = this.runTextByDigest({ ModelDigest: this.digest, RunDigest: this.runDigest })\n if (!Mdf.isNotEmptyRunText(this.runText)) {\n console.warn('Model run not found:', this.digest, this.runDigest)\n this.$q.notify({ type: 'negative', message: this.$t('Model run not found' + ': ' + this.runDigest) })\n return false\n }\n\n this.entityText = Mdf.entityTextByName(this.theModel, this.entityName)\n if (!Mdf.isNotEmptyEntityText(this.entityText)) {\n console.warn('Model entity not found:', this.entityName)\n this.$q.notify({ type: 'negative', message: this.$t('Model entity not found' + ': ' + this.entityName) })\n return false\n }\n this.runEntity = Mdf.runEntityByName(this.runText, this.entityName)\n if (!Mdf.isNotEmptyRunEntity(this.runEntity)) {\n console.warn('Entity microdata not found in model run:', this.entityName, this.runDigest)\n this.$q.notify({ type: 'negative', message: this.$t('Entity microdata not found in model run' + ': ' + this.entityName + ' ' + this.runDigest) })\n return false\n }\n return true\n }", "function checkDataset(object) {\n\tvar dataset = object.value;\n\tif(dataset == 'select') {\n\t\tunhide(\"submitbutton\");\n\t\tdocument.getElementById(\"serverMessage\").innerHTML = '&nbsp;';\n\t\treturn;\n\t}\n\tXHR = createXHR();\n\tif(XHR) {\n \t\tXHR.onreadystatechange = processDataSetCheckResponse;\n\t\tXHR.open(\"POST\", 'checkDataSet.do', true);\n\t\tXHR.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded; charset=UTF-8\");\n\t\tvar x = 'value=' + dataset;\n\t\tXHR.send(x);\n\t}\t\n}", "function isNotNull(item){\n return (item && item.label);\n }", "_initModels() {}", "function _default(ecModel, api) {\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var layout = seriesModel.get('layout');\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n var data = seriesModel.getData();\n var dimensions = [];\n each(coordSys.dimensions, function (coordDim) {\n dimensions = dimensions.concat(data.mapDimension(coordDim, true));\n });\n\n for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) {\n var value = [];\n var hasValue = false;\n\n for (var i = 0; i < dimensions.length; i++) {\n var val = data.get(dimensions[i], dataIndex);\n\n if (!isNaN(val)) {\n hasValue = true;\n }\n\n value.push(val);\n }\n\n if (hasValue) {\n data.setItemLayout(dataIndex, coordSys.dataToPoint(value));\n } else {\n // Also {Array.<number>}, not undefined to avoid if...else... statement\n data.setItemLayout(dataIndex, [NaN, NaN]);\n }\n }\n\n simpleLayoutEdge(data.graph, seriesModel);\n } else if (!layout || layout === 'none') {\n simpleLayout(seriesModel);\n }\n });\n}", "setModel(input) {\n if (input) {\n const isInitModel = this.initModel(input);\n this.data.push(isInitModel);\n }\n }", "function isDataObject(subject) {\n return subject != null\n && typeof subject.toData == 'function' }", "initializeModel() { }", "function isDataSetLike(idProp, v) {\n return _typeof_1(v) === \"object\" && v !== null && idProp === v.idProp && typeof v.add === \"function\" && typeof v.clear === \"function\" && typeof v.distinct === \"function\" && typeof forEach$2(v) === \"function\" && typeof v.get === \"function\" && typeof v.getDataSet === \"function\" && typeof v.getIds === \"function\" && typeof v.length === \"number\" && typeof map$2(v) === \"function\" && typeof v.max === \"function\" && typeof v.min === \"function\" && typeof v.off === \"function\" && typeof v.on === \"function\" && typeof v.remove === \"function\" && typeof v.setOptions === \"function\" && typeof v.stream === \"function\" && typeof v.update === \"function\" && typeof v.updateOnly === \"function\";\n}", "function loadInitialModel() {\r\n\r\n\t$.ajax({\r\n\t\ttype: \"get\",\r\n\t\turl: \"/space/getinitialmodel\",\r\n\t\tcache: false,\r\n\t\tdataType: \"json\",\r\n\t\tdata: {},\r\n\t\tsuccess: function(data) {\r\n\t\t\tif(data.issuc == \"true\") {\r\n\t\t\t\tvar options = {};\r\n\t\t\t\toptions.env = \"Local\"; // AutodeskProduction, AutodeskStaging, or AutodeskDevelopment (set in global var in this project)\r\n\t\t\t\toptions.document = \"http://\"+window.location.host+data.modelfile;\r\n\t\t\t\t_curUnitId = data.unitid;\r\n\t\t\t\t_curMajor = data.majorid;\r\n\t\t\t\t_isWholeModel = data.iswhole;\r\n\r\n\t\t\t\tAutodesk.Viewing.Initializer(options, function() {\r\n\t\t\t\t\tloadDocument(options.document); // load first entry by default\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}", "initializeDefaultArtworkCollection(options) {\n if (!(__guard__(this.get('artworkCollections'), x => x.length) > 0)) {\n this.set({artworkCollections: [new ArtworkCollection({userId: this.get('id')})]});\n }\n if (!this.defaultArtworkCollection.fetched) { return this.defaultArtworkCollection().fetch(options); }\n }", "function selectDataset(datasetIndex){\n var datasetForm = document.getElementById(\"datasets\");\n datasetForm.options[datasetIndex].selected = !(datasetForm.options[datasetIndex].selected);\n //Focus the main select form, update the metadata for the options selected in the main select form\n datasetForm.focus();\n displayMetadata(datasetForm);\n}", "checkDataSouresItems() {\n return Object.keys(this.items).filter((item) => this.items[item].datasource != undefined)\n }", "function camDef(something)\n{\n\treturn typeof(something) !== \"undefined\";\n}", "setModel(model) {\n // Do nothing. Use Callback instead of BaseCallback to track the model.\n }", "get performsNonLearnerFunction() {\n return Boolean(\n this._directedCourses?.length ||\n this._administeredCourses?.length ||\n this._administeredSessions?.length ||\n this._instructorGroups?.length ||\n this._instructedOfferings?.length ||\n this._instructedIlmSessions?.length ||\n this._instructedLearnerGroups?.length ||\n this._directedPrograms?.length ||\n this._programYears?.length ||\n this._administeredCurriculumInventoryReports?.length ||\n this._directedSchools?.length ||\n this._administeredSchools?.length\n );\n }", "isDataVizEmpty() {\n return document.querySelector(\"[data-viz='wrapper']\").getElementsByTagName(\"svg\").length === 0\n }", "function resetSourceDefaulter(ecModel) {\n\t // `datasetMap` is used to make default encode.\n\t innerGlobalModel(ecModel).datasetMap = createHashMap();\n\t }", "model(code) {\n if (typeof code !== 'string' || !code) return null;\n return this[models][code] || null;\n }", "isSubmodel(filename) {\n\t\t\treturn api.partDictionary[filename].isSubModel;\n\t\t}", "componentDidMount() {\n if (this.props.dataset.length === 0) {\n const { dispatch } = this.props;\n dispatch(fetchDataset());\n }\n }", "constructor () {\n this._model = null;\n this._formatter = null;\n this._config = this.constructor.defaultConfig();\n }", "function CMDataset() \r\n{\r\n\tCMBase.call(this);\r\n\tthis.URL=null;\r\n\t\r\n\tthis.SelectedFeature=-1;\r\n\tthis.MouseOverFeatureIndex=-1; // array of flags for rows?\r\n\tthis.ClickTolerance=8;\r\n}", "function checkPrjModel(model, modelRelation, prjset, prjtype, setname) {\n if (model === undefined || model.length == 0) {\n missing.push({'missingSet': setname});\n return;\n }\n model.forEach(function(m) {\n if (m.value.files.length === 0) {\n m.value[modelRelation].forEach(function(mr){\n prjset.forEach(function(p){\n if (p.uuid == mr) {\n var ptitle = p.value.title;\n var modeltitle = m.value.title;\n var obj = {};\n obj.title = ptitle;\n obj.model = modeltitle;\n obj.type = prjtype;\n missing.push(obj);\n }\n });\n });\n }\n });\n }", "checkIfModelBuiltFn () {\n fetch(test_url + '/TM/ldamodel', {\n mode: 'cors',\n method: 'GET'\n })\n .then((resp) => resp.json())\n .then((data) => {\n var modelBuilt = data['modelBuilt'];\n\n if (modelBuilt) {\n clearInterval(this.timerId);\n this.setState( { modelCreated: true } );\n }\n })\n .catch(function (error) {\n console.log(JSON.stringify(error));\n });\n }", "function Model() {}", "function isGraph(object){\r\n return object.data('plot') !== undefined;\r\n}", "function isGraph(object){\r\n return object.data('plot') !== undefined;\r\n}", "function isGraph(object){\r\n return object.data('plot') !== undefined;\r\n}", "function isGraph(object){\r\n return object.data('plot') !== undefined;\r\n}", "function isGraph(object){\r\n return object.data('plot') !== undefined;\r\n}", "function isGraph(object){\r\n return object.data('plot') !== undefined;\r\n}" ]
[ "0.6384554", "0.6067768", "0.56133175", "0.55288565", "0.5475066", "0.53938586", "0.5337803", "0.53140265", "0.5255647", "0.5209002", "0.5209002", "0.5209002", "0.5186419", "0.51407415", "0.5140565", "0.5138516", "0.50701576", "0.50483054", "0.50458163", "0.49737072", "0.4962524", "0.4960769", "0.495671", "0.49540308", "0.49380684", "0.4928795", "0.49212927", "0.49107993", "0.49095154", "0.49075168", "0.4899773", "0.48948187", "0.48909584", "0.48788446", "0.48686126", "0.48663965", "0.48523504", "0.48458883", "0.48443338", "0.4840917", "0.48292637", "0.48288935", "0.48149556", "0.48093393", "0.4799993", "0.47674948", "0.47610494", "0.47576848", "0.47494933", "0.47438422", "0.47429314", "0.47429314", "0.47353938", "0.47353938", "0.4728102", "0.47136986", "0.46994117", "0.46994117", "0.46994117", "0.46994117", "0.46994117", "0.46980712", "0.46980712", "0.4696299", "0.4694278", "0.46901852", "0.4683", "0.46820113", "0.4677573", "0.46756905", "0.46745527", "0.46625683", "0.46591017", "0.46555468", "0.465266", "0.46493164", "0.46431866", "0.46398747", "0.46157306", "0.4603059", "0.4600513", "0.45984533", "0.45957503", "0.4592294", "0.45912424", "0.45836088", "0.4574349", "0.45617688", "0.45588621", "0.45551014", "0.45534858", "0.45534858", "0.45534858", "0.45534858", "0.45534858", "0.45534858" ]
0.6283021
5
Build axisPointerModel, mergin tooltip.axisPointer model for each axis. allAxesInfo should be updated when setOption performed.
function collect(ecModel, api) { var result = { /** * key: makeKey(axis.model) * value: { * axis, * coordSys, * axisPointerModel, * triggerTooltip, * involveSeries, * snap, * seriesModels, * seriesDataCount * } */ axesInfo: {}, seriesInvolved: false, /** * key: makeKey(coordSys.model) * value: Object: key makeKey(axis.model), value: axisInfo */ coordSysAxesInfo: {}, coordSysMap: {} }; collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart. result.seriesInvolved && collectSeriesInfo(result, ecModel); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var axisKey = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\n var axisInfo = result.axesInfo[axisKey] = {\n key: axisKey,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: [],\n linkGroup: null\n };\n axesInfoInCoordSys[axisKey] = axisInfo;\n result.seriesInvolved = result.seriesInvolved || involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[axisKey] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var key = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\n var axisInfo = result.axesInfo[key] = {\n key: key,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: []\n };\n axesInfoInCoordSys[key] = axisInfo;\n result.seriesInvolved |= involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[key] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var key = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\n var axisInfo = result.axesInfo[key] = {\n key: key,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: []\n };\n axesInfoInCoordSys[key] = axisInfo;\n result.seriesInvolved |= involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[key] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var key = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\n var axisInfo = result.axesInfo[key] = {\n key: key,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: []\n };\n axesInfoInCoordSys[key] = axisInfo;\n result.seriesInvolved |= involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[key] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var key = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\n var axisInfo = result.axesInfo[key] = {\n key: key,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: []\n };\n axesInfoInCoordSys[key] = axisInfo;\n result.seriesInvolved |= involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[key] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var key = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\n var axisInfo = result.axesInfo[key] = {\n key: key,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: []\n };\n axesInfoInCoordSys[key] = axisInfo;\n result.seriesInvolved |= involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[key] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var key = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\n var axisInfo = result.axesInfo[key] = {\n key: key,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: []\n };\n axesInfoInCoordSys[key] = axisInfo;\n result.seriesInvolved |= involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[key] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var key = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\n var axisInfo = result.axesInfo[key] = {\n key: key,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: []\n };\n axesInfoInCoordSys[key] = axisInfo;\n result.seriesInvolved |= involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[key] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var key = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\n var axisInfo = result.axesInfo[key] = {\n key: key,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: []\n };\n axesInfoInCoordSys[key] = axisInfo;\n result.seriesInvolved |= involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[key] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n\n var axisPointerShow = axisPointerModel.get('show');\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n\n var snap = axisPointerModel.get('snap');\n var key = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category';\n\n // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n var axisInfo = result.axesInfo[key] = {\n key: key,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: []\n };\n axesInfoInCoordSys[key] = axisInfo;\n result.seriesInvolved |= involveSeries;\n\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = { axesInfo: {} });\n linkGroup.axesInfo[key] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n\n var axisPointerShow = axisPointerModel.get('show');\n if (!axisPointerShow || (\n axisPointerShow === 'auto'\n && !fromTooltip\n && !isHandleTrigger(axisPointerModel)\n )) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip\n ? makeAxisPointerModel(\n axis, baseTooltipModel, globalAxisPointerModel, ecModel,\n fromTooltip, triggerTooltip\n )\n : axisPointerModel;\n\n var snap = axisPointerModel.get('snap');\n var key = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category';\n\n // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n var axisInfo = result.axesInfo[key] = {\n key: key,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: []\n };\n axesInfoInCoordSys[key] = axisInfo;\n result.seriesInvolved |= involveSeries;\n\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {axesInfo: {}});\n linkGroup.axesInfo[key] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n\n var axisPointerShow = axisPointerModel.get('show');\n if (!axisPointerShow || (\n axisPointerShow === 'auto'\n && !fromTooltip\n && !isHandleTrigger(axisPointerModel)\n )) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip\n ? makeAxisPointerModel(\n axis, baseTooltipModel, globalAxisPointerModel, ecModel,\n fromTooltip, triggerTooltip\n )\n : axisPointerModel;\n\n var snap = axisPointerModel.get('snap');\n var key = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category';\n\n // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n var axisInfo = result.axesInfo[key] = {\n key: key,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: []\n };\n axesInfoInCoordSys[key] = axisInfo;\n result.seriesInvolved |= involveSeries;\n\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {axesInfo: {}});\n linkGroup.axesInfo[key] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n\t var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n\t var axisPointerShow = axisPointerModel.get('show');\n\t\n\t if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n\t return;\n\t }\n\t\n\t if (triggerTooltip == null) {\n\t triggerTooltip = axisPointerModel.get('triggerTooltip');\n\t }\n\t\n\t axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n\t var snap = axisPointerModel.get('snap');\n\t var axisKey = makeKey(axis.model);\n\t var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\t\n\t var axisInfo = result.axesInfo[axisKey] = {\n\t key: axisKey,\n\t axis: axis,\n\t coordSys: coordSys,\n\t axisPointerModel: axisPointerModel,\n\t triggerTooltip: triggerTooltip,\n\t involveSeries: involveSeries,\n\t snap: snap,\n\t useHandle: isHandleTrigger(axisPointerModel),\n\t seriesModels: [],\n\t linkGroup: null\n\t };\n\t axesInfoInCoordSys[axisKey] = axisInfo;\n\t result.seriesInvolved = result.seriesInvolved || involveSeries;\n\t var groupIndex = getLinkGroupIndex(linksOption, axis);\n\t\n\t if (groupIndex != null) {\n\t var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n\t axesInfo: {}\n\t });\n\t linkGroup.axesInfo[axisKey] = axisInfo;\n\t linkGroup.mapper = linksOption[groupIndex].mapper;\n\t axisInfo.linkGroup = linkGroup;\n\t }\n\t }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n\t var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n\n\t var axisPointerShow = axisPointerModel.get('show');\n\t if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n\t return;\n\t }\n\n\t if (triggerTooltip == null) {\n\t triggerTooltip = axisPointerModel.get('triggerTooltip');\n\t }\n\n\t axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n\n\t var snap = axisPointerModel.get('snap');\n\t var key = makeKey(axis.model);\n\t var involveSeries = triggerTooltip || snap || axis.type === 'category';\n\n\t // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\t var axisInfo = result.axesInfo[key] = {\n\t key: key,\n\t axis: axis,\n\t coordSys: coordSys,\n\t axisPointerModel: axisPointerModel,\n\t triggerTooltip: triggerTooltip,\n\t involveSeries: involveSeries,\n\t snap: snap,\n\t useHandle: isHandleTrigger(axisPointerModel),\n\t seriesModels: []\n\t };\n\t axesInfoInCoordSys[key] = axisInfo;\n\t result.seriesInvolved |= involveSeries;\n\n\t var groupIndex = getLinkGroupIndex(linksOption, axis);\n\t if (groupIndex != null) {\n\t var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = { axesInfo: {} });\n\t linkGroup.axesInfo[key] = axisInfo;\n\t linkGroup.mapper = linksOption[groupIndex].mapper;\n\t axisInfo.linkGroup = linkGroup;\n\t }\n\t }", "function axisPointer_install_install(registers) {\n // CartesianAxisPointer is not supposed to be required here. But consider\n // echarts.simple.js and online build tooltip, which only require gridSimple,\n // CartesianAxisPointer should be able to required somewhere.\n axis_AxisView.registerAxisPointerClass('CartesianAxisPointer', axisPointer_CartesianAxisPointer);\n registers.registerComponentModel(axisPointer_AxisPointerModel);\n registers.registerComponentView(axisPointer_AxisPointerView);\n registers.registerPreprocessor(function (option) {\n // Always has a global axisPointerModel for default setting.\n if (option) {\n (!option.axisPointer || option.axisPointer.length === 0) && (option.axisPointer = {});\n var link = option.axisPointer.link; // Normalize to array to avoid object mergin. But if link\n // is not set, remain null/undefined, otherwise it will\n // override existent link setting.\n\n if (link && !Object(util[\"t\" /* isArray */])(link)) {\n option.axisPointer.link = [link];\n }\n }\n }); // This process should proformed after coordinate systems created\n // and series data processed. So put it on statistic processing stage.\n\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) {\n // Build axisPointerModel, mergin tooltip.axisPointer model for each axis.\n // allAxesInfo should be updated when setOption performed.\n ecModel.getComponent('axisPointer').coordSysAxesInfo = collect(ecModel, api);\n }); // Broadcast to all views.\n\n registers.registerAction({\n type: 'updateAxisPointer',\n event: 'updateAxisPointer',\n update: ':updateAxisPointer'\n }, axisTrigger);\n}", "buildAnchors() {\r\n this.buildPointAnchors();\r\n }", "function cartesianAxisHelper_layout(gridModel, axisModel, opt) {\n opt = opt || {};\n var grid = gridModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\n var rawAxisPosition = axis.position;\n var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\n var axisDim = axis.dim;\n var rect = grid.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var idx = {\n left: 0,\n right: 1,\n top: 0,\n bottom: 1,\n onZero: 2\n };\n var axisOffset = axisModel.get('offset') || 0;\n var posBound = axisDim === 'x' ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\n\n if (otherAxisOnZeroOf) {\n var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\n posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\n } // Axis position\n\n\n layout.position = [axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0], axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]]; // Axis rotation\n\n layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1); // Tick and label direction, x y is axisDim\n\n var dirMap = {\n top: -1,\n bottom: 1,\n left: -1,\n right: 1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\n layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\n\n if (axisModel.get(['axisTick', 'inside'])) {\n layout.tickDirection = -layout.tickDirection;\n }\n\n if (util[\"O\" /* retrieve */](opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\n layout.labelDirection = -layout.labelDirection;\n } // Special label rotation\n\n\n var labelRotate = axisModel.get(['axisLabel', 'rotate']);\n layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate; // Over splitLine and splitArea\n\n layout.z2 = 1;\n return layout;\n}", "getOptions() {\n let grids = []\n let xAxies = []\n let yAxies = []\n let series = []\n \n let sampleRate = store.getState().sampleRate\n let keysArray = Object.keys(this.state.eegData)\n // Remove deleted keys\n keysArray = keysArray.filter((key) => {\n return !this.removedAxies.includes(key);\n });\n\n // Layout configuration\n function generateGridTops(grid_height, num_grids) {\n // Returns an array of the top value for each\n // grid to be represented by keysArray\n let padding = 4\n let render_limits = [0+padding, 100-padding]\n let jump_width = (100 - 2*padding) / num_grids\n var list = [];\n for (var i = render_limits[0]; i <= render_limits[1]; i += jump_width) {\n let adjusted_top = i - (grid_height / 2) \n list.push(Math.ceil(adjusted_top));\n }\n return list\n }\n let height = 40\n let topsList = generateGridTops(height, keysArray.length)\n\n keysArray.forEach((key) => {\n let i = keysArray.indexOf(key)\n let grid_top = topsList[i] + \"%\"\n\n grids.push({\n id: key,\n left: '10%',\n right: '2%',\n top: grid_top,\n height: height + \"%\",\n show: true,\n name: key,\n tooltip: {\n show: false,\n trigger: 'axis',\n showDelay: 25\n },\n containLabel: false, // Help grids aligned by axis\n borderWidth: 0\n })\n\n xAxies.push({\n id: key,\n name: key,\n // Index of data as categories, for now\n data: [...Array(this.state.eegData[key].length).keys()],\n type: 'category',\n gridIndex: i,\n showGrid: false,\n axisTick: {\n show: false,\n },\n axisLabel: {\n show: (i == keysArray.length - 1), // Only show on last grid\n interval: sampleRate - 1,\n formatter: (value, index) => {\n return (this.bufferStartIndex + parseInt(value)) / sampleRate\n }\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: true,\n interval: sampleRate - 1,\n },\n // Trigger event means you can click on name to register event\n triggerEvent: true,\n nameLocation: 'start',\n })\n\n // let scaleMax = new MyMaths().roundToNextDigit(Math.max(...this.state.eegData[key]))\n let scaleMax = 1\n let scaleMin = -scaleMax\n\n yAxies.push({\n id: key,\n type: 'value',\n gridIndex: i,\n axisLabel: {\n show: false,\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: false,\n },\n showGrid: false,\n // Programatically scale min/max\n min: scaleMin,\n max: scaleMax\n })\n\n // Add a line config to series object\n series.push({\n name: key,\n type: 'line',\n symbol: 'none',\n lineStyle: {\n width: 0.5,\n color: 'black',\n },\n gridIndex: i,\n yAxisIndex: i,\n xAxisIndex: i,\n smooth: false,\n sampling: 'lttb',\n\n data: this.state.eegData[key],\n })\n })\n\n /**\n * Configure backsplash grid for highlights and such\n * Adds a grid at backsplashGridIndex that takes full height\n * Adds an xAxis identical to the others\n * Adds a series of 0s meant to be undisplayed,\n * just for markAreas to be applied to\n */\n let timestampFormatter = (value) => {\n let secs = ((value + this.bufferStartIndex) / sampleRate) + this.time_adjustment_secs\n var date = new Date(0);\n date.setSeconds(secs);\n return date.toISOString().substr(11, 8);\n }\n\n this.backsplashGridIndex = keysArray.length\n let backsplashGridIndex = this.backsplashGridIndex\n let configureBacksplashGrid = () => {\n if (backsplashGridIndex == 0) {\n // Catch before data loads in\n return\n }\n let arbitraryKey = keysArray[0]\n\n grids.push({\n left: '10%',\n right: '4%',\n top: '0%',\n bottom: '4%',\n show: false,\n containLabel: false, // Help grids aligned by axis\n })\n yAxies.push({\n type: 'value',\n gridIndex: backsplashGridIndex,\n axisLabel: {\n show: false,\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: false,\n },\n showGrid: false,\n min: -1e-3,\n max: 1e-3,\n })\n xAxies.push({\n // Index of data as categories, for now\n data: [...Array(this.state.eegData[arbitraryKey].length).keys()],\n type: 'category',\n gridIndex: backsplashGridIndex,\n showGrid: false,\n axisTick: {\n show: false,\n },\n axisLabel: {\n show: true,\n interval: sampleRate - 1,\n formatter: (value, index) => {\n return timestampFormatter(value)\n }\n },\n axisLine: {\n show: false,\n },\n })\n series.push({\n type: 'line',\n symbol: 'none',\n lineStyle: {\n width: 0,\n color: '#00000000',\n },\n gridIndex: backsplashGridIndex,\n yAxisIndex: backsplashGridIndex,\n xAxisIndex: backsplashGridIndex,\n sampling: 'lttb',\n \n name: 'backSplashSeries',\n \n data: new Array(this.state.eegData[arbitraryKey].length).fill(0),\n })\n }\n configureBacksplashGrid()\n\n /**\n * \n * The actual configuration for the chart\n * Loads in all of the previously filled grids, xAxies, yAxies, and series\n * \n */\n let options = {\n // Use the values configured above\n grid: grids,\n xAxis: xAxies,\n yAxis: yAxies,\n series: series,\n\n // Other Configuration options\n animation: false,\n\n tooltip: {\n show: false,\n },\n\n // toolbox hidden\n toolbox: {\n orient: 'vertical',\n show: false,\n },\n\n // Brush allows for selection that gets turned into markAreas\n brush: {\n toolbox: ['lineX', 'keep'],\n xAxisIndex: backsplashGridIndex\n },\n\n dataZoom: [\n {\n show: false,\n xAxisIndex: Object.keys(series),\n type: 'slider',\n bottom: '2%',\n startValue: this.dz_start,\n endValue: this.dz_end,\n preventDefaultMouseMove: true,\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n },\n {\n yAxisIndex: Object.keys(series),\n type: 'slider',\n top: '45%',\n filterMode: 'none',\n show: false,\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n\n id: 'eegGain',\n start: 50 - this.yZoom,\n end: 50 + this.yZoom,\n },{\n type: 'inside',\n yAxisIndex: Object.keys(series),\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n }\n ],\n }\n\n return options\n }", "function axisTrigger(payload, ecModel, api) {\n\t var currTrigger = payload.currTrigger;\n\t var point = [payload.x, payload.y];\n\t var finder = payload;\n\t var dispatchAction = payload.dispatchAction || bind(api.dispatchAction, api);\n\t var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo; // Pending\n\t // See #6121. But we are not able to reproduce it yet.\n\t\n\t if (!coordSysAxesInfo) {\n\t return;\n\t }\n\t\n\t if (illegalPoint(point)) {\n\t // Used in the default behavior of `connection`: use the sample seriesIndex\n\t // and dataIndex. And also used in the tooltipView trigger.\n\t point = findPointFromSeries({\n\t seriesIndex: finder.seriesIndex,\n\t // Do not use dataIndexInside from other ec instance.\n\t // FIXME: auto detect it?\n\t dataIndex: finder.dataIndex\n\t }, ecModel).point;\n\t }\n\t\n\t var isIllegalPoint = illegalPoint(point); // Axis and value can be specified when calling dispatchAction({type: 'updateAxisPointer'}).\n\t // Notice: In this case, it is difficult to get the `point` (which is necessary to show\n\t // tooltip, so if point is not given, we just use the point found by sample seriesIndex\n\t // and dataIndex.\n\t\n\t var inputAxesInfo = finder.axesInfo;\n\t var axesInfo = coordSysAxesInfo.axesInfo;\n\t var shouldHide = currTrigger === 'leave' || illegalPoint(point);\n\t var outputPayload = {};\n\t var showValueMap = {};\n\t var dataByCoordSys = {\n\t list: [],\n\t map: {}\n\t };\n\t var updaters = {\n\t showPointer: curry(showPointer, showValueMap),\n\t showTooltip: curry(showTooltip, dataByCoordSys)\n\t }; // Process for triggered axes.\n\t\n\t each(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) {\n\t // If a point given, it must be contained by the coordinate system.\n\t var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);\n\t each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) {\n\t var axis = axisInfo.axis;\n\t var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo); // If no inputAxesInfo, no axis is restricted.\n\t\n\t if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {\n\t var val = inputAxisInfo && inputAxisInfo.value;\n\t\n\t if (val == null && !isIllegalPoint) {\n\t val = axis.pointToData(point);\n\t }\n\t\n\t val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload);\n\t }\n\t });\n\t }); // Process for linked axes.\n\t\n\t var linkTriggers = {};\n\t each(axesInfo, function (tarAxisInfo, tarKey) {\n\t var linkGroup = tarAxisInfo.linkGroup; // If axis has been triggered in the previous stage, it should not be triggered by link.\n\t\n\t if (linkGroup && !showValueMap[tarKey]) {\n\t each(linkGroup.axesInfo, function (srcAxisInfo, srcKey) {\n\t var srcValItem = showValueMap[srcKey]; // If srcValItem exist, source axis is triggered, so link to target axis.\n\t\n\t if (srcAxisInfo !== tarAxisInfo && srcValItem) {\n\t var val = srcValItem.value;\n\t linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo))));\n\t linkTriggers[tarAxisInfo.key] = val;\n\t }\n\t });\n\t }\n\t });\n\t each(linkTriggers, function (val, tarKey) {\n\t processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload);\n\t });\n\t updateModelActually(showValueMap, axesInfo, outputPayload);\n\t dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction);\n\t dispatchHighDownActually(axesInfo, dispatchAction, api);\n\t return outputPayload;\n\t }", "function buildTooltipModel(modelCascade, globalTooltipModel, defaultTooltipOption) {\n // Last is always tooltip model.\n var ecModel = globalTooltipModel.ecModel;\n var resultModel;\n\n if (defaultTooltipOption) {\n resultModel = new Model[\"a\" /* default */](defaultTooltipOption, ecModel, ecModel);\n resultModel = new Model[\"a\" /* default */](globalTooltipModel.option, resultModel, ecModel);\n } else {\n resultModel = globalTooltipModel;\n }\n\n for (var i = modelCascade.length - 1; i >= 0; i--) {\n var tooltipOpt = modelCascade[i];\n\n if (tooltipOpt) {\n if (tooltipOpt instanceof Model[\"a\" /* default */]) {\n tooltipOpt = tooltipOpt.get('tooltip', true);\n } // In each data item tooltip can be simply write:\n // {\n // value: 10,\n // tooltip: 'Something you need to know'\n // }\n\n\n if (util[\"C\" /* isString */](tooltipOpt)) {\n tooltipOpt = {\n formatter: tooltipOpt\n };\n }\n\n if (tooltipOpt) {\n resultModel = new Model[\"a\" /* default */](tooltipOpt, resultModel, ecModel);\n }\n }\n }\n\n return resultModel;\n}", "buildPointAnchors() {\r\n this.regionData.points.forEach((point, index) => {\r\n const anchor = this.createAnchor(this.paper, point.x, point.y);\r\n this.anchors.push(anchor);\r\n this.anchorsNode.add(anchor);\r\n this.subscribeAnchorToEvents(anchor, index);\r\n });\r\n }", "function updatePlot(axisType) {\n\n // update axisType\n if (axisType) {\n $(`#${currentAxisType}-button`).removeClass('active');\n $(`#${axisType}-button`).addClass('active');\n currentAxisType = axisType;\n }\n\n get_geolocation();\n\n if (geolocation === null || geolocation === undefined) {\n return;\n }\n if ((rawData === null) || (old_geolocation[0] != geolocation[0]) | (old_geolocation[1] != geolocation[1])) {\n rawData = {\n SMAP: {},\n NDMI: {}\n };\n rawData = get_data(geolocation, rawData);\n old_geolocation = geolocation;\n }\n\n let plot_data = null;\n let domain = null;\n let axis = {\n \"labelFontSize\": 24,\n \"titleFontSize\": 24,\n }\n if (currentAxisType === \"ndmi\") {\n plot_data = soilmoistureToNDMI(rawData);\n domain = [0, 6];\n axis.title = \"Drought Category\";\n axis.tickCount = 0;\n\n } else if (currentAxisType === \"sm\") {\n plot_data = NDMIToSoilmoisture(rawData);\n // domain = [Math.min.apply(Math, rawData.SMAP.map(function(o) {\n // if (o.moisture === undefined) {\n // return 1;\n // } else {\n // return o.moisture;\n // }\n // })), Math.max.apply(Math, rawData.SMAP.map(function(o) {\n // if (o.moisture == undefined) {\n // return 0;\n // } else {\n // return o.moisture;\n // }\n // }))];\n let smapMax = Math.max.apply(Math, Object.values(rawData.SMAP).map(function(o) {\n if (o.moisture == undefined) {\n return 0;\n } else {\n return o.moisture;\n }\n }));\n let ndmiMax = Math.max.apply(Math, plot_data.values.map(function(o) {\n if (o.NDMI == undefined) {\n return 0;\n } else {\n return o.NDMI;\n }\n }));\n domain = [0, Math.max(ndmiMax, smapMax)];\n axis.title = \"Soil Moisture (m³/m³)\";\n axis.tickCount = 5;\n }\n\n let vlSpec = makeVLSpec(plot_data, domain, axis);\n\n // Embed the visualization in the container with id `vis`\n vegaEmbed('#vis', vlSpec);\n}", "createAxesForInternalLyphs(modelClasses, entitiesByID){\n const createAxis = lyph => {\n let [sNode, tNode] = [\"s\", \"t\"].map(prefix => (\n Node.fromJSON({\n \"id\" : `${prefix}${lyph.id}`,\n \"name\" : `${prefix}${lyph.id}`,\n \"color\" : \"#ccc\",\n \"val\" : 0.1,\n \"skipLabel\": true,\n \"generated\": true\n }, modelClasses, entitiesByID)));\n\n let link = Link.fromJSON({\n \"id\" : `${lyph.id}-lnk`,\n \"source\" : sNode,\n \"target\" : tNode,\n \"geometry\" : Link.LINK_GEOMETRY.INVISIBLE,\n \"color\" : \"#ccc\",\n \"conveyingLyph\": lyph,\n \"skipLabel\" : true,\n \"generated\" : true\n }, modelClasses, entitiesByID);\n lyph.conveyedBy = link;\n sNode.sourceOf = [link];\n tNode.targetOf = [link];\n\n this.links.push(link);\n [sNode, tNode].forEach(node => this.nodes.push(node));\n };\n\n [...(this.lyphs||[]), ...(this.regions||[])]\n .filter(lyph => lyph.internalIn && !lyph.axis).forEach(lyph => createAxis(lyph, lyph.internalIn));\n\n const assignAxisLength = (lyph, container) => {\n if (container.axis) {\n if (!container.axis.length && container.container) {\n assignAxisLength(container, container.container);\n }\n lyph.axis.length = container.axis.length ? container.axis.length * 0.8 : DEFAULT_LENGTH;\n }\n };\n\n [...(this.lyphs||[]), ...(this.regions||[])]\n .filter(lyph => lyph.internalIn).forEach(lyph => assignAxisLength(lyph, lyph.internalIn));\n }", "function buildElStyle(axisPointerModel) {\n var axisPointerType = axisPointerModel.get('type');\n var styleModel = axisPointerModel.getModel(axisPointerType + 'Style');\n var style;\n\n if (axisPointerType === 'line') {\n style = styleModel.getLineStyle();\n style.fill = null;\n } else if (axisPointerType === 'shadow') {\n style = styleModel.getAreaStyle();\n style.stroke = null;\n }\n\n return style;\n}", "function drawAxes(){\n\td3.select(LRG1vLRG2)\n\t .append(\"rect\")\n\t .attr({\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t\twidth: w,\n\t\t\theight: h,\n\t\t\tfill: \"white\",\n\t\t})\n\t .on(\"click\", function(d) {\n\t\t\tremovePlotPointsWithClass(\".selected\");\n\t \t\td3.select(\"#tooltip\")\t\t\t\t\n\t\t\t\t.select(\"#selectedTooltipLine1\")\n\t\t\t\t.text(\"\")\n\n\t\t\td3.select(\"#tooltip\")\t\t\t\t\t\n\t\t\t\t.select(\"#selectedTooltipLine2\")\n\t\t\t\t.text(\"\");\n\t\t});\n\td3.select(LRG2vQSO)\n\t .append(\"rect\")\n\t .attr({\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t\twidth: w,\n\t\t\theight: h,\n\t\t\tfill: \"white\",\n\t\t})\n\t .on(\"click\", function(d) {\n\t\t\tremovePlotPointsWithClass(\".selected\");\n\t \t\td3.select(\"#tooltip\")\t\t\t\t\n\t\t\t\t.select(\"#selectedTooltipLine1\")\n\t\t\t\t.text(\"\")\n\n\t\t\td3.select(\"#tooltip\")\t\t\t\t\t\n\t\t\t\t.select(\"#selectedTooltipLine2\")\n\t\t\t\t.text(\"\");\n\t\t});\n\td3.select(SN2_G12vSN2_I12)\n\t .append(\"rect\")\n\t .attr({\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t\twidth: w,\n\t\t\theight: h,\n\t\t\tfill: \"white\",\n\t\t})\n\t .on(\"click\", function(d) {\n\t\t\tremovePlotPointsWithClass(\".selected\");\n\t \t\td3.select(\"#tooltip\")\t\t\t\t\n\t\t\t\t.select(\"#selectedTooltipLine1\")\n\t\t\t\t.text(\"\")\n\n\t\t\td3.select(\"#tooltip\")\t\t\t\t\t\n\t\t\t\t.select(\"#selectedTooltipLine2\")\n\t\t\t\t.text(\"\");\n\t\t});\n\td3.select(RAvDEC)\n\t .append(\"rect\")\n\t .attr({\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t\twidth: RAvDECwidth,\n\t\t\theight: h,\n\t\t\tfill: \"white\",\n\t\t})\n\t .on(\"click\", function(d) {\n\t\t\tremovePlotPointsWithClass(\".selected\");\n\t \t\td3.select(\"#tooltip\")\t\t\t\t\n\t\t\t\t.select(\"#selectedTooltipLine1\")\n\t\t\t\t.text(\"\")\n\n\t\t\td3.select(\"#tooltip\")\t\t\t\t\t\n\t\t\t\t.select(\"#selectedTooltipLine2\")\n\t\t\t\t.text(\"\");\n\t\t});\n\t//%LRG1v%LRG2\n\tvar xAxis= d3.svg.axis()\n\t\t\t\t\t .scale(xScaleLRG1vLRG2)\n\t\t\t\t\t .orient(\"bottom\");\n\tvar yAxis= d3.svg.axis()\n\t\t\t\t .scale(yScaleLRG1vLRG2)\n\t\t\t\t .orient(\"left\");\n\t/*axes*/\n\td3.select(LRG1vLRG2).append(\"g\")\n\t .attr({\n\t \t\tclass: \"axis\",\n\t \t\ttransform: \"translate(0,\" + (h-(3.5 * padding)) + \")\",\n\t\t})\n\t .call(xAxis);\n\n\td3.select(LRG1vLRG2).append(\"g\")\n\t .attr({\n\t \t\tclass: \"axis\",\n\t \t\ttransform: \"translate(\" + (4.5 * padding) + \",0)\",\n\t\t})\n\t .call(yAxis);\n\n\t/*label x-axis*/\n\td3.select(LRG1vLRG2).append(\"text\")\n\t .attr(\"class\", \"x label\")\n\t .attr(\"text-anchor\", \"middle\")\n\t .attr(\"x\", w /2 )\n\t .attr(\"y\", h - 6)\n\t .text(\"%LRG1\")\n\t .attr(\"font-family\", \"sans-serif\")\n\t .attr(\"font-size\", \"11px\")\n\t .attr(\"fill\", \"black\");\n\n\t/*label y-axis*/\n\td3.select(LRG1vLRG2).append(\"text\")\n\t .attr(\"class\", \"y label\")\n\t .attr(\"text-anchor\", \"middle\")\n\t .attr(\"x\", 0- h/2 )\n\t .attr(\"y\", 6)\n\t .attr(\"dy\", \".75em\")\n\t .attr(\"transform\", \"rotate(-90)\")\n\t .text(\"%LRG2\")\n\t .attr(\"font-family\", \"sans-serif\")\n\t .attr(\"font-size\", \"11px\")\n\t .attr(\"fill\", \"black\");\n\n\t//%LRG2vQSO\n\n\tvar xAxis= d3.svg.axis()\n\t\t\t\t\t .scale(xScaleLRG2vQSO)\n\t\t\t\t\t .orient(\"bottom\");\n\tvar yAxis= d3.svg.axis()\n\t\t\t\t .scale(yScaleLRG2vQSO)\n\t\t\t\t .orient(\"left\");\n\t/*axes*/\n\td3.select(LRG2vQSO).append(\"g\")\n\t .attr({\n\t \t\tclass: \"axis\",\n\t \t\ttransform: \"translate(0,\" + (h-(3.5 * padding)) + \")\",\n\t\t})\n\t .call(xAxis);\n\n\td3.select(LRG2vQSO).append(\"g\")\n\t .attr({\n\t \t\tclass: \"axis\",\n\t \t\ttransform: \"translate(\" + (4.5 * padding) + \",0)\",\n\t\t})\n\t .call(yAxis);\n\n\t/*label x-axis*/\n\td3.select(LRG2vQSO).append(\"text\")\n\t .attr(\"class\", \"x label\")\n\t .attr(\"text-anchor\", \"middle\")\n\t .attr(\"x\", w /2 )\n\t .attr(\"y\", h - 6)\n\t .text(\"%QSO\")\n\t .attr(\"font-family\", \"sans-serif\")\n\t .attr(\"font-size\", \"11px\")\n\t .attr(\"fill\", \"black\");\n\n\t/*label y-axis*/\n\td3.select(LRG2vQSO).append(\"text\")\n\t .attr(\"class\", \"y label\")\n\t .attr(\"text-anchor\", \"middle\")\n\t .attr(\"x\", 0- h/2 )\n\t .attr(\"y\", 6)\n\t .attr(\"dy\", \".75em\")\n\t .attr(\"transform\", \"rotate(-90)\")\n\t .text(\"%LRG2\")\n\t .attr(\"font-family\", \"sans-serif\")\n\t .attr(\"font-size\", \"11px\")\n\t .attr(\"fill\", \"black\");\n\n\t//SN2_G12vSN2_I12\n\tvar xAxis= d3.svg.axis()\n\t\t\t\t\t .scale(xScaleSN2_G12vSN2_I12)\n\t\t\t\t\t .orient(\"bottom\");\n\tvar yAxis= d3.svg.axis()\n\t\t\t\t .scale(yScaleSN2_G12vSN2_I12)\n\t\t\t\t .orient(\"left\");\n\t/*axis*/\n\td3.select(SN2_G12vSN2_I12).append(\"g\")\n\t .attr({\n\t \t\tclass: \"axis\",\n\t \t\ttransform: \"translate(0,\" + (h-(3.5 * padding)) + \")\",\n\t\t})\n\t .call(xAxis);\n\n\td3.select(SN2_G12vSN2_I12).append(\"g\")\n\t .attr({\n\t \t\tclass: \"axis\",\n\t \t\ttransform: \"translate(\" + (4.5 * padding) + \",0)\",\n\t\t})\n\t .call(yAxis);\n\n\t/*label x-axis*/\n\td3.select(SN2_G12vSN2_I12).append(\"text\")\n\t .attr(\"class\", \"x label\")\n\t .attr(\"text-anchor\", \"middle\")\n\t .attr(\"x\", w /2 -25)\n\t .attr(\"y\", h - 6)\n\t .text(\"SN2_G1\")\n\t .attr(\"font-family\", \"sans-serif\")\n\t .attr(\"font-size\", \"11px\")\n\t .attr(\"fill\", \"blue\");\n\n\td3.select(SN2_G12vSN2_I12).append(\"text\")\n\t .attr(\"class\", \"x label\")\n\t .attr(\"text-anchor\", \"middle\")\n\t .attr(\"x\", w /2 + 25)\n\t .attr(\"y\", h - 6)\n\t .text(\"SN2_G2\")\n\t .attr(\"font-family\", \"sans-serif\")\n\t .attr(\"font-size\", \"11px\")\n\t .attr(\"fill\", \"#ff6600\");\n\n\t/*label y-axis*/\n\td3.select(SN2_G12vSN2_I12).append(\"text\")\n\t .attr(\"class\", \"y label\")\n\t .attr(\"text-anchor\", \"middle\")\n\t .attr(\"x\", 0- h/2 - 25)\n\t .attr(\"y\", 6)\n\t .attr(\"dy\", \".75em\")\n\t .attr(\"transform\", \"rotate(-90)\")\n\t .text(\"SN2_I1\")\n\t .attr(\"font-family\", \"sans-serif\")\n\t .attr(\"font-size\", \"11px\")\n\t .attr(\"fill\", \"blue\");\n\n\td3.select(SN2_G12vSN2_I12).append(\"text\")\n\t .attr(\"class\", \"y label\")\n\t .attr(\"text-anchor\", \"middle\")\n\t .attr(\"x\", 0- h/2 + 25)\n\t .attr(\"y\", 6)\n\t .attr(\"dy\", \".75em\")\n\t .attr(\"transform\", \"rotate(-90)\")\n\t .text(\"SN2_I2\")\n\t .attr(\"font-family\", \"sans-serif\")\n\t .attr(\"font-size\", \"11px\")\n\t .attr(\"fill\", \"#ff6600\");\n\n\t//RAvDEC\n\tvar xAxis= d3.svg.axis()\n\t\t\t\t\t .scale(xAxisScaleRAvDEC)\n\t\t\t\t\t .orient(\"bottom\");\n\tvar yAxis= d3.svg.axis()\n\t\t\t\t .scale(yScaleRAvDEC)\n\t\t\t\t .orient(\"left\");\n\t/*axes*/\n\td3.select(RAvDEC).append(\"g\")\n\t .attr({\n\t \t\tclass: \"axis\",\n\t \t\ttransform: \"translate(0,\" + (h-(3.5 * padding)) + \")\",\n\t\t})\n\t .call(xAxis);\n\n\td3.select(RAvDEC).append(\"g\")\n\t .attr({\n\t \t\tclass: \"axis\",\n\t \t\ttransform: \"translate(\" + (4.5 * padding) + \",0)\",\n\t\t})\n\t .call(yAxis);\n\n\t/*label x-axis*/\n\td3.select(RAvDEC).append(\"text\")\n\t .attr(\"class\", \"x label\")\n\t .attr(\"text-anchor\", \"middle\")\n\t .attr(\"x\", RAvDECwidth /2 )\n\t .attr(\"y\", h - 6)\n\t .text(\"RA\")\n\t .attr(\"font-family\", \"sans-serif\")\n\t .attr(\"font-size\", \"11px\")\n\t .attr(\"fill\", \"black\");\n\n\t/*label y-axis*/\n\td3.select(RAvDEC).append(\"text\")\n\t .attr(\"class\", \"y label\")\n\t .attr(\"text-anchor\", \"middle\")\n\t .attr(\"x\", 0- h/2 )\n\t .attr(\"y\", 6)\n\t .attr(\"dy\", \".75em\")\n\t .attr(\"transform\", \"rotate(-90)\")\n\t .text(\"DEC\")\n\t .attr(\"font-family\", \"sans-serif\")\n\t .attr(\"font-size\", \"11px\")\n\t .attr(\"fill\", \"black\");\n\n}", "function buildTooltipModel(modelCascade) {\n\t // Last is always tooltip model.\n\t var resultModel = modelCascade.pop();\n\t\n\t while (modelCascade.length) {\n\t var tooltipOpt = modelCascade.pop();\n\t\n\t if (tooltipOpt) {\n\t if (tooltipOpt instanceof Model) {\n\t tooltipOpt = tooltipOpt.get('tooltip', true);\n\t } // In each data item tooltip can be simply write:\n\t // {\n\t // value: 10,\n\t // tooltip: 'Something you need to know'\n\t // }\n\t\n\t\n\t if (isString(tooltipOpt)) {\n\t tooltipOpt = {\n\t formatter: tooltipOpt\n\t };\n\t }\n\t\n\t resultModel = new Model(tooltipOpt, resultModel, resultModel.ecModel);\n\t }\n\t }\n\t\n\t return resultModel;\n\t }", "function axisTrigger(payload, ecModel, api) {\n var currTrigger = payload.currTrigger;\n var point = [payload.x, payload.y];\n var finder = payload;\n var dispatchAction = payload.dispatchAction || Object(util[\"c\" /* bind */])(api.dispatchAction, api);\n var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo; // Pending\n // See #6121. But we are not able to reproduce it yet.\n\n if (!coordSysAxesInfo) {\n return;\n }\n\n if (illegalPoint(point)) {\n // Used in the default behavior of `connection`: use the sample seriesIndex\n // and dataIndex. And also used in the tooltipView trigger.\n point = findPointFromSeries({\n seriesIndex: finder.seriesIndex,\n // Do not use dataIndexInside from other ec instance.\n // FIXME: auto detect it?\n dataIndex: finder.dataIndex\n }, ecModel).point;\n }\n\n var isIllegalPoint = illegalPoint(point); // Axis and value can be specified when calling dispatchAction({type: 'updateAxisPointer'}).\n // Notice: In this case, it is difficult to get the `point` (which is necessary to show\n // tooltip, so if point is not given, we just use the point found by sample seriesIndex\n // and dataIndex.\n\n var inputAxesInfo = finder.axesInfo;\n var axesInfo = coordSysAxesInfo.axesInfo;\n var shouldHide = currTrigger === 'leave' || illegalPoint(point);\n var outputPayload = {};\n var showValueMap = {};\n var dataByCoordSys = {\n list: [],\n map: {}\n };\n var updaters = {\n showPointer: Object(util[\"i\" /* curry */])(axisTrigger_showPointer, showValueMap),\n showTooltip: Object(util[\"i\" /* curry */])(showTooltip, dataByCoordSys)\n }; // Process for triggered axes.\n\n Object(util[\"k\" /* each */])(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) {\n // If a point given, it must be contained by the coordinate system.\n var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);\n Object(util[\"k\" /* each */])(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) {\n var axis = axisInfo.axis;\n var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo); // If no inputAxesInfo, no axis is restricted.\n\n if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {\n var val = inputAxisInfo && inputAxisInfo.value;\n\n if (val == null && !isIllegalPoint) {\n val = axis.pointToData(point);\n }\n\n val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload);\n }\n });\n }); // Process for linked axes.\n\n var linkTriggers = {};\n Object(util[\"k\" /* each */])(axesInfo, function (tarAxisInfo, tarKey) {\n var linkGroup = tarAxisInfo.linkGroup; // If axis has been triggered in the previous stage, it should not be triggered by link.\n\n if (linkGroup && !showValueMap[tarKey]) {\n Object(util[\"k\" /* each */])(linkGroup.axesInfo, function (srcAxisInfo, srcKey) {\n var srcValItem = showValueMap[srcKey]; // If srcValItem exist, source axis is triggered, so link to target axis.\n\n if (srcAxisInfo !== tarAxisInfo && srcValItem) {\n var val = srcValItem.value;\n linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo))));\n linkTriggers[tarAxisInfo.key] = val;\n }\n });\n }\n });\n Object(util[\"k\" /* each */])(linkTriggers, function (val, tarKey) {\n processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload);\n });\n updateModelActually(showValueMap, axesInfo, outputPayload);\n dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction);\n dispatchHighDownActually(axesInfo, dispatchAction, api);\n return outputPayload;\n}", "function singleAxisHelper_layout(axisModel, opt) {\n opt = opt || {};\n var single = axisModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var axisPosition = axis.position;\n var orient = axis.orient;\n var rect = single.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var positionMap = {\n horizontal: {\n top: rectBound[2],\n bottom: rectBound[3]\n },\n vertical: {\n left: rectBound[0],\n right: rectBound[1]\n }\n };\n layout.position = [orient === 'vertical' ? positionMap.vertical[axisPosition] : rectBound[0], orient === 'horizontal' ? positionMap.horizontal[axisPosition] : rectBound[3]];\n var r = {\n horizontal: 0,\n vertical: 1\n };\n layout.rotation = Math.PI / 2 * r[orient];\n var directionMap = {\n top: -1,\n bottom: 1,\n right: 1,\n left: -1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = directionMap[axisPosition];\n\n if (axisModel.get(['axisTick', 'inside'])) {\n layout.tickDirection = -layout.tickDirection;\n }\n\n if (util[\"O\" /* retrieve */](opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\n layout.labelDirection = -layout.labelDirection;\n }\n\n var labelRotation = opt.rotate;\n labelRotation == null && (labelRotation = axisModel.get(['axisLabel', 'rotate']));\n layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation;\n layout.z2 = 1;\n return layout;\n}", "function buildMultipleAxes() {\n if (multipleAxes && !horizontal && !stack && seriesData.length > 1) {\n stackLayout.yaxis = [];\n\n seriesData.forEach((row, index) => {\n if (index != 0) {\n if (!settings[`seriesAxis_${index}`]) {\n changed = true;\n settings[`seriesAxis_${index}`] = {\n label: `Set ${row.name} on the second axis`,\n order: 10 + index,\n section: `Multiple Axes`,\n type: `boolean`,\n default: false,\n hidden: false\n };\n }\n }\n });\n\n // Apply the config settings to the chart\n let nameA = seriesData[0].name;\n let nameB = seriesData[1].name;\n let passShow = false;\n seriesData.forEach((row, index) => {\n let sTitle = row.name;\n let seriesName = nameA;\n let axisOrientation = false;\n let show = false;\n\n if (config[`seriesAxis_${index}`] == true) {\n seriesName = nameB;\n axisOrientation = true;\n if (config.yTitle2 != ``) sTitle = yTitle2;\n } else {\n seriesName = nameA;\n axisOrientation = false;\n if (config.yTitle != ``) sTitle = yTitle;\n }\n\n // Configuration to show the axes\n if (index == 0) show = true;\n if (config[`seriesAxis_${index}`] && passShow == false) {\n passShow = true;\n show = true;\n }\n\n let obj = {\n seriesName: seriesName,\n opposite: axisOrientation,\n show: show,\n name: row.name,\n labels: {\n formatter: function(val) {\n if (typeof val == `number` && !horizontal)\n return formatAxes(val, row.value_format);\n else return val;\n }\n }\n };\n\n // Axis based label\n if (seriesName == nameA) {\n if (showTitleY) obj[`title`] = { text: sTitle };\n }\n if (seriesName == nameB) {\n if (showSecondTitleY) obj[`title`] = { text: sTitle };\n }\n\n console.log(`iteration: ${index} object`, obj);\n stackLayout.yaxis.push(obj);\n });\n }\n }", "axisPlot() {\n this.ctx = this.canvas.getContext(\"2d\");\n\n /**\n * Grid grid\n */\n if (this.grid.grid) {\n this.ctx.beginPath();\n this.ctx.font = 'italic 18pt Calibri';\n this.ctx.strokeStyle = '#979797';\n this.ctx.lineWidth = 1;\n this.ctx.setLineDash([10, 15]);\n for (let i = 30; i < this.field.width; i+= 100) {\n this.ctx.fillText(Math.ceil(this.ScreenToWorldY(i)*1000)/1000, 0, i);\n this.ctx.moveTo(0, i);\n this.ctx.lineTo(this.field.width, i);\n }\n for (let i = 100; i < this.field.width; i+= 100) {\n this.ctx.fillText(Math.ceil(this.ScreenToWorldX(i)*1000)/1000, i, this.field.height);\n this.ctx.moveTo(i, 0);\n this.ctx.lineTo(i, this.field.height);\n }\n this.ctx.stroke();\n this.ctx.closePath();\n }\n\n\n /**\n * Grid axiss\n */\n if (this.grid.axiss) {\n this.ctx.beginPath();\n this.ctx.strokeStyle = '#b10009';\n this.ctx.lineWidth = 2;\n this.ctx.setLineDash([]);\n\n this.ctx.moveTo(this.center.x, 0);\n this.ctx.lineTo(this.center.x, this.field.height);\n\n this.ctx.moveTo(0, this.center.y);\n this.ctx.lineTo(this.field.width, this.center.y);\n\n this.ctx.stroke();\n this.ctx.closePath();\n }\n\n\n if (this.grid.serifs) {\n this.ctx.beginPath();\n this.ctx.strokeStyle = '#058600';\n this.ctx.fillStyle = '#888888'\n this.ctx.lineWidth = 2;\n this.ctx.setLineDash([]);\n\n let start = 0;\n if (!this.grid.serifsStep){\n return;\n }\n\n let s = Math.abs(\n this.ScreenToWorldY(0) -\n this.ScreenToWorldY(this.grid.serifsSize)\n );\n\n /**\n * To right & to left\n */\n if ((this.center.y > 0) && (this.center.y < this.field.height)) {\n\n let finish = this.ScreenToWorldX(this.field.width);\n\n for (let i = start; i < finish; i+=this.grid.serifsStep) {\n this.moveTo(i+this.grid.serifsStep/2,(s/2));\n this.lineTo(i+this.grid.serifsStep/2,-(s/2));\n this.ctx.fillText(i+this.grid.serifsStep/2, this.WorldToScreenX(i+this.grid.serifsStep/2), this.WorldToScreenY(s/2));\n\n this.moveTo(i+this.grid.serifsStep,s);\n this.lineTo(i+this.grid.serifsStep,-s);\n this.ctx.fillText(i+this.grid.serifsStep, this.WorldToScreenX(i+this.grid.serifsStep), this.WorldToScreenY(s));\n }\n\n finish = this.ScreenToWorldX(0);\n\n for (let i = start; i > finish; i-=this.grid.serifsStep) {\n this.moveTo(i-this.grid.serifsStep/2,(s/2));\n this.lineTo(i-this.grid.serifsStep/2,-(s/2));\n this.ctx.fillText(i-this.grid.serifsStep/2, this.WorldToScreenX(i-this.grid.serifsStep/2), this.WorldToScreenY(s/2));\n\n this.moveTo(i-this.grid.serifsStep,s);\n this.lineTo(i-this.grid.serifsStep,-s);\n this.ctx.fillText(i-this.grid.serifsStep, this.WorldToScreenX(i-this.grid.serifsStep), this.WorldToScreenY(s));\n }\n }\n\n /**\n * To top & to bot\n */\n if ((this.center.x > 0) && (this.center.x < this.field.width)) {\n\n start = 0;\n let finish = this.ScreenToWorldY(0);\n\n for (let i = start; i < finish; i+=this.grid.serifsStep) {\n this.moveTo((s/2),i+this.grid.serifsStep/2);\n this.lineTo(-(s/2),i+this.grid.serifsStep/2);\n this.ctx.fillText(i+this.grid.serifsStep/2, this.WorldToScreenX(s/2), this.WorldToScreenY(i+this.grid.serifsStep/2));\n\n this.moveTo(s, i+this.grid.serifsStep);\n this.lineTo(-s, i+this.grid.serifsStep);\n this.ctx.fillText(i+this.grid.serifsStep, this.WorldToScreenX(s), this.WorldToScreenY(i+this.grid.serifsStep));\n }\n\n finish = this.ScreenToWorldY(this.field.width);\n\n for (let i = start; i > finish-this.grid.serifsStep; i-=this.grid.serifsStep) {\n this.moveTo((s/2),i+this.grid.serifsStep/2);\n this.lineTo(-(s/2),i+this.grid.serifsStep/2);\n this.ctx.fillText(i+this.grid.serifsStep/2, this.WorldToScreenX(s/2), this.WorldToScreenY(i+this.grid.serifsStep/2));\n\n this.moveTo(s, i+this.grid.serifsStep);\n this.lineTo( -s, i+this.grid.serifsStep);\n this.ctx.fillText(i+this.grid.serifsStep, this.WorldToScreenX(s), this.WorldToScreenY(i+this.grid.serifsStep));\n }\n }\n this.ctx.stroke();\n this.ctx.closePath();\n }\n }", "function tooltips ( ) {\r\n\r\n\t\t\tif ( options.dir ) {\r\n\t\t\t\toptions.tooltips.reverse();\r\n\t\t\t}\r\n\r\n\t\t\t// Tooltips are added with options.tooltips in original order.\r\n\t\t\tvar tips = scope_Handles.map(addTooltip);\r\n\r\n\t\t\tif ( options.dir ) {\r\n\t\t\t\ttips.reverse();\r\n\t\t\t\toptions.tooltips.reverse();\r\n\t\t\t}\r\n\r\n\t\t\tbindEvent('update', function(f, o, r) {\r\n\t\t\t\tif ( tips[o] ) {\r\n\t\t\t\t\ttips[o].innerHTML = options.tooltips[o] === true ? f[o] : options.tooltips[o].to(r[o]);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}", "function tooltips ( ) {\n\t\n\t\t\tif ( options.dir ) {\n\t\t\t\toptions.tooltips.reverse();\n\t\t\t}\n\t\n\t\t\t// Tooltips are added with options.tooltips in original order.\n\t\t\tvar tips = scope_Handles.map(addTooltip);\n\t\n\t\t\tif ( options.dir ) {\n\t\t\t\ttips.reverse();\n\t\t\t\toptions.tooltips.reverse();\n\t\t\t}\n\t\n\t\t\tbindEvent('update', function(f, o, r) {\n\t\t\t\tif ( tips[o] ) {\n\t\t\t\t\ttips[o].innerHTML = options.tooltips[o] === true ? f[o] : options.tooltips[o].to(r[o]);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function tooltips ( ) {\n\n\t\tif ( options.dir ) {\n\t\t\toptions.tooltips.reverse();\n\t\t}\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tif ( options.dir ) {\n\t\t\ttips.reverse();\n\t\t\toptions.tooltips.reverse();\n\t\t}\n\n\t\tbindEvent('update', function(f, o, r) {\n\t\t\tif ( tips[o] ) {\n\t\t\t\ttips[o].innerHTML = options.tooltips[o] === true ? f[o] : options.tooltips[o].to(r[o]);\n\t\t\t}\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\tif ( options.dir ) {\n\t\t\toptions.tooltips.reverse();\n\t\t}\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tif ( options.dir ) {\n\t\t\ttips.reverse();\n\t\t\toptions.tooltips.reverse();\n\t\t}\n\n\t\tbindEvent('update', function(f, o, r) {\n\t\t\tif ( tips[o] ) {\n\t\t\t\ttips[o].innerHTML = options.tooltips[o] === true ? f[o] : options.tooltips[o].to(r[o]);\n\t\t\t}\n\t\t});\n\t}", "function updateToolTip(chosenXAxis, chosenYAxis, circlesGroup) {\n\n var xlabel = \"\";\n var ylabel = \"\";\n // Looping through X axes to grab the object that corresponds\n for (var i = 0; i < xAxes.length; i++)\n if (chosenXAxis === xAxes[i].option)\n\n xLabel = xAxes[i].label;\n // Looping through Y axes to grab the object that corresponds\n for (var i = 0; i < yAxes.length; i++)\n if (chosenYAxis === yAxes[i].option)\n yLabel = yAxes[i].label;\n\n // Adding Tooltip\n\n var toolTip = d3.tip()\n .attr(\"class\", \"tooltip\")\n .offset([110, 0])\n .html(d => [\n d.state,\n formatToolTipText(xLabel, d[chosenXAxis]),\n formatToolTipText(yLabel, d[chosenYAxis])\n ].join(\"<br>\"));\n\n // Adding a callback\n circlesGroup.call(toolTip);\n\n // Adding the mouse over event\n circlesGroup\n .on(\"mouseover\", (data, index, element) => toolTip.show(data, element[index]))\n .on(\"mouseout\", (data, index, element) => toolTip.hide(data, element[index]));\n\n return circlesGroup;\n}", "function tooltips ( ) {\r\n\r\n\t\tif ( options.dir ) {\r\n\t\t\toptions.tooltips.reverse();\r\n\t\t}\r\n\r\n\t\t// Tooltips are added with options.tooltips in original order.\r\n\t\tvar tips = scope_Handles.map(addTooltip);\r\n\r\n\t\tif ( options.dir ) {\r\n\t\t\ttips.reverse();\r\n\t\t\toptions.tooltips.reverse();\r\n\t\t}\r\n\r\n\t\tbindEvent('update', function(f, o, r) {\r\n\t\t\tif ( tips[o] ) {\r\n\t\t\t\ttips[o].innerHTML = options.tooltips[o] === true ? f[o] : options.tooltips[o].to(r[o]);\r\n\t\t\t}\r\n\t\t});\r\n\t}", "init() {\n\t\t\t\tstructureData()\n\n\t\t\t\t$tooltip = d3.selectAll('.chart figure').append('div').attr('class', 'tooltip')\n\t\t\t\t$vertical = d3.selectAll('.chart figure').append('div').attr('class', 'vertical')\n\n\t\t\t\t$svg = $sel.append('svg').attr('class', 'pudding-chart');\n\t\t\t\t$axis = $svg.append('g').attr('class', 'g-axis');\n\t\t\t\tconst $g = $svg.append('g');\n\n\t\t\t\t// offset chart for margins\n\t\t\t\t$g.attr('transform', `translate(${marginLeft}, ${marginTop})`);\n\n\t\t\t\t// create axis\n\t\t\t\txAxisGroup = $axis.append('g')\n\t\t\t\t\t.attr('class', 'x axis')\n\n\t\t\t\tyAxisGroup = $axis.append('g')\n\t\t\t\t\t.attr('class', 'y axis')\n\n\t\t\t\t$fLabel = $g.append('text').attr('class', 'f-label').text('Women')\n\t\t\t\t$mLabel = $g.append('text').attr('class', 'm-label').text('Men')\n\n\t\t\t\t$biggerLabelGroup = $svg.append('g')\n\t\t\t\t$smallerLabelGroup = $svg.append('g')\n\n\t\t\t\t$biggerLabel = $biggerLabelGroup.append('text')\n\t\t\t\t\t\t.text('Bigger median hair')\n\t\t\t\t\t\t.attr('class', 'axis-label bigger-axis-label')\n\n\t\t\t\t$smallerLabel = $smallerLabelGroup.append('text')\n\t\t\t\t\t\t.text('Smaller median hair')\n\t\t\t\t\t\t.attr('class', 'axis-label smaller-axis-label')\n\n\t\t\t\t$upArrow = $biggerLabelGroup.append('svg:image')\n\t\t\t\t\t\t.attr('xlink:href', `assets/images/arrow-up.svg`)\n\t\t\t\t\t\t.attr('width', '20px')\n\t\t\t\t\t\t.attr('height', '20px')\n\n\t\t\t\t$downArrow = $smallerLabelGroup.append('svg:image')\n\t\t\t\t\t\t.attr('xlink:href', `assets/images/arrow-down.svg`)\n\t\t\t\t\t\t.attr('width', '20px')\n\t\t\t\t\t\t.attr('height', '20px')\n\n\t\t\t\t// setup viz group\n\t\t\t\t$vis = $g.append('g').attr('class', 'g-vis');\n\n\t\t\t\tlineGroup = $svg.select('.g-vis')\n\n\t\t\t\tfemaleLine = lineGroup.append('path')\n\t\t\t\t\t.datum(femaleData)\n\t\t\t\t\t.attr('class', 'Female')\n\n\t\t\t\tmaleLine = lineGroup.append('path')\n\t\t\t\t\t.datum(maleData)\n\t\t\t\t\t.attr('class', 'Male')\n\n\t\t\t\tdrawArea = $vis.append('path')\n\t\t\t\t\t.datum(dataByYear)\n\t\t\t\t\t.attr('class', 'area')\n\n\t\t\t\tChart.resize();\n\t\t\t\tChart.render();\n\t\t\t}", "function tooltips() {\n if (options.dir) {\n options.tooltips.reverse();\n }\n // Tooltips are added with options.tooltips in original order.\n var tips = scope_Handles.map(addTooltip);\n if (options.dir) {\n tips.reverse();\n options.tooltips.reverse();\n }\n bindEvent('update', function(f, o, r) {\n if (tips[o]) {\n tips[o].innerHTML = options.tooltips[o] === true ? f[o] :\n options.tooltips[o].to(r[o]);\n }\n });\n }", "__cleanUpAxisAndPlotArea() {\n // Tooltip cleanup\n this.EventManager.hideHoverFeedback();\n\n // Clear the list of registered peers\n this.Peers = [];\n\n // Clean up the axis and plot area\n if (this.xAxis) {\n this._container.removeChild(this.xAxis);\n this.xAxis.destroy();\n }\n if (this.yAxis) {\n this._container.removeChild(this.yAxis);\n this.yAxis.destroy();\n }\n if (this.y2Axis) {\n this._container.removeChild(this.y2Axis);\n this.y2Axis.destroy();\n }\n\n // Plot area which is a touch target needs to be kept so that subsequent touch events are fired.\n if (this._plotArea && this._plotArea == this._panZoomTarget) this._plotArea.setVisible(false);\n else if (this._plotArea) {\n this._container.removeChild(this._plotArea);\n this._plotArea.destroy();\n }\n\n this._plotArea = null;\n\n // Reset cache\n this.getCache().clearCache();\n }", "function appendAxes() {\n graphImg\n .append(\"g\")\n .call(xAxis)\n .attr(\"class\", \"xAxis\")\n .attr(\n \"transform\",\n \"translate(0,\" + (displayHeight - margin - labelArea) + \")\"\n );\n graphImg\n .append(\"g\")\n .call(yAxis)\n .attr(\"class\", \"yAxis\")\n .attr(\"transform\", \"translate(\" + (margin + labelArea) + \", 0)\");\n }", "plot(){\n /* plot the X and Y axis of the graph */\n super.plotXAxis();\n super.plotYAxis();\n\n /* (re)draw the points, grouped in a single graphics element */\n let canvas = d3.select('svg#canvas_bioActivity > g#graph');\n canvas.selectAll('#points').remove();\n canvas.append('g')\n .attr('id', 'points')\n .attr('transform', 'translate('+this._margin.left+', 0)')\n ;\n /* Each data point will be d3 symbol (represented using svg paths) */\n let pts = d3.select('#points').selectAll('g')\n .data(this._data)\n /* each point belongs to the 'data-point' class its positioned in the graph\n * according to the associated (x,y) coordinates and its drawn using its\n * color and shape */\n let point = pts.enter().append('path')\n .attr('class', 'data-point')\n .attr('transform', d => 'translate('+d.x+' '+d.y+')')\n .attr('fill', d => d.color )\n .attr('d', function(d){\n let s = ['Circle','Cross','Diamond','Square','Star','Triangle','Wye']\n let symbol = d3.symbol()\n .size(50)\n .type(d3.symbols[s.indexOf(d.shape)])\n ;\n return symbol();\n })\n ;\n /* each point will also have an associated svg title (tooltip) */\n point.append('svg:title')\n .text((d) => {\n return 'Organism: '+d['Organism Name']+\n '\\nGene: '+d['Gene Symbol']+\n '\\nConcentation: '+d['Activity Concentration']+'nM';\n })\n ;\n }", "function buildAxis() {\n xAxis = d3Axis.axisBottom(xScale)\n .ticks(xTicks, numberFormat)\n .tickSizeInner([-chartHeight]);\n\n yAxis = d3Axis.axisLeft(yScale);\n }", "function createAxes() {\n //create x axis svg\n xAxisSVG = diagramG.append('g')\n .style('fill', 'none')\n .style('shape-rendering', 'crispEdges')\n .attr('transform', 'translate(0,' + (height - margin.bottom - margin.top) + ')')\n .attr('class', 'eve-x-axis')\n .call(xAxis);\n\n //create y axis left svg\n yAxisSVG = diagramG.append('g')\n .style('fill', 'none')\n .style('shape-rendering', 'crispEdges')\n .attr('transform', 'translate(0)')\n .attr('class', 'eve-y-axis')\n .call(yAxis);\n\n //set axes styling\n updateAxisStyle();\n }", "function cursorCoords(x, y) {\r\n // update global chart width and height dimensions\r\n aleph.chartWidth = svgWidth;\r\n aleph.chartHeight = svgHeight;\r\n var currentSelectedYear = aleph.formatDate(aleph.xYear);\r\n\r\n // modify class definiton of tooltip 'g' element and current offset position based on mouse cursor position\r\n d3.selectAll(\".aleph-toolTip-Div\")\r\n .moveToFront()\r\n .classed(\"aleph-hide\", false)\r\n .style(\"left\", function () {\r\n if (x < aleph.chartWidth / 2) {\r\n d3.selectAll(\".aleph-mouseover-textlabel\")\r\n .style(\"text-anchor\", \"end\")\r\n .attr(\"transform\", \"translate(-20,3)\");\r\n\r\n return x + 15 + \"px\"; // left half\r\n } else {\r\n d3.selectAll(\".aleph-mouseover-textlabel\")\r\n .style(\"text-anchor\", \"start\")\r\n .attr(\"transform\", \"translate(10,3)\");\r\n\r\n return x - aleph.toolTipDimensions.width - 15 + \"px\"; // right half\r\n }\r\n })\r\n .style(\"top\", function () {\r\n if (y < aleph.chartHeight / 2) {\r\n return y + 15 + \"px\"; // top half\r\n } else {\r\n return (\r\n y -\r\n d3.selectAll(\".aleph-toolTip-Div\").style(\"height\").replace(\"px\", \"\") +\r\n \"px\"\r\n ); // bottom half\r\n }\r\n });\r\n\r\n // upate main tootlitp title.\r\n d3.selectAll(\".aleph-toolTipTitle-label\").html(currentSelectedYear);\r\n\r\n // initialise local array to help sort information content to display on tooltip\r\n var unsortedScenarioArray = [];\r\n var sortedScenarioArray = [];\r\n\r\n // cycle through all currently displayed scenarios, and push into a local array ...\r\n for (var scenario in aleph.scenarios) {\r\n unsortedScenarioArray.push(aleph.scenarios[scenario]);\r\n } // end for loop\r\n\r\n // sort local storage array based on summed values for each tiem series year.\r\n sortedScenarioArray = unsortedScenarioArray.sort(function (a, b) {\r\n return (\r\n +b.yearSummedValues[currentSelectedYear] -\r\n +a.yearSummedValues[currentSelectedYear]\r\n );\r\n });\r\n\r\n // remove the main tooltip div\r\n d3.selectAll(\".aleph-tooltip-scenario-div\").remove();\r\n\r\n d3.selectAll(\".toolTip-content-to-Remove\").remove();\r\n d3.selectAll(\".aleph-toolTip-Div\")\r\n .append(\"table\")\r\n .attr(\"class\", \"tooltip-table toolTip-content-to-Remove\")\r\n .style(\"width\", \"100%\")\r\n .style(\"height\", \"100%\");\r\n\r\n d3.selectAll(\".tooltip-table\").append(\"tr\").attr(\"class\", \"table-header-row\");\r\n\r\n var headers = [\r\n \"Marker\",\r\n \"Population Size\",\r\n \"% Total Year UK Pop.\",\r\n \"Scenario Criteria*\",\r\n ];\r\n\r\n headers.forEach(function (d, i) {\r\n d3.selectAll(\".table-header-row\")\r\n .append(\"td\")\r\n .attr(\"class\", \"table-header-row-header-cell header-cell-\" + i)\r\n .style(\"width\", \"auto\");\r\n\r\n d3.selectAll(\".table-header-row-header-cell.header-cell-\" + i)\r\n .append(\"label\")\r\n .attr(\r\n \"class\",\r\n \"table-header-row-header-cell-label header-cell-label-\" + i\r\n )\r\n .html(headers[i]);\r\n });\r\n\r\n sortedScenarioArray.forEach(function (d, i) {\r\n var rowNumber = i;\r\n d3.selectAll(\".tooltip-table\")\r\n .append(\"tr\")\r\n .attr(\r\n \"class\",\r\n \"tooltip-table-row toolTip-content-to-Remove tooltip-table-row-\" +\r\n rowNumber\r\n )\r\n .style(\"width\", \"100%\");\r\n\r\n for (var columnNumber = 0; columnNumber < headers.length; columnNumber++) {\r\n d3.selectAll(\".tooltip-table-row-\" + rowNumber)\r\n .append(\"td\")\r\n .attr(\"class\", function () {\r\n return \"table-dataCell table-dataCell-\" + columnNumber;\r\n });\r\n\r\n if (columnNumber == 0) {\r\n d3.selectAll(\".tooltip-table-row-\" + rowNumber)\r\n .selectAll(\".table-dataCell-\" + columnNumber)\r\n .append(\"div\")\r\n .attr(\"class\", \"aleph-tooltip-marker-circle-div\")\r\n .style(\"background-color\", d.lineColour);\r\n } else {\r\n d3.selectAll(\".tooltip-table-row-\" + rowNumber)\r\n .selectAll(\".table-dataCell-\" + columnNumber)\r\n .append(\"label\")\r\n .attr(\r\n \"class\",\r\n \"table-cell-text-content table-cell-text-content-\" + columnNumber\r\n )\r\n .html(function () {\r\n if (columnNumber == 1) {\r\n return numberWithCommas(d.yearSummedValues[currentSelectedYear]);\r\n } else if (columnNumber == 2) {\r\n return (\r\n (\r\n (d.yearSummedValues[currentSelectedYear] /\r\n aleph.dataYearPopulations[\r\n aleph.years.indexOf(currentSelectedYear)\r\n ]) *\r\n 100\r\n ).toFixed(2) + \"%\"\r\n );\r\n } else if (columnNumber == 3) {\r\n var string = \"\";\r\n\r\n if (\r\n d.genderString.split(\",\").length == 2 &&\r\n d.ethnicityString.split(\",\").length == 6 &&\r\n d.agebandString.split(\",\").length == 9 &&\r\n d.nationalitiesString.split(\",\").length == 2 &&\r\n d.religionsString.split(\",\").length == 4 &&\r\n d.healthString.split(\",\").length == 7 &&\r\n d.qualificationString.split(\",\").length == 4\r\n ) {\r\n string = \"Full Population\";\r\n } else {\r\n if (d.genderString.split(\",\").length != 2) {\r\n d.genderString.split(\",\").forEach(function (d) {\r\n string = string + aleph.codes.genders[d - 1] + \", \";\r\n });\r\n string =\r\n \"<span class='spanBold'>Genders:</span> \" +\r\n string.substr(0, string.length - 2) +\r\n \"</br>\";\r\n }\r\n\r\n if (d.ethnicityString.split(\",\").length != 6) {\r\n string =\r\n string + \"<span class='spanBold'> Ethnicities:</span> \";\r\n d.ethnicityString.split(\",\").forEach(function (d) {\r\n string = string + aleph.codes.ethnicities[d - 1] + \", \";\r\n });\r\n string = string.substr(0, string.length - 2) + \"</br>\";\r\n }\r\n\r\n if (d.agebandString.split(\",\").length != 9) {\r\n string =\r\n string + \"<span class='spanBold'> Age Bands:</span> \";\r\n d.agebandString.split(\",\").forEach(function (d) {\r\n string = string + aleph.codes.ageBands[d - 1] + \", \";\r\n });\r\n string = string.substr(0, string.length - 2) + \"</br>\";\r\n }\r\n\r\n if (d.nationalitiesString.split(\",\").length != 2) {\r\n string =\r\n string + \"<span class='spanBold'> Nationalities:</span> \";\r\n d.nationalitiesString.split(\",\").forEach(function (d) {\r\n string = string + aleph.codes.nationalities[d - 1] + \", \";\r\n });\r\n string = string.substr(0, string.length - 2) + \"</br>\";\r\n }\r\n\r\n if (d.religionsString.split(\",\").length != 4) {\r\n string =\r\n string + \"<span class='spanBold'> Religions:</span> \";\r\n d.religionsString.split(\",\").forEach(function (d) {\r\n string = string + aleph.codes.religions[d - 1] + \", \";\r\n });\r\n string = string.substr(0, string.length - 2) + \"</br>\";\r\n }\r\n\r\n if (d.healthString.split(\",\").length != 7) {\r\n string = string + \"<span class='spanBold'> Health:</span> \";\r\n d.healthString.split(\",\").forEach(function (d, i) {\r\n string = string + aleph.codes.health[d - 1] + \", \";\r\n });\r\n string = string.substr(0, string.length - 2) + \"</br>\";\r\n }\r\n\r\n if (d.qualificationString.split(\",\").length != 4) {\r\n string =\r\n string + \"<span class='spanBold'> Qualifications:</span> \";\r\n d.qualificationString.split(\",\").forEach(function (d) {\r\n string = string + aleph.codes.qualifications[d - 1] + \", \";\r\n });\r\n string = string.substr(0, string.length - 2) + \"</br>\";\r\n }\r\n }\r\n\r\n return string;\r\n }\r\n });\r\n }\r\n }\r\n });\r\n\r\n d3.selectAll(\".aleph-toolTip-Div\")\r\n .append(\"label\")\r\n .attr(\"class\", \"aleph-tooltip-footer toolTip-content-to-Remove\")\r\n .text(\r\n \"* Only criteria are listed for those selections modified from 'Full Population'.\"\r\n );\r\n\r\n d3.selectAll(\".aleph-toolTip-Div\").moveToFront();\r\n\r\n return;\r\n}", "function plotChart() {\n\n // Determine color\n xArr.forEach((param) => { \n if (param.xAxisVal === xSelVal) xColor = param.xColor;\n });\n yArr.forEach((param) => {\n if (param.yAxisVal === ySelVal) yColor = param.yColor;\n }); \n \n // Determine scales of x- and y-axis in the chart\n let xLinearScale = xScale(acsData, xSelVal),\n yLinearScale = yScale(acsData, ySelVal);\n\n // Create axis functions\n let bottomAxis = d3.axisBottom(xLinearScale),\n leftAxis = d3.axisLeft(yLinearScale);\n\n // Update x- and y-axis\n xAxis.transition()\n .call(bottomAxis);\n yAxis.transition()\n .call(leftAxis);\n \n // Update color of axes ticks and texts\n xAxis.select('path').style(\"stroke\", xColor);\n xAxis.selectAll(\"line\").style(\"stroke\", xColor);\n xAxis.selectAll('text').style(\"fill\", xColor); \n yAxis.select('path').style(\"stroke\", yColor);\n yAxis.selectAll(\"line\").style(\"stroke\", yColor);\n yAxis.selectAll('text').style(\"fill\", yColor);\n\n // Update x-axis titles\n xTitleWrapper.selectAll('text')\n .transition()\n .style(\"fill\", \"#c9c9c9\")\n .attr(\"class\", \"inactive axis-text\"); \n xTitleWrapper.select(`#${xSelVal}`)\n .transition()\n .style(\"fill\", xColor)\n .attr(\"class\", \"active axis-text\");\n\n // Update y-axis titles \n yTitleWrapper.selectAll('text')\n .transition()\n .style(\"fill\", \"#c9c9c9\")\n .attr(\"class\", \"inactive axis-text\"); \n yTitleWrapper.select(`#${ySelVal}`)\n .transition()\n .style(\"fill\", yColor)\n .attr(\"class\", \"active axis-text\"); \n\n // Update circles\n circlesGroup.transition()\n .duration(500)\n .attr(\"cx\", (d) => xLinearScale(d[xSelVal]))\n .attr(\"cy\", (d) => yLinearScale(d[ySelVal]))\n .attr(\"r\", 10)\n .style(\"fill\", yColor);\n\n // Update circle texts\n circleTextsGroup.transition()\n .duration(500)\n .attr(\"x\", (d) => xLinearScale(d[xSelVal]))\n .attr(\"y\", (d) => yLinearScale(d[ySelVal])) \n .attr(\"dy\", 3.5)\n .text((d) => d.abbr)\n .style(\"fill\", xColor);\n\n // .......... Event listener for tool tips .......... //\n // Determine x- and y-label to be displayed in tool tips\n xArr.forEach((param) => { \n if (param.xAxisVal === xSelVal) xToolTipLabel = param.xAxisToolTip;\n });\n yArr.forEach((param) => {\n if (param.yAxisVal === ySelVal) yToolTipLabel = param.yAxisToolTip;\n }); \n\n // Setup tool tip\n let toolTip = d3.tip()\n .attr(\"class\", \"d3-tip\")\n .offset([-20, -60])\n .html((d) => {\n return `${d.state}<br>${xToolTipLabel} ${d[xSelVal]}%<br>${yToolTipLabel} ${d[ySelVal]}%`;\n });\n \n // APPEND TOOL TIP\n circlesGroup.call(toolTip);\n\n // Event listeners for circle and tool tip\n circlesGroup\n\n .on(\"mouseover\", function(d) {\n // Show tool tip\n toolTip.show(d, this);\n // Setup selected circle\n d3.select(this)\n .style(\"fill\", \"black\") \n .attr(\"stroke-width\", 2.5)\n .attr(\"r\", 14);\n })\n\n .on(\"mouseout\", function(d) {\n // Hide tool tip\n toolTip.hide(d, this);\n // Setup selected circle\n d3.select(this)\n .style(\"fill\", yColor)\n .attr(\"stroke-width\", 1)\n .attr(\"r\", 10); \n }); \n\n // End of \"plotChart()\"\" function\n }", "_drawAnchorPoints() {\n let ctx = this.chart.canvas.ctx;\n let hoveredAnchorPoint = this.chart.selectionModule.hoveredAnchorPoint || {};\n\n // Draw the not active anchor points\n ctx.beginPath();\n ctx.fillStyle = 'rgba(255, 255, 255, 0.7)';\n ctx.lineWidth = 1;\n ctx.strokeStyle = 'rgba(100, 100, 100, 0.4)';\n this.anchorPoints.filter(a => !a.isActive && a.id != hoveredAnchorPoint.id).forEach(a => a.draw(ctx));\n ctx.stroke();\n ctx.fill();\n\n // Draw the active anchor points\n ctx.beginPath();\n ctx.fillStyle = 'rgba(255, 255, 255, 1)';\n ctx.lineWidth = 1;\n ctx.strokeStyle = 'rgba(100, 100, 100, 1)';\n this.anchorPoints.filter(a => a.isActive || a.id === hoveredAnchorPoint.id).forEach(a => a.draw(ctx));\n ctx.stroke();\n ctx.fill();\n }", "constructor(dimensions, xvar, yvar, possible_xs, possible_ys) {\n graph_counter += 1\n this.graph_name = 'WowG' + String(graph_counter);\n this.hover_circle = main_svg.append('circle')\n .attr('r', 5)\n .attr('cx', 100)\n .attr('cy', 100)\n .attr('fill', 'none')\n .attr('stroke', '#000000')\n .attr('opacity', 0);\n [this.left, this.top, this.w, this.h] = dimensions;\n this.xvar = xvar;\n this.yvar = yvar;\n let self = this;\n this.svg = main_svg;\n this.graph_stuff = this.svg.append('g');\n \n this.x_axis = this.graph_stuff.append('g').attr(\"transform\", \"translate(0,\" + String(self.top+self.h) + \")\");\n this.y_axis = this.graph_stuff.append('g').attr(\"transform\", \"translate(\" + String(self.left) + \",0)\");\n\n this.xlabel = this.svg.append('foreignObject')\n .attr('x', self.left+self.w/2-50)\n .attr('y', self.top+self.h+20)\n .attr('width', 100)\n .attr('height', 20)\n .attr('class', 'axis_label_foreign_obj');\n this.xlabel_dropdown = this.xlabel.append('xhtml:select')\n .attr('class', 'axis_label_select')\n .on('change', function() {\n self.set_x(d3.select(this).property('value'));\n console.log('Changing x to', self.xvar);\n draw_right();\n })\n .selectAll('option')\n .data(possible_xs)\n .enter()\n .append('option')\n .attr('value', d => d)\n .property('selected', d => d==self.xvar)\n .html(d => d);\n\n this.ylabel = this.svg.append('foreignObject')\n .attr('x', self.left-50)\n .attr('y', self.top-25)\n .attr('width', 100)\n .attr('height', 20)\n .attr('class', 'axis_label_foreign_obj');\n this.ylabel_dropdown = this.ylabel.append('xhtml:select')\n .attr('class', 'axis_label_select')\n .on('change', function() {\n self.set_y(d3.select(this).property('value'));\n console.log('Changing y to', self.yvar);\n draw_right();\n })\n .selectAll('option')\n .data(possible_ys)\n .enter()\n .append('option')\n .attr('value', d => d)\n .property('selected', d => d==self.yvar)\n .html(d => d);\n \n self.set_x(self.xvar);\n self.set_y(self.yvar);\n }", "function updateAxis(){\n\t\tchangeAxisX();\n\t\tchangeAxisY();\n\t\tupdateMaxMinForAxis();\n\n\t\t/*Init helpers*/\n\t\tvar width = getWidth();\n\t\tvar height = getHeight();\n\t\t//horisontal xAxis\n\t\txAxisLine\n\t\t\t.attr(\"x1\", 0)\n\t\t\t.attr(\"y1\", height/2)\n\t\t\t.attr(\"x2\", width)\n\t\t\t.attr(\"y2\", height/2)\n\t\t\t.attr(\"class\", \"axisLine\")\n\t\t\t.attr(\"stroke-width\", 2)\n\t\t\t.attr(\"stroke\", \"black\");\n\t\txAxisLabelRight\n\t\t\t.attr(\"x\", width)\n\t\t\t.attr(\"y\", height/2)\n\t\t\t.attr(\"class\", \"axisExplanation\")\n\t\t\t.attr(\"transform\", \"rotate(90 \"+width+\" \"+height/2+\") translate(0, 35)\")\n\t\t\t.text(xAxisValue);\n\t\txAxisLabelLeft\n\t\t\t.attr(\"x\", 0)\n\t\t\t.attr(\"y\", height/2)\n\t\t\t.attr(\"class\", \"axisExplanation\")\n\t\t\t.attr(\"transform\", \"rotate(270 \"+0+\" \"+height/2+\") translate(0, 35)\")\n\t\t\t.text(axisValueOpposites[axisValues.indexOf(xAxisValue)]);\n\t\t//vertical yAxis\n\t\tyAxisLine\n\t\t\t.attr(\"x1\", width/2)\n\t\t\t.attr(\"y1\", 0)\n\t\t\t.attr(\"x2\", width/2)\n\t\t\t.attr(\"y2\", height)\n\t\t\t.attr(\"class\", \"axisLine\")\n\t\t\t.attr(\"stroke-width\", 2)\n\t\t\t.attr(\"stroke\", \"black\");\n\t\tyAxisLabelTop\n\t\t\t.attr(\"x\", width/2)\n\t\t\t.attr(\"y\", 30)\n\t\t\t.attr(\"class\", \"axisExplanation\")\n\t\t\t.attr(\"transform\", \"translate(0, 5)\")\n\t\t\t.text(yAxisValue);\n\t\tyAxisLabelBottom\n\t\t\t.attr(\"x\", width/2)\n\t\t\t.attr(\"y\", height)\n\t\t\t.attr(\"transform\", \"translate(0, -5)\")\n\t\t\t.attr(\"class\", \"axisExplanation\")\n\t\t\t.text(axisValueOpposites[axisValues.indexOf(yAxisValue)]);\n\t}", "function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) {\n Object(util[\"k\" /* each */])(AXIS_TYPES, function (v, axisType) {\n var defaultOption = Object(util[\"I\" /* merge */])(Object(util[\"I\" /* merge */])({}, axisDefault[axisType], true), extraDefaultOption, true);\n\n var AxisModel =\n /** @class */\n function (_super) {\n Object(tslib_tslib_es6[\"b\" /* __extends */])(AxisModel, _super);\n\n function AxisModel() {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var _this = _super.apply(this, args) || this;\n\n _this.type = axisName + 'Axis.' + axisType;\n return _this;\n }\n\n AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n var layoutMode = Object(util_layout[\"d\" /* fetchLayoutMode */])(this);\n var inputPositionParams = layoutMode ? Object(util_layout[\"f\" /* getLayoutParams */])(option) : {};\n var themeModel = ecModel.getTheme();\n Object(util[\"I\" /* merge */])(option, themeModel.get(axisType + 'Axis'));\n Object(util[\"I\" /* merge */])(option, this.getDefaultOption());\n option.type = getAxisType(option);\n\n if (layoutMode) {\n Object(util_layout[\"h\" /* mergeLayoutParam */])(option, inputPositionParams, layoutMode);\n }\n };\n\n AxisModel.prototype.optionUpdated = function () {\n var thisOption = this.option;\n\n if (thisOption.type === 'category') {\n this.__ordinalMeta = data_OrdinalMeta.createByAxisModel(this);\n }\n };\n /**\n * Should not be called before all of 'getInitailData' finished.\n * Because categories are collected during initializing data.\n */\n\n\n AxisModel.prototype.getCategories = function (rawData) {\n var option = this.option; // FIXME\n // warning if called before all of 'getInitailData' finished.\n\n if (option.type === 'category') {\n if (rawData) {\n return option.data;\n }\n\n return this.__ordinalMeta.categories;\n }\n };\n\n AxisModel.prototype.getOrdinalMeta = function () {\n return this.__ordinalMeta;\n };\n\n AxisModel.type = axisName + 'Axis.' + axisType;\n AxisModel.defaultOption = defaultOption;\n return AxisModel;\n }(BaseAxisModelClass);\n\n registers.registerComponentModel(AxisModel);\n });\n registers.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\n}", "function tooltips() {\n removeTooltips();\n // Tooltips are added with options.tooltips in original order.\n scope_Tooltips = scope_Handles.map(addTooltip);\n bindEvent(\"update\" + INTERNAL_EVENT_NS.tooltips, function (values, handleNumber, unencoded) {\n if (!scope_Tooltips || !options.tooltips) {\n return;\n }\n if (scope_Tooltips[handleNumber] === false) {\n return;\n }\n var formattedValue = values[handleNumber];\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n scope_Tooltips[handleNumber].innerHTML = formattedValue;\n });\n }", "getLinkAnchors(mode) {\n const attrs = this.state.attributes;\n return [\n {\n element: this.object._id,\n points: [\n {\n x: attrs.x,\n y: attrs.y,\n xAttribute: \"x\",\n yAttribute: \"y\",\n direction: { x: mode == \"begin\" ? 1 : -1, y: 0 }\n }\n ]\n }\n ];\n }", "buildDefs() {\n const svg = d3.select(this.svgEl);\n const edges = flatten(this.layout).edges;\n\n // Clean up\n svg.select('defs').selectAll('.edge-marker-end').remove();\n\n svg.select('defs')\n .selectAll('.edge-marker-end')\n .data(edges)\n .enter()\n .append('marker')\n .classed('edge-marker-end', true)\n .attr('id', d => {\n const source = d.data.source.replace(/\\s/g, '');\n const target = d.data.target.replace(/\\s/g, '');\n return `arrowhead-${source}-${target}`;\n })\n .attr('viewBox', svgUtil.MARKER_VIEWBOX)\n .attr('refX', 2)\n .attr('refY', 0)\n .attr('orient', 'auto')\n .attr('markerWidth', 15)\n .attr('markerHeight', 15)\n .attr('markerUnits', 'userSpaceOnUse')\n .attr('xoverflow', 'visible')\n .append('svg:path')\n .attr('d', svgUtil.ARROW)\n .style('fill', '#000')\n .style('stroke', 'none');\n }", "function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) {\n\t each(AXIS_TYPES, function (v, axisType) {\n\t var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true);\n\t\n\t var AxisModel =\n\t /** @class */\n\t function (_super) {\n\t __extends(AxisModel, _super);\n\t\n\t function AxisModel() {\n\t var args = [];\n\t\n\t for (var _i = 0; _i < arguments.length; _i++) {\n\t args[_i] = arguments[_i];\n\t }\n\t\n\t var _this = _super.apply(this, args) || this;\n\t\n\t _this.type = axisName + 'Axis.' + axisType;\n\t return _this;\n\t }\n\t\n\t AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n\t var layoutMode = fetchLayoutMode(this);\n\t var inputPositionParams = layoutMode ? getLayoutParams(option) : {};\n\t var themeModel = ecModel.getTheme();\n\t merge(option, themeModel.get(axisType + 'Axis'));\n\t merge(option, this.getDefaultOption());\n\t option.type = getAxisType(option);\n\t\n\t if (layoutMode) {\n\t mergeLayoutParam(option, inputPositionParams, layoutMode);\n\t }\n\t };\n\t\n\t AxisModel.prototype.optionUpdated = function () {\n\t var thisOption = this.option;\n\t\n\t if (thisOption.type === 'category') {\n\t this.__ordinalMeta = OrdinalMeta.createByAxisModel(this);\n\t }\n\t };\n\t /**\n\t * Should not be called before all of 'getInitailData' finished.\n\t * Because categories are collected during initializing data.\n\t */\n\t\n\t\n\t AxisModel.prototype.getCategories = function (rawData) {\n\t var option = this.option; // FIXME\n\t // warning if called before all of 'getInitailData' finished.\n\t\n\t if (option.type === 'category') {\n\t if (rawData) {\n\t return option.data;\n\t }\n\t\n\t return this.__ordinalMeta.categories;\n\t }\n\t };\n\t\n\t AxisModel.prototype.getOrdinalMeta = function () {\n\t return this.__ordinalMeta;\n\t };\n\t\n\t AxisModel.type = axisName + 'Axis.' + axisType;\n\t AxisModel.defaultOption = defaultOption;\n\t return AxisModel;\n\t }(BaseAxisModelClass);\n\t\n\t registers.registerComponentModel(AxisModel);\n\t });\n\t registers.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\n\t }", "function makePlotFramework(gd) {\n var gd3 = d3.select(gd);\n var fullLayout = gd._fullLayout;\n fullLayout._calcInverseTransform = calcInverseTransform;\n fullLayout._calcInverseTransform(gd);\n\n // Plot container\n fullLayout._container = gd3.selectAll('.plot-container').data([0]);\n fullLayout._container.enter().insert('div', ':first-child').classed('plot-container', true).classed('plotly', true);\n\n // Make the svg container\n fullLayout._paperdiv = fullLayout._container.selectAll('.svg-container').data([0]);\n fullLayout._paperdiv.enter().append('div').classed('user-select-none', true).classed('svg-container', true).style('position', 'relative');\n\n // Make the graph containers\n // start fresh each time we get here, so we know the order comes out\n // right, rather than enter/exit which can muck up the order\n // TODO: sort out all the ordering so we don't have to\n // explicitly delete anything\n // FIXME: parcoords reuses this object, not the best pattern\n fullLayout._glcontainer = fullLayout._paperdiv.selectAll('.gl-container').data([{}]);\n fullLayout._glcontainer.enter().append('div').classed('gl-container', true);\n fullLayout._paperdiv.selectAll('.main-svg').remove();\n fullLayout._paperdiv.select('.modebar-container').remove();\n fullLayout._paper = fullLayout._paperdiv.insert('svg', ':first-child').classed('main-svg', true);\n fullLayout._toppaper = fullLayout._paperdiv.append('svg').classed('main-svg', true);\n fullLayout._modebardiv = fullLayout._paperdiv.append('div');\n delete fullLayout._modeBar;\n fullLayout._hoverpaper = fullLayout._paperdiv.append('svg').classed('main-svg', true);\n if (!fullLayout._uid) {\n var otherUids = {};\n d3.selectAll('defs').each(function () {\n if (this.id) otherUids[this.id.split('-')[1]] = 1;\n });\n fullLayout._uid = Lib.randstr(otherUids);\n }\n fullLayout._paperdiv.selectAll('.main-svg').attr(xmlnsNamespaces.svgAttrs);\n fullLayout._defs = fullLayout._paper.append('defs').attr('id', 'defs-' + fullLayout._uid);\n fullLayout._clips = fullLayout._defs.append('g').classed('clips', true);\n fullLayout._topdefs = fullLayout._toppaper.append('defs').attr('id', 'topdefs-' + fullLayout._uid);\n fullLayout._topclips = fullLayout._topdefs.append('g').classed('clips', true);\n fullLayout._bgLayer = fullLayout._paper.append('g').classed('bglayer', true);\n fullLayout._draggers = fullLayout._paper.append('g').classed('draglayer', true);\n\n // lower shape/image layer - note that this is behind\n // all subplots data/grids but above the backgrounds\n // except inset subplots, whose backgrounds are drawn\n // inside their own group so that they appear above\n // the data for the main subplot\n // lower shapes and images which are fully referenced to\n // a subplot still get drawn within the subplot's group\n // so they will work correctly on insets\n var layerBelow = fullLayout._paper.append('g').classed('layer-below', true);\n fullLayout._imageLowerLayer = layerBelow.append('g').classed('imagelayer', true);\n fullLayout._shapeLowerLayer = layerBelow.append('g').classed('shapelayer', true);\n\n // single cartesian layer for the whole plot\n fullLayout._cartesianlayer = fullLayout._paper.append('g').classed('cartesianlayer', true);\n\n // single polar layer for the whole plot\n fullLayout._polarlayer = fullLayout._paper.append('g').classed('polarlayer', true);\n\n // single smith layer for the whole plot\n fullLayout._smithlayer = fullLayout._paper.append('g').classed('smithlayer', true);\n\n // single ternary layer for the whole plot\n fullLayout._ternarylayer = fullLayout._paper.append('g').classed('ternarylayer', true);\n\n // single geo layer for the whole plot\n fullLayout._geolayer = fullLayout._paper.append('g').classed('geolayer', true);\n\n // single funnelarea layer for the whole plot\n fullLayout._funnelarealayer = fullLayout._paper.append('g').classed('funnelarealayer', true);\n\n // single pie layer for the whole plot\n fullLayout._pielayer = fullLayout._paper.append('g').classed('pielayer', true);\n\n // single treemap layer for the whole plot\n fullLayout._iciclelayer = fullLayout._paper.append('g').classed('iciclelayer', true);\n\n // single treemap layer for the whole plot\n fullLayout._treemaplayer = fullLayout._paper.append('g').classed('treemaplayer', true);\n\n // single sunburst layer for the whole plot\n fullLayout._sunburstlayer = fullLayout._paper.append('g').classed('sunburstlayer', true);\n\n // single indicator layer for the whole plot\n fullLayout._indicatorlayer = fullLayout._toppaper.append('g').classed('indicatorlayer', true);\n\n // fill in image server scrape-svg\n fullLayout._glimages = fullLayout._paper.append('g').classed('glimages', true);\n\n // lastly upper shapes, info (legend, annotations) and hover layers go on top\n // these are in a different svg element normally, but get collapsed into a single\n // svg when exporting (after inserting 3D)\n // upper shapes/images are only those drawn above the whole plot, including subplots\n var layerAbove = fullLayout._toppaper.append('g').classed('layer-above', true);\n fullLayout._imageUpperLayer = layerAbove.append('g').classed('imagelayer', true);\n fullLayout._shapeUpperLayer = layerAbove.append('g').classed('shapelayer', true);\n fullLayout._selectionLayer = fullLayout._toppaper.append('g').classed('selectionlayer', true);\n fullLayout._infolayer = fullLayout._toppaper.append('g').classed('infolayer', true);\n fullLayout._menulayer = fullLayout._toppaper.append('g').classed('menulayer', true);\n fullLayout._zoomlayer = fullLayout._toppaper.append('g').classed('zoomlayer', true);\n fullLayout._hoverlayer = fullLayout._hoverpaper.append('g').classed('hoverlayer', true);\n\n // Make the modebar container\n fullLayout._modebardiv.classed('modebar-container', true).style('position', 'absolute').style('top', '0px').style('right', '0px');\n gd.emit('plotly_framework');\n}", "function updatePlot(selection, mydata, currentaxis) {\n \n // reset existing plot\n svg.selectAll(\"circle\").remove();\n svg.selectAll(\".node\").remove();\n var xaxis = \"\";\n var yaxis = \"\";\n \n \n // set data set based on selected dimensions\n if (selected[0][2]) {\n xaxis = function(d) { return x(d.pctInPoverty); }\n x.domain([d3.min(mydata, function(d) { return d.pctInPoverty; }) - 1, d3.max(mydata, function(d) { return d.pctInPoverty; }) + 1]);\n }\n if (selected[1][2]) {\n xaxis = function(d) { return x(d.medAge); }\n x.domain([d3.min(mydata, function(d) { return d.medAge; }) -1, d3.max(mydata, function(d) { return d.medAge; }) + 1]);\n }\n if (selected[2][2]) {\n xaxis = function(d) { return x(d.medFamilyInc); }\n x.domain([d3.min(mydata, function(d) { return d.medFamilyInc; }) - 5000, d3.max(mydata, function(d) { return d.medFamilyInc; }) + 5000]);\n }\n if (selected[3][2]) {\n yaxis = function(d) { return y(d.pctNeverHadCheckup); }\n y.domain([d3.min(mydata, function(d) { return d.pctNeverHadCheckup; }) - .1, d3.max(mydata, function(d) { return d.pctNeverHadCheckup; }) + .1]);\n }\n if (selected[4][2]) {\n yaxis = function(d) { return y(d.pctStroke); }\n y.domain([d3.min(mydata, function(d) { return d.pctStroke; }) -1, d3.max(mydata, function(d) { return d.pctStroke; }) +1]);\n myYTip = \"<div>Stroke %: \" + (function(d) { return d.pctStroke; }) + \"</div>\";\n }\n if (selected[5][2]) {\n yaxis = function(d) { return y(d.pctObese); }\n y.domain([d3.min(mydata, function(d) { return d.pctObese; }) -1, d3.max(mydata, function(d) { return d.pctObese; }) +1]);\n }\n \n svg.call(tool_tip);\n \n //Refomat the x axis if clicked\n if (currentaxis == \"x\") {\n svg.select(selection)\n .style(\"fill\", \"purple\")\n .style(\"font-weight\", \"bold\")\n .attr('fill-opacity', 1)\n .transition();\n \n svg.select(prevXSelected)\n .style(\"fill\", \"black\")\n .attr('fill-opacity', 0.5)\n .style(\"font-weight\", \"normal\")\n .transition();\n \n prevXSelected = selection;\n }\n \n //Reformat the y axis if clicked\n if (currentaxis == \"y\") {\n svg.select(selection)\n .style(\"fill\", \"purple\")\n .style(\"font-weight\", \"bold\")\n .attr('fill-opacity', 1)\n .transition();\n \n svg.select(prevYSelected)\n .style(\"fill\", \"black\")\n .style(\"font-weight\", \"normal\")\n .attr('fill-opacity', 0.5)\n .transition();\n \n prevYSelected = selection;\n }\n\n // Add the scatterplot\n svg.selectAll(\"dot\")\n .data(mydata)\n .enter()\n .append(\"circle\")\n .attr(\"r\", 10)\n .attr(\"fill\", \"purple\")\n .attr('fill-opacity', 0.5)\n .attr(\"text\", mydata.state)\n .on('mouseover', tool_tip.show)\n .on('mouseout', tool_tip.hide)\n .attr(\"cx\", xaxis)\n .attr(\"cy\", yaxis); \n \n // Add the state labels\n var myg = svg.selectAll(\"g.node\")\n .data(mydata)\n .enter().append(\"svg:g\")\n .attr(\"class\", \"node\");\n \n myg.append(\"svg:text\")\n .attr(\"x\", xaxis)\n .attr(\"y\", yaxis)\n .attr(\"dy\", \".31em\")\n .style(\"font\", \"8px sans-serif\")\n .style(\"text-anchor\", \"middle\")\n .style(\"fill\", \"white\")\n .attr(\"class\", \"labels\")\n .text(function(d) { return d.state; });\n \n // Update the X Axis\n svg.select(\".xaxis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .transition()\n .call(d3.axisBottom(x));\n \n // Update the Y Axis\n svg.select(\".yaxis\")\n .transition()\n .call(d3.axisLeft(y));\n\n}", "function setupCtrlPointEvent(){\n circles.call(tip);\n circles.on('mouseover', tip.show).on('mousemove', tip.show).on('mouseout', tip.hide);\n circles.call(drag);\n //// right click to remove a opacity control point\n circles.on('contextmenu', function(d,i){\n d3.event.preventDefault(); //disable default menu popout\n if( i > 0 && i < vis.opaCtrlPoint.length - 1) {\n vis.opaCtrlPoint.splice(i, 1);\n updateTFInterface();\n tip.hide();\n }\n });\n\n circlesColor.call(tipColor);\n circlesColor.on('mouseover', tipColor.show).on('mousemove', tipColor.show).on('mouseout', tipColor.hide);\n circlesColor.call(dragColor);\n //// right click to remove a color control point\n circlesColor.on('contextmenu', function(d,i){\n d3.event.preventDefault(); //disable default menu popout\n if( i > 0 && i < vis.colorCtrlPoint.length - 1) {\n vis.colorCtrlPoint.splice(i, 1);\n updateColorGradientDef();\n updateTFInterface();\n tip.hide();\n }\n });\n }", "function tooltips() {\n removeTooltips();\n\n // Tooltips are added with options.tooltips in original order.\n scope_Tooltips = scope_Handles.map(addTooltip);\n\n bindEvent(\"update.tooltips\", function(values, handleNumber, unencoded) {\n if (!scope_Tooltips[handleNumber]) {\n return;\n }\n\n var formattedValue = values[handleNumber];\n\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n\n scope_Tooltips[handleNumber].innerHTML = formattedValue;\n });\n }", "function tooltips() {\n removeTooltips();\n\n // Tooltips are added with options.tooltips in original order.\n scope_Tooltips = scope_Handles.map(addTooltip);\n\n bindEvent(\"update.tooltips\", function(values, handleNumber, unencoded) {\n if (!scope_Tooltips[handleNumber]) {\n return;\n }\n\n var formattedValue = values[handleNumber];\n\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n\n scope_Tooltips[handleNumber].innerHTML = formattedValue;\n });\n }", "function tooltips() {\n removeTooltips();\n\n // Tooltips are added with options.tooltips in original order.\n scope_Tooltips = scope_Handles.map(addTooltip);\n\n bindEvent(\"update.tooltips\", function(values, handleNumber, unencoded) {\n if (!scope_Tooltips[handleNumber]) {\n return;\n }\n\n var formattedValue = values[handleNumber];\n\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n\n scope_Tooltips[handleNumber].innerHTML = formattedValue;\n });\n }", "function tooltips() {\n removeTooltips();\n\n // Tooltips are added with options.tooltips in original order.\n scope_Tooltips = scope_Handles.map(addTooltip);\n\n bindEvent(\"update.tooltips\", function(values, handleNumber, unencoded) {\n if (!scope_Tooltips[handleNumber]) {\n return;\n }\n\n var formattedValue = values[handleNumber];\n\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n\n scope_Tooltips[handleNumber].innerHTML = formattedValue;\n });\n }", "getLinkAnchors() {\n const attrs = this.state.attributes;\n const element = this.object._id;\n return [\n {\n element,\n points: [\n {\n x: attrs.x1,\n y: attrs.y1,\n xAttribute: \"x1\",\n yAttribute: \"y1\",\n direction: { x: -1, y: 0 }\n },\n {\n x: attrs.x1,\n y: attrs.y2,\n xAttribute: \"x1\",\n yAttribute: \"y2\",\n direction: { x: -1, y: 0 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.x2,\n y: attrs.y1,\n xAttribute: \"x2\",\n yAttribute: \"y1\",\n direction: { x: 1, y: 0 }\n },\n {\n x: attrs.x2,\n y: attrs.y2,\n xAttribute: \"x2\",\n yAttribute: \"y2\",\n direction: { x: 1, y: 0 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.x1,\n y: attrs.y1,\n xAttribute: \"x1\",\n yAttribute: \"y1\",\n direction: { x: 0, y: -1 }\n },\n {\n x: attrs.x2,\n y: attrs.y1,\n xAttribute: \"x2\",\n yAttribute: \"y1\",\n direction: { x: 0, y: -1 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.x1,\n y: attrs.y2,\n xAttribute: \"x1\",\n yAttribute: \"y2\",\n direction: { x: 0, y: 1 }\n },\n {\n x: attrs.x2,\n y: attrs.y2,\n xAttribute: \"x2\",\n yAttribute: \"y2\",\n direction: { x: 0, y: 1 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.cx,\n y: attrs.y1,\n xAttribute: \"cx\",\n yAttribute: \"y1\",\n direction: { x: 0, y: -1 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.cx,\n y: attrs.y2,\n xAttribute: \"cx\",\n yAttribute: \"y2\",\n direction: { x: 0, y: 1 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.x1,\n y: attrs.cy,\n xAttribute: \"x1\",\n yAttribute: \"cy\",\n direction: { x: -1, y: 0 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.x2,\n y: attrs.cy,\n xAttribute: \"x2\",\n yAttribute: \"cy\",\n direction: { x: 1, y: 0 }\n }\n ]\n }\n ];\n }", "function getYaxisOptions(){\n scale = new Array();\n\n if(generate_param_1){\n y1_scale = {\n type: \"linear\",\n\n display: show_scale_1,\n position: \"left\",\n id: \"y-axis-1\",\n scaleLabel: {\n display: true,\n labelString: label_1,\n },\n };\n\n if(same_scale) {\n y1_scale[\"ticks\"] = {\n min: min_scale_value,\n max: max_scale_value\n }\n }\n\n scale.push(y1_scale);\n }\n\n\n if(generate_param_2){\n y2_scale = {\n type: \"linear\",\n display: show_scale_2,\n position: \"right\",\n id: \"y-axis-2\",\n scaleLabel: {\n display: true,\n labelString: label_2,\n },\n gridLines: {\n drawOnChartArea: false,\n }\n };\n\n if(same_scale) {\n y2_scale[\"ticks\"] = {\n min: min_scale_value,\n max: max_scale_value\n }\n }\n\n scale.push(y2_scale);\n }\n\n if(generate_param_3){\n y3_scale = {\n type: \"linear\",\n display: show_scale_3,\n position: \"right\",\n id: \"y-axis-3\",\n scaleLabel: {\n display: true,\n labelString: label_3\n },\n gridLines: {\n drawOnChartArea: false,\n }\n };\n scale.push(y3_scale);\n }\n\n\n\n return scale;\n}", "function updateToolTip(selectedAxis, circlesGroup) {\n console.log(\"Selected Axis inside updateToolTips: \" + selectedAxis)\n\n if (selectedAxis == \"poverty\") {\n var label = \"Poverty (%):\"\n } else {\n var label = \"Obesity (%)\"\n }\n \n var toolTip = d3.tip()\n .attr(\"class\", \"tooltip\")\n .offset([80, -60])\n .html(function (d) {\n console.log(\"d[selectedAxis]: \" + d[selectedAxis]);\n return (`${d.states}<br>${label} ${d[selectedAxis]}`);\n \n });\n console.log(\"tooltip: \" +toolTip );\n circlesGroup.call(toolTip);\n \n circlesGroup.on(\"mouseover\", function (data) {\n toolTip.show(data);\n })\n // onmouseout event\n .on(\"mouseout\", function (data, index) {\n toolTip.hide(data);\n });\n \n return circlesGroup\n }", "function tooltips() {\n\n // Tooltips are added with options.tooltips in original order.\n var tips = scope_Handles.map(addTooltip);\n\n bindEvent('update', function (values, handleNumber, unencoded) {\n\n if (!tips[handleNumber]) {\n return;\n }\n\n var formattedValue = values[handleNumber];\n\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n\n tips[handleNumber].innerHTML = formattedValue;\n });\n }", "function chartOps() {\n const mainChartOpts = {\n tooltips: {\n enabled: false,\n custom: CustomTooltips,\n intersect: true,\n mode: 'index',\n position: 'nearest',\n callbacks: {\n labelColor: function(tooltipItem, chart) {\n return { backgroundColor: chart.data.datasets[tooltipItem.datasetIndex].borderColor }\n }\n }\n },\n maintainAspectRatio: false,\n legend: {\n display: false,\n },\n scales: {\n xAxes: [\n {\n gridLines: {\n drawOnChartArea: false,\n },\n }],\n yAxes: [\n {\n ticks: {\n beginAtZero: true,\n maxTicksLimit: 5,\n stepSize: Math.ceil(250 / 5),\n max: 250,\n },\n }],\n },\n elements: {\n point: {\n radius: 0,\n hitRadius: 10,\n hoverRadius: 4,\n hoverBorderWidth: 3,\n },\n },\n };\n return mainChartOpts;\n}", "function prepareScatterPlot(parentKeys, childKeys) {\n\t//empty the container\n\t// $(\"#lct-main-container\").empty();\n\t//dynamically load the parent keys from the data user selected\n\t//x-axis\n\t$.each(parentKeys, function (index, value) {\n\t\t$(\"#sct-parentkey-select-x\").append($(\"<option ></option>\").attr(\"value\", index).text(value));\n\t});\n\t$(\"#sct-parentkey-select-x option[value=0]\").attr(\"selected\", \"selected\");//set the first element in the parentKeys as the default value\n\n\t//set childKeys of the first parent key as the default value\n\t$.each(childKeys[parentKeys[0]], function (index, value) {\n\t\t$(\"#sct-childkey-select-x\").append($(\"<option></option>\").attr(\"value\", index).text(value));\n\t});\n\n\t//dynamically load the child keys from the parent key user selected\n\t$(\"#sct-parentkey-select-x\").change(function () {\n\t\t$(\"#sct-childkey-select-x\").empty();\n\t\tvar parentkey = $(\"#sct-parentkey-select-x option:selected\").text();\n\t\tvar validChildKeys = childKeys[parentkey];\n\t\t$.each(validChildKeys, function (index, value) {\n\t\t\t$(\"#sct-childkey-select-x\").append($(\"<option></option>\").attr(\"value\", index).text(value));\n\t\t})\n\t});\n\n\t// set the first element of the child keys as the default option\n\t$(\"#sct-childkey-select-x option[value=0]\").attr(\"selected\", \"selected\");\n\n\n\n\t//y-axis\n\t$.each(parentKeys, function (index, value) {\n\t\t$(\"#sct-parentkey-select-y\").append($(\"<option ></option>\").attr(\"value\", index).text(value));\n\t});\n\t$(\"#sct-parentkey-select-y option[value=0]\").attr(\"selected\", \"selected\");//set the first element in the parentKeys as the default value\n\n\t//set childKeys of the first parent key as the default value\n\t$.each(childKeys[parentKeys[0]], function (index, value) {\n\t\t$(\"#sct-childkey-select-y\").append($(\"<option></option>\").attr(\"value\", index).text(value));\n\t});\n\n\t//dynamically load the child keys from the parent key user selected\n\t$(\"#sct-parentkey-select-y\").change(function () {\n\t\t$(\"#sct-childkey-select-y\").empty();\n\t\tvar parentkey = $(\"#sct-parentkey-select-y option:selected\").text();\n\t\tvar validChildKeys = childKeys[parentkey];\n\t\t$.each(validChildKeys, function (index, value) {\n\t\t\t$(\"#sct-childkey-select-y\").append($(\"<option></option>\").attr(\"value\", index).text(value));\n\t\t})\n\t});\n\n\t// set the first element of the child keys as the default option\n\t$(\"#sct-childkey-select-y option[value=0]\").attr(\"selected\", \"selected\");\n}", "function setupAxes(target){\n target\n .append('g')\n .attr('class', 'axis axis-x')\n .call(d3.axisBottom(x))\n .attr('transform', 'translate(0,' + height + ')')\n .selectAll(\"text\")\n //Note: There's prob a better way to do this...\n .attr(\"transform\", \"rotate(45)\")\n .attr(\"dx\", 80)\n .attr(\"dy\", \"1em\");\n \n target\n .append('g')\n .attr('class', 'axis axis-y')\n .call(d3.axisLeft(y)\n .ticks(10));\n }", "function layout$1(gridModel, axisModel, opt) {\n\t opt = opt || {};\n\t var grid = gridModel.coordinateSystem;\n\t var axis = axisModel.axis;\n\t var layout = {};\n\t var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\n\t var rawAxisPosition = axis.position;\n\t var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\n\t var axisDim = axis.dim;\n\t var rect = grid.getRect();\n\t var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n\t var idx = {\n\t left: 0,\n\t right: 1,\n\t top: 0,\n\t bottom: 1,\n\t onZero: 2\n\t };\n\t var axisOffset = axisModel.get('offset') || 0;\n\t var posBound = axisDim === 'x' ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\n\t\n\t if (otherAxisOnZeroOf) {\n\t var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\n\t posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\n\t } // Axis position\n\t\n\t\n\t layout.position = [axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0], axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]]; // Axis rotation\n\t\n\t layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1); // Tick and label direction, x y is axisDim\n\t\n\t var dirMap = {\n\t top: -1,\n\t bottom: 1,\n\t left: -1,\n\t right: 1\n\t };\n\t layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\n\t layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\n\t\n\t if (axisModel.get(['axisTick', 'inside'])) {\n\t layout.tickDirection = -layout.tickDirection;\n\t }\n\t\n\t if (retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\n\t layout.labelDirection = -layout.labelDirection;\n\t } // Special label rotation\n\t\n\t\n\t var labelRotate = axisModel.get(['axisLabel', 'rotate']);\n\t layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate; // Over splitLine and splitArea\n\t\n\t layout.z2 = 1;\n\t return layout;\n\t }", "function sharingAxis() {\n\n\n angular.forEach(dqFactory.completeness.variables, function (variable) {\n if(variable.state.selected) {\n\n //console.log(\"sharingAxis: \", xWidth);\n\n //historical bar chart, sharing x\n var optionSharingX = {\n chart: {\n type: 'historicalBarChart',\n height: 150,\n width: xWidth,\n margin: {\n //top: 20,\n right: 20,\n bottom: 65,\n left: 75\n },\n x: function (d) {\n return d[0];\n },\n y: function (d) {\n //return d[1] / 100000;\n return d[1]\n },\n showValues: true,\n valueFormat: function (d) {\n return d3.format(',.0f')(d);\n },\n duration: 100,\n\n useInteractiveGuideline: false,\n tooltip: {\n contentGenerator: function (e) {\n var series = e.series[0];\n\n var rows =\n \"<tr>\" +\n \"<td class='key'>\" + $scope.nameX + \"</td>\" +\n \"<td class='x-value'>\" + series.key + \"</td>\" +\n \"</tr>\" +\n \"<tr>\" +\n \"<td class='key'>Missing: </td>\" +\n \"<td class='x-value'><strong>\" + d3.format(',.0f')(series.value) + \"</strong></td>\" +\n \"</tr>\";\n\n var header =\n \"<thead>\" +\n \"<tr>\" +\n \"<td class='legend-color-guide'><div style='background-color: \" + series.color + \";'></div></td>\" +\n \"<td class='key'><strong>\" + variable.name + \"</strong></td>\" +\n \"</tr>\" +\n \"</thead>\";\n\n return \"<table>\" +\n header +\n \"<tbody>\" +\n rows +\n \"</tbody>\" +\n \"</table>\";\n }\n },\n\n\n\n\n //xAxis: {\n // axisLabel: $rootScope.gv.stpX,\n // tickFormat: function (d) {\n // return d3.format('.0f')(d);\n // //return d3.time.format('%x')(new Date(d))\n // },\n // ticks: 8,\n // rotateLabels: 30,\n // showMaxMin: true\n //},\n xDomain: $scope.optionPlot.chart.xDomain,\n xAxis: $scope.optionPlot.chart.xAxis,\n yAxis: {\n axisLabel: variable.name,\n axisLabelDistance: -10,\n tickFormat: function (d) {\n return d3.format(',.0f')(d);\n }\n },\n multibar: {\n height: 1\n },\n // useInteractiveGuideline: true,\n // tooltip: {\n // keyFormatter: function (d) {\n // //$log.debug(d);\n // return \"(\".concat(variable.name).concat(\", # missing): \").concat(d);\n // //return d3.time.format('%x')(new Date(d));\n // }\n // },\n zoom: {\n enabled: false,\n scaleExtent: [1, 10],\n useFixedDomain: false,\n useNiceScale: false,\n horizontalOff: false,\n verticalOff: false,\n unzoomEventType: 'dblclick.zoom'\n }\n }\n };\n //console.log(\"xDomain: \", $scope.optionPlot.chart.xDomain);\n //optionSharingX.chart.xDomain = $scope.optionPlot.chart.xDomain;\n //optionSharingX.chart.width = xWidth;\n //console.log(variable.name, \" width: \", optionSharingX.chart.width);\n\n //optionSharingX.chart.width = document.getElementById(\"onlyMainPlotAndBottom\").offsetWidth;//$scope.optionPlot.chart.width;\n\n //optionSharingX.chart.yDomain = $scope.optionPlot.chart.yDomain;\n //console.log(\"plot width: \", $scope.optionPlot.chart.width);\n //optionSharingX.chart.width = $scope.optionPlot.chart.width;\n\n //horizontal bar chart, sharing y\n var optionSharingY = {\n chart: {\n type: 'multiBarHorizontalChart',\n height: $scope.optionPlot.chart.height,\n width: 80,\n margin: {\n left: 0\n },\n x: function (d) {\n return d.label;\n },\n y: function (d) {\n return d.value;\n },\n showControls: false,\n showValues: false,\n showLegend: false,\n showXAxis: false,\n duration: 500,\n xAxis: {showMaxMin: false},\n yAxis: {\n //axisLabel: 'Values',\n tickFormat: function (d) {\n return d3.format(',.0f')(d);\n }\n },\n useInteractiveGuideline: false,\n tooltip: {\n contentGenerator: function (e) {\n var series = e.series[0];\n\n var rows =\n \"<tr>\" +\n \"<td class='key'>\" + $scope.nameY + \"</td>\" +\n \"<td class='x-value'>\" + e.value + \"</td>\" +\n \"</tr>\" +\n \"<tr>\" +\n \"<td class='key'>Missing: </td>\" +\n \"<td class='x-value'><strong>\" + d3.format(',.0f')(series.value) + \"</strong></td>\" +\n \"</tr>\";\n\n var header =\n \"<thead>\" +\n \"<tr>\" +\n \"<td class='legend-color-guide'><div style='background-color: \" + series.color + \";'></div></td>\" +\n \"<td class='key'><strong>\" + variable.name + \"</strong></td>\" +\n \"</tr>\" +\n \"</thead>\";\n\n return \"<table>\" +\n header +\n \"<tbody>\" +\n rows +\n \"</tbody>\" +\n \"</table>\";\n }\n },\n multibar: {\n stacked: false\n }\n },\n title: {\n enable: true,\n text: variable.name,\n className: \"h5\"\n },\n subtitle: {\n enable: true,\n text: \"#missing\",\n class: {\n textAlign: \"center\"\n }\n }\n };\n\n var optionCategorical = {\n chart: {\n type: 'scatterChart',\n height: $scope.optionPlot.chart.height,\n color: dqFactory.completeness.colorRange.present, //d3.scale.category10().range(), //TODO\n scatter: {\n onlyCircles: false\n },\n showDistX: false,\n showDistY: false,\n showLegend: true,\n\n useInteractiveGuideline: false,\n tooltip: {\n contentGenerator: function (e) {\n var series = e.series[0];\n\n var rows =\n \"<tr>\" +\n \"<td class='key'>\" + $scope.nameX + \"</td>\" +\n \"<td class='x-value'>\" + e.value + \"</td>\" +\n \"</tr>\" +\n \"<tr>\" +\n \"<td class='key'>\" + $scope.nameY + \"</td>\" +\n \"<td class='x-value'><strong>\" + d3.format(',.2f')(series.value) + \"</strong></td>\" +\n \"</tr>\";\n\n var header =\n \"<thead>\" +\n \"<tr>\" +\n \"<td class='legend-color-guide'><div style='background-color: \" + series.color + \";'></div></td>\" +\n \"<td class='key'><strong>\" + series.key + \"</strong></td>\" +\n \"</tr>\" +\n \"</thead>\";\n\n return \"<table>\" +\n header +\n \"<tbody>\" +\n rows +\n \"</tbody>\" +\n \"</table>\";\n }\n\n },\n\n xAxis: {\n axisLabel: $scope.nameX,\n tickFormat: function (d) {\n return d3.format('.0f')(d);\n },\n ticks: 8\n },\n yAxis: {\n axisLabel: $scope.nameY,\n tickFormat: function (d) {\n return d3.format(',.2f')(d);\n },\n axisLabelDistance: -5\n },\n zoom: {\n //NOTE: All attributes below are optional\n enabled: false,\n scaleExtent: [1, 10],\n useFixedDomain: false,\n useNiceScale: false,\n horizontalOff: false,\n verticalOff: false\n //unzoomEventType: 'dblclick.zoom'\n }\n },\n title: {\n enable: true,\n text: variable.name,\n className: \"h5\"\n },\n subtitle: {\n enable: true,\n text: \"Categories for the \"\n .concat(variable.name)\n .concat(\" variable, related to the \")\n .concat(dqFactory.completeness.numericalPlot.nameX)\n .concat(\" vs \")\n .concat(dqFactory.completeness.numericalPlot.nameY)\n .concat(\" plot\"),\n class: {\n textAlign: \"left\"\n },\n className: \"h5\"\n }\n };\n optionCategorical.chart.xDomain = $scope.optionPlot.chart.xDomain;\n //console.log(\"categorical range: \", optionCategorical.chart.xDomain);\n optionCategorical.chart.yDomain = $scope.optionPlot.chart.yDomain;\n\n\n var dataSharingX = completenessOfVariableRespectX(variable.name, $scope.nameX);\n var dataSharingY = completenessOfVariableRespectY(variable.name, $scope.nameY);\n\n //var dataCategorical = [];\n //if(variable.state.isCategorical)\n var dataCategorical = completenessCategorical(variable.name);\n\n variable.optionSharingX = optionSharingX;\n variable.dataSharingX = dataSharingX;\n\n variable.optionSharingY = optionSharingY;\n variable.dataSharingY = dataSharingY;\n\n variable.optionCategorical = optionCategorical;\n variable.dataCategorical = dataCategorical;\n\n }\n });\n\n\n }", "function createAxis() {\n for (var i = 0; i < picArray.length; i++) {\n titleArray.push(picArray[i].title);\n clickArray.push(picArray[i].clicked);\n viewArray.push(picArray[i].viewed);\n }\n}", "function initTooltip() {\n if (!tooltip || !tooltip.node()) {\n // Create new tooltip div if it doesn't exist on DOM.\n\n var data = [1];\n tooltip = d3.select(document.body).select('#'+id).data(data);\n\n tooltip.enter().append('div')\n .attr(\"class\", \"nvtooltip \" + (classes ? classes : \"xy-tooltip\"))\n .attr(\"id\", id)\n .style(\"top\", 0).style(\"left\", 0)\n .style('opacity', 0)\n .style('position', 'fixed')\n .selectAll(\"div, table, td, tr\").classed(nvPointerEventsClass, true)\n .classed(nvPointerEventsClass, true);\n\n tooltip.exit().remove()\n }\n }", "function initTooltip() {\n if (!tooltip || !tooltip.node()) {\n // Create new tooltip div if it doesn't exist on DOM.\n\n var data = [1];\n tooltip = d3.select(document.body).select('#'+id).data(data);\n\n tooltip.enter().append('div')\n .attr(\"class\", \"nvtooltip \" + (classes ? classes : \"xy-tooltip\"))\n .attr(\"id\", id)\n .style(\"top\", 0).style(\"left\", 0)\n .style('opacity', 0)\n .style('position', 'fixed')\n .selectAll(\"div, table, td, tr\").classed(nvPointerEventsClass, true)\n .classed(nvPointerEventsClass, true);\n\n tooltip.exit().remove()\n }\n }", "function updateToolTip(chosenXAxis, chosenYAxis, circlesGroup) {\r\n\r\n // X Axis\r\n if (chosenXAxis === \"intelligence\") {\r\n var xlabel = \"intelligence: \";\r\n }\r\n else if (chosenXAxis === \"speed\") {\r\n var xlabel = \"speed: \"\r\n }\r\n else {\r\n var xlabel = \"strength: \"\r\n }\r\n\r\n // Y Axis\r\n if (chosenYAxis === \"durability\") {\r\n var ylabel = \"durability: \";\r\n }\r\n else if (chosenYAxis === \"combat\") {\r\n var ylabel = \"combat: \"\r\n }\r\n else {\r\n var ylabel = \"power: \"\r\n }\r\n\r\n var toolTip = d3.tip()\r\n .attr(\"class\", \"tooltip\")\r\n .style(\"background\", \"purple\")\r\n .style(\"color\", \"white\")\r\n .offset([100, -60])\r\n .html(function (d) {\r\n if (chosenXAxis === \"strength\") {\r\n\r\n return (`${d.name}<hr>${xlabel} ${d[chosenXAxis]}<br>${ylabel}${d[chosenYAxis]}`);\r\n } else if (chosenXAxis !== \"intelligence\" && chosenXAxis !== \"strength\") {\r\n\r\n return (`${d.name}<hr>${xlabel}${d[chosenXAxis]}<br>${ylabel}${d[chosenYAxis]}`);\r\n } else {\r\n\r\n return (`${d.name}<hr>${xlabel}${d[chosenXAxis]}<br>${ylabel}${d[chosenYAxis]}`);\r\n }\r\n });\r\n\r\n circlesGroup.call(toolTip);\r\n\r\n circlesGroup.on(\"mouseover\", function (data) {\r\n toolTip.show(data, this);\r\n })\r\n\r\n .on(\"mouseout\", function (data, index) {\r\n toolTip.hide(data)\r\n });\r\n\r\n return circlesGroup;\r\n}", "function updateToolTip(chosenXAxis, xLabel, yLabel, chosenYAxis, circlesGroup) {\n \n var toolTip = d3.tip()\n .attr(\"class\", \"tooltip\")\n //.offset([80, -60])\n .html(function(d) {\n return (`${d.state}<br>${xLabel} ${d[chosenXAxis]}<br>${yLabel}${d[chosenYAxis]}`);\n });\n \n circlesGroup.call(toolTip);\n \n circlesGroup.on(\"mouseover\", function(data) {\n toolTip.show(data,this);\n })\n //onmouseout event\n .on(\"mouseout\", function(data, index) {\n toolTip.hide(data);\n });\n \n return circlesGroup;\n }", "function configureOneAxe(axisName, inputChartDef, c3Axes) {\r\n var axisMap = inputChartDef.axisMap;\r\n if (!axisMap) {\r\n return;\r\n }\r\n var series = axisMap[axisName];\r\n if (!series) {\r\n return;\r\n }\r\n for (var _i = 0, series_1 = series; _i < series_1.length; _i++) {\r\n var seriesConfig = series_1[_i];\r\n c3Axes[seriesConfig.series] = axisName;\r\n }\r\n}", "function updateToolTip(chosenXAxis, chosenYAxis, circlesGroup) {\n\n var label;\n var labelY;\n\n if (chosenXAxis === \"gender\") {\n label = \"gender\";\n } else if (chosenXAxis === \"birthyear\") {\n label = \"birthyear\"; \n } else if (chosenXAxis === \"subscribertype\") {\n label = \"subscribertype\"; \n }\n\n if (chosenYAxis === \"tripduration\") {\n labelY = \"tripduration\";\n } else if (chosenYAxis === \"bikeid\") {\n labelY = \"bikeid\"; \n }\n\n\n var toolTip = d3.tip()\n .attr(\"class\", \"tooltip\")\n .offset([80, -60])\n .html(function(d) {\n //return (`${d.birthyear}<br>${label} ${d[chosenXAxis]}<br>${labelY} ${d[chosenYAxis]}`);\n //return (`${label} ${d[chosenXAxis]}<br>${labelY} ${d[chosenYAxis]}`);\n\n if (chosenXAxis === \"gender\") {\n return (`${label}: ${get_gender_string(d[chosenXAxis])}<br>${labelY}: ${d[chosenYAxis]}`); \n } else if (chosenXAxis === \"subscribertype\") {\n return (`usertype: ${get_usertype_string(d[chosenXAxis])}<br>${labelY}: ${d[chosenYAxis]}`);\n } else if (chosenXAxis === \"birthyear\") {\n return (`age: ${d[chosenXAxis]}<br>${labelY}: ${d[chosenYAxis]}`);\n }\n\n });\n\n circlesGroup.call(toolTip);\n\n circlesGroup.on(\"mouseover\", function(data) {\n toolTip.show(data);\n \n })\n // onmouseout event\n .on(\"mouseout\", function(data, index) {\n toolTip.hide(data);\n });\n\n return circlesGroup;\n}", "_updateIndicators() {\n const _this = this;\n this.duration = this.model.time.delayAnimations;\n this.yScale = this.model.marker.axis_y.getScale();\n this.xScale = this.model.marker.axis_x.getScale();\n this.yAxis.tickFormat(_this.model.marker.axis_y.getTickFormatter());\n this.xAxis.tickFormat(_this.model.marker.axis_x.getTickFormatter());\n this.xAxisLeft.tickFormat(_this.model.marker.axis_x.getTickFormatter());\n\n const sideDim = this.SIDEDIM;\n const stackDim = this.STACKDIM;\n\n const stacks = this.model.marker.getKeys(stackDim);\n let stackKeys = [];\n stackKeys = stacks.map(m => m[stackDim]);\n this.stackKeys = stackKeys;\n\n const sideItems = this.model.marker.label_side.getItems();\n //var sideKeys = Object.keys(sideItems);\n let sideKeys = [];\n if (!utils.isEmpty(sideItems)) {\n const sideFiltered = !!this.model.marker.side.getEntity().show[sideDim];\n const sides = this.model.marker.getKeys(sideDim)\n .filter(f => !sideFiltered || this.model.marker.side.getEntity().isShown(f));\n sideKeys = sides.map(m => m[sideDim]);\n\n if (sideKeys.length > 2) sideKeys.length = 2;\n if (sideKeys.length > 1) {\n const sortFunc = this.ui.chart.flipSides ? d3.ascending : d3.descending;\n sideKeys.sort(sortFunc);\n }\n }\n if (!sideKeys.length) sideKeys.push(\"undefined\");\n this.sideKeys = sideKeys;\n\n this.twoSided = this.sideKeys.length > 1;\n this.titleRight.classed(\"vzb-hidden\", !this.twoSided);\n if (this.twoSided) {\n this.xScaleLeft = this.xScale.copy();\n this.title.text(sideItems[this.sideKeys[1]]);\n this.titleRight.text(sideItems[this.sideKeys[0]]);\n } else {\n const title = this.sideKeys.length && sideItems[this.sideKeys[0]] ? sideItems[this.sideKeys[0]] : \"\";\n this.title.text(title);\n }\n\n this.cScale = this.model.marker.color.getScale();\n }", "function bubbleChart() {\n // Constants for sizing\n var width = 940;\n var height = 400;\n var widthGraph = 800;\n var widthOffset = 0.5*(width-widthGraph);\n widthOffset = 0;\n widthGraph = 800;\n var heightGraph = 450;\n var heightOffset = 0.5*(height-heightGraph);\n console.log(\"in bubblechart\");\n // tooltip for mouseover functionality\n var tooltip = floatingTooltip('gates_tooltip', 240);\n\n // Locations to move bubbles towards, depending\n // on which view mode is selected.\n var center = { x: width / 2, y: height / 2 };\n\n var topicCenters = {\n \t\t0: { x: 2*width/12, y: 3*height/8 },\n \t\t1: { x: 4*width/12, y: 3*height/8 },\n \t\t2: { x: 6*width/12, y: 3*height/8 },\n \t\t3: { x: 8*width/12, y: 3*height/8 },\n \t\t4: { x: 10*width/12, y: 3*height/8 }\n };\n\n\tvar dtypeCenters = {\n \t\t0: { x: 2*width/10, y: 3*height/8 },\n \t\t1: { x: 4*width/10, y: 3*height/8 },\n \t\t2: { x: 6*width/10, y: 3*height/8 },\n \t\t3: { x: 8*width/10, y: 3*height/8 },\n\t };\n\n // X locations of the topic titles.\n var topicsTitleX = {}\n topicsTitleX[\"ALL\"] = 1*width/12;\n topicsTitleX[topic1.substring(0,20)+'...'] = 3*width/12;\n topicsTitleX[topic2.substring(0,20)+'...'] = 6*width/12;\n //topicsTitleX[topic3.substring(0,20)+'...'] = 8*width/12;\n //topicsTitleX[topic4.substring(0,20)+'...'] = 11*width/12;\n // X locations of the year titles.\n var dtypesTitleX = {\n \"Pubmed\": \t\t\t2*width/10,\n \"Patents\": \t\t\t4*width/10,\n \"Clinical Trials\": 6*width/10,\n \"Grants\": \t\t\t8*width/10\n };\n\n // Used when setting up force and\n // moving around nodes\n var damper = 0.102;\n\n // These will be set in create_nodes and create_vis\n var svg = null;\n var bubbles = null;\n var nodes = [];\n\n // Charge function that is called for each node.\n // Charge is proportional to the diameter of the\n // circle (which is stored in the radius attribute\n // of the circle's associated data.\n // This is done to allow for accurate collision\n // detection with nodes of different sizes.\n // Charge is negative because we want nodes to repel.\n // Dividing by 8 scales down the charge to be\n // appropriate for the visualization dimensions.\n function charge(d) {\n return -Math.pow(d.radius, 2.0) / 8;\n }\n\n // Here we create a force layout and\n // configure it to use the charge function\n // from above. This also sets some contants\n // to specify how the force layout should behave.\n // More configuration is done below.\n var force = d3.layout.force()\n .size([width, height])\n .charge(charge)\n .gravity(-0.01)\n .friction(0.9);\n\n\n // Nice looking colors - no reason to buck the trend\n var fillColor = d3.scale.ordinal()\n .domain(['low', 'medium', 'high'])\n .range(['#d84b2a', '#beccae', '#7aa25c']);\n\n // Nice looking colors - no reason to buck the trend\n var fillColor2 = d3.scale.linear()\n .domain([0,3,6,9,12,15,18,21,24])\n .range([\n\"#b2182b\",\n\"#d6604d\",\n\"#f4a582\",\n\"#fddbc7\",\n\"#f7f7f7\",\n\"#d1e5f0\",\n\"#92c5de\",\n\"#4393c3\",\n\"#2166ac\"\n]);\n\n // Sizes bubbles based on their area instead of raw radius\n var radiusScale = d3.scale.pow()\n .exponent(0.5)\n .range([2,15]);\n\n /*\n * This data manipulation function takes the raw data from\n * the CSV file and converts it into an array of node objects.\n * Each node will store data and visualization values to visualize\n * a bubble.\n *\n * rawData is expected to be an array of data objects, read in from\n * one of d3's loading functions like d3.csv.\n *\n * This function returns the new node array, with a node in that\n * array for each element in the rawData input.\n */\n function createNodes(rawData) {\n // Use map() to convert raw data into node data.\n // Checkout http://learnjsdata.com/ for more on\n // working with data.\n console.log(\"in create nodes\");\n\t console.log(rawData);\n\t var id = 0;\n var myNodes = rawData.map(function (d) {\n console.log(\"data \"+d.name+\";\"+d.number+\";\"+d.iq+\";\"+d.dtype);\n return {\n id: d.id,\n radius: radiusScale(+d.number),\n value: d.number,\n name: d.name,\n nameID: d.nameID,\n org: d.name,\n// group: d.group,\n group: d.dtype,\n topic: d.iq,\n dtype: d.dtype,\n\n x: Math.random() * 900,\n y: Math.random() * 800\n };\n });\n\n // sort them to prevent occlusion of smaller nodes.\n myNodes.sort(function (a, b) { return b.value - a.value; });\n\n return myNodes;\n }\n\n /*\n * Main entry point to the bubble chart. This function is returned\n * by the parent closure. It prepares the rawData for visualization\n * and adds an svg element to the provided selector and starts the\n * visualization creation process.\n *\n * selector is expected to be a DOM element or CSS selector that\n * points to the parent element of the bubble chart. Inside this\n * element, the code will add the SVG continer for the visualization.\n *\n * rawData is expected to be an array of data objects as provided by\n * a d3 loading function like d3.csv.\n */\n var chart = function chart(selector, rawData) {\n console.log(\"in chart\");\n // Use the max total_amount in the data as the max in the scale's domain\n // note we have to ensure the total_amount is a number by converting it\n // with `+`.\n var maxAmount = d3.max(rawData, function (d) { return +d.number; });\n radiusScale.domain([0, maxAmount]);\n\n nodes = createNodes(rawData);\n // Set the force's nodes to our newly created nodes array.\n force.nodes(nodes);\n\n // Create a SVG element inside the provided selector\n // with desired size.\n svg = d3.select(selector)\n .append('svg')\n .attr('width', width)\n .attr('height', height);\n\n // Bind nodes data to what will become DOM elements to represent them.\n bubbles = svg.selectAll('.bubble')\n .data(nodes, function (d) { return d.id; });\n\n // Create new circle elements each with class `bubble`.\n // There will be one circle.bubble for each object in the nodes array.\n // Initially, their radius (r attribute) will be 0.\n bubbles.enter().append('circle')\n .classed('bubble', true)\n .attr('r', 0)\n .attr('fill', function (d) { return fillColor2(d.nameID); })\n .attr('stroke', function (d) { return d3.rgb(fillColor2(d.nameID)).darker(); })\n .attr('stroke-width', 2)\n .on('mouseover', showDetail)\n .on('mouseout', hideDetail);\n\n // Fancy transition to make bubbles appear, ending with the\n // correct radius\n bubbles.transition()\n .duration(2000)\n .attr('r', function (d) { return d.radius; });\n\n // Set initial layout to single group.\n groupBubbles();\n };\n\n /*\n * Sets visualization in \"single group mode\".\n * The topic labels are hidden and the force layout\n * tick function is set to move all nodes to the\n * center of the visualization.\n */\n function groupBubbles() {\n hideTopics();\n hideDtypes();\n\n force.on('tick', function (e) {\n bubbles.each(moveToCenter(e.alpha))\n .attr('cx', function (d) { return d.x; })\n .attr('cy', function (d) { return d.y; });\n });\n\n force.start();\n }\n\n /*\n * Helper function for \"single group mode\".\n * Returns a function that takes the data for a\n * single node and adjusts the position values\n * of that node to move it toward the center of\n * the visualization.\n *\n * Positioning is adjusted by the force layout's\n * alpha parameter which gets smaller and smaller as\n * the force layout runs. This makes the impact of\n * this moving get reduced as each node gets closer to\n * its destination, and so allows other forces like the\n * node's charge force to also impact final location.\n */\n function moveToCenter(alpha) {\n return function (d) {\n d.x = d.x + (center.x - d.x) * damper * alpha;\n d.y = d.y + (center.y - d.y) * damper * alpha;\n };\n }\n\n /*\n * Sets visualization in \"split by topic mode\".\n * The topic labels are shown and the force layout\n * tick function is set to move nodes to the\n * topicCenter of their data's topic.\n */\n function splitBubbles() {\n hideDtypes();\n showTopics();\n\n force.on('tick', function (e) {\n bubbles.each(moveToTopics(e.alpha))\n .attr('cx', function (d) { return d.x; })\n .attr('cy', function (d) { return d.y; });\n });\n\n force.start();\n }\n\n /*\n * Sets visualization in \"split by topic mode\".\n * The topic labels are shown and the force layout\n * tick function is set to move nodes to the\n * topicCenter of their data's topic.\n */\n function splitBubblesDtype() {\n hideTopics();\n showDtypes();\n\n force.on('tick', function (e) {\n bubbles.each(moveToDtypes(e.alpha))\n .attr('cx', function (d) { return d.x; })\n .attr('cy', function (d) { return d.y; });\n });\n\n force.start();\n }\n\n /*\n * Helper function for \"split by topic mode\".\n * Returns a function that takes the data for a\n * single node and adjusts the position values\n * of that node to move it the topic center for that\n * node.\n *\n * Positioning is adjusted by the force layout's\n * alpha parameter which gets smaller and smaller as\n * the force layout runs. This makes the impact of\n * this moving get reduced as each node gets closer to\n * its destination, and so allows other forces like the\n * node's charge force to also impact final location.\n */\n function moveToTopics(alpha) {\n return function (d) {\n var target = topicCenters[d.topic];\n d.x = d.x + (target.x - d.x) * damper * alpha * 1.1;\n d.y = d.y + (target.y - d.y) * damper * alpha * 1.1;\n };\n }\n\n /*\n * Helper function for \"split by year mode\".\n * Returns a function that takes the data for a\n * single node and adjusts the position values\n * of that node to move it the year center for that\n * node.\n *\n * Positioning is adjusted by the force layout's\n * alpha parameter which gets smaller and smaller as\n * the force layout runs. This makes the impact of\n * this moving get reduced as each node gets closer to\n * its destination, and so allows other forces like the\n * node's charge force to also impact final location.\n */\n function moveToDtypes(alpha) {\n return function (d) {\n\t //console.log(d);\n var target = dtypeCenters[d.dtype];\n\t\t//console.log(target);\n d.x = d.x + (target.x - d.x) * damper * alpha * 1.1;\n d.y = d.y + (target.y - d.y) * damper * alpha * 1.1;\n };\n }\n\n /*\n * Hides Year title displays.\n */\n function hideTopics() {\n svg.selectAll('.topic').remove();\n }\n\n /*\n * Shows topic title displays.\n */\n function showTopics() {\n // Another way to do this would be to create\n // the topic texts once and then just hide them.\n var topicsData = d3.keys(topicsTitleX);\n var topics = svg.selectAll('.topic')\n .data(topicsData);\n\n topics.enter().append('text')\n .attr('class', 'topic')\n .attr('x', function (d) { return topicsTitleX[d]; })\n .attr('y', 40)\n .attr('text-anchor', 'middle')\n .text(function (d) { return d; });\n }\n /*\n * Hides Year title displays.\n */\n function hideDtypes() {\n svg.selectAll('.dtype').remove();\n }\n /*\n * Shows Year title displays.\n */\n function showDtypes() {\n // Another way to do this would be to create\n // the year texts once and then just hide them.\n var dtypesData = d3.keys(dtypesTitleX);\n var dtypes = svg.selectAll('.dtype')\n .data(dtypesData);\n\n dtypes.enter().append('text')\n .attr('class', 'dtype')\n .attr('x', function (d) { return dtypesTitleX[d]; })\n .attr('y', 40)\n .attr('text-anchor', 'middle')\n .text(function (d) { return d; });\n }\n\n\n /*\n * Function called on mouseover to display the\n * details of a bubble in the tooltip.\n */\n function showDetail(d) {\n // change outline to indicate hover state.\n d3.select(this).attr('stroke', 'black');\n\n var content = '<span class=\"value\">' +\n d.name +\n '</span><br/>' +\n '<span class=\"name\">Dtype: </span><span class=\"value\">' +\n addCommas(d.dtype) +\n '</span><br/>' +\n '<span class=\"name\">topic: </span><span class=\"value\">' +\n d.topic +\n '</span><br/>' +\n '<span class=\"name\">Number: </span><span class=\"value\">' +\n d.value +\n '</span>';\n tooltip.showTooltip(content, d3.event);\n }\n\n /*\n * Hides tooltip\n */\n function hideDetail(d) {\n // reset outline\n d3.select(this)\n .attr('stroke', d3.rgb(fillColor2(d.group)).darker());\n\n tooltip.hideTooltip();\n }\n\n /*\n * Externally accessible function (this is attached to the\n * returned chart function). Allows the visualization to toggle\n * between \"single group\" and \"split by topic\" modes.\n *\n * displayName is expected to be a string and either 'topic' or 'all'.\n */\n chart.toggleDisplay = function (displayName) {\n if (displayName === 'topic') {\n splitBubbles();\n } else if (displayName === 'dtype') {\n splitBubblesDtype();\n } else {\n groupBubbles();\n }\n };\n\n\n // return the chart function from closure.\n return chart;\n}", "function initTooltip() {\n if (!tooltip) {\n var body;\n if (chartContainer) {\n body = chartContainer;\n } else {\n body = document.body;\n }\n //Create new tooltip div if it doesn't exist on DOM.\n tooltip = d3.select(body).append(\"div\")\n .attr(\"class\", \"nvtooltip \" + (classes ? classes : \"xy-tooltip\"))\n .attr(\"id\", id);\n tooltip.style(\"top\", 0).style(\"left\", 0);\n tooltip.style('opacity', 0);\n tooltip.selectAll(\"div, table, td, tr\").classed(nvPointerEventsClass, true);\n tooltip.classed(nvPointerEventsClass, true);\n tooltipElem = tooltip.node();\n }\n }", "getHandles() {\n const attrs = this.state.attributes;\n const { x1, y1, x2, y2 } = attrs;\n return [\n {\n type: \"line\",\n axis: \"x\",\n actions: [{ type: \"attribute\", attribute: \"x1\" }],\n value: x1,\n span: [y1, y2]\n },\n {\n type: \"line\",\n axis: \"x\",\n actions: [{ type: \"attribute\", attribute: \"x2\" }],\n value: x2,\n span: [y1, y2]\n },\n {\n type: \"line\",\n axis: \"y\",\n actions: [{ type: \"attribute\", attribute: \"y1\" }],\n value: y1,\n span: [x1, x2]\n },\n {\n type: \"line\",\n axis: \"y\",\n actions: [{ type: \"attribute\", attribute: \"y2\" }],\n value: y2,\n span: [x1, x2]\n },\n {\n type: \"point\",\n x: x1,\n y: y1,\n actions: [\n { type: \"attribute\", source: \"x\", attribute: \"x1\" },\n { type: \"attribute\", source: \"y\", attribute: \"y1\" }\n ]\n },\n {\n type: \"point\",\n x: x1,\n y: y2,\n actions: [\n { type: \"attribute\", source: \"x\", attribute: \"x1\" },\n { type: \"attribute\", source: \"y\", attribute: \"y2\" }\n ]\n },\n {\n type: \"point\",\n x: x2,\n y: y1,\n actions: [\n { type: \"attribute\", source: \"x\", attribute: \"x2\" },\n { type: \"attribute\", source: \"y\", attribute: \"y1\" }\n ]\n },\n {\n type: \"point\",\n x: x2,\n y: y2,\n actions: [\n { type: \"attribute\", source: \"x\", attribute: \"x2\" },\n { type: \"attribute\", source: \"y\", attribute: \"y2\" }\n ]\n }\n ];\n }", "function recalculatePositions() {\n\t\t// Set node positions\n\t\tnodeElements.attr(\"transform\", function (node) {\n\t\t\treturn \"translate(\" + node.x + \",\" + node.y + \")\";\n\t\t});\n\n\t\t// Set link paths and calculate additional informations\n\t\tlinkPathElements.attr(\"d\", function (l) {\n\t\t\tif (l.domain() === l.range()) {\n\t\t\t\treturn webvowl.util.math().calculateLoopPath(l);\n\t\t\t}\n\n\t\t\t// Calculate these every time to get nicer curved paths\n\t\t\tvar pathStart = webvowl.util.math().calculateIntersection(l.range(), l.domain(), 1),\n\t\t\t\tpathEnd = webvowl.util.math().calculateIntersection(l.domain(), l.range(), 1),\n\t\t\t\tlinkDistance = getVisibleLinkDistance(l),\n\t\t\t\tcurvePoint = webvowl.util.math().calculateCurvePoint(pathStart, pathEnd, l,\n\t\t\t\t\tlinkDistance / options.defaultLinkDistance());\n\n\t\t\tl.curvePoint(curvePoint);\n\n\t\t\treturn curveFunction([webvowl.util.math().calculateIntersection(l.curvePoint(), l.domain(), 1),\n\t\t\t\tcurvePoint, webvowl.util.math().calculateIntersection(l.curvePoint(), l.range(), 1)]);\n\t\t});\n\n\t\t// Set label group positions\n\t\tlabelGroupElements.attr(\"transform\", function (link) {\n\t\t\tvar posX = link.curvePoint().x,\n\t\t\t\tposY = link.curvePoint().y;\n\n\t\t\treturn \"translate(\" + posX + \",\" + posY + \")\";\n\t\t});\n\n\n\t\t// Set cardinality positions\n\t\tcardinalityElements.attr(\"transform\", function (p) {\n\t\t\tvar curve = p.link().curvePoint(),\n\t\t\t\tpos = webvowl.util.math().calculateIntersection(curve, p.range(), CARDINALITY_HDISTANCE),\n\t\t\t\tnormalV = webvowl.util.math().calculateNormalVector(curve, p.domain(), CARDINALITY_VDISTANCE);\n\n\t\t\treturn \"translate(\" + (pos.x + normalV.x) + \",\" + (pos.y + normalV.y) + \")\";\n\t\t});\n\t}", "function collect(ecModel, api) {\n\t var result = {\n\t /**\n\t * key: makeKey(axis.model)\n\t * value: {\n\t * axis,\n\t * coordSys,\n\t * axisPointerModel,\n\t * triggerTooltip,\n\t * involveSeries,\n\t * snap,\n\t * seriesModels,\n\t * seriesDataCount\n\t * }\n\t */\n\t axesInfo: {},\n\t seriesInvolved: false,\n\t\n\t /**\n\t * key: makeKey(coordSys.model)\n\t * value: Object: key makeKey(axis.model), value: axisInfo\n\t */\n\t coordSysAxesInfo: {},\n\t coordSysMap: {}\n\t };\n\t collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\t\n\t result.seriesInvolved && collectSeriesInfo(result, ecModel);\n\t return result;\n\t }", "function updateToolTip(chosenXAxis, chosenYAxis, circlesGroup) {\n let xLabel, yLabel;\n // poverty\n if (chosenXAxis === \"poverty\") {\n xLabel = \"Poverty:\";\n }\n // age\n else {\n xLabel = \"Age:\";\n }\n // Y label\n // healthcare\n if (chosenYAxis === \"healthcare\") {\n yLabel = \"No Healthcare:\";\n }\n // smoking\n else {\n yLabel = \"Smokers:\";\n }\n\n // Step 1: Append tooltip div\n var toolTip = d3.select(\"body\").append(\"div\").classed(\"tooltip\", true);\n\n // Step 2: Create \"mouseover\" event listener to display tooltip\n circlesGroup\n .on(\"mouseover\", function(d) {\n toolTip\n .style(\"display\", \"d3Style\")\n .html(function () {\n console.log(\"mouseover\",d)\n return `${\n d\n }<strong>${xLabel} ${styleX([chosenXAxis])}<strong>${yLabel} ${[chosenYAxis]}`\n })\n .style(\"left\", d3.event.pageX + \"px\")\n .style(\"top\", d3.event.pageY + \"px\");\n })\n \n // Step 3: Create \"mouseout\" event listener to hide tooltip\n .on(\"mouseout\", function () {\n toolTip.style(\"display\", \"d3Style\");\n });\n\n return circlesGroup;\n}", "function initTooltip() {\n\t if (!tooltip || !tooltip.node()) {\n\t // Create new tooltip div if it doesn't exist on DOM.\n\n\t var data = [1];\n\t tooltip = d3.select(document.body).select('#'+id).data(data);\n\n\t tooltip.enter().append('div')\n\t .attr(\"class\", \"nvtooltip \" + (classes ? classes : \"xy-tooltip\"))\n\t .attr(\"id\", id)\n\t .style(\"top\", 0).style(\"left\", 0)\n\t .style('opacity', 0)\n\t .style('position', 'fixed')\n\t .selectAll(\"div, table, td, tr\").classed(nvPointerEventsClass, true)\n\t .classed(nvPointerEventsClass, true);\n\n\t tooltip.exit().remove()\n\t }\n\t }", "function TooltipUpdate(chosenXAxis, chosenYAxis, circlesGroup) {\n\n // ----- X Axis\n //----- Poverty\n if (chosenXAxis === \"poverty\") {\n var xLabel = \"Poverty:\";\n }\n //----- Income USD\n else if (chosenXAxis === \"income\") {\n var xLabel = \"Median Income: $\";\n }\n //----- Obesity\n else if (chosenXAxis === \"obesity\") {\n var xLabel = \"Obesity (%): \";\n }\n //----- Smokes\n else if (chosenXAxis === \"smokes\") {\n var xLabel = \"Smokes (%): \";\n }\n //----- Healthcare\n else if (chosenXAxis === \"healthcare\") {\n var xLabel = \"No Healthcare (%)\";\n }\n //------ Age (Average)\n else {\n var xLabel = \"Age:\";\n }\n\n // ----- Y Axis\n //----- Poverty\n if (chosenYAxis === \"poverty\") {\n var yLabel = \"Poverty:\";\n }\n //----- Icome USD\n else if (chosenYAxis === \"income\") {\n var yLabel = \"Median Income: $\";\n }\n //----- Obesity\n else if (chosenYAxis === \"obesity\") {\n var yLabel = \"Obesity (%): \";\n }\n //----- Smokes\n else if (chosenYAxis === \"smokes\") {\n var yLabel = \"Smokes (%): \";\n }\n //----- Healthcare\n else if (chosenYAxis === \"healthcare\") {\n var yLabel = \"No Healthcare (%)\";\n }\n //------ Age (Average)\n else {\n var yLabel = \"Age:\";\n }\n\n //Tooltip\n var toolTip = d3.tip()\n .attr(\"class\", \"d3-tip\")\n .offset([-8, 0])\n .html(function(d) {\n return (`${d.state}<br>${xLabel} ${styleX(d[chosenXAxis], chosenXAxis)}<br>${yLabel} ${d[chosenYAxis]}`);\n });\n\n circlesGroup.call(toolTip);\n\n //Mouse Over event\n circlesGroup.on(\"mouseover\", toolTip.show)\n .on(\"mouseout\", toolTip.hide);\n\n return circlesGroup;\n}", "function _setTooltipPosition() {\n const targetProps = {\n height: $element.outerHeight(),\n left: $element.offset().left,\n top: $element.offset().top,\n width: $element.outerWidth(),\n };\n const tooltipPosition = angular.isDefined(lx.position) ? lx.position : 'top';\n const tooltipProps = {};\n\n _tooltip.addClass(`${CSS_PREFIX}-tooltip--position-${tooltipPosition}`).appendTo('body');\n\n /* eslint-disable no-magic-numbers */\n if (tooltipPosition === 'top') {\n tooltipProps.x = targetProps.left - _tooltip.outerWidth() / 2 + targetProps.width / 2;\n tooltipProps.y = targetProps.top - _tooltip.outerHeight() - _OFFSET;\n } else if (tooltipPosition === 'bottom') {\n tooltipProps.x = targetProps.left - _tooltip.outerWidth() / 2 + targetProps.width / 2;\n tooltipProps.y = targetProps.top + targetProps.height + _OFFSET;\n } else if (tooltipPosition === 'left') {\n tooltipProps.x = targetProps.left - _tooltip.outerWidth() - _OFFSET;\n tooltipProps.y = targetProps.top + targetProps.height / 2 - _tooltip.outerHeight() / 2;\n } else if (tooltipPosition === 'right') {\n tooltipProps.x = targetProps.left + targetProps.width + _OFFSET;\n tooltipProps.y = targetProps.top + targetProps.height / 2 - _tooltip.outerHeight() / 2;\n }\n\n _tooltip.css({\n transform: `translate3d(${tooltipProps.x}px, ${tooltipProps.y}px, 0px)`,\n });\n /* eslint-enable no-magic-numbers */\n }", "numericalMapping(axis) {\n const solver = this.solver;\n const state = this.plotSegment.state;\n const props = this.plotSegment.object.properties;\n const attrs = state.attributes;\n const dataIndices = state.dataRowIndices;\n const table = this.getTableContext();\n switch (axis) {\n case \"x\":\n {\n const data = props.xData;\n if (data.type == \"numerical\") {\n const [x1, x2] = solver.attrs(attrs, [this.x1Name, this.x2Name]);\n const expr = this.getExpression(data.expression);\n const interp = axis_1.getNumericalInterpolate(data);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getNumberValue(rowContext);\n const t = interp(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (1 - t) * props.marginX1 - t * props.marginX2, [[1 - t, x1], [t, x2]], [[1, solver.attr(markState.attributes, \"x\")]]);\n }\n }\n if (data.type == \"categorical\") {\n const [x1, x2, gapX] = solver.attrs(attrs, [\n this.x1Name,\n this.x2Name,\n \"gapX\"\n ]);\n const expr = this.getExpression(data.expression);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getStringValue(rowContext);\n this.gapX(data.categories.length, data.gapRatio);\n const i = data.categories.indexOf(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (data.categories.length - i - 0.5) * props.marginX1 -\n (i + 0.5) * props.marginX2, [\n [i + 0.5, x2],\n [data.categories.length - i - 0.5, x1],\n [-data.categories.length / 2 + i + 0.5, gapX]\n ], [\n [\n data.categories.length,\n solver.attr(markState.attributes, \"x\")\n ]\n ]);\n }\n }\n // solver.addEquals(ConstraintWeight.HARD, x, x1);\n }\n break;\n case \"y\": {\n const data = props.yData;\n if (data.type == \"numerical\") {\n const [y1, y2] = solver.attrs(attrs, [this.y1Name, this.y2Name]);\n const expr = this.getExpression(data.expression);\n const interp = axis_1.getNumericalInterpolate(data);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getNumberValue(rowContext);\n const t = interp(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (t - 1) * props.marginY2 + t * props.marginY1, [[1 - t, y1], [t, y2]], [[1, solver.attr(markState.attributes, \"y\")]]);\n }\n }\n if (data.type == \"categorical\") {\n const [y1, y2, gapY] = solver.attrs(attrs, [\n this.y1Name,\n this.y2Name,\n \"gapY\"\n ]);\n const expr = this.getExpression(data.expression);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getStringValue(rowContext);\n this.gapY(data.categories.length, data.gapRatio);\n const i = data.categories.indexOf(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (data.categories.length - i - 0.5) * props.marginY1 -\n (i + 0.5) * props.marginY2, [\n [i + 0.5, y2],\n [data.categories.length - i - 0.5, y1],\n [-data.categories.length / 2 + i + 0.5, gapY]\n ], [[data.categories.length, solver.attr(markState.attributes, \"y\")]]);\n }\n }\n // solver.addEquals(ConstraintWeight.HARD, y, y2);\n }\n }\n }", "_initToolbarPositioning() {\n __querySelectorLive(`[s-node][s-specs]`, ($node) => {\n // get the parent element that is actually the\n // element to move\n const $elm = $node.parentNode;\n $elm.addEventListener('pointerover', (e) => {\n var _a;\n // add hover class\n $elm.classList.add('hover');\n e.stopPropagation();\n const element = this.getElementFromDomNode(e.currentTarget);\n // do nothing more if already activated\n if (element.uid === ((_a = this._preselectedNode) === null || _a === void 0 ? void 0 : _a.uid)) {\n return;\n }\n // position toolbar\n this._setToolbarTitleAndPosition($elm, __upperFirst(element.specs.split('.').pop()));\n // set the \"pre\" activate element\n this._preselectedNode = element;\n });\n $elm.addEventListener('pointerout', (e) => {\n // remove hover class\n $elm.classList.remove('hover');\n });\n }, {\n rootNode: this._$websiteDocument.body,\n });\n }", "function updateToolTip(chosenXAxis, chosenYAxis, circlesGroup) {\n let xLabel = ''\n let yLabel = ''\n // console.log(chosenXAxis);\n switch (chosenXAxis) {\n\n case \"poverty\":\n xLabel = \"Percentage in Poverty\";\n break;\n case \"income\":\n xLabel = \"Median Income\";\n break;\n case \"age\":\n xLabel = \"Median Age\";\n break;\n\n }\n switch (chosenYAxis) {\n case \"obesity\":\n yLabel = \"Percentage Obese\";\n break;\n case \"healthcare\":\n yLabel = \"Percentage that Lacks Healthcare\";\n break;\n case \"smokes\":\n yLabel = \"Percentage of Smokers\";\n break;\n }\n // console.log(xLabel);\n\n let toolTip = d3.tip()\n .attr(\"class\", \"tooltip\")\n .offset([85, -90])\n .html(function(d) {\n return (`${d.state}<br>${yLabel}: ${d[chosenYAxis]}<br>${xLabel}: ${d[chosenXAxis]}`);\n });\n\n circlesGroup.call(toolTip);\n\n circlesGroup.on(\"mouseover\", (d, i, n) => toolTip.show(d, n[i]));\n circlesGroup.on(\"mouseout\", (d, i, n) => toolTip.hide(d, n[i]));\n\n return circlesGroup;\n}", "makeTooltip ( ) {\n this.tip = d3.tip( )\n .attr( 'id', 'tooltip' )\n .html( d => d );\n this.canvas.call( this.tip );\n \n return this;\n }", "function updateToolTip(chosenXAxis,chosenYAxis, circlesGroup) {\n var toolTip = d3.tip()\n .attr(\"class\", \"d3-tip\")\n .offset([80, -60])\n .html(function(d) {\n console.log(d);\n console.log(d[chosenXAxis],d[chosenYAxis]);\n return (`${d[state]}<br>${chosenXAxis}:${d[chosenXAxis]}<br>${chosenYAxis}:${d[chosenYAxis]}`);\n });\n \n console.log(chosenXAxis,chosenYAxis);\n circlesGroup.call(toolTip);\n\n circlesGroup.on(\"mouseover\", function(data) {\n toolTip.show(data);\n })\n // onmouseout event\n .on(\"mouseout\", function(data, index) {\n toolTip.hide(data);\n });\n \n return circlesGroup;\n}", "function wrapPointerGetCoordinates(proceed, e) {\n var chart = this.chart;\n var ret = {\n xAxis: [],\n yAxis: []\n };\n if (chart.polar) {\n chart.axes.forEach(function (axis) {\n // Skip colorAxis\n if (axis.coll === 'colorAxis') {\n return;\n }\n var isXAxis = axis.isXAxis, center = axis.center, x = e.chartX - center[0] - chart.plotLeft, y = e.chartY - center[1] - chart.plotTop;\n ret[isXAxis ? 'xAxis' : 'yAxis'].push({\n axis: axis,\n value: axis.translate(isXAxis ?\n Math.PI - Math.atan2(x, y) : // angle\n // distance from center\n Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)), true)\n });\n });\n }\n else {\n ret = proceed.call(this, e);\n }\n return ret;\n}", "function axisProvider(){\n\t/*\n\t * setAxisContainer(svg);\n\t * setXScale(makeLinearScale([0,width],[0,d3.max(data, function(d) { return d.x; })]));\n\t * setYScale(makeLinearScale([height,0],[0,d3.max(data, function(d) { return d.y; })]));\n\t * draw()\n\t * */\n\tvar axisProviderImpl = {\n\t\t\theight \t: 0,\n\t\t\twidth\t: 0,\n\t\t\tsvg\t\t: null,\n\t\t\txScale\t: null,\n\t\t\tyScale\t: null,\n\t\t\txAxis\t: null,\n\t\t\txGrid\t: null,\n\t\t\tyAxis\t: null,\n\t\t\tyGrid\t: null,\n\t\t\tdrawXGrid: true,\n\t\t\tdrawYGrid: true,\n\t\t\tdrawGrid: true,\n\t\t\txScaleOrient : \"bottom\",\n\t\t\tyScaleOrient : \"left\",\n\t\t\txTitle:\"\",\n\t\t\tyTitle:\"\",\n\t\t\ttitle:\"\",\n\t\t\tticks\t: 10,\n\t\t\tgridTicks : 10,\n\t\t\ttickFormat:\",r\",\n\t\t\tsetAxisContainer: function(svg){\n\t\t\t\tif(!isDefined(svg) || isNull(svg)){\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t\tthis.height = svg.attr(\"height\");\n\t\t\t\tthis.width = svg.attr(\"width\");\n\t\t\t\tthis.svg\t= svg;\n\t\t\t},\n\t\t\tmakeLinearScale : function(range,domain){\n\t\t\t\treturn d3.scale.linear().range(range).domain(domain).nice();\n\t\t\t},\n\t\t\tsetXScale\t: function(xScale){\n\t\t\t\tthis.xScale = xScale;\n\t\t\t\tthis.xAxis = d3.svg.axis().scale(xScale).orient(this.xScaleOrient).ticks(this.ticks, this.tickFormat);\n\t\t\t this.xGrid = d3.svg.axis().scale(xScale).orient(this.xScaleOrient).tickSize(-this.height, 0, 0).ticks(this.gridTicks).tickFormat(\"\");\n\t\t\t},\n\t\t\tsetYScale\t:function(yScale){\n\t\t\t\tthis.yScale = yScale;\n\t\t\t\tthis.yAxis = d3.svg.axis().scale(yScale).orient(this.yScaleOrient).ticks(this.ticks, this.tickFormat);\n\t\t\t this.yGrid = d3.svg.axis().scale(yScale).orient(this.yScaleOrient).tickSize(-this.width, 0, 0).ticks(this.gridTicks).tickFormat(\"\");\n\t\t\t},\n\t\t\tdraw\t: function(){\n\t\t\t\tconsole.log(\"Drawing Axis.\");\n\t\t\t\tthis.clear();\n\t\t\t\tif(this.drawGrid && this.drawYGrid){\n\t\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\", \"grid\").call(this.yGrid);\n\t\t\t\t}\n\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\",\"axis\").call(this.yAxis);\n\t\t\t\t//Y axis title\n\t\t\t\tthis.svg.append(\"g\")\n\t\t\t\t.attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .attr(\"transform\", \"rotate(-90)\")\n\t\t\t .text(this.yTitle)\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .attr(\"x\",-((this.height/2)))\n\t\t\t .attr(\"y\",-30);\n\t\t\t\t\n\t\t\t\tif(this.drawGrid && this.drawXGrid){\n\t\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\", \"grid\").attr(\"transform\", \"translate(0,\" + this.height + \")\").call(this.xGrid);\n\t\t\t\t}\n\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\",\"axis\").attr(\"transform\", \"translate(0,\" + this.height + \")\").call(this.xAxis);\n\t\t\t\t//X axis title\n\t\t\t this.svg.append(\"g\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"transform\", \"translate(0,\" + this.height + \")\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .text(this.xTitle)\n\t\t\t .attr(\"x\",(this.width/2))\n\t\t\t .attr(\"y\",30);\n\t\t\t //chart Title\n\t\t\t this.svg.append(\"g\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"class\",\"chartTitle\")\n\t\t\t .text(this.title)\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .attr(\"x\",(this.width/2))\n\t\t\t .attr(\"y\",0);\n\t\t\t},\n\t\t\tclear : function(){\n\t\t\t\tthis.svg.selectAll(\".grid\").remove();\n\t\t\t\tthis.svg.selectAll(\".axis\").remove();\n\t\t\t\tthis.svg.selectAll(\".axisLabel\").remove();\n\t\t\t}\n\t};\n\t\n\tthis.$get = function(){\n\t\treturn axisProviderImpl;\n\t};\n}", "function updateToolTip(chosenXAxis, chosenYAxis, chosenCircles) {\n\n// Set up x axis\n if (chosenXAxis === \"poverty\") {\n let xlabel = \"Poverty: \";\n }\n else if (chosenXAxis === \"income\") {\n let xlabel = \"Median Income: \"\n }\n else {\n let xlabel = \"Age: \"\n }\n \n// Set up y axis\n if (chosenYAxis === \"healthcare\") {\n let ylabel = \"Healthcare: \";\n }\n else if (chosenYAxis === \"smokes\") {\n let ylabel = \"Smokers: \"\n }\n else {\n let ylabel = \"Obesity: \"\n }\n// Check .tip() error? This worked in class activity?\n let toolTip = d3.tip()\n .attr(\"class\", \"tooltip\")\n .style(\"background\", \"black\")\n .style(\"color\", \"white\")\n .offset([120, -60])\n .html(function(d) {\n if (chosenXAxis === \"age\") {\n// Format yAxis tooltip labels as percentages\n// Display age as integer\n return (`${d.state}<hr>${xlabel} ${d[chosenXAxis]}<br>${ylabel}${d[chosenYAxis]}%`);\n } else if (chosenXAxis !== \"poverty\" && chosenXAxis !== \"age\") {\n return (`${d.state}<hr>${xlabel}$${d[chosenXAxis]}<br>${ylabel}${d[chosenYAxis]}%`);\n } else {\n return (`${d.state}<hr>${xlabel}${d[chosenXAxis]}%<br>${ylabel}${d[chosenYAxis]}%`);\n } \n });\n\n// Call on tooltip to perform follwing functions\n chosenCircles.call(toolTip);\n// Mouseon event\n chosenCircles.on(\"mouseover\", function(data) {\n toolTip.show(data, this);\n })\n\n// Mouseout event\n .on(\"mouseout\", function(data,index) {\n toolTip\n .hide(data)\n });\n return chosenCircles;\n }", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}" ]
[ "0.5693873", "0.5636385", "0.5636385", "0.5636385", "0.5636385", "0.5636385", "0.5636385", "0.5636385", "0.5636385", "0.56148744", "0.55848104", "0.55848104", "0.5581302", "0.5558696", "0.5493384", "0.5264039", "0.507943", "0.49443126", "0.49220106", "0.49116898", "0.48798317", "0.48484772", "0.4827196", "0.48213246", "0.48095825", "0.48003286", "0.4796459", "0.47802812", "0.47563294", "0.47531843", "0.47336313", "0.4710723", "0.47016373", "0.47016373", "0.47000188", "0.46899724", "0.46896964", "0.46862018", "0.46859935", "0.46853885", "0.468122", "0.46751446", "0.46694976", "0.46690065", "0.46430567", "0.46207744", "0.46177292", "0.45977753", "0.45489272", "0.45486256", "0.45407984", "0.45372686", "0.45356816", "0.45297462", "0.4526617", "0.45132092", "0.4499357", "0.4499357", "0.4499357", "0.4499357", "0.4493729", "0.44889888", "0.44747373", "0.44609272", "0.44438985", "0.44436267", "0.44406122", "0.443194", "0.4425691", "0.4425523", "0.44230402", "0.44230402", "0.44212425", "0.4406561", "0.4400707", "0.43911982", "0.43742052", "0.4373457", "0.43659353", "0.434704", "0.4328492", "0.43265364", "0.43221426", "0.4316971", "0.43157765", "0.4311815", "0.43095618", "0.4306028", "0.43038583", "0.43019158", "0.42954445", "0.42933792", "0.42896298", "0.42894155", "0.4286199", "0.4286199", "0.4286199", "0.4286199", "0.4286199", "0.4286199", "0.4286199" ]
0.0
-1
fromTooltip: true | false | 'cross' triggerTooltip: true | false | null
function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) { var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel); var axisPointerShow = axisPointerModel.get('show'); if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) { return; } if (triggerTooltip == null) { triggerTooltip = axisPointerModel.get('triggerTooltip'); } axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel; var snap = axisPointerModel.get('snap'); var key = makeKey(axis.model); var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority). var axisInfo = result.axesInfo[key] = { key: key, axis: axis, coordSys: coordSys, axisPointerModel: axisPointerModel, triggerTooltip: triggerTooltip, involveSeries: involveSeries, snap: snap, useHandle: isHandleTrigger(axisPointerModel), seriesModels: [] }; axesInfoInCoordSys[key] = axisInfo; result.seriesInvolved |= involveSeries; var groupIndex = getLinkGroupIndex(linksOption, axis); if (groupIndex != null) { var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = { axesInfo: {} }); linkGroup.axesInfo[key] = axisInfo; linkGroup.mapper = linksOption[groupIndex].mapper; axisInfo.linkGroup = linkGroup; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "tooltipClicked() {}", "setTooltip(valueNew){let t=e.ValueConverter.toString(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"Tooltip\")),t!==this.__tooltip&&(this.__tooltip=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"Tooltip\"}),this.__processTooltip())}", "toggleTooltips() {\n self.enableTooltips = !self.enableTooltips;\n }", "set tooltip(value) {}", "get tooltip() {}", "getTooltip(){return this.__tooltip}", "showTip(context) {\n const me = this;\n\n if (me.showTooltip) {\n me.clockTemplate = new ClockTemplate({\n scheduler: me.client\n });\n me.tip = new Tooltip({\n id: `${me.client.id}-time-range-tip`,\n cls: 'b-interaction-tooltip',\n align: 'b-t',\n autoShow: true,\n updateContentOnMouseMove: true,\n forElement: context.element,\n getHtml: () => me.getTipHtml(context.record, context.element)\n });\n }\n }", "addHighlighTooltip () {\n }", "_tooltipChanged(newValue,oldValue){if(\"\"==newValue||null==newValue){this.shadowRoot.querySelector(\"#tooltip\").setAttribute(\"aria-hidden\",\"true\")}else{this.shadowRoot.querySelector(\"#tooltip\").setAttribute(\"aria-hidden\",\"false\")}}", "showToolTip_(event) {\n this.updateToolTip_(event);\n }", "_callToolTip () {\n const toolTip = this.getToolTip();\n const svg = this.getSVG();\n\n if (toolTip) {\n svg.call(toolTip);\n\n const toolTipNode = document.getElementById('ets-tip');\n\n if (toolTipNode) {\n toolTipNode.onmouseover = () => { this._shortCircuitHide(); };\n toolTipNode.onmouseout = () => { this._hideToolTip(); };\n }\n }\n }", "set Tooltip(value) {\n this._tooltip = value;\n }", "showTip(context) {\n const me = this;\n\n if (me.showTooltip) {\n me.clockTemplate = new ClockTemplate({\n timeAxisViewModel: me.client.timeAxisViewModel\n });\n\n me.tip = new Tooltip({\n cls: 'b-interaction-tooltip',\n align: 'b-t',\n autoShow: true,\n forElement: context.element,\n getHtml: () => me.getTipHtml(context.record, context.element)\n });\n }\n }", "setupTooltipHandlers() {\n this.button.onmouseenter = () => {\n this.tooltip.showTooltip();\n };\n\n this.button.onmouseleave = () => {\n this.tooltip.hideTooltip();\n };\n }", "function enableTooltip() {\n $('[v-tooltip]').tooltip({trigger: \"hover\", 'delay': {show: 1000, hide: 100}});\n}", "function makeTip(selector, title, placement, trigger) {\n placement = placement || \"right\";\n trigger = trigger || \"focus\";\n $(selector).tooltip({\n \"placement\": placement,\n \"title\": title,\n \"trigger\": trigger,\n });\n}", "handleFocus() {\n this.setState({ tooltipOpen: true });\n }", "function showTooltipRelatedTo(el) {\n $('.tooltip-simple').hide();\n var offset = el.offset();\n var tooltip = $('.' + el.attr('tooltip-class'));\n var direction = el.attr('tooltip-direction');\n var align = el.attr('tooltip-align');\n \n if (direction === 'left') {\n tooltip.css('top', offset.top - $(window).scrollTop() + parseInt(el.css('margin-top')) +'px');\n tooltip.css('left', offset.left + parseInt(el.css('margin-left')) + (el.width()+5)+'px');\n // tooltip.fadeIn( 250 );\n }\n\n if (direction === 'right') {\n tooltip.show();\n tooltip.css('top', offset.top - $(window).scrollTop() + parseInt(el.css('margin-top')) +'px');\n tooltip.css('left', offset.left - tooltip.outerWidth() - 5 +'px');\n tooltip.hide();\n // tooltip.fadeIn( 250 );\n \n }\n\n if (direction === 'up') {\n tooltip.show();\n tooltip.css('top', offset.top - $(window).scrollTop() - tooltip.outerHeight() - 5 +'px');\n if (align === 'right') {\n tooltip.css('left', offset.left + (el.width() - tooltip.outerWidth()) + 'px');\n } else {\n tooltip.css('left', offset.left + parseInt(el.css('margin-left')) +'px');\n }\n tooltip.hide();\n // tooltip.fadeIn( 250 );\n }\n\n if (direction === 'down') {\n tooltip.show();\n tooltip.css('top', offset.top + el.height() - $(window).scrollTop() + parseInt(el.css('margin-bottom')) + 5 +'px');\n if (align === 'right') {\n tooltip.css('left', offset.left + (el.width() - tooltip.outerWidth()) + 'px');\n } else {\n tooltip.css('left', offset.left + parseInt(el.css('margin-left')) +'px');\n }\n tooltip.hide();\n }\n tooltip.fadeIn( 250 );\n return;\n }", "function doTooltip(e, msg) {\nif ( typeof Tooltip == \"undefined\" || !Tooltip.ready ) return;\nTooltip.show(e, msg);\n}", "function mouseOver() {\n tooltip\n .style(\"opacity\", 1)\n .style(\"display\",\"inherit\");\n}", "function ActivateTooltip() {\n // creates the tooltip to display the y point\n $(\"<div id='tooltip'></div>\").css({\n position: \"absolute\",\n display: \"none\",\n border: \"1px solid #fdd\",\n padding: \"2px\",\n \"background-color\": \"#fee\",\n opacity: 0.80\n }).appendTo(\"body\");\n // displays the tooltip on hover\n $(\"#placeholder\").bind(\"plothover\", function (event, pos, item) {\n if (item) {\n var x = item.datapoint[0].toFixed(2), y = item.datapoint[1].toFixed(2);\n $(\"#tooltip\").html(y)\n .css({ top: item.pageY + 5, left: item.pageX + 5 })\n .fadeIn(200);\n }\n else {\n $(\"#tooltip\").hide();\n }\n });\n }", "function MatTooltipDefaultOptions() {}", "handleTooltip(event) {\n if (this.state.showTooltip == event.currentTarget.id) {\n this.setState({\n showTooltip: '',\n eventListener: false,\n });\n trackEvent('Full Modal', `Opened Tooltip by clicking`)\n } else {\n this.setState({\n showTooltip: event.currentTarget.id,\n eventListener: true,\n });\n trackEvent('Full Modal', `Closed Tooltip by clicking on it`)\n }\n }", "function toggleAllTooltips() {\n \ttooltip_active = true; //only set to true during programmatic triggering of events\n\n \t$.each(pegList, function( index1, arr ) {\n \t\t$.each(arr, function( index2, peg ) {\n\n \t\t\t//if the tooltips are not being shown, turn them on\n \t\t\tif (!tooltip_status) {\n \t\t\t\tpeg.shape.fire('mouseenter');\n \t\t\t}\n \t\t\t//if the tooltips are being shown, turn them off\n \t\t\telse if (tooltip_status) {\n \t\t\t\tpeg.shape.fire('mouseleave');\n \t\t\t}\n \t\t\t//else - Error\n \t\t\telse {\n \t\t\t\tconsole.log('Error with toggleAllTooltips');\n \t\t\t\talert('Error with toggling tooltips - tooltip_status reached unknown state');\n \t\t\t}\n\n \t\t});\n \t});\n \ttooltip_active = false; //set back to false to prevent non-programmatic event triggers\n \ttooltip_status = (!tooltip_status) ? true : false;\n }", "_moveToolTip (element, event) {\n var div = document.getElementById(\"bcdChartToolTip\");\n if (! div)\n return;\n if (jQuery(div).is(\":visible\"))\n bcdui.widget._flyOverPositioning({event: event, htmlElement: div, positionUnderMouse: false});\n }", "initTooltip() {\n const me = this,\n {\n client\n } = me;\n\n if (me.showTooltip) {\n if (me.tip) {\n me.tip.showBy(me.getTooltipTarget());\n } else {\n me.clockTemplate = new ClockTemplate({\n scheduler: client\n });\n me.tip = new Tooltip({\n id: `${client.id}-drag-create-tip`,\n autoShow: true,\n trackMouse: false,\n updateContentOnMouseMove: true,\n getHtml: me.getTipHtml.bind(me),\n align: client.isVertical ? 't-b' : 'b100-t100',\n hideDelay: 0,\n axisLock: true // Don't want it flipping to the side where we are dragging\n\n });\n me.tip.on('innerhtmlupdate', me.updateDateIndicator, me);\n }\n }\n }", "async toggleTooltip() {\n this.actionEventHandler();\n }", "initTooltip() {\n const me = this,\n client = me.client;\n\n if (me.showTooltip) {\n if (me.tip) {\n me.tip.showBy(me.getTooltipTarget());\n } else {\n me.clockTemplate = new ClockTemplate({\n timeAxisViewModel: client.timeAxisViewModel\n });\n\n me.tip = new Tooltip({\n id: `${client.id}-drag-create-tip`,\n autoShow: true,\n trackMouse: false,\n getHtml: me.getTipHtml.bind(me),\n align: client.isVertical ? 't-b' : 'b100-t100',\n hideDelay: 0,\n axisLock: true // Don't want it flipping to the side where we are dragging\n });\n\n me.tip.on('innerhtmlupdate', me.updateDateIndicator, me);\n }\n }\n }", "toggleBonusTooltip() {\n this.setState({ shouldTooltipDisplay: !this.state.shouldTooltipDisplay })\n }", "function HideToolTip (){\ntooltip\n .style(\"opacity\",0);\n}", "function toggle_tooltip() {\n $('[data-toggle=\"tooltip\"]').tooltip(); \n}", "_addTooltips() {\n $(this.el.querySelectorAll('[title]')).tooltip({\n delay: { show: 500, hide: 0 }\n });\n }", "function enableToolTipForContactTime(){\r\n\t$('[id^=\"contactFrom\"]').tooltip({title: \"Please follow military time format from 0800 to 1800.\", animation: true,placement: \"auto\"});\r\n\t$('[id^=\"contactTo\"]').tooltip({title: \"Please follow military time format from 0800 to 1800.\", animation: true,placement: \"auto\"});\r\n}", "function tooltips ( ) {\r\n\r\n\t\t// Tooltips are added with options.tooltips in original order.\r\n\t\tvar tips = scope_Handles.map(addTooltip);\r\n\r\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\r\n\r\n\t\t\tif ( !tips[handleNumber] ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tvar formattedValue = values[handleNumber];\r\n\r\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\r\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\r\n\t\t\t}\r\n\r\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\r\n\t\t});\r\n\t}", "function mouseOver() {\n\t\ttooltip.style(\"display\", \"block\")\n\t\t\t .style(\"visibility\", \"visible\");\n\t}", "function tooltipx(event){\n\t\t$(\"[data-toggle=tooltip]\").tooltip({ \n\t\t\t//placement: 'right'\n\t\t});\n\t}", "_createToolTip () {\n const tip = d3.tip().attr('id', 'ets-tip')\n .html((d) => { return this._getTipContent(d); })\n .direction((d) => { return this._setTipDirection(d); });\n\n\n return tip;\n }", "getToolTip () {\n if (this._toolTip) {\n return this._toolTip;\n }\n }", "function displayNavMenuControlTooltip() {\n var tooltipAnchor = $(\"#leftnav-maincontent-wrapper .right-pane .menu-control\");\n\n tooltipAnchor.tooltipster({\n position: \"right\",\n trigger: \"custom\",\n minWidth: 150, \n theme: 'tooltipster-shadow', \n content: i18n.getMessage(\"nav_menu_collapse_helper\"), \n timer: 5000\n }).tooltipster('show');\n }", "function toolTip() {\n $('[data-toggle=\"tooltip\"]').tooltip();\n}", "showTooltip() {\n this.setState({ visible: true });\n }", "_events() {\n var _this = this;\n var $template = this.template;\n var isFocus = false;\n\n if (!this.options.disableHover) {\n\n this.$element\n .on('mouseenter.zf.tooltip', function(e) {\n if (!_this.isActive) {\n _this.timeout = setTimeout(function() {\n _this.show();\n }, _this.options.hoverDelay);\n }\n })\n .on('mouseleave.zf.tooltip', function(e) {\n clearTimeout(_this.timeout);\n if (!isFocus || (_this.isClick && !_this.options.clickOpen)) {\n _this.hide();\n }\n });\n }\n\n if (this.options.clickOpen) {\n this.$element.on('mousedown.zf.tooltip', function(e) {\n e.stopImmediatePropagation();\n if (_this.isClick) {\n //_this.hide();\n // _this.isClick = false;\n } else {\n _this.isClick = true;\n if ((_this.options.disableHover || !_this.$element.attr('tabindex')) && !_this.isActive) {\n _this.show();\n }\n }\n });\n } else {\n this.$element.on('mousedown.zf.tooltip', function(e) {\n e.stopImmediatePropagation();\n _this.isClick = true;\n });\n }\n\n if (!this.options.disableForTouch) {\n this.$element\n .on('tap.zf.tooltip touchend.zf.tooltip', function(e) {\n _this.isActive ? _this.hide() : _this.show();\n });\n }\n\n this.$element.on({\n // 'toggle.zf.trigger': this.toggle.bind(this),\n // 'close.zf.trigger': this.hide.bind(this)\n 'close.zf.trigger': this.hide.bind(this)\n });\n\n this.$element\n .on('focus.zf.tooltip', function(e) {\n isFocus = true;\n if (_this.isClick) {\n // If we're not showing open on clicks, we need to pretend a click-launched focus isn't\n // a real focus, otherwise on hover and come back we get bad behavior\n if(!_this.options.clickOpen) { isFocus = false; }\n return false;\n } else {\n _this.show();\n }\n })\n\n .on('focusout.zf.tooltip', function(e) {\n isFocus = false;\n _this.isClick = false;\n _this.hide();\n })\n\n .on('resizeme.zf.trigger', function() {\n if (_this.isActive) {\n _this._setPosition();\n }\n });\n }", "tooltipHide(vis) {\n moveTimeSliderLayerUp();\n d3.select('#mapchart-tooltip').style('display', 'none');\n }", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function bindTooltip(){\n bindTooltipSkin(\".b-tooltip, .b-panel-icons-item a,.b-tool, .b-image-nav, .b-help, .b-title\",\"qtip-light\");\n }", "get currentTooltip() {\n return this._defaultOrToggled(\n this.tooltip,\n this.toggledTooltip,\n this.isToggled\n );\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n\t var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n\n\t var axisPointerShow = axisPointerModel.get('show');\n\t if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n\t return;\n\t }\n\n\t if (triggerTooltip == null) {\n\t triggerTooltip = axisPointerModel.get('triggerTooltip');\n\t }\n\n\t axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n\n\t var snap = axisPointerModel.get('snap');\n\t var key = makeKey(axis.model);\n\t var involveSeries = triggerTooltip || snap || axis.type === 'category';\n\n\t // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\t var axisInfo = result.axesInfo[key] = {\n\t key: key,\n\t axis: axis,\n\t coordSys: coordSys,\n\t axisPointerModel: axisPointerModel,\n\t triggerTooltip: triggerTooltip,\n\t involveSeries: involveSeries,\n\t snap: snap,\n\t useHandle: isHandleTrigger(axisPointerModel),\n\t seriesModels: []\n\t };\n\t axesInfoInCoordSys[key] = axisInfo;\n\t result.seriesInvolved |= involveSeries;\n\n\t var groupIndex = getLinkGroupIndex(linksOption, axis);\n\t if (groupIndex != null) {\n\t var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = { axesInfo: {} });\n\t linkGroup.axesInfo[key] = axisInfo;\n\t linkGroup.mapper = linksOption[groupIndex].mapper;\n\t axisInfo.linkGroup = linkGroup;\n\t }\n\t }", "_tooltipChanged(newValue, oldValue) {\n if (newValue == \"\" || newValue == null) {\n this.shadowRoot\n .querySelector(\"#tooltip\")\n .setAttribute(\"aria-hidden\", \"true\");\n } else {\n this.shadowRoot\n .querySelector(\"#tooltip\")\n .setAttribute(\"aria-hidden\", \"false\");\n }\n }", "function showTooltips(evt) {\n\t\tif (tooltips_element) {\n\t\t\ttooltips_element.style.display = '';\n\t\t}\n\t}", "function customToolTip(tooltip, elementId, templateEpaSourceMap) {\n\n // Tooltip Element\n let tooltipEl = $('#' + elementId);\n // Hide if no tooltip\n if (!tooltip) {\n tooltipEl.css({\n opacity: 0\n });\n return;\n }\n\n let epaId = EPATextToNumber(tooltip.text.split(\":\")[0]),\n epaRootId = epaId.split(\".\")[0];\n\n // Set caret Position\n tooltipEl.removeClass('above below');\n tooltipEl.addClass(tooltip.yAlign);\n // Set Text\n tooltipEl.html(tooltip.text + \", \" + templateEpaSourceMap[epaRootId].subRoot[epaId]);\n // Find Y Location on page\n var top;\n if (tooltip.yAlign == 'above') {\n top = tooltip.y - tooltip.caretHeight - tooltip.caretPadding;\n } else {\n top = tooltip.y + tooltip.caretHeight + tooltip.caretPadding;\n }\n // Display, position, and set styles for font\n tooltipEl.css({\n opacity: 1,\n left: tooltip.chart.canvas.offsetLeft + tooltip.x + 'px',\n top: tooltip.chart.canvas.offsetTop + top + 'px',\n fontFamily: tooltip.fontFamily,\n fontSize: tooltip.fontSize,\n fontStyle: tooltip.fontStyle,\n });\n\n}", "setHyperlinkContentToToolTip(fieldBegin, widget, xPos) {\n if (fieldBegin) {\n if (this.owner.contextMenuModule &&\n this.owner.contextMenuModule.contextMenuInstance.element.style.display === 'block') {\n return;\n }\n if (!this.toolTipElement) {\n this.toolTipElement = createElement('div', { className: 'e-de-tooltip' });\n this.viewer.viewerContainer.appendChild(this.toolTipElement);\n }\n this.toolTipElement.style.display = 'block';\n let l10n = new L10n('documenteditor', this.owner.defaultLocale);\n l10n.setLocale(this.owner.locale);\n let toolTipText = l10n.getConstant('Click to follow link');\n if (this.owner.useCtrlClickToFollowHyperlink) {\n toolTipText = 'Ctrl+' + toolTipText;\n }\n let linkText = this.getLinkText(fieldBegin);\n this.toolTipElement.innerHTML = linkText + '</br><b>' + toolTipText + '</b>';\n let widgetTop = this.getTop(widget) * this.viewer.zoomFactor;\n let page = this.getPage(widget.paragraph);\n let containerWidth = this.viewer.viewerContainer.getBoundingClientRect().width + this.viewer.viewerContainer.scrollLeft;\n let left = page.boundingRectangle.x + xPos * this.viewer.zoomFactor;\n if ((left + this.toolTipElement.clientWidth + 10) > containerWidth) {\n left = left - ((this.toolTipElement.clientWidth - (containerWidth - left)) + 15);\n }\n let top = this.getPageTop(page) + (widgetTop - this.toolTipElement.offsetHeight);\n top = top > this.viewer.viewerContainer.scrollTop ? top : top + widget.height + this.toolTipElement.offsetHeight;\n this.showToolTip(left, top);\n if (!isNullOrUndefined(this.toolTipField) && fieldBegin !== this.toolTipField) {\n this.toolTipObject.position = { X: left, Y: top };\n }\n this.toolTipObject.show();\n this.toolTipField = fieldBegin;\n }\n else {\n this.hideToolTip();\n }\n }", "get eventTooltipTemplate() {\n\t\treturn this.nativeElement ? this.nativeElement.eventTooltipTemplate : undefined;\n\t}", "function showTooltip(d) {\n $(this).popover({\n placement: 'auto top', //place the tooltip above the item\n container: '#chart', //the name (class or id) of the container\n trigger: 'manual',\n html : true,\n content: function() { //the html content to show inside the tooltip\n return \"<span style='font-size: 11px; text-align: center;'>\" + \"sds\" + \"</span>\"; }\n });\n $(this).popover('show'); \n}//function showTooltip", "async showTooltip() {\n this.actionEventHandler();\n }", "function moveTooltip() {\n\t tooltip.style(\"top\",(d3.event.pageY+tooltipOffset.y)+\"px\")\n\t .style(\"left\",(d3.event.pageX+tooltipOffset.x)+\"px\");\n\t}", "get tooltipTemplate() {\n return html`<simple-tooltip\n id=\"tooltip\"\n for=\"button\"\n ?hidden=\"${!this.currentTooltip && !this.currentLabel}\"\n position=\"${this.tooltipDirection || \"bottom\"}\"\n >${this.currentTooltip || this.currentLabel}</simple-tooltip\n >`;\n }", "function hideTooltip() {\n tooltip.style(\"display\",\"none\");\n}", "bindEvents ($element) {\n let showEvents = 'srf.tooltip.show',\n hideEvents = 'srf.tooltip.hide';\n\n if ($element.data('tooltipNoHover') === undefined) {\n showEvents += ' mouseenter focus';\n hideEvents += ' mouseleave focusout';\n }\n\n $element.on(showEvents, () => {\n $element.children('.tooltip').remove();\n\n $element.append(this.template);\n $element.css('position', 'relative');\n\n $element.find('.tooltip-content').html(this.title);\n\n const $tooltip = $element.children('.tooltip');\n\n // use custom offset, if defined. Otherwise take the default offset\n let offset = $element.data('tooltipOffset') ? $element.data('tooltipOffset') : DEFAULT_OFFSET;\n\n // Move tooltip in right position relative to its parent\n const leftPosition = (this.originalWidth - $tooltip.width()) / 2;\n const topPosition = ($tooltip.height() + ADDITIONAL_OFFSET + offset) * -1;\n\n $tooltip.css({\n 'top': topPosition,\n 'left': leftPosition - 8,\n 'position': 'absolute'\n });\n }).on(hideEvents, () => {\n $element.children('.tooltip').remove();\n });\n }", "function v(){var n=Q.popperChildren.tooltip,e=Q.props.popperOptions,t=Me[\"round\"===Q.props.arrowType?\"ROUND_ARROW\":\"ARROW\"],i=n.querySelector(t),r=fe({placement:Q.props.placement},e||{},{modifiers:fe({},e?e.modifiers:{},{arrow:fe({element:t},e&&e.modifiers?e.modifiers.arrow:{}),flip:fe({enabled:Q.props.flip,padding:Q.props.distance+5/* 5px from viewport boundary */,behavior:Q.props.flipBehavior},e&&e.modifiers?e.modifiers.flip:{}),offset:fe({offset:Q.props.offset},e&&e.modifiers?e.modifiers.offset:{})}),onCreate:function e(){n.style[St(Q.popper)]=Ct(Q.props.distance,de.distance),i&&Q.props.arrowTransform&&wt(i,Q.props.arrowTransform)},onUpdate:function e(){var t=n.style;t.top=\"\",t.bottom=\"\",t.left=\"\",t.right=\"\",t[St(Q.popper)]=Ct(Q.props.distance,de.distance),i&&Q.props.arrowTransform&&wt(i,Q.props.arrowTransform)}}),o=new MutationObserver(function(){Q.popperInstance.update()});return o.observe(Q.popper,{childList:!0,subtree:!0}),R&&R.disconnect(),R=o,\n// fixes https://github.com/atomiks/tippyjs/issues/193\n$||($=!0,Q.popper.addEventListener(\"mouseenter\",function(e){Q.props.interactive&&Q.state.isVisible&&\"mouseenter\"===M.type&&a(e)}),Q.popper.addEventListener(\"mouseleave\",function(e){Q.props.interactive&&\"mouseenter\"===M.type&&0===Q.props.interactiveDebounce&&Et(St(Q.popper),Q.popper.getBoundingClientRect(),e,Q.props)&&s()})),new Re(Q.reference,Q.popper,r)}", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n\t var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n\t var axisPointerShow = axisPointerModel.get('show');\n\t\n\t if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n\t return;\n\t }\n\t\n\t if (triggerTooltip == null) {\n\t triggerTooltip = axisPointerModel.get('triggerTooltip');\n\t }\n\t\n\t axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n\t var snap = axisPointerModel.get('snap');\n\t var axisKey = makeKey(axis.model);\n\t var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\t\n\t var axisInfo = result.axesInfo[axisKey] = {\n\t key: axisKey,\n\t axis: axis,\n\t coordSys: coordSys,\n\t axisPointerModel: axisPointerModel,\n\t triggerTooltip: triggerTooltip,\n\t involveSeries: involveSeries,\n\t snap: snap,\n\t useHandle: isHandleTrigger(axisPointerModel),\n\t seriesModels: [],\n\t linkGroup: null\n\t };\n\t axesInfoInCoordSys[axisKey] = axisInfo;\n\t result.seriesInvolved = result.seriesInvolved || involveSeries;\n\t var groupIndex = getLinkGroupIndex(linksOption, axis);\n\t\n\t if (groupIndex != null) {\n\t var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n\t axesInfo: {}\n\t });\n\t linkGroup.axesInfo[axisKey] = axisInfo;\n\t linkGroup.mapper = linksOption[groupIndex].mapper;\n\t axisInfo.linkGroup = linkGroup;\n\t }\n\t }", "get tooltipClass() { return this._tooltipClass; }", "function tooltips() {\r\n\t$('.tooltip-link').tooltip();\r\n}", "setTooltip_() {\n this.tooltip = $('arc-event-band-tooltip');\n this.svg.onmouseover = this.showToolTip_.bind(this);\n this.svg.onmouseout = this.hideToolTip_.bind(this);\n this.svg.onmousemove = this.updateToolTip_.bind(this);\n this.svg.onclick = (event) => {\n showDetailedInfoForBand(this, event);\n };\n }", "tooltipMove(event, d, vis) {\n d3.select('#mapchart-tooltip')\n .style('left', () => {\n if (event.pageX > 750)\n return event.pageX - vis.tooltipWidth - vis.config.tooltipPadding + 'px';\n return event.pageX + vis.config.tooltipPadding + 'px';\n })\n .style('top', () => {\n if (event.pageY > 500)\n return event.pageY - vis.tooltipHeight - vis.config.tooltipPadding + 'px';\n return event.pageY + vis.config.tooltipPadding + 'px';\n });\n }", "function checkLeft(targetOffset,tooltipLayerStyleRight,tooltipOffset,tooltipLayer){if(targetOffset.left+targetOffset.width-tooltipLayerStyleRight-tooltipOffset.width<0){// off the left side of the window\ntooltipLayer.style.left=\"\".concat(-targetOffset.left,\"px\");return false;}tooltipLayer.style.right=\"\".concat(tooltipLayerStyleRight,\"px\");return true;}", "function initTooltip() {\n angular.element(elem).tooltip({\n title: scope.bsTip,\n placement: scope.bsTipPlacement\n });\n }", "function tooltipInit() {\n $('[data-toggle=\"tooltip\"]').tooltip();\n}", "function toolTips(el,help) {\n\t\t$(el).on('mouseenter', function() {\n\t\t\t$(help).show();\n\t\t\t$(el).on('click', function() {\n\t\t\t\t$(help).hide();\n\t\t\t});\n\t\t\t$(el).on('mouseleave', function() {\n\t\t\t\t$(help).hide();\n\t\t\t});\n\t\t});\n\t}", "displayToolTip(item) {\n console.log(\"Hovering Over Item: \", item.name);\n }", "function showTooltip_onMouseOver(){\n//----------------------------------------------------------------------------------------------------------------------------\t\n\n\n this.dispalyTooltips = function(toolz){ //args(tooplips array)\n // request mousemove events\n $(\"#graph\").mousemove(function (e) {\n\t\t var onMouseOver_file = new onMouseOver();//uses other module in this very file\n onMouseOver_file.handleMouseMoveAction(e, toolz); //args(mouse event, tooplips array)\n });\n\n } \n}", "function openTooltip(row, col, action) {\n\t\t\tconsole.log(\"tooltip opened\", row, col, action);\n\t\t}", "function show() {\n tID = null;\n let isBrowsable = false;\n if ($.tooltip.current !== null) {\n isBrowsable = settings($.tooltip.current).isBrowsable;\n }\n\n if ((!IE || !$.fn.bgiframe) && settings($.tooltip.current).fade) {\n if (helper.parent.is(':animated'))\n helper.parent\n .stop()\n .show()\n .fadeTo(settings($.tooltip.current).fade, 100);\n else\n helper.parent.is(':visible')\n ? helper.parent.fadeTo(\n settings($.tooltip.current).fade,\n 100\n )\n : helper.parent.fadeIn(settings($.tooltip.current).fade);\n } else {\n helper.parent.show();\n }\n\n $(helper.parent[0])\n .unbind('mouseenter')\n .unbind('mouseleave')\n .mouseenter(function () {\n if (isBrowsable) {\n $.tooltip.currentHover = true;\n }\n })\n .mouseleave(function () {\n if (isBrowsable) {\n // if tooltip has scrollable content or selectionnable text - should be closed on mouseleave:\n $.tooltip.currentHover = false;\n helper.parent.hide();\n }\n });\n\n update();\n }", "function tooltips() {\n\n // Tooltips are added with options.tooltips in original order.\n var tips = scope_Handles.map(addTooltip);\n\n bindEvent('update', function (values, handleNumber, unencoded) {\n\n if (!tips[handleNumber]) {\n return;\n }\n\n var formattedValue = values[handleNumber];\n\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n\n tips[handleNumber].innerHTML = formattedValue;\n });\n }", "function mouseLeave() {\n tooltip\n .style(\"opacity\", 0)\n .style(\"display\",\"none\")\n}", "function openTaxesAndFeesToolTip(){\n\t$(\"span[id^='taxesAndFees-']\").hover(function(event) {\n\t\tvar packageId = $(this).attr(\"id\").split(\"-\")[1];\n\t\tmouseEnterAnchor($(this), packageId,event);\n\t}, function() {\n\t\tvar packageId = $(this).attr(\"id\").split(\"-\")[1];\n\t\tmouseLeaveAnchor($(this), packageId);\n\t});\n}", "function initBootstrapTooltips() {\n const options = {\n delay: { \"show\": 750, \"hide\": 100 },\n trigger: 'hover'\n };\n\n if(isTouchDevice() === false) {\n $('[data-toggle = \"tooltip\"]').tooltip(options);\n }\n}", "function ActivateTooltips(container) {\n if (container && container.tooltip) {\n container.find('span[rel=\"tooltip\"]').tooltip();\n }\n }", "applyTooltips() {\n tippy(\".tipped\", {\n arrow: true,\n animateFill: false,\n size: \"small\",\n maxWidth: 200,\n interactiveBorder: 8\n });\n }", "function enableToolTipForHeader(){\r\n\t$('#merchantUpload').tooltip({title: \"Upload new set of images for an application.\", animation: true,placement: \"auto\"});\r\n\t$('[href=\"/search\"]').tooltip({title: \"Search existing or previously uploaded application from the system.\", animation: true,placement: \"auto\"});\r\n\t$('[href=\"/followup\"]').tooltip({title: \"Search applications for document followup from Head office.\", animation: true,placement: \"auto\"});\r\n\t$('[href=\"/signup\"]').tooltip({title: \"Register new merchant promoter or staff in Online Submission Application.\", animation: true,placement: \"auto\"});\r\n\t$('[href=\"#logout\"]').tooltip({title: \"Logout to OSA-PH.\", animation: true,placement: \"auto\"});\r\n}", "function showTooltip() {\n if (angular.isDefined(_tooltip) || angular.isUndefined(lx.text) || !lx.text) {\n return;\n }\n\n _tooltip = angular.element('<div/>', {\n class: `${CSS_PREFIX}-tooltip`,\n });\n\n _tooltipArrow = angular.element('<div/>', {\n class: `${CSS_PREFIX}-tooltip__arrow`,\n });\n\n _tooltipInner = angular.element('<span/>', {\n class: `${CSS_PREFIX}-tooltip__inner`,\n text: lx.text,\n });\n\n _tooltip.append(_tooltipArrow).append(_tooltipInner);\n\n _hoverTimeout = $timeout(_setTooltipPosition, _HOVER_DELAY);\n }", "function switchToolTip() {\n //show information box when the mouse is placed on top of the question mark image\n document.getElementById('questionmark').onmouseover = function() {\n var toolTip = document.getElementById('tooltip');\n toolTip.style.display = 'block';\n };\n //hide information box when mouse is moved away from question mark image\n document.getElementById('questionmark').onmouseout = function() {\n var toolTip = document.getElementById('tooltip');\n toolTip.style.display = 'none';\n };\n}", "function hideTooltip() {\n\t tooltip.style(\"display\",\"none\");\n\t}", "function showToolTipHelp() {\n\t\tvar link = tip.triggerElement;\n\t\tif (!link) {\n\t\t\treturn false;\n\t\t}\n\t\tvar table = link.getAttribute('data-table');\n\t\tvar field = link.getAttribute('data-field');\n\t\tvar key = table + '.' + field;\n\t\tvar response = cshHelp.key(key);\n\t\ttip.target = tip.triggerElement;\n\t\tif (response) {\n\t\t\tupdateTip(response);\n\t\t} else {\n\t\t\t\t// If a table is defined, use ExtDirect call to get the tooltip's content\n\t\t\tif (table) {\n\t\t\t\tvar description = '';\n\t\t\t\tif (typeof(top.TYPO3.LLL) !== 'undefined') {\n\t\t\t\t\tdescription = top.TYPO3.LLL.core.csh_tooltip_loading;\n\t\t\t\t} else if (opener && typeof(opener.top.TYPO3.LLL) !== 'undefined') {\n\t\t\t\t\tdescription = opener.top.TYPO3.LLL.core.csh_tooltip_loading;\n\t\t\t\t}\n\n\t\t\t\t\t// Clear old tooltip contents\n\t\t\t\tupdateTip({\n\t\t\t\t\tdescription: description,\n\t\t\t\t\tcshLink: '',\n\t\t\t\t\tmoreInfo: '',\n\t\t\t\t\ttitle: ''\n\t\t\t\t});\n\t\t\t\t\t// Load content\n\t\t\t\tTYPO3.CSH.ExtDirect.getTableContextHelp(table, function(response, options) {\n\t\t\t\t\tExt.iterate(response, function(key, value){\n\t\t\t\t\t\tcshHelp.add(value);\n\t\t\t\t\t\tif (key === field) {\n\t\t\t\t\t\t\tupdateTip(value);\n\t\t\t\t\t\t\t\t// Need to re-position because the height may have increased\n\t\t\t\t\t\t\ttip.show();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}, this);\n\n\t\t\t\t// No table was given, use directly title and description\n\t\t\t} else {\n\t\t\t\tupdateTip({\n\t\t\t\t\tdescription: link.getAttribute('data-description'),\n\t\t\t\t\tcshLink: '',\n\t\t\t\t\tmoreInfo: '',\n\t\t\t\t\ttitle: link.getAttribute('data-title')\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}", "function showHelpTooltip() {\n $('#tooltip_help').show();\n}", "function canvasClickEvent(event){\r\n if((typeof clickeventFlag !== 'undefined') && clickeventFlag){\r\n //desactive le focus\r\n if(document.getElementById(\"tooltip\")!=null)\r\n document.getElementById(\"tooltip\").remove();\r\n clickeventFlag= false;\r\n canvasMouseEvent(event);\r\n return;\r\n }\r\n\r\n canvasMouseEvent(event);\r\n //Active le drapeau pour bloquer le tooltip\r\n clickeventFlag=true;\r\n var tooltip= document.getElementById(\"tooltip\");\r\n var doc = document.documentElement;\r\n //Position du scroll de la page\r\n var scrolltop = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);\r\n var scrollleft = (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);\r\n\r\n var mytop = tooltip.offsetTop+scrolltop;\r\n var myleft = tooltip.offsetLeft+scrollleft;\r\n\r\n tooltip.style.position=\"absolute\";\r\n tooltip.style.left = myleft+\"px\";\r\n tooltip.style.top = mytop+\"px\";\r\n var div = document.createElement(\"div\");\r\n div.innerHTML=\"Actions : <br>\";\r\n var a = document.createElement(\"a\");\r\n a.innerHTML=\"Afficher plus d'information (lot de 500)\";\r\n a.onclick=function (ev) {\r\n showLot();\r\n return false;\r\n };\r\n a.className=\"btn btn-default btn-xs\";\r\n div.appendChild(a);\r\n /*var a2 = document.createElement(\"a\");\r\n a2.innerHTML=\"Afficher plus d'information (tous)\";\r\n a2.onclick=function (ev) {\r\n showLot();\r\n return false;\r\n };\r\n a2.className=\"btn btn-default btn-xs\";\r\n div.appendChild(a2);*/\r\n tooltip.appendChild(div);\r\n}", "function mousemoveDeputy() { return tooltip.style(\"top\", (event.pageY - 10)+\"px\").style(\"left\",(event.pageX + 10)+\"px\");}", "function createTooltip(obj, w, h) {\n var radius, label, type, note;\n\n if (obj.type === 'edge') {\n radius = 0;\n label = obj.node.label;\n note = Object(_modal_node__WEBPACK_IMPORTED_MODULE_1__[\"typeConversion\"])(obj.node.type) + ' connected to this line';\n d3__WEBPACK_IMPORTED_MODULE_0__[\"select\"]('#chart-tooltip').style('border', '2px solid ' + obj.node.fill).style('box-shadow', 'none');\n } else {\n //node\n radius = obj.r;\n label = obj.label;\n note = Object(_modal_node__WEBPACK_IMPORTED_MODULE_1__[\"typeConversion\"])(obj.type);\n d3__WEBPACK_IMPORTED_MODULE_0__[\"select\"]('#chart-tooltip').style('border', null).style('box-shadow', null);\n } //else\n //Change titles\n\n\n d3__WEBPACK_IMPORTED_MODULE_0__[\"select\"]('#chart-tooltip .tooltip-type').html(note);\n d3__WEBPACK_IMPORTED_MODULE_0__[\"select\"]('#chart-tooltip .tooltip-title').html(label);\n var box_size = document.getElementById('chart-tooltip').getBoundingClientRect(); //Place & show the tooltip\n\n d3__WEBPACK_IMPORTED_MODULE_0__[\"select\"]('#chart-tooltip').style('top', obj.y + h / 2 - box_size.height - radius - Math.max(radius * 0.2, 30) + 'px').style('left', obj.x + w / 2 - box_size.width / 2 + 'px').style('opacity', 1);\n} //function createTooltip", "hideTooltip () {\n this.tooltip\n .transition ()\n .duration (this.settings.transition_duration / 2)\n .ease (d3.easeLinear)\n .style ('opacity', 0);\n }", "function enableTooltip() {\n\tvar hoverMsg = ( _sessLang == SESS_LANG_CHN ) ? \"如果選擇列表中沒有,選擇任何稱謂然後用“更改”的方式去更正!\" : \"If not found in the dropdown selection list, select any and then use Edit to correct it!\";\n\t$(document).tooltip({content: hoverMsg});\n\t$(document).tooltip(\"enable\");\n} // enableTooltip()", "function tooltipOff(d) {\n tooltip.style('left', '-10000px');\n }", "function showTooltip(content, refIndic,event) {\n tt.style('opacity', 1.0)\n .html(content);\n\n updatelineChart(refIndic)\n updatePosition(event);\n }", "function tooltip(options) {\n var arrow = options.arrow;\n var shadowSize = (options.shadow) ? options.shadow.size : 0;\n var shadowSideMultiplier = 2.5;\n var pathOptions = {\n x: shadowSideMultiplier * shadowSize,\n y: shadowSideMultiplier * shadowSize,\n width: options.width,\n height: options.height,\n cornerRadius: options.cornerRadius,\n arrow: options.arrow\n };\n var path = svg_1.tooltipPath(pathOptions);\n var width = options.width + 2 * shadowSideMultiplier * shadowSize;\n if (arrow && (arrow.position === 'left' || arrow.position === 'right'))\n width += arrow.height;\n var height = options.height + 2 * shadowSideMultiplier * shadowSize;\n if (arrow && (arrow.position === 'top' || arrow.position === 'bottom'))\n height += arrow.height;\n var filterXOffset = (shadowSize * shadowSideMultiplier / options.width) * -200;\n var filterYOffset = (shadowSize * shadowSideMultiplier / options.height) * -200;\n var filterWidth = 100 + (shadowSize * shadowSideMultiplier / options.width) * 400;\n var filterHeight = 100 + (shadowSize * shadowSideMultiplier / options.height) * 400;\n var shadowColor = 'rgb(0, 0, 0)';\n var shadowOpacity = 0.5;\n var shadowOffset = { x: 0, y: 0 };\n if (options.shadow) {\n if (options.shadow.color)\n shadowColor = options.shadow.color;\n if (options.shadow.opacity)\n shadowOpacity = options.shadow.opacity;\n if (options.shadow.offset)\n shadowOffset = options.shadow.offset;\n }\n var svg = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n <svg width=\\\"\" + width + \"px\\\" height=\\\"\" + height + \"px\\\" viewBox=\\\"0 0 \" + width + \" \" + height + \"\\\" version=\\\"1.1\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\" xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\">\\n <defs>\\n <path d=\\\"\" + path.toString() + \"\\\" id=\\\"tooltip\\\"></path>\\n <filter id=\\\"shadow\\\" x=\\\"\" + filterXOffset + \"%\\\" y=\\\"\" + filterYOffset + \"%\\\" width=\\\"\" + filterWidth + \"%\\\" height=\\\"\" + filterHeight + \"%\\\">\\n <feGaussianBlur stdDeviation=\\\"\" + shadowSize + \"\\\" />\\n <feOffset dx=\\\"\" + shadowOffset.x + \"\\\" dy=\\\"\" + shadowOffset.y + \"\\\" result=\\\"blur\\\"/>\\n <feFlood flood-color=\\\"\" + shadowColor + \"\\\" flood-opacity=\\\"\" + shadowOpacity + \"\\\"/>\\n <feComposite in2=\\\"blur\\\" operator=\\\"in\\\" result=\\\"colorShadow\\\"/>\\n <feComposite in=\\\"SourceGraphic\\\" in2=\\\"colorShadow\\\" operator=\\\"over\\\"/>\\n </filter>\\n </defs>\\n <g>\\n <use fill=\\\"\" + options.fillColor + \"\\\" fill-rule=\\\"evenodd\\\" xlink:href=\\\"#tooltip\\\"\" + (shadowSize ? ' filter=\"url(#shadow)\"' : '') + \"></use>\\n </g>\\n </svg>\\n \";\n return {\n svg: svg,\n insets: {\n top: pathOptions.y + ((arrow && arrow.position === 'top') ? arrow.height : 0),\n left: pathOptions.x + ((arrow && arrow.position === 'left') ? arrow.height : 0),\n right: pathOptions.x + ((arrow && arrow.position === 'right') ? arrow.height : 0),\n bottom: pathOptions.y + ((arrow && arrow.position === 'bottom') ? arrow.height : 0)\n },\n size: {\n width: width,\n height: height\n }\n };\n}" ]
[ "0.7494436", "0.73168004", "0.7181213", "0.715156", "0.70786935", "0.70663327", "0.69018006", "0.68914866", "0.6801135", "0.677454", "0.6710075", "0.6703516", "0.6672522", "0.6609714", "0.66061527", "0.65261465", "0.65257114", "0.65245795", "0.65063286", "0.65041316", "0.64813066", "0.64683515", "0.6456692", "0.64557916", "0.6448445", "0.64309245", "0.6402186", "0.6361047", "0.6345824", "0.63429", "0.633853", "0.6334176", "0.6326008", "0.63164246", "0.6310243", "0.63052243", "0.62881655", "0.62875867", "0.62800604", "0.6279509", "0.62739676", "0.62730366", "0.6268545", "0.626171", "0.626171", "0.626171", "0.626171", "0.626171", "0.626171", "0.626171", "0.626171", "0.626171", "0.626171", "0.6258432", "0.62564933", "0.62541914", "0.62415284", "0.62409943", "0.6238519", "0.62343955", "0.6233417", "0.6232791", "0.6221738", "0.6221485", "0.6212476", "0.62086934", "0.61926806", "0.61868626", "0.618376", "0.61833954", "0.6182102", "0.6154979", "0.61540914", "0.6147967", "0.61380386", "0.61257243", "0.61237806", "0.61204344", "0.6114426", "0.61022097", "0.6098415", "0.6096829", "0.60962653", "0.60891396", "0.6078649", "0.60711", "0.6070862", "0.6068885", "0.60651606", "0.60629576", "0.6058629", "0.6044136", "0.60403943", "0.6027624", "0.60261285", "0.6021907", "0.6019591", "0.601432", "0.6010743", "0.60104954", "0.60044545" ]
0.0
-1
Check if the given character code, or the character code at the first character, is decimal.
function decimal(character) { var code = typeof character === 'string' ? character.charCodeAt(0) : character return code >= 48 && code <= 57 /* 0-9 */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character;\n return code >= 48 && code <= 57; /* 0-9 */\n}", "function _isDecimalDigit(ch) {\n return ch >= 48 && ch <= 57; // 0...9\n }", "function isdecimal(num) {\n return (/^\\d+(\\.\\d+)?$/.test(num + \"\"));\n}", "function isNumberChar(char) {\n\treturn char.charCodeAt(0) >= 48 && char.charCodeAt(0) <= 57;\n}", "function isValidNumberChar(ch) {\n return isNumeral(ch) || ch === '.';\n }", "function containsDecimal (string) {\n return string.includes(\".\");\n}", "function isIntDecimal(value)\r\n{\r\n //var res = value.match(/^\\d+(\\.\\d+)?$/);\r\n if(!value.match(/^\\d+(\\.\\d+)?$/))\r\n\t\treturn false;\r\n else\t\r\n\t\treturn true;\r\n}", "function isDigit(code) {\n return code >= 0x0030 && code <= 0x0039;\n}", "function isNumeric(val) {\r\n var dp = false;\r\n for (var i=0; i < val.length; i++) {\r\n if (!isDigit(val.charAt(i))) {\r\n if (val.charAt(i) == '.') {\r\n if (dp == true) { return false; } // already saw a decimal point\r\n else { dp = true; }\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }", "function checkDecimal(stringValue) {\n\t\tstringValue = stringValue.trim();\n\t\t/*\tRegExp explanation:\n\t\t\t# [^ - Start of negated character class\t\t\t\t\t\t\t# , The literal character ,\t\t\t\t\t\t\t\t\n\t\t\t# ] - End of negated character class\t\t\t\t\t\t\t\t# \\. Matches the character . literally\n\t\t\t# 0-9 A single character in the range between 0 and 9\t\t\t\t# \\d Match a digit [0-9]\n\t\t\t# g Modifier: global. All matches (don't return on first match)\t# {2} Quantifier: {2} Exactly 2 times\n\t\t\t# [,\\.] Match a single character present in the list below\t\t\t# $ Assert position at end of the string\n\t\t*/\n\t\tvar result = stringValue.replace(/[^-0-9]/g, '');\n\t\tif (/[,\\.]\\d{2}$/.test(stringValue)) {\n\t\t\tresult = result.replace(/(\\d{2})$/, '.$1');\n\t\t}\n\t\treturn parseFloat(result);\n\t}", "function checkDecimal(stringValue) {\n\t\tstringValue = stringValue.trim();\n\t\t/*\tRegExp explanation:\n\t\t\t# [^ - Start of negated character class\t\t\t\t\t\t\t# , The literal character ,\t\t\t\t\t\t\t\t\n\t\t\t# ] - End of negated character class\t\t\t\t\t\t\t\t# \\. Matches the character . literally\n\t\t\t# 0-9 A single character in the range between 0 and 9\t\t\t\t# \\d Match a digit [0-9]\n\t\t\t# g Modifier: global. All matches (don't return on first match)\t# {2} Quantifier: {2} Exactly 2 times\n\t\t\t# [,\\.] Match a single character present in the list below\t\t\t# $ Assert position at end of the string\n\t\t*/\n\t\tvar result = stringValue.replace(/[^-0-9]/g, '');\n\t\tif (/[,\\.]\\d{2}$/.test(stringValue)) {\n\t\t\tresult = result.replace(/(\\d{2})$/, '.$1');\n\t\t}\n\t\treturn parseFloat(result);\n\t}", "function decimalCurrency(txt) {\n\tregExp = /^[0-9]+(\\.[0-9]+)*$/;\n\treturn regExp.test(txt.value);\n}", "function isWholeOrDecimal(num){\n if (parseInt(num) === num){\n return \"whole num\";\n }else {\n return \"decimal num\";\n }\n}", "function isDigit (c)\r\n{ return ((c >= \"0\") && (c <= \"9\"))\r\n}", "function isDigit (c)\r\n{ return ((c >= \"0\") && (c <= \"9\"))\r\n}", "function isDecimal(theInputField)\r\n{\r\n\r\n theInput = theInputField.value;\r\n theLength = theInput.length ;\r\n var dec_count = 0 ;\r\n\r\n for (var i = 0 ; i < theLength ; i++)\r\n {\r\n if(theInput.charAt(i) == '.')\r\n // the text field has decimal point entry\r\n {\r\n dec_count = dec_count + 1;\r\n }\r\n }\r\n //check if number field contains more than one decimal points '.'\r\n if(dec_count > 1)\r\n {\r\n\talert('The field cannot contain two decimal points');\r\n\ttheInputField.focus();\r\n\ttheInputField.select();\r\n return(false);\r\n }\r\n //check if decimal field contains just a '.'\r\n if (dec_count == 1 && dec_count == theLength)\r\n {\r\n\talert('The field cannot contain just a decimal');\r\n\ttheInputField.focus();\r\n\ttheInputField.select();\r\n \treturn false;\r\n }\r\n for (var i = 0 ; i < theLength ; i++)\r\n {\r\n\t//check if decimal field contains laphabets or spaces\r\n if (theInput.charAt(i) < '0' || theInput.charAt(i) > '9')\r\n {\r\n\t if(theInput.charAt(i) == '-'){\r\n\t\t continue;\r\n\t }\r\n if(theInput.charAt(i) != '.')\r\n {\r\n alert(\"This field cannot contain alphabets or spaces\");\r\n theInputField.focus();\r\n\t theInputField.select();\r\n return(false);\r\n }\r\n }\r\n }// for ends\r\n return (true);\r\n}", "function isChar (code) {\n\t// http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes\n\treturn code === 32 || (code > 46 && !(code >= 91 && code <= 123) && code !== 144 && code !== 145);\n}", "function isDigit (c)\n{ return ((c >= \"0\") && (c <= \"9\"))\n}", "function isAsciiDigit(cp) {\n return cp >= CODE_POINTS.DIGIT_0 && cp <= CODE_POINTS.DIGIT_9;\n}", "function decimal(campo)\n\t{\n\tvar charpos = campo.value.search(\"[^0-9. ]\");\n\tif(campo.value.length > 0 && charpos >= 0)\n\t\t{\n\t\tcampo.value = campo.value.slice(0, -1)\n\t\tcampo.focus();\n\t\treturn false;\n\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\treturn true;\n\t\t\t\t}\n\t}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDecimal(element)\n{\nreturn (/^\\d+(\\.\\d)?$/.test(element.value) || /^\\d+(\\.\\d\\d)?$/.test(element.value)\n\t\t || /^(\\.\\d\\d)?$/.test(element.value) || /^\\d+(\\.)?$/.test(element.value));\n}", "function isFullDigital(char)\n{\n\t//if (char < '0' || char > '9')\n\tif (char == '0' || char == '1' || char == '2' || char == '3' || char == '4'\n\t || char == '5' || char == '6' || char == '7' || char == '8' || char == '9')\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "function isDigit(c)\n{\n return !isNaN(parseFloat(c)) && isFinite(c);\n}", "function isDigit(character)\n{\n return (1 == character.length) && (!isNaN(parseInt(character), 10));\n}", "function isDigit_(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit_(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(c) {\n return c >= '0' && c <= '9';\n}", "function onlyDecimalCP(e){ \n// note: backspace = 8, enter = 13, '0' = 48, '9' = 57 \n\tif(!e) e = window.event;\n\tvar key; key = !e.keyCode ? e.which : e.keyCode;\n\tvar punto = 0;\n\tvar decimals = 0;\n\tvar _this;\n\tif (e.target) _this = e.target;\n\telse if (e.srcElement) _this = e.srcElement;\n\tif (_this.nodeType == 3) // defeat Safari bug\n\t _this = targ.parentNode;\n\n\tif ((key >= 48 && key <= 57) || key == 45 || key == 46 || keySpecial(key)) {\n\t __hiddenInfo(e);\n\t if (key == 46) {\n cadena = _this.value\n\t if (cadena.indexOf(\".\") != -1) {\n\t punto = 1;\n\t }\n\t punto++;\n\t if (punto > 1) { stopEvent(e); cancelEvent(e); __showInfo(e, 3); }\n\t } else {\n try{\n //cadena = _this.value.substring(0, _this.selectionStart);\n cadena = _this.value.substring(0, getCaret(_this));\n }catch(e){\n cadena = _this.value;\n }\n if (cadena.indexOf(\".\") != -1) {\n //decimals = cadena.substring(cadena.indexOf(\".\")).length;\n decimals = _this.value.substring(_this.value.indexOf(\".\")).length;\n }\n if (decimals > 2) { stopEvent(e); cancelEvent(e); __showInfo(e, 3); }\n\t\t}\n\t}\n\telse { stopEvent(e); cancelEvent(e); __showInfo(e, 3); }\n}", "function isNumeric (c) {\n // FIXME: is this correct? Seems to work\n return (c >= '0') && (c <= '9')\n}", "function isNumeric (c) {\n // FIXME: is this correct? Seems to work\n return (c >= '0') && (c <= '9')\n}", "function isNumeric (c) {\n // FIXME: is this correct? Seems to work\n return (c >= '0') && (c <= '9')\n}", "function isHalfDigital(char)\n{\n\tif (char < '0' || char > '9')\n\t{\n\t\treturn false;\n\t}\n\treturn true;\n}", "function sc_isCharNumeric(c)\n { return sc_isCharOfClass(c.val, SC_NUMBER_CLASS); }", "function is_digit(char) {\n return /[0-9]/i.test(char);\n }", "function charIsDigit(charCode)\n{\n return (charCode >= 48 && charCode <= 57);\n}", "function isNumeric (c) {\n\t // FIXME: is this correct? Seems to work\n\t return (c >= '0') && (c <= '9')\n\t}", "function isNumeral(ch) {\n const Ascii_0 = 48;\n const Ascii_9 = 57;\n let code = ch.charCodeAt(0);\n return Ascii_0 <= code && code <= Ascii_9;\n }", "function isNumber(character) {\n return Number.isInteger(parseInt(character))\n}", "function isDecimalNumber(evt) {\n var charCode = (evt.which) ? evt.which : evt.keyCode;\n if (charCode !== 46 && charCode > 31\n && (charCode < 48 || charCode > 57))\n return false;\n\n return true;\n}", "function isDigit(charVal)\r\n{\r\n\treturn (charVal >= '0' && charVal <= '9');\r\n}", "static isDigit(ch) {\n return ch >= 0x30 && ch < 0x3A;\n }", "function isNumeric(c) \n\t{\n\t\tif (c >= '0' && c <= '9') \n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function isNumber(codepoint) {\n return codepoint >= Character._0 && codepoint <= Character._9;\n}", "function __is_comm_chars(char_code)\n{\n\tif (char_code == 0) return true;\t\t\t\t\t\t/* some control key. */\n\tif (char_code == 8) return true;\t\t\t\t\t\t/* TAB */\n\tif (char_code >= 48 && char_code <= 57) return true;\t/* 0~9 */\n\tif (char_code >= 65 && char_code <= 90) return true;\t/* A~Z */\n\tif (char_code >= 97 && char_code <= 122) return true;\t/* a~z */\n\n\treturn false;\n}", "function isNumber(character){\n return !isNaN(character);\n}", "function isLetterOrDigit (c)\r\n{ return (isLetter(c) || isDigit(c))\r\n}", "function isLetterOrDigit (c)\r\n{ return (isLetter(c) || isDigit(c))\r\n}", "function isValidPositiveNumber(val){\r\n if(val==null){return false;}\r\n if (val.length==0){return false;}\r\n var DecimalFound = false;\r\n for (var i = 0; i < val.length; i++) {\r\n var ch = val.charAt(i)\r\n if (ch == \".\" && !DecimalFound) {\r\n DecimalFound = true;\r\n continue;\r\n }\r\n if (ch < \"0\" || ch > \"9\") {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "function isEmptyDecimal(value) {\n return value === \"\" || value === \"-\" || value === \".\" || value === \"-.\";\n}", "static isDecimalOrBlank(string) {\n return string.match(/^\\d+(\\.\\d{0,2})?$|^$/)\n }", "function esNumeroDecimalValido(strNumeroDecimal) {\n\treturn (/^[\\-]*[0-9]+\\.[0-9][0-9]$/.test(strDecimal));\n}", "function esNumeroDecimalValido(strNumeroDecimal) {\n\treturn (/^[\\-]*[0-9]+\\.[0-9][0-9]$/.test(strDecimal));\n}", "function input_decimal(){\n console.log(\"Handling decimal\");\n let dot = \".\";\n const {curr_num} = calculator;\n // case 1: what if i already have a decimal in the current number? do nothing. Check only for when there is\n if(!curr_num.includes(dot)){\n calculator.curr_display += dot;\n calculator.curr_num += dot;\n }\n}", "function num_d(event){\n var char = event.which;\n if (char > 31 && (char < 48 || char > 57) && char != 68) {\n return false;\n }\n}", "function charIsSymbol(charCode)\n{\n switch (charCode)\n {\n case 36: // $\n case 95: // _\n return true;\n\n default:\n return (\n (charCode >= 48 && charCode <= 57) || // 0-9\n (charCode >= 97 && charCode <= 122) || // a-z\n (charCode >= 64 && charCode <= 90) // A-Z\n );\n }\n}", "function isCmplSep(achar) {\n if (achar == 44 || achar == 188 || achar == 10 || achar == 13) {\n return 1;\n } else { \n return 0;\n }\n}", "function isLetterOrNumber(codepoint) {\n return isLetter(codepoint) || isNumber(codepoint);\n}", "function Digitos(e, field) {\n var teclaPulsada = window.event ? window.event.keyCode : e.which;\n var valor = field.value;\n\n if (teclaPulsada == 08 || (teclaPulsada == 46 && valor.indexOf(\".\") == -1)) return true;\n\n return /\\d/.test(String.fromCharCode(teclaPulsada));\n}", "function isnotValidDecimal(str){\n\tif((str.indexOf(\".\"))!=-1){\n\t\tfr1=str.indexOf('.');\n\t\tmm = (str.substring(fr1,str.length));\n\t\tstrnum=(Number(mm.length));\n\t\tif(strnum>3){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}\n}", "function containsDecimalPlaces (string) {\n return (containsDecimal(string) && string.indexOf(\".\") < string.length - 1);\n}", "function numCheck(num) {\n let charPresent = false;\n for (let i = 0; i < num.length; i++) {\n if (isNaN(num[i])) {\n charPresent = true;\n return charPresent;\n }\n }\n}", "function checkDecimalWithPrecesion (field, totalDecimal, allowedPrecision)\r\n{\r\n\r\n\t//alert('inside checkDecimalWithPrecision');\r\n var value = field.value;\r\n if (value.length == 0) {\r\n //value is empty / field is blank\r\n\treturn flagIsBlank;\r\n } \r\n \r\n if (isDecimal(field)) \r\n {\r\n dindex = value.indexOf(\".\", 0);\r\n\tvar s1 = value;\r\n var adj = 0;\r\n\t\r\n\tif (dindex > 0) {\r\n\t s1 = value.substring (0, dindex);\r\n\t var adj = (dindex > 0)?1:0;\r\n\r\n\t var s2 = value.substring (dindex + 1, value.length);\r\n\r\n\t if (s2.length > allowedPrecision) {\r\n\t return flagExceedNumericLimit;\r\n\t }\r\n\t} \r\n\t\r\n\tif (s1.length > (totalDecimal - allowedPrecision + adj)) {\r\n\t //alert (\"Exceeds allowed numerical length\");\t\r\n\t return flagExceedPecisionLimit;\r\n\t}\r\n }\r\n else\r\n\t{\r\n\t return flagIsBlank;\r\n\t}\r\n return flagIsValid; \r\n}", "function isValidCharToStartNumber(ch) {\n return isNumeral(ch) || ch == '-';\n }", "function isDigitalOrLetter(str)\n{\n\tvar result = true;\n \tif(str == null || str.trim() == \"\") return false;\n\t\n\tstr = str.trim();\n\n for(var i=0; i<str.length; i++)\n {\n var strSub = str.substring(i,i+1); \n if( !((strSub<=\"9\"&&strSub>=\"0\") || \n\t\t (strSub<=\"Z\"&&strSub>=\"A\") || \n\t\t\t(strSub<=\"z\"&&strSub>=\"a\")) )\n {\n\t\t\tresult = false;\n\t\t\tbreak;\n }\n }\n return result ;\t\n}", "function isNumberKeyDecimal(evt){\n var charCode = (evt.which) ? evt.which : evt.keyCode;\n if (charCode > 31 && (charCode !== 46 &&(charCode < 48 || charCode > 57)))\n return false;\n return true;\n}", "function priceFormatCheck(input) {\r\n var i = 0;\r\n do {\r\n if (i === input.length) {\r\n return false;\r\n }\r\n i++;\r\n } while (input.charAt(i) != '.');\r\n return 2 === input.length - (i + 1);\r\n}", "function decimal(){\n if (foo.inputMode === false) {\n foo.key = '0.';\n } else if (foo.register.includes('.')){\n return;\n } else {\n foo.key = '.';\n }\n foo.numPad();\n return;\n }", "function isNumberCheck(el, evt) {\n var charCode = (evt.which) ? evt.which : event.keyCode;\n var num=el.value;\n var number = el.value.split('.');\n if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) {\n return false;\n }\n //just one dot\n if((number.length > 1 && charCode == 46) || ( el.value=='' && charCode == 46)) {\n return false;\n }\n //get the carat position\n var caratPos = getSelectionStart(el);\n var dotPos = el.value.indexOf(\".\");\n if( caratPos > dotPos && dotPos>-1 && (number[1].length > 1)){\n return false;\n }\n return true;\n}", "function numbersCurrency(myfield, e, dec)\n{\n\tvar key;\n\tvar keychar;\n\t\n\tif (window.event)\n\t key = window.event.keyCode;\n\telse if (e)\n\t key = e.which;\n\telse\n\t return true;\n\tkeychar = String.fromCharCode(key);\n\t\n\t// control keys\n\tif ((key==null) || (key==0) || (key==8) || \n\t (key==9) || (key==13) || (key==27) )\n\t return true;\n\t\n\t// numbers\n\telse if (((\"0123456789.\").indexOf(keychar) > -1))\n\t return true;\n\t\n\t// decimal point jump\n\telse if (dec && (keychar == \".\"))\n\t {\n\t myfield.form.elements[dec].focus();\n\t return false;\n\t }\n\telse\n\t return false;\n}", "function IsCharCodeNumeric(charCode)\n{\n return ((charCode > 47) && (charCode < 58));\n}", "static get decimal() {\n return /^[\\+\\-]?\\d*\\.\\d+$/;\n }", "function intOnly(myfield, e, dec)\r\n{\r\n\tvar key;\r\n\tvar keychar;\r\n\t \r\n\tif (window.event)\r\n\t key = window.event.keyCode;\r\n\telse if (e)\r\n\t key = e.which;\r\n\telse\r\n\t return true;\r\n\tkeychar = String.fromCharCode(key);\r\n\t \r\n\t// control keys\r\n\tif ((key==null) || (key==0) || (key==8) || \r\n\t\t(key==9) || (key==13) || (key==27) )\r\n\t return true;\r\n\t \r\n\t// numbers\r\n\telse if (((\"0123456789\").indexOf(keychar) > -1))\r\n\t return true;\r\n\telse if (((\".\").indexOf(keychar) > -1)){\r\n\t if (myfield.value.indexOf(\".\") >-1){\r\n\t\t return false;\r\n\t }else \r\n\t return true;\r\n\t }\r\n\t \r\n\telse\r\n\t return false;\r\n}", "function isDigit(ch) {\n return /^[0-9]$/.test(ch);\n }", "function isDecimal(possibleNumber)\n\t{\n//\t\t//trace(\"in is decimal\");\n//\t\t//trace(possibleNumber);\n\n\t\tif (isNaN(possibleNumber))\n\t\t\treturn false;\n\n\t\treturn !(possibleNumber === Math.floor(possibleNumber))\n\t}", "function decimals(evt,id)\n{\n\ttry{\n var charCode = (evt.which) ? evt.which : event.keyCode;\n \n if(charCode==46){\n var txt=document.getElementById(id).value;\n if(!(txt.indexOf(\".\") > -1)){\n\t\n return true;\n }\n }\n if (charCode > 31 && (charCode < 48 || charCode > 57) )\n return false;\n\n return true;\n\t}catch(w){\n\t\talert(w);\n\t}\n}", "function likeNumber(value) {\n\t var code = value.charCodeAt(0);\n\t var nextCode;\n\n\t if (code === plus || code === minus) {\n\t nextCode = value.charCodeAt(1);\n\n\t if (nextCode >= 48 && nextCode <= 57) {\n\t return true;\n\t }\n\n\t var nextNextCode = value.charCodeAt(2);\n\n\t if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) {\n\t return true;\n\t }\n\n\t return false;\n\t }\n\n\t if (code === dot) {\n\t nextCode = value.charCodeAt(1);\n\n\t if (nextCode >= 48 && nextCode <= 57) {\n\t return true;\n\t }\n\n\t return false;\n\t }\n\n\t if (code >= 48 && code <= 57) {\n\t return true;\n\t }\n\n\t return false;\n\t}", "function isDigitOrAlphabetChar(c) {\nreturn ((c>='0' && c<='9') || (c>='a' && c<='z') || (c>='A' && c<='Z'));\n}", "num_decimals(num) {\n if (!this.is_numeric(num)) return false;\n let text = num.toString()\n if (text.indexOf('e-') > -1) {\n let [base, trail] = text.split('e-')\n let elen = parseInt(trail, 10)\n let idx = base.indexOf(\".\")\n return idx == -1 ? 0 + elen : (base.length - idx - 1) + elen\n }\n let index = text.indexOf(\".\")\n return index == -1 ? 0 : (text.length - index - 1)\n }", "function isHexDigit(code) {\n return (\n isDigit(code) || // 0 .. 9\n (code >= 0x0041 && code <= 0x0046) || // A .. F\n (code >= 0x0061 && code <= 0x0066) // a .. f\n );\n}", "startsWith(c){ return this.isSign(c) || Character.isDigit(c) }", "function decimals(evt,id)\n{\t\n\ttry{\n var charCode = (evt.which) ? evt.which : event.keyCode; \n if(charCode==46){\n var txt=document.getElementById(id).value;\n if(!(txt.indexOf(\".\") > -1)){\n\t\n return true;\n }\n }\n if (charCode > 31 && (charCode < 48 || charCode > 57) )\n return false;\n\n return true;\n\t}catch(w){\n\t\t//alert(w);\n\t}\n}", "function checkDecimalMisc(op) {\r\n\tfor (element of splitBySymbol(op)) {\r\n\t\tif (!element.match(/[-+*/%]/) && element % 1 != 0) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t} \r\n\treturn false;\r\n}", "function isDigit(s) { return Number.isInteger(parseInt(s)); }", "function isChar(c) {\n return (c >= 0x0001 && c <= 0xD7FF) ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}", "function checkDecimalAndPrecision(theInputField, val)\r\n{\r\n\r\n theInput = theInputField.value;\r\n theLength = theInput.length ;\r\n var dec_count = 0 ;\r\n\r\n for (var i = 0 ; i < theLength ; i++)\r\n {\r\n if(theInput.charAt(i) == '.')\r\n // the text field has decimal point entry\r\n {\r\n dec_count = dec_count + 1;\r\n }\r\n }\r\n\r\n //check if number field contains more than one decimal points '.'\r\n if(dec_count > 1)\r\n {\r\n\t//alert('The field cannot contain two decimal points');\r\n\ttheInputField.focus();\r\n\ttheInputField.select();\r\n return flagExtraDecimal;\r\n }\r\n //check if decimal field contains just a '.'\r\n if (dec_count == 1 && dec_count == theLength)\r\n {\r\n\t//alert('The field cannot contain just a decimal');\r\n\ttheInputField.focus();\r\n\ttheInputField.select();\r\n \treturn flagOnlyDecimal;\r\n }\r\n for (var i = 0 ; i < theLength ; i++)\r\n {\r\n\t//check if decimal field contains laphabets or spaces\r\n if (theInput.charAt(i) < '0' || theInput.charAt(i) > '9')\r\n {\r\n if(theInput.charAt(i) != '.' && theInput.charAt(i) != ',')\r\n {\r\n // alert(\"This field cannot contain alphabets or spaces\");\r\n theInputField.focus();\r\n\t theInputField.select();\r\n return flagNonNumeric;\r\n }\r\n }\r\n }// for ends\r\n\tif(theInputField.value >= val)\r\n\t{\r\n // alert(\"This field cannot be greater than or equal to\" + val);\r\n\t\ttheInputField.focus();\r\n\t\ttheInputField.select();\r\n\t\treturn flagMaxLimit;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn flagFieldValid;\r\n\t}\r\n}" ]
[ "0.79054266", "0.7266932", "0.67030036", "0.6647496", "0.66463494", "0.6593356", "0.65619695", "0.65289533", "0.6522555", "0.6487612", "0.6487612", "0.6465668", "0.6428157", "0.6406563", "0.6406563", "0.6393902", "0.63832724", "0.6336196", "0.6335597", "0.6279863", "0.62780327", "0.62780327", "0.62780327", "0.62780327", "0.62780327", "0.62780327", "0.62780327", "0.62780327", "0.627547", "0.6274079", "0.62503564", "0.6237782", "0.6235462", "0.62323976", "0.6231939", "0.6222251", "0.6203301", "0.6190887", "0.6190887", "0.6190887", "0.61172533", "0.61034817", "0.60867316", "0.6084722", "0.60651493", "0.60408914", "0.60266906", "0.6012996", "0.6011686", "0.60037524", "0.5991671", "0.59751636", "0.5974268", "0.5965714", "0.5961807", "0.5961807", "0.5935768", "0.5930059", "0.58813316", "0.58712834", "0.58712834", "0.5851423", "0.58447134", "0.5842311", "0.58276224", "0.5822622", "0.5819433", "0.57992095", "0.5797876", "0.57819796", "0.57670075", "0.5765979", "0.5763564", "0.57472324", "0.5737899", "0.57314354", "0.5728371", "0.57278925", "0.57239926", "0.57115996", "0.57015723", "0.5686148", "0.5685616", "0.5680421", "0.56764525", "0.5668791", "0.5667768", "0.5652655", "0.56411135", "0.56409764", "0.5638267", "0.562829", "0.56240505", "0.56206554" ]
0.7949005
4
Removes all keyvalue entries from the hash.
function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; this.size = 0; }
{ "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}", "remove(key) {\r\n const hash = this.calculateHash(key);\r\n if(this.values.hasOwnProperty(hash) && this.values[hash].hasOwnProperty(key)) {\r\n delete this.values[hash][key];\r\n this.numberOfValues--;\r\n }\r\n }", "removeFromHash(hash, ...keys) {\n let hashObj = this.parseHash(hash);\n keys.forEach((key, i) => {\n delete hashObj[key]\n });\n return this.buildHash(hashObj);\n }", "clear() {\n log.map(\"Clearing the map of all the entries\");\n this._map.clear();\n }", "function _cleanupKeys()\n {\n if (this._count == this._keys.length) {\n return;\n }\n var srcIndex = 0;\n var destIndex = 0;\n var seen = {};\n while (srcIndex < this._keys.length) {\n var key = this._keys[srcIndex];\n if (_hasKey(this._map, key)\n && !_hasKey(seen, key)\n ) {\n this._keys[destIndex++] = key;\n seen[key] = true;\n }\n srcIndex++;\n }\n this._keys.length = destIndex;\n }", "async clear() {\n return await keyv.clear();\n }", "remove() {\n for (var key of this.keys) {\n this.elements[key].remove();\n }\n }", "function clear () {\n keys().each(function (cookie) {\n remove(cookie);\n });\n }", "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}", "function hashClear() {\n\t\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t\t this.size = 0;\n\t\t}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "clear() {\n for (const key of Object.keys(this.datastore)) {\n delete this.datastore[key];\n // this.remove(key);\n }\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "function hashClear() {\n\t\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t\t this.size = 0;\n\t\t }", "function hashClear() {\n\t\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t\t this.size = 0;\n\t\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }" ]
[ "0.67325383", "0.66216296", "0.6511944", "0.6454195", "0.6214277", "0.6200593", "0.61385626", "0.61101323", "0.6029097", "0.5966128", "0.5934792", "0.5905935", "0.5905935", "0.5905935", "0.5903774", "0.5899288", "0.5899288", "0.5899288", "0.58634514", "0.58634514", "0.58634514", "0.58634514", "0.58634514", "0.58634514", "0.58634514", "0.58634514", "0.58634514", "0.58634514", "0.58634514", "0.58634514", "0.58634514", "0.58634514", "0.58634514", "0.58634514", "0.58634514", "0.58634514", "0.58634514", "0.58634514", "0.5861084", "0.5861084", "0.58483696", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575", "0.58482575" ]
0.0
-1
Removes all keyvalue entries from the list cache.
function listCacheClear() { this.__data__ = []; this.size = 0; }
{ "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() {\n\t\t this.__data__ = [];\n\t\t}", "function listCacheClear() {\n\t\t this.__data__ = [];\n\t\t}", "function listCacheClear() {\n\t\t this.__data__ = [];\n\t\t }", "function listCacheClear(){this.__data__=[];this.size=0}", "function listCacheClear(){this.__data__=[];this.size=0}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }" ]
[ "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.7234546", "0.7234546", "0.7234546", "0.7234546", "0.7234546", "0.7234546", "0.7234546", "0.7234546", "0.7234546", "0.7234546", "0.7234546", "0.7234546", "0.7234546", "0.7234546", "0.7234546", "0.7234546", "0.7234546", "0.7234546", "0.7234546", "0.72320706", "0.7231067", "0.7231067", "0.7231067", "0.7231067", "0.7231067", "0.7231067", "0.7226719", "0.7226719", "0.7226719", "0.7226719", "0.7214961", "0.7214961", "0.7207822", "0.7207822", "0.7207822", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724", "0.71798724" ]
0.0
-1