Skip to content

Commit

Permalink
Update node imports to include "node:" prefix. Replace NodeJS.Timer r…
Browse files Browse the repository at this point in the history
…eferences with NodeJS.Timeout.
  • Loading branch information
mceachen committed Sep 4, 2023
1 parent 77062c3 commit 029a7fd
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/Async.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import timers from "timers"
import timers from "node:timers"

export function delay(millis: number, unref = false): Promise<void> {
return new Promise<void>((resolve) => {
Expand Down
2 changes: 1 addition & 1 deletion src/BatchCluster.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import process from "process"
import process from "node:process"
import { filterInPlace } from "./Array"
import { delay, until } from "./Async"
import { BatchCluster } from "./BatchCluster"
Expand Down
10 changes: 5 additions & 5 deletions src/BatchCluster.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import child_process from "child_process"
import events from "events"
import process from "process"
import timers from "timers"
import child_process from "node:child_process"
import events from "node:events"
import process from "node:process"
import timers from "node:timers"
import { count, filterInPlace } from "./Array"
import {
BatchClusterEmitter,
Expand Down Expand Up @@ -83,7 +83,7 @@ export class BatchCluster {
#nextSpawnTime = 0
#lastPidsCheckTime = 0
readonly #tasks: Task[] = []
#onIdleInterval: NodeJS.Timer | undefined
#onIdleInterval: NodeJS.Timeout | undefined
readonly #startErrorRate = new Rate()
#spawnedProcs = 0
#endPromise?: Deferred<void>
Expand Down
6 changes: 3 additions & 3 deletions src/BatchProcess.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import child_process from "child_process"
import timers from "timers"
import child_process from "node:child_process"
import timers from "node:timers"
import { until } from "./Async"
import { Deferred } from "./Deferred"
import { cleanError, tryEach } from "./Error"
Expand Down Expand Up @@ -68,7 +68,7 @@ export class BatchProcess {
* Should be undefined if this instance is not currently processing a task.
*/
#currentTask: Task | undefined
#currentTaskTimeout: NodeJS.Timer | undefined
#currentTaskTimeout: NodeJS.Timeout | undefined

#endPromise: undefined | Deferred<void>

Expand Down
2 changes: 1 addition & 1 deletion src/Logger.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import util from "util"
import util from "node:util"
import { map } from "./Object"
import { notBlank } from "./String"

Expand Down
4 changes: 2 additions & 2 deletions src/Pids.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import child_process from "child_process"
import process from "process"
import child_process from "node:child_process"
import process from "node:process"
import { map } from "./Object"
import { isWin } from "./Platform"

Expand Down
2 changes: 1 addition & 1 deletion src/Platform.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os from "os"
import os from "node:os"

const _platform = os.platform()

Expand Down
2 changes: 1 addition & 1 deletion src/Stream.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import stream from "stream"
import stream from "node:stream"

export function end(
endable: stream.Writable,
Expand Down
2 changes: 1 addition & 1 deletion src/Timeout.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import timers from "timers"
import timers from "node:timers"
export const Timeout = Symbol("timeout")

export async function thenOrTimeout<T>(
Expand Down
6 changes: 3 additions & 3 deletions src/_chai.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ try {
}

import { expect, use } from "chai"
import child_process from "child_process"
import path from "path"
import process from "process"
import child_process from "node:child_process"
import path from "node:path"
import process from "node:process"
import { Log, logger, setLogger } from "./Logger"
import { Parser } from "./Parser"
import { pids } from "./Pids"
Expand Down
2 changes: 1 addition & 1 deletion src/test.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import child_process from "child_process"
import child_process from "node:child_process"
import { until } from "./Async"
import { Deferred } from "./Deferred"
import { kill, pidExists } from "./Pids"
Expand Down
2 changes: 1 addition & 1 deletion src/test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
import process from "process"
import process from "node:process"
import { delay } from "./Async"
import { Mutex } from "./Mutex"

Expand Down

0 comments on commit 029a7fd

Please sign in to comment.