@mitre/hdf-schema 3.4.0 → 3.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/helpers.js CHANGED
@@ -92,14 +92,16 @@ export function createDescription(label, data) {
92
92
  /**
93
93
  * Create a RequirementResult
94
94
  * @param {import('../dist/ts/hdf-results.js').ResultStatus} status - Test result status
95
- * @param {string} [message] - Optional message explaining the result
95
+ * @param {string} [message] - Optional message explaining the result. Omitted from
96
+ * the result entirely when empty/undefined, so converters no longer emit a spurious
97
+ * `"message": ""` that the Go side (omitempty) drops — keeping TS/Go output aligned.
96
98
  * @param {Object} [options] - Optional fields
97
99
  * @returns {import('../dist/ts/hdf-results.js').RequirementResult}
98
100
  */
99
- export function createResult(status, message = '', options = {}) {
101
+ export function createResult(status, message, options = {}) {
100
102
  return {
101
103
  status,
102
- message,
104
+ ...(message ? { message } : {}),
103
105
  codeDesc: options.codeDesc || '',
104
106
  startTime: options.startTime,
105
107
  runTime: options.runTime,