theorem.js
Version:
A Math library for computation in JavaScript
15 lines (14 loc) • 583 B
JavaScript
// Browserify / Node.js
if (typeof define === "function" && define.amd) {
define(() => new TheoremJS());
// CommonJS and Node.js module support.
} else if (typeof exports !== "undefined") {
// Support Node.js specific `module.exports` (which can be a function)
if (typeof module !== "undefined" && module.exports) {
exports = module.exports = new TheoremJS();
}
// But always support CommonJS module 1.1.1 spec (`exports` cannot be a function)
exports.TheoremJS = new TheoremJS();
} else if (typeof global !== "undefined") {
global.TheoremJS = new TheoremJS();
}