Skip to content

Commit df1d6a0

Browse files
schiltz3github-actions[bot]
authored andcommitted
Apply auto formatting changes
1 parent 6a4a3fc commit df1d6a0

File tree

2 files changed

+31
-32
lines changed

2 files changed

+31
-32
lines changed

utils/docker.ts

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
import fs from "node:fs";
2-
3-
//! This code was taken from the package `is-docker` and modified to work here with esm
4-
//! Original repository: https://github.com/sindresorhus/is-docker
5-
let isDockerCached: boolean;
6-
7-
function hasDockerEnv() {
8-
try {
9-
fs.statSync("/.dockerenv");
10-
return true;
11-
} catch {
12-
return false;
13-
}
14-
}
15-
16-
function hasDockerCGroup() {
17-
try {
18-
return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
19-
} catch {
20-
return false;
21-
}
22-
}
23-
24-
export function isDocker() {
25-
// TODO: Use `??=` when targeting Node.js 16.
26-
if (isDockerCached === undefined) {
27-
isDockerCached = hasDockerEnv() || hasDockerCGroup();
28-
}
29-
30-
return isDockerCached;
31-
}
1+
import fs from "node:fs";
2+
3+
//! This code was taken from the package `is-docker` and modified to work here with esm
4+
//! Original repository: https://github.com/sindresorhus/is-docker
5+
let isDockerCached: boolean;
6+
7+
function hasDockerEnv() {
8+
try {
9+
fs.statSync("/.dockerenv");
10+
return true;
11+
} catch {
12+
return false;
13+
}
14+
}
15+
16+
function hasDockerCGroup() {
17+
try {
18+
return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
19+
} catch {
20+
return false;
21+
}
22+
}
23+
24+
export function isDocker() {
25+
// TODO: Use `??=` when targeting Node.js 16.
26+
if (isDockerCached === undefined) {
27+
isDockerCached = hasDockerEnv() || hasDockerCGroup();
28+
}
29+
30+
return isDockerCached;
31+
}

utils/sleep.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ export function sleep(ms: number) {
44
setTimeout(resolve, ms)
55
);
66
}
7-

0 commit comments

Comments
 (0)