Refactor: simplify build infra

This commit is contained in:
SukkaW
2023-09-14 22:34:25 +08:00
parent 2448cbe39a
commit 573c0f5274
22 changed files with 127 additions and 132 deletions

View File

@@ -42,13 +42,11 @@ const compare = (a, b) => {
* @param {import('gorhill-publicsuffixlist').default | null} [gorhill]
*/
const createDomainSorter = (gorhill = null) => {
const cached = require('./cached-tld-parse');
if (gorhill) {
/**
* @param {string} input
*/
const getDomain = cached.createCachedGorhillGetDomain(gorhill);
const getDomain = require('./cached-tld-parse').createCachedGorhillGetDomain(gorhill);
/**
* @param {string} a
@@ -66,7 +64,7 @@ const createDomainSorter = (gorhill = null) => {
};
}
const tldts = cached;
const tldts = require('./cached-tld-parse');
/**
* @param {string} a
* @param {string} b