fetch-reddit
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -169,7 +169,10 @@ 'use strict'; | ||
function getPermalink(post, path) { | ||
function getPermalink(post) { | ||
var path = arguments.length <= 1 || arguments[1] === undefined ? '' : arguments[1]; | ||
if (post.permalink) { | ||
return REDDIT_URL + post.permalink; | ||
} | ||
return REDDIT_URL + path + '/' + post.id; | ||
var slash = path.slice(-1) === '/' ? '' : '/'; | ||
return REDDIT_URL + path + slash + post.id; | ||
} |
{ | ||
"name": "fetch-reddit", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "Easily fetch links from Reddit subs and threads", | ||
@@ -11,2 +11,4 @@ "main": "lib/index.js", | ||
"clean": "rimraf lib", | ||
"preversion": "npm run lint && npm run test", | ||
"version": "auto-changelog --package -t compact; git add CHANGELOG.md", | ||
"prepublish": "npm run build", | ||
@@ -32,2 +34,3 @@ "postpublish": "npm run clean" | ||
"devDependencies": { | ||
"auto-changelog": "^0.3.0", | ||
"babel-cli": "^6.1.18", | ||
@@ -34,0 +37,0 @@ "babel-core": "^6.1.20", |
11075
6
158
9