Reputation: 2822
In TypeScript we can re-export modules in the following way:
export * from './validators'; // Re-export all exports
export { validate as stringValidator } from './validators/string'; // Re-export with changed name
My question is about whether it is possible to re-export as default, e.g. combine the following two statements into one:
import * as validators from './validators';
export default validators;
Upvotes: 5
Views: 3304
Reputation: 276199
combine the following two statements into one
No. You need two statements.
Upvotes: 2