So looking at the example, you can avoid one level of indentation by doing e.g.:
if (items === null) { return 0; }
at the start. Which is fine if that's the preferred style, but if it is, then you should do it regardless of how deeply nested the dependent stuff is.