@legalplace/lplogic 2.0.1 → 2.0.2

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.
Files changed (2) hide show
  1. package/dist/LpLogic.js +22 -0
  2. package/package.json +1 -1
package/dist/LpLogic.js CHANGED
@@ -110,5 +110,27 @@ json_logic_js_1.default.add_operation("does-not-contain", function (value, compa
110
110
  var filter = value.filter(function (_value) { return _value !== comparator; });
111
111
  return value.length === filter.length;
112
112
  });
113
+ json_logic_js_1.default.add_operation("empty", function (value) {
114
+ if (!Array.isArray(value)) {
115
+ var stringValue = typeof value === "number" ? value.toString() : value;
116
+ return stringValue.trim().length === 0;
117
+ }
118
+ var filter = value.filter(function (_value) {
119
+ var stringValue = typeof _value === "number" ? _value.toString() : _value;
120
+ return stringValue.trim().length === 0;
121
+ });
122
+ return value.length === filter.length;
123
+ });
124
+ json_logic_js_1.default.add_operation("not-empty", function (value) {
125
+ if (!Array.isArray(value)) {
126
+ var stringValue = typeof value === "number" ? value.toString() : value;
127
+ return stringValue.trim().length > 0;
128
+ }
129
+ var filter = value.filter(function (_value) {
130
+ var stringValue = typeof _value === "number" ? _value.toString() : _value;
131
+ return stringValue.trim().length > 0;
132
+ });
133
+ return value.length === filter.length;
134
+ });
113
135
  var LpLogic = json_logic_js_1.default.apply;
114
136
  exports.default = LpLogic;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legalplace/lplogic",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "LegalPlace LpLogic",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",