1
1
2
2
// if we are in a node env
3
- if ( typeof ( exports ) == 'object' ) {
3
+ if ( typeof ( exports ) === 'object' ) {
4
4
var papersLib = require ( './papers.functions.js' ) ;
5
5
publicObject = exports ;
6
6
@@ -10,7 +10,7 @@ if(typeof(exports) == 'object'){
10
10
papers = publicObject ;
11
11
}
12
12
13
- if ( 'undefined' != typeof ( $ ) ) publicObject . $ = $ ;
13
+ if ( 'undefined' !== typeof ( $ ) ) publicObject . $ = $ ;
14
14
15
15
publicObject . debug = false ;
16
16
@@ -51,23 +51,23 @@ publicObject.formatters = {
51
51
52
52
// private functions with no side-effects are loaded seperately
53
53
// this is done so that these can be unit tested
54
- var appendElem = papersLib . appendElem
54
+ var appendElem = papersLib . appendElem ;
55
55
56
56
public . addDataToDocument = function ( list , sourceElement , targetElement , formatter ) {
57
57
58
58
if ( public . debug )
59
59
console . log ( list , sourceElement , targetElement , formatter ) ;
60
60
61
- if ( 0 == publicObject . $ ( sourceElement ) . length )
61
+ if ( 0 === publicObject . $ ( sourceElement ) . length )
62
62
throw new Error ( "sourceElement is empty." ) ;
63
63
64
- if ( 0 == publicObject . $ ( targetElement ) . length )
64
+ if ( 0 === publicObject . $ ( targetElement ) . length )
65
65
throw new Error ( "targetElement is empty." ) ;
66
66
67
67
publicObject . $ ( list ) . each ( function ( index , item ) {
68
68
appendElem ( item , sourceElement , targetElement , formatter ) ;
69
69
} ) ;
70
- }
70
+ } ;
71
71
72
72
public . helpers = { } ;
73
73
@@ -86,7 +86,7 @@ publicObject.formatters = {
86
86
) ;
87
87
88
88
return list ;
89
- }
89
+ } ;
90
90
91
91
/**
92
92
* Duplicate each element of a list to make it longer
@@ -103,9 +103,9 @@ publicObject.formatters = {
103
103
newList . push ( list [ i ] ) ;
104
104
105
105
return newList ;
106
- }
106
+ } ;
107
107
108
- } ) ( publicObject )
108
+ } ) ( publicObject ) ;
109
109
110
110
111
111
0 commit comments