not a big change, but it looks like you don't need to assign empty string in first place
```
return _.isNull(str) || (/^\s*$/).test(str);
```