Skip to content

Commit f5ad403

Browse files
committed
update ebay routes according to presubmit finding
1 parent d3ff772 commit f5ad403

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

lib/routes/.DS_Store

6 KB
Binary file not shown.

lib/routes/ebay/.DS_Store

6 KB
Binary file not shown.

lib/routes/ebay/search.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { Route } from '@/types';
21
import { load } from 'cheerio';
3-
import ofetch from '@/utils/ofetch';
2+
43
import logger from '@/utils/logger';
4+
import ofetch from '@/utils/ofetch';
5+
import type { Route } from '@/types';
56

67
export const route: Route = {
78
path: '/search/:keywords',
@@ -41,7 +42,7 @@ export const route: Route = {
4142
.map((item) => {
4243
const $item = $(item);
4344
const titleElement = $item.find('.s-item__title, .s-card__title, .s-item__title--has-tags');
44-
const title = titleElement.text().replace(/^New Listing/i, '').trim();
45+
const title = titleElement.text().replace(/^New Listing/i, '');
4546
const link = $item.find('.s-item__link, .s-card__link').attr('href');
4647
const price = $item.find('.s-item__price, .s-card__price').text().trim();
4748
const image =

lib/routes/ebay/user.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { Route } from '@/types';
21
import { load } from 'cheerio';
2+
33
import ofetch from '@/utils/ofetch';
4+
import type { Route } from '@/types';
45

56
export const route: Route = {
67
path: ['/usr/:username', '/user/:username'],

lib/routes/ebay/utils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { CheerioAPI, Element } from 'cheerio';
21

32
/**
43
* Transforms an eBay image URL to prefer WebP format if it's a JPG/JPEG.

0 commit comments

Comments
 (0)