Skip to content

Commit

Permalink
가격이 없다면 description에서 숫자 데이터가 있으면 해당 값을 가져오도록 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
hyejungg committed Jan 5, 2025
1 parent 88f8e05 commit e8b9ef9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ const parsingForGeneral = async (url) => {
if (!itemPrice) {
const description = value;

const priceRegex = /(\d{1,3}(,\d{3})*(\.\d{2})?)/;
const matchPriceString = priceRegex.exec(description)[1];
const priceRegex = /\d{1,3}(,\d{3})*/g;
const matchPriceString = description.match(priceRegex);
if (matchPriceString) {
itemPrice = matchPriceString;
itemPrice = matchPriceString[0];
}
}
break;
Expand Down

0 comments on commit e8b9ef9

Please sign in to comment.