Compare commits
2 Commits
2da69f70b9
...
6503d29801
| Author | SHA1 | Date | |
|---|---|---|---|
| 6503d29801 | |||
| d4769519c2 |
@@ -81,7 +81,7 @@ function inferPackageDebugFromRawName(rawName: string): {
|
||||
}
|
||||
|
||||
// e.g. "5dl", "1,5l"
|
||||
const singlePack = /(\d+(?:[\.,]\d+)?)\s*(ml|cl|dl|l|g|kg)\b/i.exec(normalized);
|
||||
const singlePack = /(\d+(?:[\.,]\d+)?)\s*(ml|cl|dl|l|g|kg)\b/i.exec(normalized.replace(/([\d.,]+)(ml|cl|dl|l|g|kg)\b/i, '$1 $2'));
|
||||
if (singlePack) {
|
||||
const qty = Number.parseFloat(singlePack[1].replace(',', '.'));
|
||||
const unit = singlePack[2].toLowerCase();
|
||||
|
||||
Reference in New Issue
Block a user