Update directory.js

watch the spacing and formatting. Are you trying to minimize your code, or make it friendly to debug? Can you do both?