- Notifications
You must be signed in to change notification settings - Fork7
Open
Description
Because compatibility.
Something along these lines would do:
(function (root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define([], factory); } else if (typeof module === 'object' && module.exports) { // Node. module.exports = factory(); } else { // Browser globals (root is window) root.noop = factory(); }}(this, function () { // Return a value to define the module export. return function noop(){};}));