he wei
2022-11-13 b4816f6294646157b50bb49f1d19eaf306e0ac8c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
export function isDef (v){
  return v !== undefined && v !== null
}
 
/**
 * Remove an item from an array.
 */
export function remove (arr, item) {
  if (arr.length) {
    const index = arr.indexOf(item)
    if (index > -1) {
      return arr.splice(index, 1)
    }
  }
}
 
export function isRegExp (v) {
  return _toString.call(v) === '[object RegExp]'
}
 
export function toFixed(value, bit) {
  const num = Math.pow(10, bit);
  return Math.round(value * num) / num;
}
 
const _toString = Object.prototype.toString