This isn't doing what you want; retrieveLicenseForDependency can return no licenses, and therefore .each() won't be called, so you end up without that dependency in the output.