mirror of
https://kevinblog.sytes.net/Code/Jibo-Revival-Group/JiboViteDocs.git
synced 2026-06-16 06:36:23 +00:00
Initalize
This commit is contained in:
3
node_modules/feed/lib/atom1.d.ts
generated
vendored
Normal file
3
node_modules/feed/lib/atom1.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { Feed } from "./feed";
|
||||
declare const _default: (ins: Feed) => string;
|
||||
export default _default;
|
||||
121
node_modules/feed/lib/atom1.js
generated
vendored
Normal file
121
node_modules/feed/lib/atom1.js
generated
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var convert = require("xml-js");
|
||||
var config_1 = require("./config");
|
||||
var utils_1 = require("./utils");
|
||||
exports.default = (function (ins) {
|
||||
var options = ins.options;
|
||||
var base = {
|
||||
_declaration: { _attributes: { version: "1.0", encoding: "utf-8" } },
|
||||
feed: {
|
||||
_attributes: { xmlns: "http://www.w3.org/2005/Atom" },
|
||||
id: options.id,
|
||||
title: options.title,
|
||||
updated: options.updated ? options.updated.toISOString() : new Date().toISOString(),
|
||||
generator: utils_1.sanitize(options.generator || config_1.generator)
|
||||
}
|
||||
};
|
||||
if (options.author) {
|
||||
base.feed.author = formatAuthor(options.author);
|
||||
}
|
||||
base.feed.link = [];
|
||||
if (options.link) {
|
||||
base.feed.link.push({ _attributes: { rel: "alternate", href: utils_1.sanitize(options.link) } });
|
||||
}
|
||||
var atomLink = utils_1.sanitize(options.feed || (options.feedLinks && options.feedLinks.atom));
|
||||
if (atomLink) {
|
||||
base.feed.link.push({ _attributes: { rel: "self", href: utils_1.sanitize(atomLink) } });
|
||||
}
|
||||
if (options.hub) {
|
||||
base.feed.link.push({ _attributes: { rel: "hub", href: utils_1.sanitize(options.hub) } });
|
||||
}
|
||||
if (options.description) {
|
||||
base.feed.subtitle = options.description;
|
||||
}
|
||||
if (options.image) {
|
||||
base.feed.logo = options.image;
|
||||
}
|
||||
if (options.favicon) {
|
||||
base.feed.icon = options.favicon;
|
||||
}
|
||||
if (options.copyright) {
|
||||
base.feed.rights = options.copyright;
|
||||
}
|
||||
base.feed.category = [];
|
||||
ins.categories.map(function (category) {
|
||||
base.feed.category.push({ _attributes: { term: category } });
|
||||
});
|
||||
base.feed.contributor = [];
|
||||
ins.contributors.map(function (contributor) {
|
||||
base.feed.contributor.push(formatAuthor(contributor));
|
||||
});
|
||||
base.feed.entry = [];
|
||||
ins.items.map(function (item) {
|
||||
var entry = {
|
||||
title: { _attributes: { type: "html" }, _cdata: item.title },
|
||||
id: utils_1.sanitize(item.id || item.link),
|
||||
link: [{ _attributes: { href: utils_1.sanitize(item.link) } }],
|
||||
updated: item.date.toISOString()
|
||||
};
|
||||
if (item.description) {
|
||||
entry.summary = {
|
||||
_attributes: { type: "html" },
|
||||
_cdata: item.description,
|
||||
};
|
||||
}
|
||||
if (item.content) {
|
||||
entry.content = {
|
||||
_attributes: { type: "html" },
|
||||
_cdata: item.content,
|
||||
};
|
||||
}
|
||||
if (Array.isArray(item.author)) {
|
||||
entry.author = [];
|
||||
item.author.map(function (author) {
|
||||
entry.author.push(formatAuthor(author));
|
||||
});
|
||||
}
|
||||
if (Array.isArray(item.category)) {
|
||||
entry.category = [];
|
||||
item.category.map(function (category) {
|
||||
entry.category.push(formatCategory(category));
|
||||
});
|
||||
}
|
||||
if (item.contributor && Array.isArray(item.contributor)) {
|
||||
entry.contributor = [];
|
||||
item.contributor.map(function (contributor) {
|
||||
entry.contributor.push(formatAuthor(contributor));
|
||||
});
|
||||
}
|
||||
if (item.published) {
|
||||
entry.published = item.published.toISOString();
|
||||
}
|
||||
if (item.copyright) {
|
||||
entry.rights = item.copyright;
|
||||
}
|
||||
base.feed.entry.push(entry);
|
||||
});
|
||||
return convert.js2xml(base, { compact: true, ignoreComment: true, spaces: 4 });
|
||||
});
|
||||
var formatAuthor = function (author) {
|
||||
var name = author.name, email = author.email, link = author.link;
|
||||
var out = { name: name };
|
||||
if (email) {
|
||||
out.email = email;
|
||||
}
|
||||
if (link) {
|
||||
out.uri = utils_1.sanitize(link);
|
||||
}
|
||||
return out;
|
||||
};
|
||||
var formatCategory = function (category) {
|
||||
var name = category.name, scheme = category.scheme, term = category.term;
|
||||
return {
|
||||
_attributes: {
|
||||
label: name,
|
||||
scheme: scheme,
|
||||
term: term,
|
||||
},
|
||||
};
|
||||
};
|
||||
//# sourceMappingURL=atom1.js.map
|
||||
1
node_modules/feed/lib/atom1.js.map
generated
vendored
Normal file
1
node_modules/feed/lib/atom1.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"atom1.js","sourceRoot":"","sources":["../src/atom1.ts"],"names":[],"mappings":";;AAAA,gCAAkC;AAClC,mCAAqC;AAGrC,iCAAmC;AAMnC,mBAAe,UAAC,GAAS;IACf,IAAA,OAAO,GAAK,GAAG,QAAR,CAAS;IAExB,IAAM,IAAI,GAAQ;QAChB,YAAY,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;QACpE,IAAI,EAAE;YACJ,WAAW,EAAE,EAAE,KAAK,EAAE,6BAA6B,EAAE;YACrD,EAAE,EAAE,OAAO,CAAC,EAAE;YACd,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACnF,SAAS,EAAE,gBAAQ,CAAC,OAAO,CAAC,SAAS,IAAI,kBAAS,CAAC;SACpD;KACF,CAAC;IAEF,IAAI,OAAO,CAAC,MAAM,EAAE;QAClB,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;KACjD;IAED,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;IAGpB,IAAI,O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AAO,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;AACjF,CAAC,EAAC;AAMF,IAAM,YAAY,GAAG,UAAC,MAAc;IAC1B,IAAA,IAAI,GAAkB,MAAM,KAAxB,EAAE,KAAK,GAAW,MAAM,MAAjB,EAAE,IAAI,GAAK,MAAM,KAAX,CAAY;IAErC,IAAM,GAAG,GAAoD,EAAE,IAAI,MAAA,EAAE,CAAC;IACtE,IAAI,KAAK,EAAE;QACT,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;KACnB;IAED,IAAI,IAAI,EAAE;QACR,GAAG,CAAC,GAAG,GAAG,gBAAQ,CAAC,IAAI,CAAC,CAAC;KAC1B;IAED,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAMF,IAAM,cAAc,GAAG,UAAC,QAAkB;IAChC,IAAA,IAAI,GAAmB,QAAQ,KAA3B,EAAE,MAAM,GAAW,QAAQ,OAAnB,EAAE,IAAI,GAAK,QAAQ,KAAb,CAAc;IAExC,OAAO;QACL,WAAW,EAAE;YACX,KAAK,EAAE,IAAI;YACX,MAAM,QAAA;YACN,IAAI,MAAA;SACL;KACF,CAAC;AACJ,CAAC,CAAC"}
|
||||
1
node_modules/feed/lib/config/index.d.ts
generated
vendored
Normal file
1
node_modules/feed/lib/config/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare const generator = "https://github.com/jpmonette/feed";
|
||||
5
node_modules/feed/lib/config/index.js
generated
vendored
Normal file
5
node_modules/feed/lib/config/index.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.generator = void 0;
|
||||
exports.generator = "https://github.com/jpmonette/feed";
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/feed/lib/config/index.js.map
generated
vendored
Normal file
1
node_modules/feed/lib/config/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,mCAAmC,CAAC"}
|
||||
17
node_modules/feed/lib/feed.d.ts
generated
vendored
Normal file
17
node_modules/feed/lib/feed.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import { Author, Extension, FeedOptions, Item } from "./typings";
|
||||
export { Author, Extension, FeedOptions, Item };
|
||||
export declare class Feed {
|
||||
options: FeedOptions;
|
||||
items: Item[];
|
||||
categories: string[];
|
||||
contributors: Author[];
|
||||
extensions: Extension[];
|
||||
constructor(options: FeedOptions);
|
||||
addItem: (item: Item) => number;
|
||||
addCategory: (category: string) => number;
|
||||
addContributor: (contributor: Author) => number;
|
||||
addExtension: (extension: Extension) => number;
|
||||
atom1: () => string;
|
||||
rss2: () => string;
|
||||
json1: () => string;
|
||||
}
|
||||
26
node_modules/feed/lib/feed.js
generated
vendored
Normal file
26
node_modules/feed/lib/feed.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Feed = void 0;
|
||||
var atom1_1 = require("./atom1");
|
||||
var json_1 = require("./json");
|
||||
var rss2_1 = require("./rss2");
|
||||
var Feed = (function () {
|
||||
function Feed(options) {
|
||||
var _this = this;
|
||||
this.items = [];
|
||||
this.categories = [];
|
||||
this.contributors = [];
|
||||
this.extensions = [];
|
||||
this.addItem = function (item) { return _this.items.push(item); };
|
||||
this.addCategory = function (category) { return _this.categories.push(category); };
|
||||
this.addContributor = function (contributor) { return _this.contributors.push(contributor); };
|
||||
this.addExtension = function (extension) { return _this.extensions.push(extension); };
|
||||
this.atom1 = function () { return atom1_1.default(_this); };
|
||||
this.rss2 = function () { return rss2_1.default(_this); };
|
||||
this.json1 = function () { return json_1.default(_this); };
|
||||
this.options = options;
|
||||
}
|
||||
return Feed;
|
||||
}());
|
||||
exports.Feed = Feed;
|
||||
//# sourceMappingURL=feed.js.map
|
||||
1
node_modules/feed/lib/feed.js.map
generated
vendored
Normal file
1
node_modules/feed/lib/feed.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"feed.js","sourceRoot":"","sources":["../src/feed.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AACjC,+BAAgC;AAChC,+BAA+B;AAQ/B;IAOE,cAAY,OAAoB;QAAhC,iBAEC;QAPD,UAAK,GAAW,EAAE,CAAC;QACnB,eAAU,GAAa,EAAE,CAAC;QAC1B,iBAAY,GAAa,EAAE,CAAC;QAC5B,eAAU,GAAgB,EAAE,CAAC;QAUtB,YAAO,GAAG,UAAC,IAAU,IAAK,OAAA,KAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAArB,CAAqB,CAAC;QAMhD,gBAAW,GAAG,UAAC,QAAgB,IAAK,OAAA,KAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAA9B,CAA8B,CAAC;QAMnE,mBAAc,GAAG,UAAC,WAAmB,IAAK,OAAA,KAAI,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,EAAnC,CAAmC,CAAC;QAM9E,iBAAY,GAAG,UAAC,SAAoB,IAAK,OAAA,KAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,EAA/B,CAA+B,CAAC;QAKzE,UAAK,GAAG,cAAc,OAAA,eAAU,CAAC,KAAI,CAAC,EAAhB,CAAgB,CAAC;QAKvC,SAAI,GAAG,cAAc,OAAA,cAAS,CAAC,KAAI,CAAC,EAAf,CAAe,CAAC;QAKrC,UAAK,GAAG,cAAc,OAAA,cAAU,CAAC,KAAI,CAAC,EAAhB,CAAgB,CAAC;QAxC5C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAwCH,WAAC;AAAD,CAAC,AAjDD,IAiDC;AAjDY,oBAAI"}
|
||||
3
node_modules/feed/lib/json.d.ts
generated
vendored
Normal file
3
node_modules/feed/lib/json.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { Feed } from "./feed";
|
||||
declare const _default: (ins: Feed) => string;
|
||||
export default _default;
|
||||
86
node_modules/feed/lib/json.js
generated
vendored
Normal file
86
node_modules/feed/lib/json.js
generated
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = (function (ins) {
|
||||
var options = ins.options, items = ins.items, extensions = ins.extensions;
|
||||
var feed = {
|
||||
version: "https://jsonfeed.org/version/1",
|
||||
title: options.title,
|
||||
};
|
||||
if (options.link) {
|
||||
feed.home_page_url = options.link;
|
||||
}
|
||||
if (options.feedLinks && options.feedLinks.json) {
|
||||
feed.feed_url = options.feedLinks.json;
|
||||
}
|
||||
if (options.description) {
|
||||
feed.description = options.description;
|
||||
}
|
||||
if (options.image) {
|
||||
feed.icon = options.image;
|
||||
}
|
||||
if (options.author) {
|
||||
feed.author = {};
|
||||
if (options.author.name) {
|
||||
feed.author.name = options.author.name;
|
||||
}
|
||||
if (options.author.link) {
|
||||
feed.author.url = options.author.link;
|
||||
}
|
||||
}
|
||||
extensions.map(function (e) {
|
||||
feed[e.name] = e.objects;
|
||||
});
|
||||
feed.items = items.map(function (item) {
|
||||
var feedItem = {
|
||||
id: item.id,
|
||||
content_html: item.content,
|
||||
};
|
||||
if (item.link) {
|
||||
feedItem.url = item.link;
|
||||
}
|
||||
if (item.title) {
|
||||
feedItem.title = item.title;
|
||||
}
|
||||
if (item.description) {
|
||||
feedItem.summary = item.description;
|
||||
}
|
||||
if (item.image) {
|
||||
feedItem.image = item.image;
|
||||
}
|
||||
if (item.date) {
|
||||
feedItem.date_modified = item.date.toISOString();
|
||||
}
|
||||
if (item.published) {
|
||||
feedItem.date_published = item.published.toISOString();
|
||||
}
|
||||
if (item.author) {
|
||||
var author = item.author;
|
||||
if (author instanceof Array) {
|
||||
author = author[0];
|
||||
}
|
||||
feedItem.author = {};
|
||||
if (author.name) {
|
||||
feedItem.author.name = author.name;
|
||||
}
|
||||
if (author.link) {
|
||||
feedItem.author.url = author.link;
|
||||
}
|
||||
}
|
||||
if (Array.isArray(item.category)) {
|
||||
feedItem.tags = [];
|
||||
item.category.map(function (category) {
|
||||
if (category.name) {
|
||||
feedItem.tags.push(category.name);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (item.extensions) {
|
||||
item.extensions.map(function (e) {
|
||||
feedItem[e.name] = e.objects;
|
||||
});
|
||||
}
|
||||
return feedItem;
|
||||
});
|
||||
return JSON.stringify(feed, null, 4);
|
||||
});
|
||||
//# sourceMappingURL=json.js.map
|
||||
1
node_modules/feed/lib/json.js.map
generated
vendored
Normal file
1
node_modules/feed/lib/json.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"json.js","sourceRoot":"","sources":["../src/json.ts"],"names":[],"mappings":";;AAOA,mBAAe,UAAC,GAAS;IACf,IAAA,OAAO,GAAwB,GAAG,QAA3B,EAAE,KAAK,GAAiB,GAAG,MAApB,EAAE,UAAU,GAAK,GAAG,WAAR,CAAS;IAE3C,IAAI,IAAI,GAAQ;QACd,OAAO,EAAE,gCAAgC;QACzC,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC;IAEF,IAAI,OAAO,CAAC,IAAI,EAAE;QAChB,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;KACnC;IAED,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE;QAC/C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;KACxC;IAED,IAAI,OAAO,CAAC,WAAW,EAAE;QACvB,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;KACxC;IAED,IAAI,OAAO,CAAC,KAAK,EAAE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.d.ts
generated
vendored
Normal file
3
node_modules/feed/lib/rss2.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { Feed } from "./feed";
|
||||
declare const _default: (ins: Feed) => string;
|
||||
export default _default;
|
||||
168
node_modules/feed/lib/rss2.js
generated
vendored
Normal file
168
node_modules/feed/lib/rss2.js
generated
vendored
Normal file
@@ -0,0 +1,168 @@
|
||||
"use strict";
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var convert = require("xml-js");
|
||||
var config_1 = require("./config");
|
||||
var utils_1 = require("./utils");
|
||||
exports.default = (function (ins) {
|
||||
var options = ins.options;
|
||||
var isAtom = false;
|
||||
var isContent = false;
|
||||
var base = {
|
||||
_declaration: { _attributes: { version: "1.0", encoding: "utf-8" } },
|
||||
rss: {
|
||||
_attributes: { version: "2.0" },
|
||||
channel: {
|
||||
title: { _text: options.title },
|
||||
link: { _text: utils_1.sanitize(options.link) },
|
||||
description: { _text: options.description },
|
||||
lastBuildDate: { _text: options.updated ? options.updated.toUTCString() : new Date().toUTCString() },
|
||||
docs: { _text: options.docs ? options.docs : "https://validator.w3.org/feed/docs/rss2.html" },
|
||||
generator: { _text: options.generator || config_1.generator },
|
||||
},
|
||||
},
|
||||
};
|
||||
if (options.language) {
|
||||
base.rss.channel.language = { _text: options.language };
|
||||
}
|
||||
if (options.ttl) {
|
||||
base.rss.channel.ttl = { _text: options.ttl };
|
||||
}
|
||||
if (options.image) {
|
||||
base.rss.channel.image = {
|
||||
title: { _text: options.title },
|
||||
url: { _text: options.image },
|
||||
link: { _text: utils_1.sanitize(options.link) }
|
||||
};
|
||||
}
|
||||
if (options.copyright) {
|
||||
base.rss.channel.copyright = { _text: options.copyright };
|
||||
}
|
||||
ins.categories.map(function (category) {
|
||||
if (!base.rss.channel.category) {
|
||||
base.rss.channel.category = [];
|
||||
}
|
||||
base.rss.channel.category.push({ _text: category });
|
||||
});
|
||||
var atomLink = options.feed || (options.feedLinks && options.feedLinks.rss);
|
||||
if (atomLink) {
|
||||
isAtom = true;
|
||||
base.rss.channel["atom:link"] = [
|
||||
{
|
||||
_attributes: {
|
||||
href: utils_1.sanitize(atomLink),
|
||||
rel: "self",
|
||||
type: "application/rss+xml",
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
if (options.hub) {
|
||||
isAtom = true;
|
||||
if (!base.rss.channel["atom:link"]) {
|
||||
base.rss.channel["atom:link"] = [];
|
||||
}
|
||||
base.rss.channel["atom:link"] = {
|
||||
_attributes: {
|
||||
href: utils_1.sanitize(options.hub),
|
||||
rel: "hub"
|
||||
}
|
||||
};
|
||||
}
|
||||
base.rss.channel.item = [];
|
||||
ins.items.map(function (entry) {
|
||||
var item = {};
|
||||
if (entry.title) {
|
||||
item.title = { _cdata: entry.title };
|
||||
}
|
||||
if (entry.link) {
|
||||
item.link = { _text: utils_1.sanitize(entry.link) };
|
||||
}
|
||||
if (entry.guid) {
|
||||
item.guid = { _text: entry.guid };
|
||||
}
|
||||
else if (entry.id) {
|
||||
item.guid = { _text: entry.id };
|
||||
}
|
||||
else if (entry.link) {
|
||||
item.guid = { _text: utils_1.sanitize(entry.link) };
|
||||
}
|
||||
if (entry.date) {
|
||||
item.pubDate = { _text: entry.date.toUTCString() };
|
||||
}
|
||||
if (entry.published) {
|
||||
item.pubDate = { _text: entry.published.toUTCString() };
|
||||
}
|
||||
if (entry.description) {
|
||||
item.description = { _cdata: entry.description };
|
||||
}
|
||||
if (entry.content) {
|
||||
isContent = true;
|
||||
item["content:encoded"] = { _cdata: entry.content };
|
||||
}
|
||||
if (Array.isArray(entry.author)) {
|
||||
item.author = [];
|
||||
entry.author.map(function (author) {
|
||||
if (author.email && author.name) {
|
||||
item.author.push({ _text: author.email + " (" + author.name + ")" });
|
||||
}
|
||||
});
|
||||
}
|
||||
if (Array.isArray(entry.category)) {
|
||||
item.category = [];
|
||||
entry.category.map(function (category) {
|
||||
item.category.push(formatCategory(category));
|
||||
});
|
||||
}
|
||||
if (entry.enclosure) {
|
||||
item.enclosure = formatEnclosure(entry.enclosure);
|
||||
}
|
||||
if (entry.image) {
|
||||
item.enclosure = formatEnclosure(entry.image, "image");
|
||||
}
|
||||
if (entry.audio) {
|
||||
item.enclosure = formatEnclosure(entry.audio, "audio");
|
||||
}
|
||||
if (entry.video) {
|
||||
item.enclosure = formatEnclosure(entry.video, "video");
|
||||
}
|
||||
base.rss.channel.item.push(item);
|
||||
});
|
||||
if (isContent) {
|
||||
base.rss._attributes["xmlns:dc"] = "http://purl.org/dc/elements/1.1/";
|
||||
base.rss._attributes["xmlns:content"] = "http://purl.org/rss/1.0/modules/content/";
|
||||
}
|
||||
if (isAtom) {
|
||||
base.rss._attributes["xmlns:atom"] = "http://www.w3.org/2005/Atom";
|
||||
}
|
||||
return convert.js2xml(base, { compact: true, ignoreComment: true, spaces: 4 });
|
||||
});
|
||||
var formatEnclosure = function (enclosure, mimeCategory) {
|
||||
if (mimeCategory === void 0) { mimeCategory = "image"; }
|
||||
if (typeof enclosure === "string") {
|
||||
var type_1 = new URL(enclosure).pathname.split(".").slice(-1)[0];
|
||||
return { _attributes: { url: enclosure, length: 0, type: mimeCategory + "/" + type_1 } };
|
||||
}
|
||||
var type = new URL(enclosure.url).pathname.split(".").slice(-1)[0];
|
||||
return { _attributes: __assign({ length: 0, type: mimeCategory + "/" + type }, enclosure) };
|
||||
};
|
||||
var formatCategory = function (category) {
|
||||
var name = category.name, domain = category.domain;
|
||||
return {
|
||||
_text: name,
|
||||
_attributes: {
|
||||
domain: domain,
|
||||
},
|
||||
};
|
||||
};
|
||||
//# sourceMappingURL=rss2.js.map
|
||||
1
node_modules/feed/lib/rss2.js.map
generated
vendored
Normal file
1
node_modules/feed/lib/rss2.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
59
node_modules/feed/lib/typings/index.d.ts
generated
vendored
Normal file
59
node_modules/feed/lib/typings/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
export interface Item {
|
||||
title: string;
|
||||
id?: string;
|
||||
link: string;
|
||||
date: Date;
|
||||
description?: string;
|
||||
content?: string;
|
||||
category?: Category[];
|
||||
guid?: string;
|
||||
image?: string | Enclosure;
|
||||
audio?: string | Enclosure;
|
||||
video?: string | Enclosure;
|
||||
enclosure?: Enclosure;
|
||||
author?: Author[];
|
||||
contributor?: Author[];
|
||||
published?: Date;
|
||||
copyright?: string;
|
||||
extensions?: Extension[];
|
||||
}
|
||||
export interface Enclosure {
|
||||
url: string;
|
||||
type?: string;
|
||||
length?: number;
|
||||
title?: string;
|
||||
duration?: number;
|
||||
}
|
||||
export interface Author {
|
||||
name?: string;
|
||||
email?: string;
|
||||
link?: string;
|
||||
}
|
||||
export interface Category {
|
||||
name?: string;
|
||||
domain?: string;
|
||||
scheme?: string;
|
||||
term?: string;
|
||||
}
|
||||
export interface FeedOptions {
|
||||
id: string;
|
||||
title: string;
|
||||
updated?: Date;
|
||||
generator?: string;
|
||||
language?: string;
|
||||
ttl?: number;
|
||||
feed?: string;
|
||||
feedLinks?: any;
|
||||
hub?: string;
|
||||
docs?: string;
|
||||
author?: Author;
|
||||
link?: string;
|
||||
description?: string;
|
||||
image?: string;
|
||||
favicon?: string;
|
||||
copyright: string;
|
||||
}
|
||||
export interface Extension {
|
||||
name: string;
|
||||
objects: any;
|
||||
}
|
||||
3
node_modules/feed/lib/typings/index.js
generated
vendored
Normal file
3
node_modules/feed/lib/typings/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/feed/lib/typings/index.js.map
generated
vendored
Normal file
1
node_modules/feed/lib/typings/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/typings/index.ts"],"names":[],"mappings":""}
|
||||
1
node_modules/feed/lib/utils.d.ts
generated
vendored
Normal file
1
node_modules/feed/lib/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function sanitize(url: string | undefined): string | undefined;
|
||||
11
node_modules/feed/lib/utils.js
generated
vendored
Normal file
11
node_modules/feed/lib/utils.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.sanitize = void 0;
|
||||
function sanitize(url) {
|
||||
if (typeof (url) === 'undefined') {
|
||||
return;
|
||||
}
|
||||
return url.replace(/&/g, '&');
|
||||
}
|
||||
exports.sanitize = sanitize;
|
||||
//# sourceMappingURL=utils.js.map
|
||||
1
node_modules/feed/lib/utils.js.map
generated
vendored
Normal file
1
node_modules/feed/lib/utils.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAAA,SAAgB,QAAQ,CAAC,GAAuB;IAC9C,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,WAAW,EAAE;QAChC,OAAO;KACR;IACD,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACpC,CAAC;AALD,4BAKC"}
|
||||
Reference in New Issue
Block a user