Blame view

node_modules/better-scroll/src/util/lang.js 514 Bytes
aaac7fed   liuqimichale   add
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  export function getNow() {
    return window.performance && window.performance.now ? (window.performance.now() + window.performance.timing.navigationStart) : +new Date()
  }
  
  export function extend(target, ...rest) {
    for (let i = 0; i < rest.length; i++) {
      let source = rest[i]
      for (let key in source) {
        target[key] = source[key]
      }
    }
    return target
  }
  
  export function isUndef(v) {
    return v === undefined || v === null
  }
  
  export function getDistance(x, y) {
    return Math.sqrt(x * x + y * y)
  }