all files / src/util/ lang.js

87.5% Statements 7/8
83.33% Branches 5/6
75% Functions 3/4
87.5% Lines 7/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22  17×       35× 69× 69× 1451×     35×       237×            
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)
}