diff --git a/package-lock.json b/package-lock.json index 870a7893e4..872f090a0e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "ISC", "dependencies": { "glob": "^8.0.3", - "tldjs": "^2.3.1" + "tldts": "^6.1.2" } }, "node_modules/balanced-match": { @@ -82,23 +82,22 @@ "wrappy": "1" } }, - "node_modules/punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==" - }, - "node_modules/tldjs": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tldjs/-/tldjs-2.3.1.tgz", - "integrity": "sha512-W/YVH/QczLUxVjnQhFC61Iq232NWu3TqDdO0S/MtXVz4xybejBov4ud+CIwN9aYqjOecEqIy0PscGkwpG9ZyTw==", - "hasInstallScript": true, + "node_modules/tldts": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.2.tgz", + "integrity": "sha512-bmIVB9OKvYlNcEoCRpa2swYlLpAmhLvGlXMZ0pSzmbU+0S/LNZJwTzHB56Fom7m9XCVh+mf2RDyCTRgX6MRDjQ==", "dependencies": { - "punycode": "^1.4.1" + "tldts-core": "^6.1.2" }, - "engines": { - "node": ">= 4" + "bin": { + "tldts": "bin/cli.js" } }, + "node_modules/tldts-core": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.2.tgz", + "integrity": "sha512-cFBCCSilkRe/7JkZrQlzqhWDE0r1irpEYRp5XiFLFGl8fTwN4eWqutyx9wfFaDfmVv7E7pQMUZnM1VHnOid5Vw==" + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -166,19 +165,19 @@ "wrappy": "1" } }, - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==" - }, - "tldjs": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tldjs/-/tldjs-2.3.1.tgz", - "integrity": "sha512-W/YVH/QczLUxVjnQhFC61Iq232NWu3TqDdO0S/MtXVz4xybejBov4ud+CIwN9aYqjOecEqIy0PscGkwpG9ZyTw==", + "tldts": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.2.tgz", + "integrity": "sha512-bmIVB9OKvYlNcEoCRpa2swYlLpAmhLvGlXMZ0pSzmbU+0S/LNZJwTzHB56Fom7m9XCVh+mf2RDyCTRgX6MRDjQ==", "requires": { - "punycode": "^1.4.1" + "tldts-core": "^6.1.2" } }, + "tldts-core": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.2.tgz", + "integrity": "sha512-cFBCCSilkRe/7JkZrQlzqhWDE0r1irpEYRp5XiFLFGl8fTwN4eWqutyx9wfFaDfmVv7E7pQMUZnM1VHnOid5Vw==" + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index 03345f20f3..6572cc4260 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "url-validation": "node workflow_scripts/url-validation.js", "json-duplicates": "node workflow_scripts/no-duplicates.js", "static-bl-fail": "echo \"Error: Blacklists directory is automatically managed by internal systems and CANNOT be altered in a pull request. Please contact PhishFort team.\" && exit 1" - }, "repository": { "type": "git", @@ -22,6 +21,6 @@ "homepage": "https://github.com/phishfort/phishfort-lists#readme", "dependencies": { "glob": "^8.0.3", - "tldjs": "^2.3.1" + "tldts": "^6.1.2" } } diff --git a/workflow_scripts/url-validation.js b/workflow_scripts/url-validation.js index 1b1f803bbd..e45da43e1f 100644 --- a/workflow_scripts/url-validation.js +++ b/workflow_scripts/url-validation.js @@ -1,6 +1,6 @@ const fs = require("fs"); const path = require("path"); -const tldjs = require("tldjs"); +const tldts = require("tldts"); const { getDomainJsonFileNames } = require("./helpers/get-json-file-names"); const { log } = require("./helpers/log"); @@ -13,7 +13,7 @@ const init = async () => { const data = JSON.parse(fs.readFileSync(dirPath)); for (let url of data) { - if (tldjs.parse(url).hostname !== url) { + if (tldts.parse(url).hostname !== url) { log.error(`'${url}' in "${fn}" is not a valid domain.`); failed = true; }