parse-domain
Version:
Splits a hostname into subdomains, domain and (effective) top-level domains
20 lines • 1.21 kB
JavaScript
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
import * as path from "path";
import * as url from "url";
import * as fs from "fs";
import { fetchPsl } from "../psl/fetch-psl.js";
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
export const done = (() => __awaiter(void 0, void 0, void 0, function* () {
const pathToPslFixture = path.resolve(__dirname, "..", "tests", "fixtures", "public-suffix-list.txt");
const psl = yield fetchPsl();
yield fs.promises.writeFile(pathToPslFixture, psl);
}))();
//# sourceMappingURL=update-psl-fixture.js.map