js compress as functional