From 1ed633f937896340f5f414e9071e74b4a1c42887 Mon Sep 17 00:00:00 2001 From: Michael Brewer Date: Sat, 25 May 2024 12:16:14 -0700 Subject: [PATCH] chore(git-config): revert --- test.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/test.ts b/test.ts index 193bb04..c2eb65e 100644 --- a/test.ts +++ b/test.ts @@ -2,12 +2,6 @@ import { readableStreamToText, spawn } from "bun"; import { afterEach, expect, it } from "bun:test"; import { readFile, unlink } from "fs/promises"; -function uuidv4() { - return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, c => - (+c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +c / 4).toString(16) - ); -} - export const runContainer = async ( image: string, init = "sleep infinity", @@ -179,7 +173,7 @@ export const runTerraformApply = async ( vars: Record, env: Record = {}, ): Promise => { - const stateFile = `${dir}/${uuidv4()}.tfstate`; + const stateFile = `${dir}/${crypto.randomUUID()}.tfstate`; Object.keys(vars).forEach((key) => (env[`TF_VAR_${key}`] = vars[key])); const proc = spawn( [