@gem-sdk/core 2.0.0-dev.716 → 2.0.0-dev.719
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.
|
@@ -71,8 +71,8 @@ const removeUndefinedValuesFromObject = (obj)=>{
|
|
|
71
71
|
function sanitizeLiquid(input) {
|
|
72
72
|
return input.replace(/\{\{\s*(.*?)\s*\}\}/g, (_, inner)=>{
|
|
73
73
|
const trimmed = inner.trim();
|
|
74
|
-
// eslint-disable-next-line regexp/no-unused-capturing-group, regexp/prefer-w, regexp/prefer-d
|
|
75
|
-
const isValidLiquid = /^([a-zA-Z_][a-zA-Z0-9_]*)(\.[a-zA-Z0-9_]+)
|
|
74
|
+
// eslint-disable-next-line regexp/no-unused-capturing-group, regexp/no-dupe-characters-character-class, regexp/prefer-w, regexp/prefer-d
|
|
75
|
+
const isValidLiquid = /^([a-zA-Z_][a-zA-Z0-9_-]*)(\.[a-zA-Z0-9_-]+)*$/i.test(trimmed);
|
|
76
76
|
if (isValidLiquid) {
|
|
77
77
|
return `{{ ${trimmed} }}`;
|
|
78
78
|
}
|
|
@@ -69,8 +69,8 @@ const removeUndefinedValuesFromObject = (obj)=>{
|
|
|
69
69
|
function sanitizeLiquid(input) {
|
|
70
70
|
return input.replace(/\{\{\s*(.*?)\s*\}\}/g, (_, inner)=>{
|
|
71
71
|
const trimmed = inner.trim();
|
|
72
|
-
// eslint-disable-next-line regexp/no-unused-capturing-group, regexp/prefer-w, regexp/prefer-d
|
|
73
|
-
const isValidLiquid = /^([a-zA-Z_][a-zA-Z0-9_]*)(\.[a-zA-Z0-9_]+)
|
|
72
|
+
// eslint-disable-next-line regexp/no-unused-capturing-group, regexp/no-dupe-characters-character-class, regexp/prefer-w, regexp/prefer-d
|
|
73
|
+
const isValidLiquid = /^([a-zA-Z_][a-zA-Z0-9_-]*)(\.[a-zA-Z0-9_-]+)*$/i.test(trimmed);
|
|
74
74
|
if (isValidLiquid) {
|
|
75
75
|
return `{{ ${trimmed} }}`;
|
|
76
76
|
}
|