Skip to content

Commit

Permalink
revert: "fix(common-config): add back parseDate and timezone"
Browse files Browse the repository at this point in the history
This reverts commit 02efe69.

looks like tsx doesn't allow this
  • Loading branch information
Tony committed Sep 20, 2024
1 parent e4da362 commit 62d7283
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions lib/utils/common-config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { load } from 'cheerio';
import ofetch from '@/utils/ofetch';
import iconv from 'iconv-lite';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { parseDate } from '@/utils/parse-date';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import timezone from '@/utils/timezone';

function transElemText($, prop) {
const regex = /\$\((.*)\)/g;
Expand Down Expand Up @@ -60,16 +56,18 @@ async function buildData(data) {
title: getProp(data, 'title', $),
description: getProp(data, 'description', $),
allowEmpty: data.allowEmpty || false,
item: $item.toArray().map((e) => {
const $elem = (selector) => $(e).find(selector);
return {
title: getProp(data, ['item', 'title'], $elem),
description: getProp(data, ['item', 'description'], $elem),
pubDate: getProp(data, ['item', 'pubDate'], $elem),
link: getProp(data, ['item', 'link'], $elem),
guid: getProp(data, ['item', 'guid'], $elem),
};
}),
item: $item
.map((_, e) => {
const $elem = (selector) => $(e).find(selector);
return {
title: getProp(data, ['item', 'title'], $elem),
description: getProp(data, ['item', 'description'], $elem),
pubDate: getProp(data, ['item', 'pubDate'], $elem),
link: getProp(data, ['item', 'link'], $elem),
guid: getProp(data, ['item', 'guid'], $elem),
};
})
.get(),
};
}

Expand Down

0 comments on commit 62d7283

Please sign in to comment.