Socket
Socket
Sign inDemoInstall

parse-domain

Package Overview
Dependencies
8
Maintainers
9
Versions
53
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.0 to 6.0.0

build/config.d.ts

19

bin/update.js
#!/usr/bin/env node
"use strict";
import { EOL } from "os";
const { EOL } = require("os");
(async () => {
process.argv.push(
"--",
"../../serialized-tries",
"../../../build-esm/serialized-tries"
);
process.argv.push("--", "../../serialized-tries");
await require("../build-cjs/src/scripts/update-tries.js").done;
const updateTries = await import("../build/scripts/update-tries.js");
await updateTries.done;
process.stderr.write("Running smoke test... ");
require("../build-cjs/src/smoke-test.js").runSmokeTest();
const smokeTest = await import("../build/smoke-test.js");
smokeTest.runSmokeTest();
process.stdout.write("ok" + EOL);
})().catch((error) => {
console.error(`parse-domain update failed: ${error}`);
// eslint-disable-next-line no-process-exit, node/no-process-exit
process.exit(1);
});
{
"name": "parse-domain",
"version": "5.0.0",
"version": "6.0.0",
"description": "Splits a hostname into subdomains, domain and (effective) top-level domains",

@@ -14,26 +14,19 @@ "keywords": [

],
"main": "./build-cjs/src/main.js",
"module": "./build-esm/src/main.js",
"types": "./build-esm/src/main.d.ts",
"exports": {
"require": "./build-cjs/src/main.js",
"node": "./build-cjs/src/main.mjs",
"default": "./build-esm/src/main.js"
},
"type": "module",
"main": "./build/src/main.js",
"types": "./build/src/main.d.ts",
"scripts": {
"test": "run-p test:*",
"test:suite": "jest",
"posttest": "run-s build posttest:*",
"posttest:lint": "eslint --cache --ext js,ts *.js src bin",
"test:suite": "node --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js",
"test:lint": "eslint --max-warnings 0 --cache --ext js,ts --ignore-path .gitignore .",
"build": "run-s build:*",
"build:cleanup": "rimraf build-cjs build-esm",
"build:tsc": "run-p build:tsc:cjs build:tsc:esm",
"build:tsc:cjs": "tsc -p ./tsconfig.build-cjs.json",
"build:tsc:esm": "tsc -p ./tsconfig.build-esm.json",
"build:cpy": "cpy ./src/main.mjs ./build-cjs/src",
"build:cleanup": "rimraf build",
"build:tsc": "tsc -p ./tsconfig.build.json",
"build:update": "./bin/update.js",
"prepare": "husky install",
"update:psl-fixture": "ts-node --transpile-only ./src/scripts/update-psl-fixture.ts",
"update:tries": "ts-node --transpile-only ./src/scripts/update-tries.ts -- ../../serialized-tries",
"update:dependencies": "updtr"
"prepare": "run-s prepare:*",
"prepare:husky": "husky install",
"prepare:build": "npm run build",
"update:psl-fixture": "npm run node -- ./src/scripts/update-psl-fixture.ts",
"update:dependencies": "updtr",
"node": "node --no-warnings --loader ts-node/esm/transpile-only"
},

@@ -51,4 +44,4 @@ "bin": {

"bin",
"build-cjs",
"build-esm"
"build",
"serialized-tries"
],

@@ -68,31 +61,28 @@ "sideEffects": false,

"dependencies": {
"is-ip": "^3.1.0",
"node-fetch": "^2.6.1",
"punycode": "^2.1.1"
"is-ip": "^4.0.0",
"node-fetch": "^3.2.0"
},
"devDependencies": {
"@types/jest": "^27.0.1",
"@types/node": "^16.7.10",
"@types/node-fetch": "^2.5.12",
"@types/jest": "^27.4.0",
"@types/node": "^17.0.10",
"@types/punycode": "^2.1.0",
"@typescript-eslint/eslint-plugin": "^4.30.0",
"@typescript-eslint/parser": "^4.30.0",
"cpy-cli": "^3.1.1",
"eslint": "^7.32.0",
"eslint-config-peerigon": "^31.0.2",
"@typescript-eslint/eslint-plugin": "^5.10.0",
"@typescript-eslint/parser": "^5.10.0",
"eslint": "^8.7.0",
"eslint-config-peerigon": "^33.2.4",
"eslint-plugin-no-null": "^1.0.2",
"eslint-plugin-node": "^11.1.0",
"husky": "^7.0.2",
"jest": "^27.1.0",
"lint-staged": "^11.1.2",
"nock": "^13.1.3",
"husky": "^7.0.4",
"jest": "^27.4.7",
"lint-staged": "^12.3.1",
"nock": "^13.2.2",
"npm-run-all": "^4.1.5",
"pin-github-action": "^1.4.0",
"prettier": "^2.3.2",
"pin-github-action": "^1.5.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.2",
"ts-jest": "^27.0.5",
"ts-node": "^10.2.1",
"typescript": "^4.4.2",
"ts-jest": "^27.1.3",
"ts-node": "^10.4.0",
"typescript": "^4.5.5",
"updtr": "^4.0.0"
}
}

@@ -417,5 +417,5 @@ # parse-domain

type ParseResultInvalid = {
type: ParseResultType.INVALID;
hostname: string | typeof NO_HOSTNAME;
errors: Array<ValidationError>;
type: ParseResultType.INVALID;
hostname: string | typeof NO_HOSTNAME;
errors: Array<ValidationError>;
};

@@ -426,5 +426,5 @@

{
type: "INVALID",
hostname: ".com",
errors: [...]
type: "INVALID",
hostname: ".com",
errors: [...]
}

@@ -441,5 +441,5 @@ ```

type ValidationError = {
type: ValidationErrorType;
message: string;
column: number;
type: ValidationErrorType;
message: string;
column: number;
};

@@ -450,5 +450,5 @@

{
type: "LABEL_MIN_LENGTH",
message: `Label "" is too short. Label is 0 octets long but should be at least 1.`,
column: 1,
type: "LABEL_MIN_LENGTH",
message: `Label "" is too short. Label is 0 octets long but should be at least 1.`,
column: 1,
}

@@ -488,5 +488,5 @@ ```

type ParseResultIp = {
type: ParseResultType.Ip;
hostname: string;
ipVersion: 4 | 6;
type: ParseResultType.Ip;
hostname: string;
ipVersion: 4 | 6;
};

@@ -497,5 +497,5 @@

{
type: "IP",
hostname: "192.168.0.1",
ipVersion: 4
type: "IP",
hostname: "192.168.0.1",
ipVersion: 4
}

@@ -525,5 +525,5 @@ ```

type ParseResultReserved = {
type: ParseResultType.Reserved;
hostname: string;
labels: Array<string>;
type: ParseResultType.Reserved;
hostname: string;
labels: Array<string>;
};

@@ -534,5 +534,5 @@

{
type: "RESERVED",
hostname: "pecorino.local",
labels: ["pecorino", "local"]
type: "RESERVED",
hostname: "pecorino.local",
labels: ["pecorino", "local"]
}

@@ -551,5 +551,5 @@ ```

type ParseResultNotListed = {
type: ParseResultType.NotListed;
hostname: string;
labels: Array<string>;
type: ParseResultType.NotListed;
hostname: string;
labels: Array<string>;
};

@@ -560,5 +560,5 @@

{
type: "NOT_LISTED",
hostname: "this.is.not-listed",
labels: ["this", "is", "not-listed"]
type: "NOT_LISTED",
hostname: "this.is.not-listed",
labels: ["this", "is", "not-listed"]
}

@@ -575,13 +575,13 @@ ```

type ParseResultListed = {
type: ParseResultType.Listed;
hostname: string;
labels: Array<string>;
subDomains: Array<string>;
domain: string | undefined;
topLevelDomains: Array<string>;
icann: {
subDomains: Array<string>;
domain: string | undefined;
topLevelDomains: Array<string>;
};
type: ParseResultType.Listed;
hostname: string;
labels: Array<string>;
subDomains: Array<string>;
domain: string | undefined;
topLevelDomains: Array<string>;
icann: {
subDomains: Array<string>;
domain: string | undefined;
topLevelDomains: Array<string>;
};
};

@@ -592,13 +592,13 @@

{
type: "LISTED",
hostname: "parse-domain.github.io",
labels: ["parse-domain", "github", "io"]
subDomains: [],
domain: "parse-domain",
topLevelDomains: ["github", "io"],
icann: {
subDomains: ["parse-domain"],
domain: "github",
topLevelDomains: ["io"]
}
type: "LISTED",
hostname: "parse-domain.github.io",
labels: ["parse-domain", "github", "io"]
subDomains: [],
domain: "parse-domain",
topLevelDomains: ["github", "io"],
icann: {
subDomains: ["parse-domain"],
domain: "github",
topLevelDomains: ["io"]
}
}

@@ -605,0 +605,0 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc