Permalink
Browse files

Stopped stupid assignment of false if value is undefined (it's false …

…anyway)
  • Loading branch information...
1 parent b2691b1 commit 1f9623a694bf771daab90582e40447b91e64694d @fb55 fb55 committed Sep 17, 2011
Showing with 13 additions and 13 deletions.
  1. +13 −13 lib/nodepie.js
View
@@ -258,13 +258,13 @@ NodePie.prototype._parseContents = function(str){
if(typeof str === "string"){
str = str.trim();
- return str && this._formatStr(str) || false;
+ return str && this._formatStr(str);
}
if(typeof str === "object"){
if(typeof str.$t === "string"){
str.$t = str.$t.trim();
- return str.$t && this._formatStr(str.$t) || false;
+ return str.$t && this._formatStr(str.$t);
}
}
@@ -400,7 +400,7 @@ NodePie.prototype.getLink = function(rel, type){
rel = rel || "alternate";
type = type || "text/html";
- var link = (atom10ns && this.channelElement[atom10ns+":link"]) || this.channelElement.link || false;
+ var link = (atom10ns && this.channelElement[atom10ns+":link"]) || this.channelElement.link;
if(!link){
return false;
@@ -635,7 +635,7 @@ NodePie.Item.prototype.getLink = function(rel, type){
rel = rel || "alternate";
type = type || "text/html";
- var link = this.element.link || false;
+ var link = this.element.link;
if(!link){
return false;
@@ -769,7 +769,7 @@ NodePie.Item.prototype.getDate = function(){
var dcns = this.feed.namespaces[NodePie.NS.DC], date;
date = this.element.pubDate || this.element.published || this.element.created || this.element.issued ||
- this.element.updated || this.element.modified || (dcns && this.element[dcns+":date"]) || false;
+ this.element.updated || this.element.modified || (dcns && this.element[dcns+":date"]);
if(!date){
return false;
@@ -869,7 +869,7 @@ NodePie.Item.prototype.getContents = function(){
**/
NodePie.Item.prototype.getCategory = function(){
var categories = this.getCategories();
- return categories && categories[0] || false;
+ return categories && categories[0];
};
/**
@@ -885,24 +885,24 @@ NodePie.Item.prototype.getCategory = function(){
NodePie.Item.prototype.getCategories = function(){
var category, categories = [], dcns = this.feed.namespaces[NodePie.NS.DC];
- category = this.element.category || this.element[dcns+":subject"] || false;
+ category = this.element.category || this.element[dcns+":subject"];
if(!category){
return false;
}
if(typeof category === "string"){
category = category.trim();
- return category && [this._formatStr(category)] || false;
+ return category && [this._formatStr(category)];
}
if(typeof category === "object" && !Array.isArray(category)){
- category = category.term || category.$t || false;
+ category = category.term || category.$t;
if(!category){
return false;
}
category = category.trim();
- return category && [this._formatStr(category)] || false;
+ return category && [this._formatStr(category)];
}
if(Array.isArray(category)){
@@ -919,7 +919,7 @@ NodePie.Item.prototype.getCategories = function(){
}
}
}
- return categories.length && categories || false;
+ return categories.length && categories;
}
return false;
@@ -949,13 +949,13 @@ NodePie.Item.prototype.getComments = function(){
if(this.element.comments){
html = this.element.comments;
}else{
- html = this.getLink("replies", "text/html") || false;
+ html = this.getLink("replies", "text/html");
}
if(wfwns && this.element[wfwns+":commentRss"]){
feed = this.element[wfwns+":commentRss"];
}else{
- feed = this.getLink("replies", "application/atom+xml") || false;
+ feed = this.getLink("replies", "application/atom+xml");
}
return feed || html ? {feed: feed, html: html} : false;

0 comments on commit 1f9623a

Please sign in to comment.