Get preview items from a Grip.

@param {Object} Grip from which we want the preview items
@return {Array} Array of the preview items of the grip, or an empty array
if the grip does not have preview items
333724
function getGripPreviewItems(grip) {
  if (!grip) {
    return [];
  }

  // Promise resolved value Grip
  if (grip.promiseState && grip.promiseState.value) {
    return [grip.promiseState.value];
  }

  // Array Grip
  if (grip.preview && grip.preview.items) {
    return grip.preview.items;
  }

  // Node Grip
  if (grip.preview && grip.preview.childNodes) {
    return grip.preview.childNodes;
  }

  // Set or Map Grip
  if (grip.preview && grip.preview.entries) {
    return grip.preview.entries.reduce((res, entry) => res.concat(entry), []);
  }

  // Event Grip
  if (grip.preview && grip.preview.target) {
    const keys = Object.keys(grip.preview.properties);
    const values = Object.values(grip.preview.properties);
    return [grip.preview.target, ...keys, ...values];
  }

  // RegEx Grip
  if (grip.displayString) {
    return [grip.displayString];
  }

  // Generic Grip
  if (grip.preview && grip.preview.ownProperties) {
    let propertiesValues = Object.values(grip.preview.ownProperties).map(
      property => property.value || property
    );

    const propertyKeys = Object.keys(grip.preview.ownProperties);
    propertiesValues = propertiesValues.concat(propertyKeys);

    // ArrayBuffer Grip
    if (grip.preview.safeGetterValues) {
      propertiesValues = propertiesValues.concat(
        Object.values(grip.preview.safeGetterValues).map(
          property => property.getterValue || property
        )
      );
    }

    return propertiesValues;
  }

  return [];
}
1250135
function getFingerArrayPriority (fingerArray) {
    var item = getPointedFinger(fingerArray);
    return item !== SYMBOL_NOTHING ? getPriority(item) : Infinity;
  }
702407
function (item) {
        if (this.state.held && this.state.dragged && this.state.dragged.item === item) {
          return this.state.draggedStyle;
        }
        return undefined;
      }
55780
function (gesture) {
    var clip;
    var i;
    for (i = 0; i < this.clips.length; i++) {
      clip = this.clips[i];
      if (clip.name !== gesture) { continue; }
      return clip;
    }
  }
1142894
def grip str
      return str unless self.class.const_defined?(:GRIP_TAGS)
      result = str.bowl
      self.class::GRIP_TAGS.each { |tag, value|
        result.gsub!(/(?:#{tag})(.*?)(?:#{tag})/m) {
          next if (args = $1).vacant?
          tag = value[:marker] if Hash === value && value[:marker]
          "⌦ #{tag} #{args}#{tag}∎⌫"
        }
      }
      result.unbowl
    end
713780
function() {
      var self = this;
      var touchlist = [];

      // we can use forEach since pointerEvents only is in IE10
      Object.keys(self.pointers).sort().forEach(function(id) {
        touchlist.push(self.pointers[id]);
      });
      return touchlist;
    }
312751
function () {
        const items = []
        _.each(this._items, (item) => {
          items.push(item.toObject())
        })
        return items
      }
226796
function _getItemUnready(item) {
  item.classList.remove('ready');
  item.removeAttribute(OFFSET);
  item.style.webkitTransitionDuration = '0';
  item.style.webkitTransform = 'none';
}
1104244
function getTouches(center, points, radius, degrees) {
            var cx = center[0],
                cy = center[1],
                touches = [],
                slice, i, angle;

            // just one touch, at the center
            if (points === 1) {
                return [{ x: cx, y: cy }];
            }

            radius = radius || 100;
            degrees = degrees !== null ? (degrees * Math.PI / 180) : 0;
            slice = 2 * Math.PI / points;

            for (i = 0; i < points; i++) {
                angle = (slice * i) + degrees;
                touches.push({
                    x: (cx + radius * Math.cos(angle)),
                    y: (cy + radius * Math.sin(angle))
                });
            }
            return touches;
        }
952613
function getHandlers (name, callback, context) {
    var events = [];
    if (!callback && !context) {
        if (name) {
            return (this._events && this._events[name]) || [];
        } else {
            return this._events;
        }
    }
    _.each(this._events, function (value, key) {
        if (!name || key === name) {
            value.forEach(function (event) {
                if ((!callback || event.callback === callback) && (!context || event.context === context)) {
                    events.push(event);
                }
            });
        }
    });
    return events;
}
407652
function getTouchById(touches, id) {
  if (touches != null && id != null) {
    for (var i = 0; i < touches.length; i++) {
      if (touches[i].identifier === id) {
        return touches[i];
      }
    }
  }
  return null;
}
758966
function getFingerArrayOrder (fingerArray) {
    var item = getPointedFinger(fingerArray);
    return item !== SYMBOL_NOTHING ? getOrder(item) : Infinity;
  }
486917
function () {
    // Get the array of gamepads, the first method (getGamepads)
    // is the most modern one and is supported by Firefox 28+ and
    // Chrome 35+. The second one (webkitGetGamepads) is a deprecated method
    // used by older Chrome builds.
    var rawGamepads =
        (navigator.getGamepads && navigator.getGamepads()) ||
        (navigator.webkitGetGamepads && navigator.webkitGetGamepads());

    if (rawGamepads) {
      // We don't want to use rawGamepads coming straight from the browser,
      // since it can have "holes" (e.g. if you plug two gamepads, and then
      // unplug the first one, the remaining one will be at index [1]).
      gamepadSupport.gamepads = [];

      // We only refresh the display when we detect some gamepads are new
      // or removed; we do it by comparing raw gamepad table entries to
      // `undefined`.
      var gamepadsChanged = false;

      for (var i = 0; i < rawGamepads.length; i++) {
        if (typeof rawGamepads[i] !== gamepadSupport.prevRawGamepadTypes[i]) {
          gamepadsChanged = true;
          gamepadSupport.prevRawGamepadTypes[i] = typeof rawGamepads[i];
        }

        if (rawGamepads[i]) {
          gamepadSupport.gamepads.push(rawGamepads[i]);
        }
      }

      // Ask the tester to refresh the visual representations of gamepads
      // on the screen.
      if (gamepadsChanged) {
        window.tester.updateGamepads(gamepadSupport.gamepads);
      }
    }
  }
804383
function getEventPosition(event) {
    let _event = event
    if (event.touches) {
        [_event] = event.touches
    }
    return [
        _event.pageX - window.pageXOffset,
        _event.pageY - window.pageYOffset
    ]
}
46879
function getHandlers(handlers) {
        if (typeof handlers === 'string') {
          prev[c.script].handlers.push(handlers)
        } else if (Array.isArray(c.handlers)) {
          c.handlers.forEach(h => {
            prev[c.script].handlers.push(h)
          })
        } else {
          Object.keys(handlers).forEach(k => getHandlers(handlers[k]))
        }
      }
239304
function getGesture(gestures, type) {
  if (!gestures.length) return;
  var types = _.pluck(gestures, 'type');
  var index = types.indexOf(type);
  if (index > -1) return gestures[index];
}
1330665
function getChangedTouches(mouseEv, eventName) {
        var touchList = createTouchList(mouseEv);

        // we only want to return the added/removed item on multitouch
        // which is the second pointer, so remove the first pointer from the touchList
        //
        // but when the mouseEv.type is mouseup, we want to send all touches because then
        // no new input will be possible
        if(isMultiTouch && mouseEv.type != 'mouseup' &&
            (eventName == 'touchstart' || eventName == 'touchend')) {
            touchList.splice(0, 1);
        }

        return touchList;
    }