-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Title bar job start button now observes job submission variables data
- Loading branch information
1 parent
26b778b
commit 8fe7339
Showing
3 changed files
with
38 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* Copyright (c) HashiCorp, Inc. | ||
* SPDX-License-Identifier: BUSL-1.1 | ||
*/ | ||
|
||
// @ts-check | ||
|
||
/** | ||
* Convert a JSON object to an HCL string. | ||
* | ||
* @param {Object} obj - The JSON object to convert. | ||
* @returns {string} The HCL string representation of the JSON object. | ||
*/ | ||
export default function jsonToHcl(obj) { | ||
const hclLines = []; | ||
|
||
for (const key in obj) { | ||
const value = obj[key]; | ||
const hclValue = typeof value === 'string' ? `"${value}"` : value; | ||
hclLines.push(`${key}=${hclValue}\n`); | ||
} | ||
|
||
return hclLines.join('\n'); | ||
} |