@lowdefy/operators 3.22.0 → 4.0.0-alpha.1
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/dist/common/and.js +8 -24
- package/dist/common/args.js +10 -31
- package/dist/common/array.js +244 -153
- package/dist/common/change_case.js +114 -160
- package/dist/common/date.js +33 -54
- package/dist/common/divide.js +16 -36
- package/dist/common/eq.js +10 -28
- package/dist/common/function.js +27 -59
- package/dist/common/get.js +21 -46
- package/dist/common/gt.js +10 -28
- package/dist/common/gte.js +10 -28
- package/dist/common/if.js +9 -26
- package/dist/common/if_none.js +13 -32
- package/dist/common/index.js +39 -53
- package/dist/common/json.js +53 -57
- package/dist/common/log.js +5 -18
- package/dist/common/lt.js +10 -28
- package/dist/common/lte.js +10 -28
- package/dist/common/math.js +255 -194
- package/dist/common/mql.js +93 -102
- package/dist/common/ne.js +10 -28
- package/dist/common/not.js +3 -16
- package/dist/common/number.js +130 -108
- package/dist/common/nunjucks.js +24 -44
- package/dist/common/object.js +89 -98
- package/dist/common/operator.js +33 -44
- package/dist/common/or.js +8 -24
- package/dist/common/product.js +11 -29
- package/dist/common/random.js +74 -109
- package/dist/common/regex.js +26 -49
- package/dist/common/string.js +270 -171
- package/dist/common/subtract.js +13 -32
- package/dist/common/sum.js +11 -29
- package/dist/common/switch.js +30 -0
- package/dist/common/type.js +36 -67
- package/dist/common/uri.js +29 -46
- package/dist/common/user.js +10 -35
- package/dist/common/uuid.js +48 -59
- package/dist/common/yaml.js +56 -63
- package/dist/getFromArray.js +22 -44
- package/dist/getFromObject.js +25 -70
- package/dist/index.js +14 -20
- package/dist/node/base64.js +31 -48
- package/dist/node/diff.js +30 -47
- package/dist/node/hash.js +55 -71
- package/dist/node/index.js +6 -14
- package/dist/{web/list_contexts.js → node/payload.js} +9 -16
- package/dist/node/secret.js +32 -53
- package/dist/nodeParser.js +95 -146
- package/dist/runClass.js +57 -82
- package/dist/runInstance.js +60 -84
- package/dist/web/_index.js +25 -0
- package/dist/web/actions.js +10 -31
- package/dist/web/base64.js +29 -46
- package/dist/{common/_index.js → web/event.js} +10 -30
- package/dist/web/event_log.js +10 -35
- package/dist/web/format.js +15 -37
- package/dist/web/global.js +25 -0
- package/dist/web/index.js +17 -21
- package/dist/{common/event.js → web/input.js} +10 -31
- package/dist/web/js.js +10 -30
- package/dist/web/location.js +44 -59
- package/dist/web/media.js +46 -75
- package/dist/web/menu.js +10 -28
- package/dist/web/request.js +19 -40
- package/dist/web/request_details.js +10 -35
- package/dist/web/state.js +25 -0
- package/dist/web/url_query.js +25 -0
- package/dist/webParser.js +115 -157
- package/package.json +16 -15
- package/dist/common/global.js +0 -50
- package/dist/common/input.js +0 -50
- package/dist/common/state.js +0 -50
- package/dist/common/url_query.js +0 -50
- package/dist/getFromOtherContext.js +0 -96
package/dist/common/gt.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _helpers = require("@lowdefy/helpers");
|
|
9
|
-
|
|
10
1
|
/*
|
|
11
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
12
3
|
|
|
@@ -21,23 +12,14 @@ var _helpers = require("@lowdefy/helpers");
|
|
|
21
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
13
|
See the License for the specific language governing permissions and
|
|
23
14
|
limitations under the License.
|
|
24
|
-
*/
|
|
25
|
-
function _gt(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (params.length !== 2) {
|
|
36
|
-
throw new Error("Operator Error: _gt takes an array of length 2 as input. Received: ".concat(JSON.stringify(params), " at ").concat(location, "."));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return params[0] > params[1];
|
|
15
|
+
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
+
function _gt({ params , location }) {
|
|
17
|
+
if (!type.isArray(params)) {
|
|
18
|
+
throw new Error(`Operator Error: _gt takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
19
|
+
}
|
|
20
|
+
if (params.length !== 2) {
|
|
21
|
+
throw new Error(`Operator Error: _gt takes an array of length 2 as input. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
22
|
+
}
|
|
23
|
+
return params[0] > params[1];
|
|
40
24
|
}
|
|
41
|
-
|
|
42
|
-
var _default = _gt;
|
|
43
|
-
exports.default = _default;
|
|
25
|
+
export default _gt;
|
package/dist/common/gte.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _helpers = require("@lowdefy/helpers");
|
|
9
|
-
|
|
10
1
|
/*
|
|
11
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
12
3
|
|
|
@@ -21,23 +12,14 @@ var _helpers = require("@lowdefy/helpers");
|
|
|
21
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
13
|
See the License for the specific language governing permissions and
|
|
23
14
|
limitations under the License.
|
|
24
|
-
*/
|
|
25
|
-
function _gte(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (params.length !== 2) {
|
|
36
|
-
throw new Error("Operator Error: _gte takes an array of length 2 as input. Received: ".concat(JSON.stringify(params), " at ").concat(location, "."));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return params[0] >= params[1];
|
|
15
|
+
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
+
function _gte({ params , location }) {
|
|
17
|
+
if (!type.isArray(params)) {
|
|
18
|
+
throw new Error(`Operator Error: _gte takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
19
|
+
}
|
|
20
|
+
if (params.length !== 2) {
|
|
21
|
+
throw new Error(`Operator Error: _gte takes an array of length 2 as input. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
22
|
+
}
|
|
23
|
+
return params[0] >= params[1];
|
|
40
24
|
}
|
|
41
|
-
|
|
42
|
-
var _default = _gte;
|
|
43
|
-
exports.default = _default;
|
|
25
|
+
export default _gte;
|
package/dist/common/if.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
1
|
/*
|
|
9
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
10
3
|
|
|
@@ -19,23 +12,13 @@ exports.default = void 0;
|
|
|
19
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
13
|
See the License for the specific language governing permissions and
|
|
21
14
|
limitations under the License.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
params
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return params.then;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (params.test === false) {
|
|
34
|
-
return params.else;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
throw new Error("Operator Error: _if takes a boolean type for parameter test. Received: ".concat(JSON.stringify(params), " at ").concat(location, "."));
|
|
15
|
+
*/ function _if({ location , params }) {
|
|
16
|
+
if (params.test === true) {
|
|
17
|
+
return params.then;
|
|
18
|
+
}
|
|
19
|
+
if (params.test === false) {
|
|
20
|
+
return params.else;
|
|
21
|
+
}
|
|
22
|
+
throw new Error(`Operator Error: _if takes a boolean type for parameter test. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
38
23
|
}
|
|
39
|
-
|
|
40
|
-
var _default = _if;
|
|
41
|
-
exports.default = _default;
|
|
24
|
+
export default _if;
|
package/dist/common/if_none.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _helpers = require("@lowdefy/helpers");
|
|
9
|
-
|
|
10
1
|
/*
|
|
11
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
12
3
|
|
|
@@ -21,27 +12,17 @@ var _helpers = require("@lowdefy/helpers");
|
|
|
21
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
13
|
See the License for the specific language governing permissions and
|
|
23
14
|
limitations under the License.
|
|
24
|
-
*/
|
|
25
|
-
function _if_none(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
throw new Error("Operator Error: _if_none takes an array of length 2 as input. Received: ".concat(JSON.stringify(params), " at ").concat(location, "."));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (_helpers.type.isNone(params[0])) {
|
|
40
|
-
return params[1];
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return params[0];
|
|
15
|
+
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
+
function _if_none({ params , location }) {
|
|
17
|
+
if (!type.isArray(params)) {
|
|
18
|
+
throw new Error(`Operator Error: _if_none takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
19
|
+
}
|
|
20
|
+
if (params.length !== 2) {
|
|
21
|
+
throw new Error(`Operator Error: _if_none takes an array of length 2 as input. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
22
|
+
}
|
|
23
|
+
if (type.isNone(params[0])) {
|
|
24
|
+
return params[1];
|
|
25
|
+
}
|
|
26
|
+
return params[0];
|
|
44
27
|
}
|
|
45
|
-
|
|
46
|
-
var _default = _if_none;
|
|
47
|
-
exports.default = _default;
|
|
28
|
+
export default _if_none;
|
package/dist/common/index.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
1
|
/*
|
|
9
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
10
3
|
|
|
@@ -19,50 +12,43 @@ exports.default = void 0;
|
|
|
19
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
13
|
See the License for the specific language governing permissions and
|
|
21
14
|
limitations under the License.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
_type: 'common/type',
|
|
62
|
-
_uri: 'common/uri',
|
|
63
|
-
_url_query: 'common/url_query',
|
|
64
|
-
_user: 'common/user',
|
|
65
|
-
_uuid: 'common/uuid',
|
|
66
|
-
_yaml: 'common/yaml'
|
|
15
|
+
*/ export default {
|
|
16
|
+
_and: 'common/and',
|
|
17
|
+
_args: 'common/args',
|
|
18
|
+
_array: 'common/array',
|
|
19
|
+
_change_case: 'common/change_case',
|
|
20
|
+
_date: 'common/date',
|
|
21
|
+
_divide: 'common/divide',
|
|
22
|
+
_eq: 'common/eq',
|
|
23
|
+
_function: 'common/function',
|
|
24
|
+
_get: 'common/get',
|
|
25
|
+
_gt: 'common/gt',
|
|
26
|
+
_gte: 'common/gte',
|
|
27
|
+
_if_none: 'common/if_none',
|
|
28
|
+
_if: 'common/if',
|
|
29
|
+
_json: 'common/json',
|
|
30
|
+
_log: 'common/log',
|
|
31
|
+
_lt: 'common/lt',
|
|
32
|
+
_lte: 'common/lte',
|
|
33
|
+
_math: 'common/math',
|
|
34
|
+
_mql: 'common/mql',
|
|
35
|
+
_ne: 'common/ne',
|
|
36
|
+
_not: 'common/not',
|
|
37
|
+
_number: 'common/number',
|
|
38
|
+
_nunjucks: 'common/nunjucks',
|
|
39
|
+
_object: 'common/object',
|
|
40
|
+
_operator: 'common/operator',
|
|
41
|
+
_or: 'common/or',
|
|
42
|
+
_product: 'common/product',
|
|
43
|
+
_random: 'common/random',
|
|
44
|
+
_regex: 'common/regex',
|
|
45
|
+
_string: 'common/string',
|
|
46
|
+
_subtract: 'common/subtract',
|
|
47
|
+
_sum: 'common/sum',
|
|
48
|
+
_switch: 'common/switch',
|
|
49
|
+
_type: 'common/type',
|
|
50
|
+
_uri: 'common/uri',
|
|
51
|
+
_user: 'common/user',
|
|
52
|
+
_uuid: 'common/uuid',
|
|
53
|
+
_yaml: 'common/yaml'
|
|
67
54
|
};
|
|
68
|
-
exports.default = _default;
|
package/dist/common/json.js
CHANGED
|
@@ -1,64 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
-
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2021 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import { serializer } from '@lowdefy/helpers';
|
|
16
|
+
import runClass from '../runClass.js';
|
|
20
17
|
function parse(input) {
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
if (input === 'undefined') return undefined;
|
|
19
|
+
return serializer.deserializeFromString(input);
|
|
23
20
|
}
|
|
24
|
-
|
|
25
21
|
function stringify(input, options) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
return serializer.serializeToString(input, {
|
|
23
|
+
space: 2,
|
|
24
|
+
isoStringDates: true,
|
|
25
|
+
...options
|
|
26
|
+
});
|
|
30
27
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
stringify
|
|
28
|
+
const functions = {
|
|
29
|
+
parse,
|
|
30
|
+
stringify
|
|
35
31
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
32
|
+
const meta = {
|
|
33
|
+
stringify: {
|
|
34
|
+
namedArgs: [
|
|
35
|
+
'on',
|
|
36
|
+
'options'
|
|
37
|
+
],
|
|
38
|
+
validTypes: [
|
|
39
|
+
'object',
|
|
40
|
+
'array'
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
parse: {
|
|
44
|
+
singleArg: true,
|
|
45
|
+
validTypes: [
|
|
46
|
+
'string'
|
|
47
|
+
]
|
|
48
|
+
}
|
|
45
49
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
location,
|
|
56
|
-
meta,
|
|
57
|
-
methodName,
|
|
58
|
-
operator: '_json',
|
|
59
|
-
params
|
|
60
|
-
});
|
|
50
|
+
function _json({ params , location , methodName }) {
|
|
51
|
+
return runClass({
|
|
52
|
+
functions,
|
|
53
|
+
location,
|
|
54
|
+
meta,
|
|
55
|
+
methodName,
|
|
56
|
+
operator: '_json',
|
|
57
|
+
params
|
|
58
|
+
});
|
|
61
59
|
}
|
|
62
|
-
|
|
63
|
-
var _default = _json;
|
|
64
|
-
exports.default = _default;
|
|
60
|
+
export default _json;
|
package/dist/common/log.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
1
|
/*
|
|
9
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
10
3
|
|
|
@@ -19,15 +12,9 @@ exports.default = void 0;
|
|
|
19
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
13
|
See the License for the specific language governing permissions and
|
|
21
14
|
limitations under the License.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
params
|
|
26
|
-
} = _ref;
|
|
27
|
-
// eslint-disable-next-line no-console
|
|
28
|
-
console.log(params);
|
|
29
|
-
return params;
|
|
15
|
+
*/ function _log({ params }) {
|
|
16
|
+
// eslint-disable-next-line no-console
|
|
17
|
+
console.log(params);
|
|
18
|
+
return params;
|
|
30
19
|
}
|
|
31
|
-
|
|
32
|
-
var _default = _log;
|
|
33
|
-
exports.default = _default;
|
|
20
|
+
export default _log;
|
package/dist/common/lt.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _helpers = require("@lowdefy/helpers");
|
|
9
|
-
|
|
10
1
|
/*
|
|
11
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
12
3
|
|
|
@@ -21,23 +12,14 @@ var _helpers = require("@lowdefy/helpers");
|
|
|
21
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
13
|
See the License for the specific language governing permissions and
|
|
23
14
|
limitations under the License.
|
|
24
|
-
*/
|
|
25
|
-
function _lt(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (params.length !== 2) {
|
|
36
|
-
throw new Error("Operator Error: _lt takes an array of length 2 as input. Received: ".concat(JSON.stringify(params), " at ").concat(location, "."));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return params[0] < params[1];
|
|
15
|
+
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
+
function _lt({ params , location }) {
|
|
17
|
+
if (!type.isArray(params)) {
|
|
18
|
+
throw new Error(`Operator Error: _lt takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
19
|
+
}
|
|
20
|
+
if (params.length !== 2) {
|
|
21
|
+
throw new Error(`Operator Error: _lt takes an array of length 2 as input. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
22
|
+
}
|
|
23
|
+
return params[0] < params[1];
|
|
40
24
|
}
|
|
41
|
-
|
|
42
|
-
var _default = _lt;
|
|
43
|
-
exports.default = _default;
|
|
25
|
+
export default _lt;
|
package/dist/common/lte.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _helpers = require("@lowdefy/helpers");
|
|
9
|
-
|
|
10
1
|
/*
|
|
11
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
12
3
|
|
|
@@ -21,23 +12,14 @@ var _helpers = require("@lowdefy/helpers");
|
|
|
21
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
13
|
See the License for the specific language governing permissions and
|
|
23
14
|
limitations under the License.
|
|
24
|
-
*/
|
|
25
|
-
function _lte(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (params.length !== 2) {
|
|
36
|
-
throw new Error("Operator Error: _lte takes an array of length 2 as input. Received: ".concat(JSON.stringify(params), " at ").concat(location, "."));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return params[0] <= params[1];
|
|
15
|
+
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
+
function _lte({ params , location }) {
|
|
17
|
+
if (!type.isArray(params)) {
|
|
18
|
+
throw new Error(`Operator Error: _lte takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
19
|
+
}
|
|
20
|
+
if (params.length !== 2) {
|
|
21
|
+
throw new Error(`Operator Error: _lte takes an array of length 2 as input. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
22
|
+
}
|
|
23
|
+
return params[0] <= params[1];
|
|
40
24
|
}
|
|
41
|
-
|
|
42
|
-
var _default = _lte;
|
|
43
|
-
exports.default = _default;
|
|
25
|
+
export default _lte;
|