> I guess it can be changed to just if (options.data)

Not sure. I prefer to keep condition same as orininal was.