forked from sam/fedifeed
Update convert.js
This commit is contained in:
parent
2bcec3c2d1
commit
d40af4b589
1 changed files with 5 additions and 1 deletions
|
@ -4,6 +4,10 @@ var ejs = require('ejs');
|
|||
var fs = require('fs');
|
||||
var template = ejs.compile(fs.readFileSync('./lib/template.ejs','utf8'));
|
||||
|
||||
function isArray(a){
|
||||
return (typeof a.length == 'number' && typeof a.forEach == 'function');
|
||||
}
|
||||
|
||||
// source the files
|
||||
|
||||
module.exports = function(stream,opts,callback){
|
||||
|
@ -79,7 +83,7 @@ function buildUp(jsonObj,opts){
|
|||
if (item["activity:object"] && item["activity:object"].link){
|
||||
|
||||
|
||||
if (Array.isArrray(item["activity:object"].link) ){
|
||||
if (isArrray(item["activity:object"].link) ){
|
||||
item["activity:object"].link.forEach(parseLink);
|
||||
}else if (typeof item["activity:object"].link == 'object'){
|
||||
parseLink(item["activity:object"].link);
|
||||
|
|
Loading…
Reference in a new issue