add type checking in js post from badoo tech blog