interactjs
Version:
Drag and drop, resizing and multi-touch gestures with inertia and snapping for modern browsers (and also IE8+)
26 lines (21 loc) • 634 B
JavaScript
function pointerExtend (dest, source) {
for (const prop in source) {
const prefixedPropREs = module.exports.prefixedPropREs;
let deprecated = false;
// skip deprecated prefixed properties
for (const vendor in prefixedPropREs) {
if (prop.indexOf(vendor) === 0 && prefixedPropREs[vendor].test(prop)) {
deprecated = true;
break;
}
}
if (!deprecated && typeof source[prop] !== 'function') {
dest[prop] = source[prop];
}
}
return dest;
}
pointerExtend.prefixedPropREs = {
webkit: /(Movement[XY]|Radius[XY]|RotationAngle|Force)$/,
};
module.exports = pointerExtend;