diff --git a/lib/provider/regionalimmobilien24.js b/lib/provider/regionalimmobilien24.js index fc73c65..3e78ca4 100755 --- a/lib/provider/regionalimmobilien24.js +++ b/lib/provider/regionalimmobilien24.js @@ -8,7 +8,7 @@ function normalize(o) { const title = o.title || 'No title available'; const link = o.link != null ? decodeURIComponent(o.link) : config.url; - var urlReg = new RegExp(/url\((.*?)\)/gim); + const urlReg = new RegExp(/url\((.*?)\)/gim); const image = o.image != null ? urlReg.exec(o.image)[1] : null; return Object.assign(o, { id, address, title, link, image }); } diff --git a/lib/services/storage/listingsStorage.js b/lib/services/storage/listingsStorage.js index 94e96f8..fef1ca6 100755 --- a/lib/services/storage/listingsStorage.js +++ b/lib/services/storage/listingsStorage.js @@ -152,8 +152,9 @@ export const storeListings = (jobId, providerId, listings) => { */ function extractNumber(str) { if (!str) return null; - const match = str.replace(/[.,]/g, '').match(/\d+/); - return match ? +match[0] : null; + const cleaned = str.replace(/\./g, '').replace(',', '.'); + const num = parseFloat(cleaned); + return isNaN(num) ? null : num; } /** diff --git a/package.json b/package.json index f2720ad..0a33e19 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fredy", - "version": "14.3.2", + "version": "14.3.3", "description": "[F]ind [R]eal [E]states [d]amn eas[y].", "scripts": { "prepare": "husky",