expandSegments was replaced by pathSegments

which is part of derby-templates and defined in /lib/expressions.js
jshint conformance
whitespace
assume isEmpty means no enumerable properties