Skip to content

Commit 71cad03

Browse files
committed
fixes #3520 - add TEMPLATE_STRING_REGEX to Lib exported object
1 parent 5925c10 commit 71cad03

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ lib.numSeparate = function(value, separators, separatethousands) {
994994
return x1 + x2;
995995
};
996996

997-
var TEMPLATE_STRING_REGEX = /%{([^\s%{}:]*)(:[^}]*)?}/g;
997+
lib.TEMPLATE_STRING_REGEX = /%{([^\s%{}:]*)(:[^}]*)?}/g;
998998
var SIMPLE_PROPERTY_REGEX = /^\w*$/;
999999

10001000
/**
@@ -1014,7 +1014,7 @@ lib.templateString = function(string, obj) {
10141014
// just in case it speeds things up *slightly*:
10151015
var getterCache = {};
10161016

1017-
return string.replace(TEMPLATE_STRING_REGEX, function(dummy, key) {
1017+
return string.replace(lib.TEMPLATE_STRING_REGEX, function(dummy, key) {
10181018
if(SIMPLE_PROPERTY_REGEX.test(key)) {
10191019
return obj[key] || '';
10201020
}
@@ -1047,7 +1047,7 @@ lib.hovertemplateString = function(string, labels) {
10471047
// just in case it speeds things up *slightly*:
10481048
var getterCache = {};
10491049

1050-
return string.replace(TEMPLATE_STRING_REGEX, function(match, key, format) {
1050+
return string.replace(lib.TEMPLATE_STRING_REGEX, function(match, key, format) {
10511051
var obj, value, i;
10521052
for(i = 2; i < args.length; i++) {
10531053
obj = args[i];

0 commit comments

Comments
 (0)