From 8212532b29fbcf971cb320b8cfc84f3a8d8ad795 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Fri, 20 Sep 2024 11:10:19 +0200 Subject: [PATCH] fix(cli): make CLI compatible with Node 18 --- cli/utils.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cli/utils.ts b/cli/utils.ts index f0927baba4..5f2de77f6b 100644 --- a/cli/utils.ts +++ b/cli/utils.ts @@ -3,6 +3,7 @@ // @ts-nocheck This file is copied from a JS project, so it's not type-safe. import { log, encodeHex, SEP } from "./deps.ts"; +import crypto from "node:crypto"; export function deepEqual(a: T, b: T): boolean { if (a === b) return true; @@ -132,6 +133,9 @@ export function sleep(ms: number) { export function isFileResource(path: string): boolean { const splitPath = path.split("."); - return splitPath.length >= 4 && splitPath[1] == "resource" && splitPath[2] == "file"; + return ( + splitPath.length >= 4 && + splitPath[1] == "resource" && + splitPath[2] == "file" + ); } -