Skip to content

Commit 7be3a64

Browse files
committed
Move cloneObject into utilities and export it.
1 parent 19a1da5 commit 7be3a64

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

lib/codeql.js

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/codeql.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/util.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/util.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/codeql.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import * as setupCodeql from "./setup-codeql";
3131
import { ToolsFeature, isSupportedToolsFeature } from "./tools-features";
3232
import { shouldEnableIndirectTracing } from "./tracer-config";
3333
import * as util from "./util";
34-
import { BuildMode, wrapError } from "./util";
34+
import { BuildMode, wrapError, cloneObject } from "./util";
3535

3636
type Options = Array<string | number | boolean>;
3737

@@ -1344,10 +1344,6 @@ async function generateCodeScanningConfig(
13441344
return codeScanningConfigFile;
13451345
}
13461346

1347-
function cloneObject<T>(obj: T): T {
1348-
return JSON.parse(JSON.stringify(obj)) as T;
1349-
}
1350-
13511347
// This constant sets the size of each TRAP cache in megabytes.
13521348
const TRAP_CACHE_SIZE_MB = 1024;
13531349

src/util.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,3 +1100,7 @@ export enum BuildMode {
11001100
/** The database will be created by building the source root using manually specified build steps. */
11011101
Manual = "manual",
11021102
}
1103+
1104+
export function cloneObject<T>(obj: T): T {
1105+
return JSON.parse(JSON.stringify(obj)) as T;
1106+
}

0 commit comments

Comments
 (0)