Move cloneObject into utilities and export it.

This commit is contained in:
Remco Vermeulen 2024-07-31 17:56:06 -07:00
parent 19a1da54d1
commit 7be3a64c02
6 changed files with 12 additions and 11 deletions

View file

@ -31,7 +31,7 @@ import * as setupCodeql from "./setup-codeql";
import { ToolsFeature, isSupportedToolsFeature } from "./tools-features";
import { shouldEnableIndirectTracing } from "./tracer-config";
import * as util from "./util";
import { BuildMode, wrapError } from "./util";
import { BuildMode, wrapError, cloneObject } from "./util";
type Options = Array<string | number | boolean>;
@ -1344,10 +1344,6 @@ async function generateCodeScanningConfig(
return codeScanningConfigFile;
}
function cloneObject<T>(obj: T): T {
return JSON.parse(JSON.stringify(obj)) as T;
}
// This constant sets the size of each TRAP cache in megabytes.
const TRAP_CACHE_SIZE_MB = 1024;