Unverified Commit 3293bbf7 authored by cjihrig's avatar cjihrig
Browse files

esm: refactor createDynamicModule()

This commit refactors createDynamicModule() for readability:

- The map() callback functions are named and moved to a higher
  scope.
- The two export map() loops are combined.
- JSON.stringify() is only called once per import.

PR-URL: https://github.com/nodejs/node/pull/27809


Reviewed-By: default avatarGus Caplan <me@gus.host>
Reviewed-By: default avatarDaniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: default avatarGuy Bedford <guybedford@gmail.com>
Reviewed-By: default avatarJeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: default avatarLuigi Pinca <luigipinca@gmail.com>
Reviewed-By: default avatarYongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
parent 77b9ce57
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment