Skip to content

Commit 53d5098

Browse files
committed
fixing wrong number extraction
1 parent 32c7518 commit 53d5098

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

lib/provider/regionalimmobilien24.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function normalize(o) {
88
const title = o.title || 'No title available';
99
const link = o.link != null ? decodeURIComponent(o.link) : config.url;
1010

11-
var urlReg = new RegExp(/url\((.*?)\)/gim);
11+
const urlReg = new RegExp(/url\((.*?)\)/gim);
1212
const image = o.image != null ? urlReg.exec(o.image)[1] : null;
1313
return Object.assign(o, { id, address, title, link, image });
1414
}

lib/services/storage/listingsStorage.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,9 @@ export const storeListings = (jobId, providerId, listings) => {
152152
*/
153153
function extractNumber(str) {
154154
if (!str) return null;
155-
const match = str.replace(/[.,]/g, '').match(/\d+/);
156-
return match ? +match[0] : null;
155+
const cleaned = str.replace(/\./g, '').replace(',', '.');
156+
const num = parseFloat(cleaned);
157+
return isNaN(num) ? null : num;
157158
}
158159

159160
/**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fredy",
3-
"version": "14.3.2",
3+
"version": "14.3.3",
44
"description": "[F]ind [R]eal [E]states [d]amn eas[y].",
55
"scripts": {
66
"prepare": "husky",

0 commit comments

Comments
 (0)