Skip to content

Commit f96abc2

Browse files
committed
Modify autometrics/src/platform.node.ts to work in deno test env (import process)
1 parent 58e2ede commit f96abc2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/autometrics/src/platform.node.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import { AsyncLocalStorage } from "node:async_hooks";
66
import { readFileSync } from "node:fs";
77
import { dirname, join, parse } from "node:path";
8+
import * as process from "node:process";
89

910
import { AUTOMETRICS_DEFAULT_SERVICE_NAME } from "./constants.ts";
1011
import { getGitRepositoryUrl, getPackageStringField } from "./platformUtils.ts";
@@ -118,7 +119,7 @@ export function getALSInstance() {
118119
* @internal
119120
*/
120121
export function isRootPath(pathToCheck: string): boolean {
121-
return pathToCheck == parse(getCwd()).root;
122+
return pathToCheck === parse(getCwd()).root;
122123
}
123124

124125
function detectPackageName(): string | undefined {
@@ -142,7 +143,7 @@ function detectRepositoryUrl(): string | undefined {
142143
} catch {}
143144
}
144145

145-
function readClosest(path: string): Uint8Array {
146+
export function readClosest(path: string): Uint8Array {
146147
let basePath = getCwd();
147148
while (basePath.length > 0) {
148149
try {

0 commit comments

Comments
 (0)