code: function gestureEnd(ev) {
      if (!pointer || !typesMatch(ev, pointer)) return;
  
      updatePointerState(ev, pointer);
      pointer.endTime = +Date.now();
  
      if (ev.type !== 'pointercancel') {
        runHandlers('end', ev);
      }
  
      lastPointer = pointer;
      pointer = null;
    }
docs: /*
  If an end event happens of the right type, update the pointer, run endHandlers, and save the pointer as 'lastPointer'