typographic-currency
Advanced tools
Comparing version 0.1.6 to 0.1.7
@@ -20,6 +20,6 @@ 'use strict'; | ||
// use global and ignore letter case | ||
var pattern = new RegExp(key, 'gi'); | ||
var pattern = new RegExp('([^a-z]|\\b)(' + key + ')\\b', 'gi'); | ||
var textInput = text ? text : input; | ||
text = textInput.replace(pattern, currentKey); | ||
text = textInput.replace(pattern, '$1' + currentKey); | ||
} | ||
@@ -26,0 +26,0 @@ |
@@ -10,9 +10,9 @@ import currencyDB from 'typographic-currency-db'; | ||
// use global and ignore letter case | ||
const pattern = new RegExp(key, 'gi'); | ||
const pattern = new RegExp(`([^a-z]|\\b)(${key})\\b`, 'gi'); | ||
let textInput = (text) ? text : input; | ||
text = textInput.replace(pattern, currentKey); | ||
text = textInput.replace(pattern, `$1${currentKey}`); | ||
} | ||
return text; | ||
}; | ||
}; |
{ | ||
"name": "typographic-currency", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "Use the correct symbol of currency", | ||
@@ -24,3 +24,4 @@ "main": "index.es5.js", | ||
"typography", | ||
"currency" | ||
"currency", | ||
"textr" | ||
], | ||
@@ -27,0 +28,0 @@ "author": "talgautb <gtalk.kz@gmail.com> (http://gtalk.kz)", |
@@ -7,2 +7,3 @@ import { equal } from 'assert'; | ||
equal(typographicCurrency('My Tesla costs about 80usd'), 'My Tesla costs about 80$'); | ||
equal(typographicCurrency('Natural rubber'), 'Natural rubber'); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4431
38