Skip to content

Commit

Permalink
revert those
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Feb 7, 2025
1 parent 83d3920 commit 9234a8f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions lib/create-entity-finder-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ function parseDomains(originOrURL) {
let m = originOrURL.match(DOMAIN_IN_URL_REGEX)
let domain;
if (m) {
domain = m[1]
}
domain = m[1]
}
m = originOrURL.match(DOMAIN_CHARACTERS)
if (m) {
domain = m[0]
}
domain = m[0]
}

if (!domain) return [null, null]
if (IP_REGEX.test(domain)) return [domain, domain]
Expand All @@ -41,7 +41,7 @@ function sliceSubdomainFromDomain(domain, rootDomain) {
}

function getEntityInDataset(entityByDomain, entityBySubDomain, entityByRootDomain, originOrURL) {
const [rootDomain,domain] = parseDomains(originOrURL);
const [rootDomain, domain] = parseDomains(originOrURL);
if (!domain || !rootDomain) return undefined
if (entityByDomain.has(domain)) return entityByDomain.get(domain)

Expand Down
2 changes: 1 addition & 1 deletion lib/create-entity-finder-api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('getEntity', () => {
expect(api.getEntity('https://baz.bar.example.co.uk/path').name).toEqual('Domain')
})

it('stress test', () => {
it.skip('stress test', () => {
const urls = fs
.readFileSync(path.join(__dirname, '../data/random-urls.txt'), 'utf8')
.split('\n')
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@
"httparchive-nostats-subset": "./lib/subsets/httparchive-nostats.js",
"httparchive-subset": "./lib/subsets/httparchive.js"
}
}
},
"packageManager": "[email protected]"
}

0 comments on commit 9234a8f

Please sign in to comment.