almond.0 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Curve 25519-based cryptography collection.
  3. *
  4. * EC Diffie-Hellman (ECDH) based on Curve25519 and digital signatures (EdDSA)
  5. * based on Ed25519.
  6. *
  7. * Copyright (c) 2012 Ron Garret
  8. * Copyright (c) 2007, 2013, 2014 Michele Bini
  9. * Copyright (c) 2014 Mega Limited
  10. * under the MIT License.
  11. *
  12. * You should have received a copy of the license along with this program.
  13. */
  14. // See https://github.com/jrburke/almond#exporting-a-public-api
  15. (function (root, factory) {
  16. if (typeof define === 'function' && define.amd) {
  17. // Allow using this built library as an AMD module
  18. // in another project. That other project will only
  19. // see this AMD call, not the internal modules in
  20. // the closure below.
  21. define([], factory);
  22. } else if (typeof module === 'object' && module.exports) {
  23. // Allow using this built library as a CommonJS module
  24. module.exports = factory();
  25. } else {
  26. // Browser globals case. Just assign the
  27. // result to a property on the global.
  28. root.jodid25519 = factory();
  29. }
  30. }(this, function () {
  31. if (typeof module === 'object' && module.exports) {
  32. // If we're running under CommonJS, our dependencies get confused and
  33. // each clobber module.exports which leads to bad behaviour because
  34. // almond does asynchronous loading. So just pretend we're in the
  35. // browser globals case, and make them write to those values instead.
  36. // TODO: ditch requirejs/almond and use browserify or something.
  37. var __oldModule = module;
  38. var __oldExports = exports;
  39. var window = global;
  40. module = undefined;
  41. exports = undefined;
  42. }