| 1 |
export const stringifyOptions = function ( widgetOptions ) { |
| 2 |
let widgetOptionsArray = []; |
| 3 |
for ( const property in widgetOptions ) { |
| 4 |
if ( ! widgetOptions.hasOwnProperty( property ) ) { |
| 5 |
continue; |
| 6 |
} |
| 7 |
let propertyValue; |
| 8 |
if ( typeof widgetOptions[ property ] === 'object' ) { |
| 9 |
propertyValue = stringifyOptions( widgetOptions[ property ] ); |
| 10 |
} else { |
| 11 |
propertyValue = widgetOptions[ property ]; |
| 12 |
} |
| 13 |
widgetOptionsArray.push( property + ': ' + propertyValue ); |
| 14 |
} |
| 15 |
return widgetOptionsArray.join( ', ' ); |
| 16 |
}; |
| 17 |
|