Move cloneObject into utilities and export it.
This commit is contained in:
parent
19a1da54d1
commit
7be3a64c02
6 changed files with 12 additions and 11 deletions
5
lib/codeql.js
generated
5
lib/codeql.js
generated
|
|
@ -813,7 +813,7 @@ async function runTool(cmd, args = [], opts = {}) {
|
||||||
async function generateCodeScanningConfig(config, logger) {
|
async function generateCodeScanningConfig(config, logger) {
|
||||||
const codeScanningConfigFile = getGeneratedCodeScanningConfigPath(config);
|
const codeScanningConfigFile = getGeneratedCodeScanningConfigPath(config);
|
||||||
// make a copy so we can modify it
|
// make a copy so we can modify it
|
||||||
const augmentedConfig = cloneObject(config.originalUserInput);
|
const augmentedConfig = (0, util_1.cloneObject)(config.originalUserInput);
|
||||||
// Inject the queries from the input
|
// Inject the queries from the input
|
||||||
if (config.augmentationProperties.queriesInput) {
|
if (config.augmentationProperties.queriesInput) {
|
||||||
if (config.augmentationProperties.queriesInputCombines) {
|
if (config.augmentationProperties.queriesInputCombines) {
|
||||||
|
|
@ -857,9 +857,6 @@ async function generateCodeScanningConfig(config, logger) {
|
||||||
fs.writeFileSync(codeScanningConfigFile, yaml.dump(augmentedConfig));
|
fs.writeFileSync(codeScanningConfigFile, yaml.dump(augmentedConfig));
|
||||||
return codeScanningConfigFile;
|
return codeScanningConfigFile;
|
||||||
}
|
}
|
||||||
function cloneObject(obj) {
|
|
||||||
return JSON.parse(JSON.stringify(obj));
|
|
||||||
}
|
|
||||||
// This constant sets the size of each TRAP cache in megabytes.
|
// This constant sets the size of each TRAP cache in megabytes.
|
||||||
const TRAP_CACHE_SIZE_MB = 1024;
|
const TRAP_CACHE_SIZE_MB = 1024;
|
||||||
async function getTrapCachingExtractorConfigArgs(config) {
|
async function getTrapCachingExtractorConfigArgs(config) {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
4
lib/util.js
generated
4
lib/util.js
generated
|
|
@ -66,6 +66,7 @@ exports.getErrorMessage = getErrorMessage;
|
||||||
exports.prettyPrintPack = prettyPrintPack;
|
exports.prettyPrintPack = prettyPrintPack;
|
||||||
exports.checkDiskUsage = checkDiskUsage;
|
exports.checkDiskUsage = checkDiskUsage;
|
||||||
exports.checkActionVersion = checkActionVersion;
|
exports.checkActionVersion = checkActionVersion;
|
||||||
|
exports.cloneObject = cloneObject;
|
||||||
const fs = __importStar(require("fs"));
|
const fs = __importStar(require("fs"));
|
||||||
const os = __importStar(require("os"));
|
const os = __importStar(require("os"));
|
||||||
const path = __importStar(require("path"));
|
const path = __importStar(require("path"));
|
||||||
|
|
@ -858,4 +859,7 @@ var BuildMode;
|
||||||
/** The database will be created by building the source root using manually specified build steps. */
|
/** The database will be created by building the source root using manually specified build steps. */
|
||||||
BuildMode["Manual"] = "manual";
|
BuildMode["Manual"] = "manual";
|
||||||
})(BuildMode || (exports.BuildMode = BuildMode = {}));
|
})(BuildMode || (exports.BuildMode = BuildMode = {}));
|
||||||
|
function cloneObject(obj) {
|
||||||
|
return JSON.parse(JSON.stringify(obj));
|
||||||
|
}
|
||||||
//# sourceMappingURL=util.js.map
|
//# sourceMappingURL=util.js.map
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -31,7 +31,7 @@ import * as setupCodeql from "./setup-codeql";
|
||||||
import { ToolsFeature, isSupportedToolsFeature } from "./tools-features";
|
import { ToolsFeature, isSupportedToolsFeature } from "./tools-features";
|
||||||
import { shouldEnableIndirectTracing } from "./tracer-config";
|
import { shouldEnableIndirectTracing } from "./tracer-config";
|
||||||
import * as util from "./util";
|
import * as util from "./util";
|
||||||
import { BuildMode, wrapError } from "./util";
|
import { BuildMode, wrapError, cloneObject } from "./util";
|
||||||
|
|
||||||
type Options = Array<string | number | boolean>;
|
type Options = Array<string | number | boolean>;
|
||||||
|
|
||||||
|
|
@ -1344,10 +1344,6 @@ async function generateCodeScanningConfig(
|
||||||
return codeScanningConfigFile;
|
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.
|
// This constant sets the size of each TRAP cache in megabytes.
|
||||||
const TRAP_CACHE_SIZE_MB = 1024;
|
const TRAP_CACHE_SIZE_MB = 1024;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1100,3 +1100,7 @@ export enum BuildMode {
|
||||||
/** The database will be created by building the source root using manually specified build steps. */
|
/** The database will be created by building the source root using manually specified build steps. */
|
||||||
Manual = "manual",
|
Manual = "manual",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function cloneObject<T>(obj: T): T {
|
||||||
|
return JSON.parse(JSON.stringify(obj)) as T;
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue