-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarifying comments in checklist-mapper file #6654
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -296,10 +296,28 @@ function getHdfSpecificDataAttribute( | |
} | ||
|
||
/** | ||
* ChecklistResults is a wrapper for ChecklistMapper using the intakeType | ||
* default returns a single hdf object without any modifications | ||
* split returns multiple hdf object based on number of iSTIG objects in checklist | ||
* wrapper returns a single hdf object with an additional profile created using file name as profile name and adds parent_profile key to each mapped profile | ||
* The `ChecklistResults` class extends the `ChecklistJsonixConverter` and is responsible for converting | ||
* checklist data between different formats (XML CKL, HDF JSON). | ||
* | ||
* @extends ChecklistJsonixConverter | ||
* | ||
* @property {string | ExecJSON.Execution} data - The input data, which can be a string of XML data or an HDF JSON execution object. | ||
* @property {Checklist} jsonixData - The JSON representation of the checklist data. | ||
* @property {ChecklistObject} checklistObject - The intermediate object representation of the checklist data. | ||
* @property {boolean} withRaw - A flag indicating whether to include raw data in the output. | ||
* | ||
* @constructor | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why are we defining the constructor parameters both here and on top of the constructor? |
||
* @param {string | ExecJSON.Execution} data - The input data, which can be a string of XML data or an HDF JSON execution object. | ||
* @param {boolean} [withRaw=false] - Optional flag indicating whether to include raw data in the output. | ||
* | ||
* @method getJsonix | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this info be here or directly on top of the corresponding function? |
||
* @returns {Checklist} - Returns the JSON representation of the checklist data. | ||
* | ||
* @method toCkl | ||
* @returns {string} - Converts the checklist data to CKL (Checklist) XML format. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. converts the jsonix json representation of the ckl data into the xml format |
||
* | ||
* @method toHdf | ||
* @returns {ExecJSON.Execution} - Converts the checklist data to HDF (Heimdall Data Format). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. converts the intermediate format ckl data into hdf |
||
*/ | ||
export class ChecklistResults extends ChecklistJsonixConverter { | ||
data: string | ExecJSON.Execution; | ||
|
@@ -308,8 +326,12 @@ export class ChecklistResults extends ChecklistJsonixConverter { | |
withRaw: boolean; | ||
|
||
/** | ||
* Creates instance of ChecklistResult object because ChecklistMapper uses the intermediate ChecklistObject to create HDF mapping | ||
* @param checklistXml - string of xml data | ||
* @param {string | ExecJSON.Execution} data - The input data, which can be either an HDF JSON object | ||
* or an XML CKL string, depending on the direction of the conversion. | ||
* @param {boolean} [withRaw=false] - A flag indicating whether to include raw data in the output. | ||
* Defaults to false. | ||
* | ||
* @throws Will throw an error if the asset metadata is invalid. | ||
*/ | ||
constructor(data: string | ExecJSON.Execution, withRaw = false) { | ||
super(jsonixMapping); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd revise this statement to explain better that it's like the jsonix, direct conversion of the ckl, js checklist data in comparison to the intermediate representation which cleans it up and makes it easier to use.