Skip to content

Commit

Permalink
fix(utils/pointerExtend): skip all vendor-prefixed props
Browse files Browse the repository at this point in the history
Close #978
Re: #282
  • Loading branch information
taye authored and interactjs-ci committed Sep 17, 2023
1 parent d4fc733 commit 0d7e058
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/@interactjs/utils/pointerExtend.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
const VENDOR_PREFIXES = ['webkit', 'moz']

export default function pointerExtend<T> (dest: Partial<T & { __set?: Partial<T> }>, source: T) {
dest.__set ||= {} as any

for (const prop in source) {
// skip deprecated prefixed properties
if (VENDOR_PREFIXES.some((prefix) => prop.indexOf(prefix) === 0)) continue

if (typeof dest[prop] !== 'function' && prop !== '__set') {
Object.defineProperty(dest, prop, {
get () {
Expand Down

0 comments on commit 0d7e058

Please sign in to comment.