Skip to content

Instantly share code, notes, and snippets.

@jugglinmike
Last active August 29, 2015 13:57
Show Gist options
  • Save jugglinmike/9439131 to your computer and use it in GitHub Desktop.
Save jugglinmike/9439131 to your computer and use it in GitHub Desktop.
Converting AMD early returns to generic equivalent
define(function() {
if (true) {
return 23;
}
return 45;
});
module.exports = (function() {
if (true) {
return 23;
}
return 45;
})();
TRANSMOGRIFY: {
if (true) {
module.exports = 23;
break TRANSMOGRIFY;
}
module.exports = 45;
break TRANSMOGRIFY;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment