vendor/videojs/video.js
function normalizeContent(content) {

  // First, invoke content if it is a function. If it produces an array,
  // that needs to happen before normalization.
  if (typeof content === 'function') {
    content = content();
  }

  // Next up, normalize to an array, so one or many items can be normalized,
  // filtered, and returned.
  return (Array.isArray(content) ? content : [content]).map(function (value) {

    // First, invoke value if it is a function to produce a new value,
    // which will be subsequently normalized to a Node of some kind.
    if (typeof value === 'function') {
      value = value();
    }

    if (isEl(value) || isTextNode(value)) {
      return value;
    }

    if (typeof value === 'string' && /\S/.test(value)) {
      return _document2['default'].createTextNode(value);
    }
  }).filter(function (value) {
    return value;
  });
}
function normalizeContent(content) {

  // First, invoke content if it is a function. If it produces an array,
  // that needs to happen before normalization.
  if (typeof content === 'function') {
    content = content();
  }

  // Next up, normalize to an array, so one or many items can be normalized,
  // filtered, and returned.
  return (Array.isArray(content) ? content : [content]).map(function (value) {

    // First, invoke value if it is a function to produce a new value,
    // which will be subsequently normalized to a Node of some kind.
    if (typeof value === 'function') {
      value = value();
    }

    if (isEl(value) || isTextNode(value)) {
      return value;
    }

    if (typeof value === 'string' && /\S/.test(value)) {
      return _document2['default'].createTextNode(value);
    }
  }).filter(function (value) {
    return value;
  });
}
function normalizeContent ( content ) { // First, invoke content if it is a function. If it produces an array, // that needs to happen before normalization. if ( typeof content === 'function' ) { content = content ( ) ; } // Next up, normalize to an array, so one or many items can be normalized, // filtered, and returned. return ( Array . isArray ( content ) ? content : [ content ] ) . map ( function ( value ) { // First, invoke value if it is a function to produce a new value, // which will be subsequently normalized to a Node of some kind. if ( typeof value === 'function' ) { value = value ( ) ; } if ( isEl ( value ) || isTextNode ( value ) ) { return value ; } if ( typeof value === 'string' && / \S / . test ( value ) ) { return _document2 [ 'default' ] . createTextNode ( value ) ; } } ) . filter ( function ( value ) { return value ; } ) ; }
Normalizes content for eventual insertion into the DOM.

This allows a wide range of content definition methods, but protects
from falling into the trap of simply writing to `innerHTML`, which is
an XSS concern.

The content for an element can be passed in multiple types and
combinations, whose behavior is as follows:

- String
Normalized into a text node.

- Element, TextNode
Passed through.

- Array
A one-dimensional array of strings, elements, nodes, or functions (which
return single strings, elements, or nodes).

- Function
If the sole argument, is expected to produce a string, element,
node, or array.

@function normalizeContent
@param    {String|Element|TextNode|Array|Function} content
@return   {Array}
Normalizes content for eventual insertion into the DOM .