refactor(cloudfunc) typeof -> isString