Files
30-seconds-of-code/node_modules/gatsby-plugin-transition-link/utils/shouldNavigate.js
2019-08-20 15:52:05 +02:00

15 lines
512 B
JavaScript

"use strict";
exports.__esModule = true;
exports.shouldNavigate = void 0;
/*
* adapted from @reach/router implementation:
* defintion: https://github.com/reach/router/blob/master/src/index.js#L542-L545
* usage: https://github.com/reach/router/blob/master/src/index.js#L391-L397
*/
var shouldNavigate = function shouldNavigate(event) {
return !event.defaultPrevented && event.button === 0 && !(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
};
exports.shouldNavigate = shouldNavigate;