Version: 5.0.05.1.05.1.15.2.05.2.15.2.25.2.35.2.45.2.55.3.05.3.15.4.05.4.16.0.06.0.16.0.26.1.06.1.16.1.26.2.06.3.06.3.16.3.26.4.06.4.16.4.26.4.36.4.46.4.56.4.66.4.76.4.86.5.06.5.16.5.27.0.07.0.17.0.27.1.07.2.07.2.17.3.07.3.17.3.27.3.37.3.47.3.57.3.67.4.07.4.17.4.27.5.07.5.17.5.27.6.07.6.17.6.27.6.37.6.47.6.57.6.67.6.77.6.87.6.97.6.107.7.07.7.17.8.07.9.07.10.07.10.17.10.28.0.08.0.18.0.28.1.08.2.08.2.18.3.08.3.18.3.28.3.38.4.08.4.18.4.28.5.08.5.18.5.28.5.38.5.48.5.58.5.69.0.09.0.19.0.29.0.39.0.49.0.59.1.09.1.19.1.29.1.49.1.59.1.69.1.79.1.89.1.9
/**
* Setup a mock hammer.js object, for unit testing.
*
* Inspiration: https://github.com/uber/deck.gl/pull/658
* @returns {{on: noop, off: noop, destroy: noop, emit: noop, get: get}}
*/
function hammerMock() {
const noop = () => {};
return {
on: noop,
off: noop,
destroy: noop,
emit: noop,
get: function(m) { //eslint-disable-line no-unused-vars
set: noop
};
}
if (typeof window !== 'undefined') {
var Hammer = window['Hammer'] || require('@egjs/hammerjs');
module.exports = Hammer;
else {
module.exports = function () {
// hammer.js is only available in a browser, not in node.js. Replacing it with a mock object.
return hammerMock();