Skip to content

Commit

Permalink
Introduce ts-check
Browse files Browse the repository at this point in the history
  • Loading branch information
foooomio committed May 15, 2019
1 parent a7adc5d commit 68ca046
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -7,7 +7,8 @@
"private": true,
"license": "MIT",
"devDependencies": {
"mocha": "^5.2.0",
"puppeteer-core": "^1.11.0"
"@types/chrome": "0.0.85",
"mocha": "^6.1.4",
"puppeteer-core": "^1.16.0"
}
}
7 changes: 3 additions & 4 deletions src/content.js
@@ -1,6 +1,4 @@
//
// content.js
//
// @ts-check

'use strict';

Expand Down Expand Up @@ -57,6 +55,7 @@ function getComputedBackgroundImages(element, pseudo) {
const results = [];
value.replace(/url\("?(.+?)"?\)/g, (match, p) => {
results.push(p.replace(/\\"/g, '"'));
return '';
});
return results;
}
Expand All @@ -66,7 +65,7 @@ function getComputedBackgroundImages(element, pseudo) {
* @returns {string}
*/
function getSVGDataURI(element) {
const svg = element.cloneNode(true);
const svg = /** @type {SVGSVGElement} */ (element.cloneNode(true));
svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
svg.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
return 'data:image/svg+xml,' + svg.outerHTML;
Expand Down
4 changes: 1 addition & 3 deletions src/script.js
@@ -1,6 +1,4 @@
//
// script.js
//
// @ts-check

'use strict';

Expand Down

0 comments on commit 68ca046

Please sign in to comment.