extensions/amp-analytics/0.1/events.js
/**
   * Rounds the boundaries for scroll trigger to nearest
   * SCROLL_PRECISION_PERCENT and returns an object with normalized boundaries
   * as keys and false as values.
   *
   * @param {!Array<number>} bounds array of bounds.
   * @return {!JsonObject} Object with normalized bounds as keys
   * and false as value.
   * @private
   */
Rounds the boundaries for scroll trigger to nearest
SCROLL_PRECISION_PERCENT and returns an object with normalized boundaries
as keys and false as values.

@param {!Array} bounds array of bounds.
@return {!JsonObject} Object with normalized bounds as keys
and false as value.
@private
Rounds the boundaries for scroll trigger to nearest SCROLL_PRECISION_PERCENT and returns an object with normalized boundaries as keys and false as values . @param { !Array } bounds array of bounds . @return { !JsonObject } Object with normalized bounds as keys and false as value . @private
normalizeBoundaries_(bounds) {
    const result = dict({});
    if (!bounds || !Array.isArray(bounds)) {
      return result;
    }
    for (let b = 0; b < bounds.length; b++) {
      let bound = bounds[b];
      if (typeof bound !== 'number' || !isFinite(bound)) {
        user().error(TAG, 'Scroll trigger boundaries must be finite.');
        return result;
      }
      bound = Math.min(Math.round(bound / SCROLL_PRECISION_PERCENT) *
        SCROLL_PRECISION_PERCENT, 100);
      result[bound] = false;
    }
    return result;
  }
normalizeBoundaries_ ( bounds ) { const result = dict ( { } ) ; if ( ! bounds || ! Array . isArray ( bounds ) ) { return result ; } for ( let b = 0 ; b < bounds . length ; b ++ ) { let bound = bounds [ b ] ; if ( typeof bound !== 'number' || ! isFinite ( bound ) ) { user ( ) . error ( TAG , 'Scroll trigger boundaries must be finite.' ) ; return result ; } bound = Math . min ( Math . round ( bound / SCROLL_PRECISION_PERCENT ) * SCROLL_PRECISION_PERCENT , 100 ) ; result [ bound ] = false ; } return result ; }
Rounds the boundaries for scroll trigger to nearest
 SCROLL_PRECISION_PERCENT and returns an object with normalized boundaries
 as keys and false as values.
Rounds the boundaries for scroll trigger to nearest SCROLL_PRECISION_PERCENT and returns an object with normalized boundaries as keys and false as values .