@cocreate/utils 1.14.3 → 1.15.0
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/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/utils.js +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [1.15.0](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.14.3...v1.15.0) (2022-12-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* checkValue function to check if value contains template brackets {{}} ([8432c50](https://github.com/CoCreate-app/CoCreate-utils/commit/8432c50ab48e345dfbcaf025128bed7db1abd539))
|
|
7
|
+
|
|
1
8
|
## [1.14.3](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.14.2...v1.14.3) (2022-12-07)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/utils.js
CHANGED
|
@@ -34,6 +34,13 @@
|
|
|
34
34
|
|
|
35
35
|
const ObjectId = (rnd = r16 => Math.floor(r16).toString(16)) =>
|
|
36
36
|
rnd(Date.now()/1000) + ' '.repeat(16).replace(/./g, () => rnd(Math.random()*16));
|
|
37
|
+
|
|
38
|
+
function checkValue(value) {
|
|
39
|
+
if (/{{\s*([\w\W]+)\s*}}/g.test(value))
|
|
40
|
+
return false;
|
|
41
|
+
else
|
|
42
|
+
return true
|
|
43
|
+
}
|
|
37
44
|
|
|
38
45
|
function dotNotationToObject(data, obj = {}) {
|
|
39
46
|
try {
|
|
@@ -501,6 +508,7 @@
|
|
|
501
508
|
|
|
502
509
|
return {
|
|
503
510
|
ObjectId,
|
|
511
|
+
checkValue,
|
|
504
512
|
dotNotationToObject,
|
|
505
513
|
getValueFromObject,
|
|
506
514
|
domParser,
|