Skip to content

Instantly share code, notes, and snippets.

@VitorLuizC
Created March 22, 2018 03:27
Show Gist options
  • Save VitorLuizC/97cfc6cc0733170ee315c6cd7ec17330 to your computer and use it in GitHub Desktop.
Save VitorLuizC/97cfc6cc0733170ee315c6cd7ec17330 to your computer and use it in GitHub Desktop.
const Implementation = { ... } || ( ... ) => { ... };
/**
* Fix some buggy module interoperability strategies.
* @example ```js
* const ModuleName = require('module-name');
* // Or
* const { default: ModuleName } = require('module-name');
* ```
* @param target
*/
const createCircularDefault = (target: Object) => target['default'] = target;
createCircularDefault(Implementation);
export default Implementation;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment