mirror of
https://github.com/bettercap/bettercap
synced 2025-07-06 04:52:10 -07:00
Fix JavaScript backwards compatible number conversion
This commit is contained in:
parent
4eb923f972
commit
5da2cd8d29
1 changed files with 13 additions and 0 deletions
|
@ -159,12 +159,25 @@ func jsPropToUint64(obj map[string]interface{}, key string) uint64 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
case "uint64":
|
||||||
|
if v, ok := prop.(uint64); ok {
|
||||||
|
return v
|
||||||
|
}
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.Error("error converting JS property to uint64 where key is: %s", key)
|
log.Error("error converting JS property to uint64 where key is: %s", key)
|
||||||
return uint64(0)
|
return uint64(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func uint16ArrayToInt64Array(arr []uint16, key string) []int64 {
|
||||||
|
vArr := make([]int64, 0, len(arr))
|
||||||
|
for _, item := range arr {
|
||||||
|
vArr = append(vArr, int64(item))
|
||||||
|
}
|
||||||
|
return vArr
|
||||||
|
}
|
||||||
|
|
||||||
func (j *JSQuery) NewHash() string {
|
func (j *JSQuery) NewHash() string {
|
||||||
answers, _ := json.Marshal(j.Answers)
|
answers, _ := json.Marshal(j.Answers)
|
||||||
extras, _ := json.Marshal(j.Extras)
|
extras, _ := json.Marshal(j.Extras)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue