src/layout.js
/**
 * Asserts that the supplied value is a CSS Length value
 * (including percent unit).
 * @param {!LengthDef|string} length
 * @return {!LengthDef}
 */
Asserts that the supplied value is a CSS Length value
(including percent unit).
Asserts that the supplied value is a CSS Length value ( including percent unit ) .
function assertLengthOrPercent(length) {
  user().assert(/^\d+(\.\d+)?(px|em|rem|vh|vw|vmin|vmax|%)$/.test(length),
      'Invalid length or percent value: %s', length);
  return length;
}
function assertLengthOrPercent ( length ) { user ( ) . assert ( / ^\d+(\.\d+)?(px|em|rem|vh|vw|vmin|vmax|%)$ / . test ( length ) , 'Invalid length or percent value: %s' , length ) ; return length ; }
Asserts that the supplied value is a CSS Length value
 (including percent unit).
Asserts that the supplied value is a CSS Length value ( including percent unit ) .