third-party-web
Advanced tools
Comparing version 0.5.0 to 0.6.0
@@ -32,2 +32,5 @@ const DOMAIN_IN_URL_REGEX = /:\/\/(.*?)(\/|$)/ | ||
if (!entity.company) entity.company = entity.name | ||
entity.totalExecutionTime = Number(entity.totalExecutionTime) || 0 | ||
entity.totalOccurrences = Number(entity.totalOccurrences) || 0 | ||
entity.averageExecutionTime = entity.totalExecutionTime / entity.totalOccurrences | ||
@@ -34,0 +37,0 @@ for (const domain of entity.domains) { |
@@ -7,2 +7,5 @@ export interface IEntity { | ||
domains: string[] | ||
averageExecutionTime: number | ||
totalExecutionTime: number | ||
totalOccurrences: number | ||
} | ||
@@ -9,0 +12,0 @@ |
@@ -26,19 +26,58 @@ const fs = require('fs') | ||
it('works for direct domain usage', () => { | ||
expect(getEntity('https://js.connect.facebook.net/lib.js')).toEqual({ | ||
name: 'Facebook', | ||
company: 'Facebook', | ||
homepage: 'https://www.facebook.com', | ||
categories: ['social'], | ||
domains: expect.any(Array), | ||
}) | ||
expect(getEntity('https://js.connect.facebook.net/lib.js')).toMatchInlineSnapshot(` | ||
Object { | ||
"averageExecutionTime": 233.43429691479307, | ||
"categories": Array [ | ||
"social", | ||
], | ||
"company": "Facebook", | ||
"domains": Array [ | ||
"www.facebook.com", | ||
"connect.facebook.net", | ||
"staticxx.facebook.com", | ||
"static.xx.fbcdn.net", | ||
"m.facebook.com", | ||
"atlassbx.com", | ||
"fbcdn-photos-e-a.akamaihd.net", | ||
"23.62.3.183", | ||
"akamai.net", | ||
"akamaiedge.net", | ||
"akamaitechnologies.com", | ||
"akamaitechnologies.fr", | ||
"akamaized.net", | ||
"edgefcs.net", | ||
"edgekey.net", | ||
"edgesuite.net", | ||
"srip.net", | ||
"cquotient.com", | ||
"demandware.net", | ||
"platform-lookaside.fbsbx.com", | ||
], | ||
"homepage": "https://www.facebook.com", | ||
"name": "Facebook", | ||
"totalExecutionTime": 2249323397, | ||
"totalOccurrences": 9635788, | ||
} | ||
`) | ||
}) | ||
it('works for inferred domain usage', () => { | ||
expect(getEntity('https://unknown.typekit.net/fonts.css')).toEqual({ | ||
name: 'Adobe TypeKit', | ||
company: 'Adobe', | ||
homepage: 'https://fonts.adobe.com/', | ||
categories: ['library'], | ||
domains: expect.any(Array), | ||
}) | ||
expect(getEntity('https://unknown.typekit.net/fonts.css')).toMatchInlineSnapshot(` | ||
Object { | ||
"averageExecutionTime": 233.43429691479307, | ||
"categories": Array [ | ||
"library", | ||
], | ||
"company": "Adobe", | ||
"domains": Array [ | ||
"use.typekit.net", | ||
"typekit.com", | ||
"p.typekit.net", | ||
], | ||
"homepage": "https://fonts.adobe.com/", | ||
"name": "Adobe TypeKit", | ||
"totalExecutionTime": 2249323397, | ||
"totalOccurrences": 9635788, | ||
} | ||
`) | ||
}) | ||
@@ -45,0 +84,0 @@ |
{ | ||
"name": "third-party-web", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "Categorized data on third party entities on the web.", | ||
@@ -34,2 +34,3 @@ "main": "./lib/index.js", | ||
"exportAliases": { | ||
"httparchive-nostats-subset": "./lib/subsets/httparchive-nostats.js", | ||
"httparchive-subset": "./lib/subsets/httparchive.js" | ||
@@ -36,0 +37,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
465469
21
171
0