#!/bin/sh
set -e

node - <<'EOF'
const Hammer = require('@egjs/hammerjs');

if (typeof Hammer !== 'function') {
	throw new Error('expected @egjs/hammerjs to export a constructor');
}

for (const key of ['Manager', 'Recognizer', 'Tap', 'Pan', 'Swipe', 'Pinch', 'Rotate', 'Press']) {
	if (typeof Hammer[key] !== 'function') {
		throw new Error(`missing Hammer.${key}`);
	}
}
EOF
