File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ // if the module has no dependencies
2+ ! ( function umd ( root , factory ) {
3+ if ( typeof exports === 'object' && typeof module === 'object' )
4+ // Node. CommonJs2 environments that support module.exports.
5+ module . exports = factory ( ) ;
6+ else if ( typeof define === 'function' && define . amd )
7+ // AMD. Register as an anonymous module.
8+ define ( [ ] , factory ) ;
9+ else if ( typeof exports === 'object' )
10+ // CommonJs
11+ exports . myLib = factory ( ) ;
12+ else {
13+ // Browser. Allow Module Augmentation (root is window)
14+ var ts = Object . prototype . toString ,
15+ obj = '[object Object]' ,
16+ myLib = factory ( ) ;
17+ if ( ts . call ( root . myLib ) === obj && ts . call ( myLib ) === obj ) {
18+ for ( var p in myLib ) root . myLib [ p ] = myLib [ p ] ;
19+ // not used Object.assign(a,b) for compatibility
20+ } else root . myLib = myLib ;
21+ }
22+ } ( this , function ( ) {
23+
24+ // Just return a value to define the module export.
25+ // This example returns an object, but the module
26+ // can return a function as the exported value.
27+ return { } ;
28+ } ) ) ;
You can’t perform that action at this time.
0 commit comments