@jsenv/performance-impact 2.2.11 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { assertAndNormalizeDirectoryUrl } from "@jsenv/filesystem"
|
|
2
2
|
import { commentGitHubPullRequestImpact } from "@jsenv/github-pull-request-impact"
|
|
3
3
|
import { importOneExportFromFile } from "@jsenv/dynamic-import-worker"
|
|
4
4
|
|
|
@@ -27,16 +27,16 @@ export const reportPerformanceImpact = async ({
|
|
|
27
27
|
commitInGeneratedByInfo,
|
|
28
28
|
}) => {
|
|
29
29
|
rootDirectoryUrl = assertAndNormalizeDirectoryUrl(rootDirectoryUrl)
|
|
30
|
-
|
|
30
|
+
let performanceReportUrl
|
|
31
|
+
if (performanceReportPath === "string") {
|
|
32
|
+
performanceReportUrl = new URL(performanceReportPath, rootDirectoryUrl).href
|
|
33
|
+
} else if (performanceReportPath instanceof URL) {
|
|
34
|
+
performanceReportUrl = performanceReportPath.href
|
|
35
|
+
} else {
|
|
31
36
|
throw new TypeError(
|
|
32
|
-
`performanceReportPath must be a string but received ${performanceReportPath}`,
|
|
37
|
+
`performanceReportPath must be a string or an url but received ${performanceReportPath}`,
|
|
33
38
|
)
|
|
34
39
|
}
|
|
35
|
-
rootDirectoryUrl = assertAndNormalizeDirectoryUrl(rootDirectoryUrl)
|
|
36
|
-
const performanceReportUrl = resolveUrl(
|
|
37
|
-
performanceReportPath,
|
|
38
|
-
rootDirectoryUrl,
|
|
39
|
-
)
|
|
40
40
|
|
|
41
41
|
return commentGitHubPullRequestImpact({
|
|
42
42
|
logLevel,
|