Skip to content

Commit 5ae0598

Browse files
committed
pull-review influenced fixes
1 parent 9b7a4e4 commit 5ae0598

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

lib/papers.functions.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11

22
// if we are in a node env
3-
if(typeof(exports) == 'object'){
3+
if(typeof(exports) === 'object'){
44
publicObject = exports;
55

66
// if we are in the browser
77
}else{
88
publicObject = {};
9-
papersLib = publicObject;
9+
var papersLib = publicObject;
1010
}
1111

12-
if( 'undefined' != typeof($)) publicObject.$ = $;
12+
if( 'undefined' !== typeof($)) publicObject.$ = $;
1313

1414

1515
/**

lib/papers.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
// if we are in a node env
3-
if(typeof(exports) == 'object'){
3+
if(typeof(exports) === 'object'){
44
var papersLib = require('./papers.functions.js');
55
publicObject = exports;
66

@@ -10,7 +10,7 @@ if(typeof(exports) == 'object'){
1010
papers = publicObject;
1111
}
1212

13-
if( 'undefined' != typeof($)) publicObject.$ = $;
13+
if( 'undefined' !== typeof($)) publicObject.$ = $;
1414

1515
publicObject.debug = false;
1616

@@ -51,23 +51,23 @@ publicObject.formatters = {
5151

5252
// private functions with no side-effects are loaded seperately
5353
// this is done so that these can be unit tested
54-
var appendElem = papersLib.appendElem
54+
var appendElem = papersLib.appendElem;
5555

5656
public.addDataToDocument = function(list,sourceElement,targetElement,formatter){
5757

5858
if(public.debug)
5959
console.log(list,sourceElement,targetElement,formatter);
6060

61-
if(0 == publicObject.$(sourceElement).length)
61+
if(0 === publicObject.$(sourceElement).length)
6262
throw new Error("sourceElement is empty.");
6363

64-
if(0 == publicObject.$(targetElement).length)
64+
if(0 === publicObject.$(targetElement).length)
6565
throw new Error("targetElement is empty.");
6666

6767
publicObject.$(list).each(function(index,item){
6868
appendElem(item,sourceElement,targetElement,formatter);
6969
});
70-
}
70+
};
7171

7272
public.helpers = {};
7373

@@ -86,7 +86,7 @@ publicObject.formatters = {
8686
);
8787

8888
return list;
89-
}
89+
};
9090

9191
/**
9292
* Duplicate each element of a list to make it longer
@@ -103,9 +103,9 @@ publicObject.formatters = {
103103
newList.push(list[i]);
104104

105105
return newList;
106-
}
106+
};
107107

108-
})(publicObject)
108+
})(publicObject);
109109

110110

111111

test/test.papers.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ describe('papers', function() {
1919
var $ = zeptoEnv;
2020

2121
var dataList = function(){ return [
22-
{'tit': "a", 'img': "src/img/a", 'txt': "test a text" },
23-
{'tit': "b", 'img': "src/img/b", 'txt': "test b text" },
24-
{'tit': "c", 'img': "src/img/c", 'txt': "test c text" },
25-
];
26-
}
22+
{'tit': "a", 'img': "src/img/a", 'txt': "test a text" },
23+
{'tit': "b", 'img': "src/img/b", 'txt': "test b text" },
24+
{'tit': "c", 'img': "src/img/c", 'txt': "test c text" },
25+
];
26+
};
2727

28-
var srcElem = function(){ return "<section><h3></h3><img/><p></p></section>"; }
28+
var srcElem = function(){ return "<section><h3></h3><img/><p></p></section>"; };
2929

3030
describe('paper object' , function() {
3131

0 commit comments

Comments
 (0)