mirror of
https://github.com/fenwick67/mastofeed
synced 2024-12-23 07:38:10 +01:00
Update convert.js
This commit is contained in:
parent
2bcec3c2d1
commit
d40af4b589
@ -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 New Issue
Block a user