11// Diff2Html minifier version (automatically generated)
2- var global = this ;
2+ /*
3+ * Hack to allow nodejs require("package/file") in the browser
4+ * How?
5+ * Since every require is used as an object:
6+ * `require("./utils.js").Utils` // (notice the `.Utils`)
7+ *
8+ * We can say that when there is no require method
9+ * we use the global object in which the `Utils`
10+ * object was already injected.
11+ */
12+
13+ var $globalHolder = ( typeof module !== 'undefined' && module . exports ) ||
14+ ( typeof exports !== 'undefined' && exports ) ||
15+ ( typeof window !== 'undefined' && window ) ||
16+ ( typeof self !== 'undefined' && self ) ||
17+ ( typeof this !== 'undefined' && this ) ||
18+ Function ( 'return this' ) ( ) ;
319function require ( ) {
4- return global ;
5- } /* See LICENSE file for terms of use */
20+ return $globalHolder ;
21+ }
22+ /* See LICENSE file for terms of use */
623
724/*
825 * Text diff implementation.
@@ -652,7 +669,7 @@ function require() {
652669 *
653670 */
654671
655- ( function ( global , undefined ) {
672+ ( function ( ctx , undefined ) {
656673
657674 function Utils ( ) {
658675 }
@@ -673,11 +690,13 @@ function require() {
673690 return value ? value : "" ;
674691 } ;
675692
676- if ( typeof module !== 'undefined' && module . exports ) {
677- module . exports . Utils = new Utils ( ) ;
678- } else if ( typeof global . Utils === 'undefined' ) {
679- global . Utils = new Utils ( ) ;
680- }
693+ // expose this module
694+ ( ( typeof module !== 'undefined' && module . exports ) ||
695+ ( typeof exports !== 'undefined' && exports ) ||
696+ ( typeof window !== 'undefined' && window ) ||
697+ ( typeof self !== 'undefined' && self ) ||
698+ ( typeof $this !== 'undefined' && $this ) ||
699+ Function ( 'return this' ) ( ) ) [ "Utils" ] = new Utils ( ) ;
681700
682701} ) ( this ) ;
683702/*
@@ -687,7 +706,7 @@ function require() {
687706 *
688707 */
689708
690- ( function ( global , undefined ) {
709+ ( function ( ctx , undefined ) {
691710
692711 var utils = require ( "./utils.js" ) . Utils ;
693712
@@ -895,11 +914,13 @@ function require() {
895914 else return language ;
896915 }
897916
898- if ( typeof module !== 'undefined' && module . exports ) {
899- module . exports . DiffParser = new DiffParser ( ) ;
900- } else if ( typeof global . DiffParser === 'undefined' ) {
901- global . DiffParser = new DiffParser ( ) ;
902- }
917+ // expose this module
918+ ( ( typeof module !== 'undefined' && module . exports ) ||
919+ ( typeof exports !== 'undefined' && exports ) ||
920+ ( typeof window !== 'undefined' && window ) ||
921+ ( typeof self !== 'undefined' && self ) ||
922+ ( typeof $this !== 'undefined' && $this ) ||
923+ Function ( 'return this' ) ( ) ) [ "DiffParser" ] = new DiffParser ( ) ;
903924
904925} ) ( this ) ;
905926/*
@@ -909,12 +930,10 @@ function require() {
909930 *
910931 */
911932
912- ( function ( global , undefined ) {
933+ ( function ( ctx , undefined ) {
913934
914935 // dirty hack for browser compatibility
915- var jsDiff = ( typeof JsDiff !== "undefined" && JsDiff ) ||
916- require ( "diff" ) ||
917- require ( "../lib/diff.js" ) ;
936+ var jsDiff = ( typeof JsDiff !== "undefined" && JsDiff ) || require ( "diff" ) ;
918937 var utils = require ( "./utils.js" ) . Utils ;
919938
920939 function PrinterUtils ( ) {
@@ -988,11 +1007,13 @@ function require() {
9881007 return line . replace ( / ( < d e l > ( ( .| \n ) * ?) < \/ d e l > ) / g, "" ) ;
9891008 }
9901009
991- if ( typeof module !== 'undefined' && module . exports ) {
992- module . exports . PrinterUtils = new PrinterUtils ( ) ;
993- } else if ( typeof global . PrinterUtils === 'undefined' ) {
994- global . PrinterUtils = new PrinterUtils ( ) ;
995- }
1010+ // expose this module
1011+ ( ( typeof module !== 'undefined' && module . exports ) ||
1012+ ( typeof exports !== 'undefined' && exports ) ||
1013+ ( typeof window !== 'undefined' && window ) ||
1014+ ( typeof self !== 'undefined' && self ) ||
1015+ ( typeof $this !== 'undefined' && $this ) ||
1016+ Function ( 'return this' ) ( ) ) [ "PrinterUtils" ] = new PrinterUtils ( ) ;
9961017
9971018} ) ( this ) ;
9981019/*
@@ -1002,7 +1023,7 @@ function require() {
10021023 *
10031024 */
10041025
1005- ( function ( global , undefined ) {
1026+ ( function ( ctx , undefined ) {
10061027
10071028 var diffParser = require ( "./diff-parser.js" ) . DiffParser ;
10081029 var printerUtils = require ( "./printer-utils.js" ) . PrinterUtils ;
@@ -1183,11 +1204,13 @@ function require() {
11831204 return fileHtml ;
11841205 }
11851206
1186- if ( typeof module !== 'undefined' && module . exports ) {
1187- module . exports . SideBySidePrinter = new SideBySidePrinter ( ) ;
1188- } else if ( typeof global . SideBySidePrinter === 'undefined' ) {
1189- global . SideBySidePrinter = new SideBySidePrinter ( ) ;
1190- }
1207+ // expose this module
1208+ ( ( typeof module !== 'undefined' && module . exports ) ||
1209+ ( typeof exports !== 'undefined' && exports ) ||
1210+ ( typeof window !== 'undefined' && window ) ||
1211+ ( typeof self !== 'undefined' && self ) ||
1212+ ( typeof $this !== 'undefined' && $this ) ||
1213+ Function ( 'return this' ) ( ) ) [ "SideBySidePrinter" ] = new SideBySidePrinter ( ) ;
11911214
11921215} ) ( this ) ;
11931216/*
@@ -1197,7 +1220,7 @@ function require() {
11971220 *
11981221 */
11991222
1200- ( function ( global , undefined ) {
1223+ ( function ( ctx , undefined ) {
12011224
12021225 var diffParser = require ( "./diff-parser.js" ) . DiffParser ;
12031226 var printerUtils = require ( "./printer-utils.js" ) . PrinterUtils ;
@@ -1342,11 +1365,13 @@ function require() {
13421365 "</tr>\n" ;
13431366 }
13441367
1345- if ( typeof module !== 'undefined' && module . exports ) {
1346- module . exports . LineByLinePrinter = new LineByLinePrinter ( ) ;
1347- } else if ( typeof global . LineByLinePrinter === 'undefined' ) {
1348- global . LineByLinePrinter = new LineByLinePrinter ( ) ;
1349- }
1368+ // expose this module
1369+ ( ( typeof module !== 'undefined' && module . exports ) ||
1370+ ( typeof exports !== 'undefined' && exports ) ||
1371+ ( typeof window !== 'undefined' && window ) ||
1372+ ( typeof self !== 'undefined' && self ) ||
1373+ ( typeof $this !== 'undefined' && $this ) ||
1374+ Function ( 'return this' ) ( ) ) [ "LineByLinePrinter" ] = new LineByLinePrinter ( ) ;
13501375
13511376} ) ( this ) ;
13521377/*
@@ -1356,7 +1381,7 @@ function require() {
13561381 *
13571382 */
13581383
1359- ( function ( global , undefined ) {
1384+ ( function ( ctx , undefined ) {
13601385
13611386 var lineByLinePrinter = require ( "./line-by-line-printer.js" ) . LineByLinePrinter ;
13621387 var sideBySidePrinter = require ( "./side-by-side-printer.js" ) . SideBySidePrinter ;
@@ -1368,23 +1393,23 @@ function require() {
13681393
13691394 HtmlPrinter . prototype . generateSideBySideJsonHtml = sideBySidePrinter . generateSideBySideJsonHtml ;
13701395
1371- if ( typeof module !== 'undefined' && module . exports ) {
1372- module . exports . HtmlPrinter = new HtmlPrinter ( ) ;
1373- } else if ( typeof global . HtmlPrinter === 'undefined' ) {
1374- global . HtmlPrinter = new HtmlPrinter ( ) ;
1375- }
1396+ // expose this module
1397+ ( ( typeof module !== 'undefined' && module . exports ) ||
1398+ ( typeof exports !== 'undefined' && exports ) ||
1399+ ( typeof window !== 'undefined' && window ) ||
1400+ ( typeof self !== 'undefined' && self ) ||
1401+ ( typeof $this !== 'undefined' && $this ) ||
1402+ Function ( 'return this' ) ( ) ) [ "HtmlPrinter" ] = new HtmlPrinter ( ) ;
13761403
13771404} ) ( this ) ;
13781405/*
13791406 *
13801407 * Diff to HTML (diff2html.js)
13811408 * Author: rtfpessoa
13821409 *
1383- * Diff commands:
1384- * git diff
13851410 */
13861411
1387- ( function ( global , undefined ) {
1412+ ( function ( ctx , undefined ) {
13881413
13891414 var diffParser = require ( "./diff-parser.js" ) . DiffParser ;
13901415 var htmlPrinter = require ( "./html-printer.js" ) . HtmlPrinter ;
@@ -1393,13 +1418,12 @@ function require() {
13931418 }
13941419
13951420 /*
1396- * config
1397- * {
1398- * "wordByWord" : true (default)
1399- * OR
1400- * "charByChar" : true
1401- * }
1402- *
1421+ * Line diff type configuration
1422+ var config = {
1423+ "wordByWord": true, // (default)
1424+ // OR
1425+ "charByChar": true
1426+ };
14031427 */
14041428
14051429 /*
@@ -1444,10 +1468,12 @@ function require() {
14441468 return htmlPrinter . generateSideBySideJsonHtml ( diffJson , configOrEmpty ) ;
14451469 } ;
14461470
1447- if ( typeof module !== 'undefined' && module . exports ) {
1448- module . exports . Diff2Html = new Diff2Html ( ) ;
1449- } else if ( typeof global . Diff2Html === 'undefined' ) {
1450- global . Diff2Html = new Diff2Html ( ) ;
1451- }
1471+ // expose this module
1472+ ( ( typeof module !== 'undefined' && module . exports ) ||
1473+ ( typeof exports !== 'undefined' && exports ) ||
1474+ ( typeof window !== 'undefined' && window ) ||
1475+ ( typeof self !== 'undefined' && self ) ||
1476+ ( typeof $this !== 'undefined' && $this ) ||
1477+ Function ( 'return this' ) ( ) ) [ "Diff2Html" ] = new Diff2Html ( ) ;
14521478
14531479} ) ( this ) ;
0 commit comments