message: fix(utils): pointerExtend with getter and setter
  Close
diff: -function pointerExtend<T> (dest: Partial<T>, source: T) {
  - for (const prop in source) {
  - const prefixedPropREs = pointerExtend.prefixedPropREs
  - let deprecated = false
  +export default function pointerExtend<T> (dest: Partial<T & { __set?: Partial<T> }>, source: T) {
  + dest.__set ||= {} as any
  - // skip deprecated prefixed properties
  - for (const vendor in prefixedPropREs) {
  - if (prop.indexOf(vendor) === 0 && prefixedPropREs[vendor].test(prop)) {
  - deprecated = true
  - break
  - }
  - }
  + for (const prop in source) {
  + if (typeof dest[prop] !== 'function' && prop !== '__set') {
  + Object.defineProperty(dest, prop, {
  + get () {
  + if (prop in dest.__set) return dest.__set[prop]
  - if (!deprecated && typeof source[prop] !== 'function') {
  - dest[prop] = source[prop]
  + return (dest.__set[prop] = source[prop] as any)
  + },
  + set (value: any) {
  + dest.__set[prop] = value
  + },
  + configurable: true,
  + })
  }
  }
  return dest
  }
  -
  -pointerExtend.prefixedPropREs = {
  - webkit: /(Movement[XY]|Radius[XY]|RotationAngle|Force)$/,
  - moz: /(Pressure)$/,
  -} as { [prefix: string]: RegExp }
  -
  -export default pointerExtend
  