Skip to content

Commit

Permalink
Check constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
guiqiqi committed Jan 16, 2022
1 parent 9b2343a commit def0289
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/feed.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

hexo.extend.generator.register("feed", (locals) => {

// Load config
Expand All @@ -10,8 +8,11 @@ hexo.extend.generator.register("feed", (locals) => {
const hstrip = hexo.extend.helper.get("strip_html").bind(hexo);
if (!theme.rss || !theme.rss.enable) return;

const podcast = require("podcast");
if (podcast.hasOwnProperty('Podcast'))
let podcast = require("podcast");
function is_constructor(obj) {
return !!obj.prototype && !!obj.prototype.constructor.name;
}
if (!is_constructor(podcast))
podcast = podcast.Podcast;

// Generate Podcast Categories content
Expand Down

0 comments on commit def0289

Please sign in to comment.