assets/ckeditor/tests/_benderjs/ckeditor/lib/testbuilder.js
/**
 * Generic test metadata parser will create test.ckeditor object containing ckeditor options.
 * This builder converts each value to a proper format
 * @param  {Object} data Test data
 * @return {Object}
 */
Generic test metadata parser will create test.ckeditor object containing ckeditor options.
This builder converts each value to a proper format
@param  {Object} data Test data
@return {Object}
Generic test metadata parser will create test . ckeditor object containing ckeditor options . This builder converts each value to a proper format @param { Object } data Test data @return { Object }
function build( data ) {
	function convert( obj ) {
		if ( typeof obj == 'string' ) {
			return obj.trim().split( /\s*,\s*/ );
		}
		if ( obj && typeof obj == 'object' && !Array.isArray( obj ) ) {
			Object.keys( obj ).forEach( function( key ) {
				obj[ key ] = convert( obj[ key ] );
			} );
		}
		return obj;
	}
	Object.keys( data.tests ).forEach( function( id ) {
		var test = data.tests[ id ];
		if ( !test.ckeditor ) {
			return;
		}
		test.ckeditor = convert( test.ckeditor );
	} );
	return data;
}
function build ( data ) { function convert ( obj ) { if ( typeof obj == 'string' ) { return obj . trim ( ) . split ( / \s*,\s* / ) ; } if ( obj && typeof obj == 'object' && ! Array . isArray ( obj ) ) { Object . keys ( obj ) . forEach ( function ( key ) { obj [ key ] = convert ( obj [ key ] ) ; } ) ; } return obj ; } Object . keys ( data . tests ) . forEach ( function ( id ) { var test = data . tests [ id ] ; if ( ! test . ckeditor ) { return ; } test . ckeditor = convert ( test . ckeditor ) ; } ) ; return data ; }
Generic test metadata parser will create test.ckeditor object containing ckeditor options.
Generic test metadata parser will create test . ckeditor object containing ckeditor options .
// converts recursively strings found in an object to arrays