@domql/utils 2.3.153 → 2.3.154
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/package.json +2 -2
- package/string.js +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/utils",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.154",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@domql/key": "latest",
|
|
24
24
|
"@domql/tags": "latest"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "6c166817b0c218f1b3f3f0860ae9147a07e7dabc",
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@babel/core": "^7.12.0"
|
|
29
29
|
}
|
package/string.js
CHANGED
|
@@ -8,7 +8,13 @@ export const stringIncludesAny = (str, characters) => {
|
|
|
8
8
|
}
|
|
9
9
|
return false
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Replaces placeholders in a string with corresponding {{ }} values from an object.
|
|
13
|
+
*
|
|
14
|
+
* @param {string} str - The string containing placeholders to replace.
|
|
15
|
+
* @param {object} state - The object containing the values to substitute.
|
|
16
|
+
* @returns {string} The modified string with placeholders replaced by values from the object.
|
|
17
|
+
*/
|
|
12
18
|
export const replaceLiteralsWithObjectFields = (str, state) => {
|
|
13
19
|
if (!str.includes('{{')) return str
|
|
14
20
|
return str.replace(/\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g, (_, parentPath, variable) => {
|