lib/record-normalizer.js
function getValidators(subjDesc, element, validationSets) {

	const validators = subjDesc.validators;

	if (!validators)
		return null;

	const allValidators = new Array();
	for (let set in validators) {
		if (element && !set.startsWith('element:'))
			continue;
		if (validationSets.has(element ? set.substring('element:'.length) : set))
			for (let validator of validators[set])
				allValidators.push(validator);
	}

	return (allValidators.length > 0 ? allValidators : null);
}
function getValidators(subjDesc, element, validationSets) {

	const validators = subjDesc.validators;

	if (!validators)
		return null;

	const allValidators = new Array();
	for (let set in validators) {
		if (element && !set.startsWith('element:'))
			continue;
		if (validationSets.has(element ? set.substring('element:'.length) : set))
			for (let validator of validators[set])
				allValidators.push(validator);
	}

	return (allValidators.length > 0 ? allValidators : null);
}
function getValidators ( subjDesc , element , validationSets ) { const validators = subjDesc . validators ; if ( ! validators ) return null ; const allValidators = new Array ( ) ; for ( let set in validators ) { if ( element && ! set . startsWith ( 'element:' ) ) continue ; if ( validationSets . has ( element ? set . substring ( 'element:' . length ) : set ) ) for ( let validator of validators [ set ] ) allValidators . push ( validator ) ; } return ( allValidators . length > 0 ? allValidators : null ) ; }
Get validators sequence for the specified subject descriptor.

@private
@param {(module:x2node-records~RecordTypeDescriptor|module:x2node-records~PropertyDescriptor)} subjDesc
Descriptor with validators on it.
@param {boolean} element <code>true</code> for collection element validators.
@param {Set.<string>} validationSets Validation sets.
@returns {Array.<module:x2node-validators.curriedValidator>} List of
validators to run or <code>null</code> if none.
Get validators sequence for the specified subject descriptor .