Add launch.json into the .vscode folder.
Now, enter the Debug view. Either add debugger into one of the tests or add breakpoints, before you execute one of the scripts.
| import { useLayoutEffect, useState } from 'react'; | |
| /** | |
| * Determine if the input DOM element is truncated by CSS (using ellipse for example) | |
| * @param domElement | |
| * @returns boolean | |
| */ | |
| export function isTruncated(domElement: Element): boolean { | |
| // https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollWidth | |
| return domElement.scrollWidth > domElement.clientWidth; |
| import { useLayoutEffect, useState } from 'react'; | |
| /** | |
| * Determine if the input DOM element is truncated by CSS (using ellipse for example) | |
| * @param domElement | |
| * @returns boolean | |
| */ | |
| export function isTruncated(domElement: Element): boolean { | |
| // https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollWidth | |
| return domElement.scrollWidth > domElement.clientWidth; |
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>App Redirection</title> | |
| </head> | |
| <body> | |
| <!-- iframe used for attempting to load a custom protocol --> | |
| <iframe style="display:none" height="0" width="0" id="loader"></iframe> |
| // Remove Duplicates from an array | |
| const removeDuplicates = | |
| arr => arr.filter((item, index) => index === arr.indexOf(item)); | |
| const removeDuplicates1 = array => [...new Set(array)]; | |
| const removeDuplicates2 = array => Array.from(new Set(array)); | |
| // Flattens an array(doesn't flatten deeply). |
| /*TODO MAKE IT IN ES6 | |
| var data=[4,5,6,9,10,14,15,20,21,22,23,24,25,30,31,34] | |
| output | |
| 4-6,9-10,14-15,20-25,30-31,34 | |
| */ | |
| var data=[4,5,6,9,10,14,15,20,21,22,23,24,25,30,31,34,36,37,94,95]; | |
| var start=data[0]; | |
| var temp=1; | |
| var a=0; |