index-default.js 872 B

123456789101112131415161718192021222324252627
  1. // Default Export
  2. // ==============
  3. // In this module, we mix our bundled exports into the `_` object and export
  4. // the result. This is analogous to setting `module.exports = _` in CommonJS.
  5. // Hence, this module is also the entry point of our UMD bundle and the package
  6. // entry point for CommonJS and AMD users. In other words, this is (the source
  7. // of) the module you are interfacing with when you do any of the following:
  8. //
  9. // ```js
  10. // // CommonJS
  11. // var _ = require('underscore');
  12. //
  13. // // AMD
  14. // define(['underscore'], function(_) {...});
  15. //
  16. // // UMD in the browser
  17. // // _ is available as a global variable
  18. // ```
  19. import * as allExports from './index.js';
  20. import { mixin } from './index.js';
  21. // Add all of the Underscore functions to the wrapper object.
  22. var _ = mixin(allExports);
  23. // Legacy Node.js API.
  24. _._ = _;
  25. // Export the Underscore API.
  26. export default _;