@cocreate/utils 1.14.2 → 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 CHANGED
@@ -1,3 +1,17 @@
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
+
8
+ ## [1.14.3](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.14.2...v1.14.3) (2022-12-07)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * bump dependencies ([20dfebf](https://github.com/CoCreate-app/CoCreate-utils/commit/20dfebf1c48cf79c10ba376ce3d409c7065e0147))
14
+
1
15
  ## [1.14.2](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.14.1...v1.14.2) (2022-12-07)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/utils",
3
- "version": "1.14.2",
3
+ "version": "1.15.0",
4
4
  "description": "A simple utils component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "utils",
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,