util.js: fix promise early resolution, indentation and code style
util.js: fix promise early resolution, indentation and code style

thotty/harmonic,joaopauloti/harmonic,mauricionr/harmonic,robsongajunior/harmonic,JSRocksHQ/harmonic,viniciusdacal/harmonic