function generateEncodedHookMap(sourceAST) {
  const hookMap = generateHookMap(sourceAST);
  const encoded = encode(hookMap.mappings);
  return {
    names: hookMap.names,
    mappings: encoded
  };
}
Returns encoded version of a Hook Map that is returned
by generateHookMap.

**NOTE:**
TODO: To encode the `mappings` in the Hook Map, we
reuse the encode function from the `sourcemap-codec`
library, which means that we are restricted to only
encoding segments of specific sizes.
Inside generateHookMap we make sure to build segments
of size 4.
In the future, when we implement our own encoding, we will not
need this restriction and can remove the -1 at the end.