@svta/common-media-library
Version:
A common library for media playback in JavaScript
37 lines • 1.2 kB
JavaScript
import { validateSwitchingSet } from './validateSwitchingSet.js';
/**
* Validate a list of switching set.
* It validates in cascade, calling each child validation method.
*
* @example
* ```ts
* import cmaf, { SwitchingSet } from '@svta/common-media-library/cmaf-ham';
* ...
*
* // const switchingSets: SwitchingSet[] = ...;
*
* const validation = cmaf.validateSwitchingSets(switchingSets);
* ```
*
* Example output: `{ status: true|false, errorMessages: [...] }`
*
* @param switchingSets - List of SwitchingSets from cmaf ham model
* @param selectionSetId - Optional: parent selection set id
* @param prevValidation - Optional: validation object from parent previous validate method call
* @returns Validation
*
* @group CMAF
* @alpha
*
*/
export function validateSwitchingSets(switchingSets, selectionSetId, prevValidation) {
const validation = prevValidation !== null && prevValidation !== void 0 ? prevValidation : {
status: true,
errorMessages: [],
};
switchingSets.forEach((switchingSet) => {
validateSwitchingSet(switchingSet, selectionSetId, validation);
});
return validation;
}
//# sourceMappingURL=validateSwitchingSets.js.map