cavalion-js 1.0.77 → 1.0.78

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,6 +1,11 @@
1
+ ### 2024/05/16 - 1.0.78
2
+
3
+ * Adds Array.fn.nonNil
4
+ * Introduces js.eval
5
+
1
6
  ### 2024/03/24 - 1.0.77
2
7
 
3
- *
8
+ * Introduces util/Text
4
9
 
5
10
  ### 2023/09/30 - 1.0.76
6
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cavalion-js",
3
- "version": "1.0.77",
3
+ "version": "1.0.78",
4
4
  "description": "Cavalion common JavaScript library",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/js/_js.js CHANGED
@@ -17,6 +17,8 @@ define(function(require) {
17
17
  const groupBy = (arr, key) => arr.reduce((a, o) =>
18
18
  ((a[js.get(key, o)] || (a[js.get(key, o)] = []))
19
19
  .push(o), a), {});
20
+
21
+ const tlc = (s) => s.toLowerCase();
20
22
 
21
23
  /*var js;*/
22
24
  return (js = {
@@ -38,6 +40,7 @@ define(function(require) {
38
40
  sj: JSON.stringify,//serialize.serialize,
39
41
  pj: JSON.parse,
40
42
  sf: String.format,
43
+ eval: global[tlc("EVAL")],
41
44
  nameOf: nameOf,
42
45
  defineClass: defineClass,
43
46
  mixIn: mixIn,
@@ -108,6 +108,8 @@ define(function(require) {
108
108
  return before.concat([item]).concat(arr);
109
109
  };
110
110
  Array.fn = {
111
+ nonNil(item) { return item !== null && item !== undefined; },
112
+ nonNull(item) { return item !== null },
111
113
  truthy(item) { return !!item; },
112
114
  falsy(item) { return !item; },
113
115
  unique(item, index, array) { return array.indexOf(item) === index; },