A barrel file re-exports several modules in order; later exports shadow earlier ones with the same name. Input: a JSON array of objects (each module's named exports, in re-export order). Print the final merged export map as JSON with keys sorted.
Input: one JSON array of objects. Output: merged JSON object, keys sorted.
Your program reads from stdin and prints to stdout.
Example 1
Input: [{"a":1,"b":2},{"b":9,"c":3}]
Output: {"a":1,"b":9,"c":3}
Hints
A barrel file re-exports several modules in order; later exports shadow earlier ones with the same name. Input: a JSON array of objects (each module's named exports, in re-export order). Print the final merged export map as JSON with keys sorted.
Input: one JSON array of objects. Output: merged JSON object, keys sorted.
Your program reads from stdin and prints to stdout.
Example 1
Input: [{"a":1,"b":2},{"b":9,"c":3}]
Output: {"a":1,"b":9,"c":3}
Hints