diff --git a/package.json b/package.json index 6f3221ae..3863f372 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "@types/firefox-webext-browser": "^78.0.0", "@types/jest": "^26.0.4", "@types/node": "^14.0.23", + "@types/ramda": "^0.27.11", "@types/selenium-webdriver": "^4.0.9", "@typescript-eslint/eslint-plugin": "^3.6.1", "@typescript-eslint/eslint-plugin-tslint": "^3.6.1", diff --git a/src/background.ts b/src/background.ts index 9e69eb3d..b1f8e760 100644 --- a/src/background.ts +++ b/src/background.ts @@ -166,7 +166,7 @@ config.addChangeListener("autocmds", (previous, current) => const path = R.path([requestEvent, pattern]) // If this is a new autocmd, register it - !R.equals(...R.map(path, [current, previous])) && + path(current) !== path(previous) && webrequests.registerWebRequestAutocmd( requestEvent, pattern, diff --git a/src/content/hinting.ts b/src/content/hinting.ts index e7614d91..94068553 100644 --- a/src/content/hinting.ts +++ b/src/content/hinting.ts @@ -1017,7 +1017,9 @@ export function hintables(selectors = DOM.HINTTAGS_selectors, withjs = false) { hintables.push({ elements: R.pipe( Array.from, - R.filter(DOM.isVisible), + // Ramda gives an error here without the "any" + // Problem for a rainy day :) + R.filter(DOM.isVisible) as any, R.without(elems), changeHintablesToLargestChild, )(DOM.hintworthy_js_elems), diff --git a/src/lib/config.ts b/src/lib/config.ts index 5cd73857..9ac13d83 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -25,7 +25,8 @@ import * as binding from "@src/lib/binding" const removeNull = R.when( R.is(Object), R.pipe( - R.reject(val => val === null), + // Ramda gives an error here without the any + R.reject(val => val === null) as any, R.map(a => removeNull(a)), ), ) diff --git a/tsconfig.json b/tsconfig.json index 965e9dd1..779342eb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,7 @@ "noImplicitThis": true, "strictFunctionTypes": true, "baseUrl": "src/", - "types": ["@types/firefox-webext-browser", "web-ext-types"], + "types": ["@types/ramda", "@types/firefox-webext-browser", "web-ext-types"], "paths": { "@src/*": ["*"] } diff --git a/yarn.lock b/yarn.lock index b22ee579..5e4619c9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -752,6 +752,13 @@ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-1.19.1.tgz#33509849f8e679e4add158959fdb086440e9553f" integrity sha512-5qOlnZscTn4xxM5MeGXAMOsIOIKIbh9e85zJWfBRVPlRMEVawzoPhINYbRGkBZCI8LxvBe7tJCdWiarA99OZfQ== +"@types/ramda@^0.27.11": + version "0.27.11" + resolved "https://registry.yarnpkg.com/@types/ramda/-/ramda-0.27.11.tgz#a2efedc1fecc0faa2d3530eb53cf468e219f7c51" + integrity sha512-pojA0+wBhjMWfwZ1tAea/OdUqZxaRQOi/vHldthrOIEPdRQdJb/hvU4yM1uHKGTT89ZZpxe43KM1sq5YGxS5lw== + dependencies: + ts-toolbelt "^6.3.3" + "@types/selenium-webdriver@^4.0.9": version "4.0.9" resolved "https://registry.yarnpkg.com/@types/selenium-webdriver/-/selenium-webdriver-4.0.9.tgz#12621e55b2ef8f6c98bd17fe23fa720c6cba16bd" @@ -8349,6 +8356,11 @@ ts-node@^8.10.2: source-map-support "^0.5.17" yn "3.1.1" +ts-toolbelt@^6.3.3: + version "6.13.4" + resolved "https://registry.yarnpkg.com/ts-toolbelt/-/ts-toolbelt-6.13.4.tgz#313a1a380341c99db3f669cb8cdbfd33354aa98f" + integrity sha512-6DJVcjPYdgF0NR2G80vNrRAChgks16DQ/a49UzQOF9opMixAv61vCQcSUSKX64sXAf2OKqke0gapxtTZGE/qrg== + tsconfig-paths-webpack-plugin@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/tsconfig-paths-webpack-plugin/-/tsconfig-paths-webpack-plugin-3.2.0.tgz#6e70bd42915ad0efb64d3385163f0c1270f3e04d"