docs-combiner 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/renderer.js +54 -1
- package/dist/renderer.js.map +1 -1
- package/package.json +1 -1
package/dist/renderer.js
CHANGED
|
@@ -89978,6 +89978,37 @@ function App() {
|
|
|
89978
89978
|
const trimmed = value.trim();
|
|
89979
89979
|
if (!trimmed)
|
|
89980
89980
|
return { price: '', currency: '' };
|
|
89981
|
+
// Currency symbol to code mapping
|
|
89982
|
+
const currencySymbolMap = {
|
|
89983
|
+
'₦': 'NGN', // Nigerian Naira
|
|
89984
|
+
'€': 'EUR', // Euro
|
|
89985
|
+
'$': 'USD', // US Dollar (also used for other dollars)
|
|
89986
|
+
'£': 'GBP', // British Pound
|
|
89987
|
+
'¥': 'JPY', // Japanese Yen
|
|
89988
|
+
'₹': 'INR', // Indian Rupee
|
|
89989
|
+
'₽': 'RUB', // Russian Ruble
|
|
89990
|
+
'₴': 'UAH', // Ukrainian Hryvnia
|
|
89991
|
+
'₸': 'KZT', // Kazakhstani Tenge
|
|
89992
|
+
'₪': 'ILS', // Israeli Shekel
|
|
89993
|
+
'₨': 'PKR', // Pakistani Rupee / Sri Lankan Rupee (ambiguous, defaulting to PKR)
|
|
89994
|
+
'₫': 'VND', // Vietnamese Dong
|
|
89995
|
+
'₱': 'PHP', // Philippine Peso
|
|
89996
|
+
'₩': 'KRW', // South Korean Won
|
|
89997
|
+
'₡': 'CRC', // Costa Rican Colón
|
|
89998
|
+
'₵': 'GHS', // Ghanaian Cedi
|
|
89999
|
+
'₮': 'MNT', // Mongolian Tugrik
|
|
90000
|
+
'₯': 'GRD', // Greek Drachma (obsolete)
|
|
90001
|
+
'₰': 'DEM', // German Mark (obsolete)
|
|
90002
|
+
'₲': 'PYG', // Paraguayan Guaraní
|
|
90003
|
+
'₳': 'ARA', // Argentine Austral (obsolete)
|
|
90004
|
+
'₶': 'LVL', // Latvian Lats (obsolete)
|
|
90005
|
+
'₷': 'EEK', // Estonian Kroon (obsolete)
|
|
90006
|
+
'₺': 'TRY', // Turkish Lira
|
|
90007
|
+
'₼': 'AZN', // Azerbaijani Manat
|
|
90008
|
+
'₾': 'GEL', // Georgian Lari
|
|
90009
|
+
'₿': 'BTC', // Bitcoin
|
|
90010
|
+
'¢': 'USD', // Cent (US)
|
|
90011
|
+
};
|
|
89981
90012
|
// Currency name to code mapping
|
|
89982
90013
|
const currencyMap = {
|
|
89983
90014
|
'euro': 'EUR',
|
|
@@ -90008,8 +90039,30 @@ function App() {
|
|
|
90008
90039
|
'dkk': 'DKK',
|
|
90009
90040
|
'koruna': 'CZK',
|
|
90010
90041
|
'koruny': 'CZK',
|
|
90011
|
-
'czk': 'CZK'
|
|
90042
|
+
'czk': 'CZK',
|
|
90043
|
+
'naira': 'NGN',
|
|
90044
|
+
'nairas': 'NGN',
|
|
90045
|
+
'ngn': 'NGN'
|
|
90012
90046
|
};
|
|
90047
|
+
// First, check for currency symbols (before or after the number)
|
|
90048
|
+
// Check if first character is a currency symbol (e.g., "₦48900" or "₦ 48900")
|
|
90049
|
+
const firstChar = trimmed[0];
|
|
90050
|
+
if (currencySymbolMap[firstChar]) {
|
|
90051
|
+
const rest = trimmed.slice(1).trim();
|
|
90052
|
+
const priceMatch = rest.match(/^(\d+(?:\.\d+)?)$/);
|
|
90053
|
+
if (priceMatch) {
|
|
90054
|
+
return { price: priceMatch[1], currency: currencySymbolMap[firstChar] };
|
|
90055
|
+
}
|
|
90056
|
+
}
|
|
90057
|
+
// Check if last character is a currency symbol (e.g., "48900 ₦" or "48900₦")
|
|
90058
|
+
const lastChar = trimmed[trimmed.length - 1];
|
|
90059
|
+
if (currencySymbolMap[lastChar]) {
|
|
90060
|
+
const rest = trimmed.slice(0, -1).trim();
|
|
90061
|
+
const priceMatch = rest.match(/^(\d+(?:\.\d+)?)$/);
|
|
90062
|
+
if (priceMatch) {
|
|
90063
|
+
return { price: priceMatch[1], currency: currencySymbolMap[lastChar] };
|
|
90064
|
+
}
|
|
90065
|
+
}
|
|
90013
90066
|
// Try to match pattern: number followed by currency code (3 letters)
|
|
90014
90067
|
const match = trimmed.match(/^(\d+(?:\.\d+)?)\s+([A-Z]{3})$/i);
|
|
90015
90068
|
if (match) {
|