@lowdefy/operators 3.23.2 → 4.0.0-alpha.10

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 (71) hide show
  1. package/dist/getFromArray.js +23 -45
  2. package/dist/getFromObject.js +26 -71
  3. package/dist/index.js +18 -20
  4. package/dist/nodeParser.js +77 -146
  5. package/dist/runClass.js +58 -83
  6. package/dist/runInstance.js +61 -85
  7. package/dist/webParser.js +81 -157
  8. package/package.json +17 -19
  9. package/dist/common/_index.js +0 -45
  10. package/dist/common/and.js +0 -39
  11. package/dist/common/args.js +0 -46
  12. package/dist/common/array.js +0 -170
  13. package/dist/common/change_case.js +0 -185
  14. package/dist/common/date.js +0 -75
  15. package/dist/common/divide.js +0 -51
  16. package/dist/common/eq.js +0 -43
  17. package/dist/common/event.js +0 -46
  18. package/dist/common/function.js +0 -78
  19. package/dist/common/get.js +0 -61
  20. package/dist/common/global.js +0 -50
  21. package/dist/common/gt.js +0 -43
  22. package/dist/common/gte.js +0 -43
  23. package/dist/common/if.js +0 -41
  24. package/dist/common/if_none.js +0 -47
  25. package/dist/common/index.js +0 -69
  26. package/dist/common/input.js +0 -50
  27. package/dist/common/json.js +0 -64
  28. package/dist/common/log.js +0 -33
  29. package/dist/common/lt.js +0 -43
  30. package/dist/common/lte.js +0 -43
  31. package/dist/common/math.js +0 -210
  32. package/dist/common/mql.js +0 -124
  33. package/dist/common/ne.js +0 -43
  34. package/dist/common/not.js +0 -31
  35. package/dist/common/number.js +0 -125
  36. package/dist/common/nunjucks.js +0 -60
  37. package/dist/common/object.js +0 -118
  38. package/dist/common/operator.js +0 -49
  39. package/dist/common/or.js +0 -39
  40. package/dist/common/product.js +0 -45
  41. package/dist/common/random.js +0 -132
  42. package/dist/common/regex.js +0 -65
  43. package/dist/common/state.js +0 -50
  44. package/dist/common/string.js +0 -188
  45. package/dist/common/subtract.js +0 -47
  46. package/dist/common/sum.js +0 -45
  47. package/dist/common/switch.js +0 -49
  48. package/dist/common/type.js +0 -82
  49. package/dist/common/uri.js +0 -67
  50. package/dist/common/url_query.js +0 -50
  51. package/dist/common/user.js +0 -50
  52. package/dist/common/uuid.js +0 -76
  53. package/dist/common/yaml.js +0 -70
  54. package/dist/getFromOtherContext.js +0 -96
  55. package/dist/node/base64.js +0 -69
  56. package/dist/node/diff.js +0 -66
  57. package/dist/node/hash.js +0 -100
  58. package/dist/node/index.js +0 -29
  59. package/dist/node/secret.js +0 -54
  60. package/dist/web/actions.js +0 -46
  61. package/dist/web/base64.js +0 -67
  62. package/dist/web/event_log.js +0 -50
  63. package/dist/web/format.js +0 -52
  64. package/dist/web/index.js +0 -36
  65. package/dist/web/js.js +0 -45
  66. package/dist/web/list_contexts.js +0 -31
  67. package/dist/web/location.js +0 -74
  68. package/dist/web/media.js +0 -90
  69. package/dist/web/menu.js +0 -43
  70. package/dist/web/request.js +0 -56
  71. package/dist/web/request_details.js +0 -50
@@ -1,170 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _runInstance = _interopRequireDefault(require("../runInstance"));
9
-
10
- var _helpers = require("@lowdefy/helpers");
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- /*
15
- Copyright 2020-2021 Lowdefy, Inc
16
-
17
- Licensed under the Apache License, Version 2.0 (the "License");
18
- you may not use this file except in compliance with the License.
19
- You may obtain a copy of the License at
20
-
21
- http://www.apache.org/licenses/LICENSE-2.0
22
-
23
- Unless required by applicable law or agreed to in writing, software
24
- distributed under the License is distributed on an "AS IS" BASIS,
25
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26
- See the License for the specific language governing permissions and
27
- limitations under the License.
28
- */
29
- var prep = args => {
30
- if (_helpers.type.isNone(args[0])) {
31
- args[0] = [];
32
- }
33
-
34
- return args;
35
- };
36
-
37
- var meta = {
38
- concat: {
39
- prep,
40
- validTypes: ['array']
41
- },
42
- copyWithin: {
43
- namedArgs: ['on', 'target', 'start', 'end'],
44
- prep,
45
- validTypes: ['array', 'object']
46
- },
47
- every: {
48
- namedArgs: ['on', 'callback'],
49
- prep,
50
- validTypes: ['array', 'object']
51
- },
52
- fill: {
53
- namedArgs: ['on', 'value', 'start', 'end'],
54
- prep,
55
- validTypes: ['array', 'object']
56
- },
57
- filter: {
58
- namedArgs: ['on', 'callback'],
59
- prep,
60
- validTypes: ['array', 'object']
61
- },
62
- find: {
63
- namedArgs: ['on', 'callback'],
64
- prep,
65
- validTypes: ['array', 'object']
66
- },
67
- findIndex: {
68
- namedArgs: ['on', 'callback'],
69
- prep,
70
- validTypes: ['array', 'object']
71
- },
72
- flat: {
73
- namedArgs: ['on', 'depth'],
74
- prep,
75
- validTypes: ['array', 'object']
76
- },
77
- includes: {
78
- namedArgs: ['on', 'value'],
79
- prep,
80
- validTypes: ['array', 'object']
81
- },
82
- indexOf: {
83
- namedArgs: ['on', 'value'],
84
- prep,
85
- validTypes: ['array', 'object']
86
- },
87
- join: {
88
- namedArgs: ['on', 'separator'],
89
- prep,
90
- validTypes: ['array', 'object']
91
- },
92
- lastIndexOf: {
93
- namedArgs: ['on', 'value'],
94
- prep,
95
- validTypes: ['array', 'object']
96
- },
97
- map: {
98
- namedArgs: ['on', 'callback'],
99
- prep,
100
- validTypes: ['array', 'object']
101
- },
102
- reduce: {
103
- namedArgs: ['on', 'callback', 'initialValue'],
104
- prep,
105
- validTypes: ['array', 'object']
106
- },
107
- reduceRight: {
108
- namedArgs: ['on', 'callback', 'initialValue'],
109
- prep,
110
- validTypes: ['array', 'object']
111
- },
112
- reverse: {
113
- prep,
114
- validTypes: ['array'],
115
- singleArg: true
116
- },
117
- slice: {
118
- namedArgs: ['on', 'start', 'end'],
119
- prep,
120
- validTypes: ['array', 'object']
121
- },
122
- some: {
123
- namedArgs: ['on', 'callback'],
124
- prep,
125
- validTypes: ['array', 'object']
126
- },
127
- sort: {
128
- namedArgs: ['on'],
129
- prep,
130
- validTypes: ['array']
131
- },
132
- splice: {
133
- namedArgs: ['on', 'start', 'deleteCount'],
134
- spreadArgs: 'insert',
135
- returnInstance: true,
136
- prep,
137
- validTypes: ['array', 'object']
138
- },
139
- length: {
140
- validTypes: ['array'],
141
- prep,
142
- property: true
143
- } // some,
144
- // forEach,
145
- // pop: { namedArgs: ['on'] },
146
- // push: { namedArgs: ['on'] },
147
- // shift: { namedArgs: ['on'] },
148
- // toString,
149
- // unshift: { namedArgs: ['on'] },
150
-
151
- };
152
-
153
- function _array(_ref) {
154
- var {
155
- params,
156
- location,
157
- methodName
158
- } = _ref;
159
- return (0, _runInstance.default)({
160
- location,
161
- meta,
162
- methodName,
163
- operator: '_array',
164
- params,
165
- instanceType: 'array'
166
- });
167
- }
168
-
169
- var _default = _array;
170
- exports.default = _default;
@@ -1,185 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _changeCase = require("change-case");
9
-
10
- var _helpers = require("@lowdefy/helpers");
11
-
12
- var _runClass = _interopRequireDefault(require("../runClass"));
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- /*
17
- Copyright 2020-2021 Lowdefy, Inc
18
-
19
- Licensed under the Apache License, Version 2.0 (the "License");
20
- you may not use this file except in compliance with the License.
21
- You may obtain a copy of the License at
22
-
23
- http://www.apache.org/licenses/LICENSE-2.0
24
-
25
- Unless required by applicable law or agreed to in writing, software
26
- distributed under the License is distributed on an "AS IS" BASIS,
27
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28
- See the License for the specific language governing permissions and
29
- limitations under the License.
30
- */
31
-
32
- /* eslint-disable import/namespace */
33
- var changeCase = {
34
- camelCase: _changeCase.camelCase,
35
- capitalCase: _changeCase.capitalCase,
36
- constantCase: _changeCase.constantCase,
37
- dotCase: _changeCase.dotCase,
38
- headerCase: _changeCase.headerCase,
39
- noCase: _changeCase.noCase,
40
- paramCase: _changeCase.paramCase,
41
- pascalCase: _changeCase.pascalCase,
42
- pathCase: _changeCase.pathCase,
43
- sentenceCase: _changeCase.sentenceCase,
44
- snakeCase: _changeCase.snakeCase
45
- };
46
-
47
- var prepRegex = (prop, location) => {
48
- var regex = _helpers.type.isString(prop) ? {
49
- pattern: prop
50
- } : prop;
51
-
52
- if (!_helpers.type.isObject(regex)) {
53
- throw new Error("Operator Error: regex must be string or an object. Received ".concat(JSON.stringify(prop), " at ").concat(location, "."));
54
- }
55
-
56
- try {
57
- return new RegExp(regex.pattern, regex.flags || 'gm');
58
- } catch (e) {
59
- throw new Error("Operator Error: ".concat(e.message, ". Received: ").concat(JSON.stringify(prop), " at ").concat(location, "."));
60
- }
61
- };
62
-
63
- var prep = (args, _ref) => {
64
- var {
65
- location
66
- } = _ref;
67
- var options = args[1];
68
-
69
- if (!_helpers.type.isNone(options) && !_helpers.type.isObject(options)) {
70
- throw new Error("Operator Error: options must be an object. Received ".concat(JSON.stringify(options), " at ").concat(location, "."));
71
- }
72
-
73
- if (_helpers.type.isObject(options)) {
74
- if (options.splitRegexp) {
75
- options.splitRegexp = prepRegex(options.splitRegexp, location);
76
- }
77
-
78
- if (options.stripRegexp) {
79
- options.stripRegexp = prepRegex(options.stripRegexp, location);
80
- }
81
- }
82
-
83
- return args;
84
- };
85
-
86
- var convertArray = _ref2 => {
87
- var {
88
- methodName,
89
- on,
90
- options
91
- } = _ref2;
92
- return on.map(item => {
93
- if (_helpers.type.isString(item)) {
94
- return changeCase[methodName](item, options);
95
- }
96
-
97
- return item;
98
- });
99
- };
100
-
101
- var convertObject = _ref3 => {
102
- var {
103
- methodName,
104
- on,
105
- options
106
- } = _ref3;
107
- var result = {};
108
- var keyConverter = (0, _helpers.get)(options, 'convertKeys') ? key => changeCase[methodName](key, options) : key => key;
109
- var valueConverter = (0, _helpers.get)(options, 'convertValues', {
110
- default: true
111
- }) ? val => changeCase[methodName](val, options) : val => val;
112
- Object.entries(on).forEach(_ref4 => {
113
- var [key, value] = _ref4;
114
-
115
- if (_helpers.type.isString(value)) {
116
- result[keyConverter(key)] = valueConverter(value);
117
- } else {
118
- result[keyConverter(key)] = value;
119
- }
120
- });
121
- return result;
122
- };
123
-
124
- var makeCaseChanger = _ref5 => {
125
- var {
126
- methodName
127
- } = _ref5;
128
- return function (on) {
129
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
130
-
131
- if (_helpers.type.isString(on)) {
132
- return changeCase[methodName](on, options);
133
- }
134
-
135
- if (_helpers.type.isArray(on)) {
136
- return convertArray({
137
- methodName,
138
- on,
139
- options
140
- });
141
- }
142
-
143
- if (_helpers.type.isObject(on)) {
144
- return convertObject({
145
- methodName,
146
- on,
147
- options
148
- });
149
- }
150
-
151
- return on;
152
- };
153
- };
154
-
155
- var functions = {};
156
- var meta = {};
157
- Object.keys(changeCase).forEach(methodName => {
158
- functions[methodName] = makeCaseChanger({
159
- methodName
160
- });
161
- meta[methodName] = {
162
- namedArgs: ['on', 'options'],
163
- validTypes: ['array', 'object'],
164
- prep
165
- };
166
- });
167
-
168
- function change_case(_ref6) {
169
- var {
170
- params,
171
- location,
172
- methodName
173
- } = _ref6;
174
- return (0, _runClass.default)({
175
- functions,
176
- location,
177
- meta,
178
- methodName,
179
- operator: '_change_case',
180
- params
181
- });
182
- }
183
-
184
- var _default = change_case;
185
- exports.default = _default;
@@ -1,75 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _runClass = _interopRequireDefault(require("../runClass"));
9
-
10
- var _helpers = require("@lowdefy/helpers");
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- /*
15
- Copyright 2020-2021 Lowdefy, Inc
16
-
17
- Licensed under the Apache License, Version 2.0 (the "License");
18
- you may not use this file except in compliance with the License.
19
- You may obtain a copy of the License at
20
-
21
- http://www.apache.org/licenses/LICENSE-2.0
22
-
23
- Unless required by applicable law or agreed to in writing, software
24
- distributed under the License is distributed on an "AS IS" BASIS,
25
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26
- See the License for the specific language governing permissions and
27
- limitations under the License.
28
- */
29
- function date(input) {
30
- var result = new Date(input);
31
-
32
- if (!_helpers.type.isDate(result)) {
33
- throw new Error("".concat(input, " could not resolve as a valid javascript date."));
34
- }
35
-
36
- return result;
37
- }
38
-
39
- function now() {
40
- return new Date();
41
- }
42
-
43
- var functions = {
44
- __default: date,
45
- now
46
- };
47
- var meta = {
48
- __default: {
49
- singleArg: true,
50
- validTypes: ['number', 'string']
51
- },
52
- now: {
53
- noArgs: true
54
- }
55
- };
56
-
57
- function _date(_ref) {
58
- var {
59
- params,
60
- location,
61
- methodName
62
- } = _ref;
63
- return (0, _runClass.default)({
64
- functions,
65
- location,
66
- meta,
67
- methodName: methodName,
68
- operator: '_date',
69
- params,
70
- defaultFunction: '__default'
71
- });
72
- }
73
-
74
- var _default = _date;
75
- exports.default = _default;
@@ -1,51 +0,0 @@
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
- /*
11
- Copyright 2020-2021 Lowdefy, Inc
12
-
13
- Licensed under the Apache License, Version 2.0 (the "License");
14
- you may not use this file except in compliance with the License.
15
- You may obtain a copy of the License at
16
-
17
- http://www.apache.org/licenses/LICENSE-2.0
18
-
19
- Unless required by applicable law or agreed to in writing, software
20
- distributed under the License is distributed on an "AS IS" BASIS,
21
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
- See the License for the specific language governing permissions and
23
- limitations under the License.
24
- */
25
- function _divide(_ref) {
26
- var {
27
- params,
28
- location
29
- } = _ref;
30
-
31
- if (!_helpers.type.isArray(params)) {
32
- throw new Error("Operator Error: _divide takes an array type as input. Received: ".concat(JSON.stringify(params), " at ").concat(location, "."));
33
- }
34
-
35
- if (params.length !== 2) {
36
- throw new Error("Operator Error: _divide takes an array of length 2 as input. Received: ".concat(JSON.stringify(params), " at ").concat(location, "."));
37
- }
38
-
39
- if (!_helpers.type.isNumber(params[0]) || !_helpers.type.isNumber(params[1])) {
40
- throw new Error("Operator Error: _divide takes an array of 2 numbers. Received: ".concat(JSON.stringify(params), " at ").concat(location, "."));
41
- }
42
-
43
- if (params[1] === 0) {
44
- throw new Error("Operator Error: _divide by zero not allowed. Received: ".concat(JSON.stringify(params), " at ").concat(location, "."));
45
- }
46
-
47
- return params[0] / params[1];
48
- }
49
-
50
- var _default = _divide;
51
- exports.default = _default;
package/dist/common/eq.js DELETED
@@ -1,43 +0,0 @@
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
- /*
11
- Copyright 2020-2021 Lowdefy, Inc
12
-
13
- Licensed under the Apache License, Version 2.0 (the "License");
14
- you may not use this file except in compliance with the License.
15
- You may obtain a copy of the License at
16
-
17
- http://www.apache.org/licenses/LICENSE-2.0
18
-
19
- Unless required by applicable law or agreed to in writing, software
20
- distributed under the License is distributed on an "AS IS" BASIS,
21
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
- See the License for the specific language governing permissions and
23
- limitations under the License.
24
- */
25
- function _eq(_ref) {
26
- var {
27
- params,
28
- location
29
- } = _ref;
30
-
31
- if (!_helpers.type.isArray(params)) {
32
- throw new Error("Operator Error: _eq takes an array type as input. Received: ".concat(JSON.stringify(params), " at ").concat(location, "."));
33
- }
34
-
35
- if (params.length !== 2) {
36
- throw new Error("Operator Error: _eq takes an array of length 2 as input. Received: ".concat(JSON.stringify(params), " at ").concat(location, "."));
37
- }
38
-
39
- return params[0] === params[1];
40
- }
41
-
42
- var _default = _eq;
43
- exports.default = _default;
@@ -1,46 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _getFromObject = _interopRequireDefault(require("../getFromObject"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
- /*
13
- Copyright 2020-2021 Lowdefy, Inc
14
-
15
- Licensed under the Apache License, Version 2.0 (the "License");
16
- you may not use this file except in compliance with the License.
17
- You may obtain a copy of the License at
18
-
19
- http://www.apache.org/licenses/LICENSE-2.0
20
-
21
- Unless required by applicable law or agreed to in writing, software
22
- distributed under the License is distributed on an "AS IS" BASIS,
23
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24
- See the License for the specific language governing permissions and
25
- limitations under the License.
26
- */
27
- function _event(_ref) {
28
- var {
29
- arrayIndices,
30
- env,
31
- event,
32
- location,
33
- params
34
- } = _ref;
35
- return (0, _getFromObject.default)({
36
- arrayIndices,
37
- env,
38
- location,
39
- object: event,
40
- operator: '_event',
41
- params
42
- });
43
- }
44
-
45
- var _default = _event;
46
- exports.default = _default;
@@ -1,78 +0,0 @@
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
- /*
11
- Copyright 2020-2021 Lowdefy, Inc
12
-
13
- Licensed under the Apache License, Version 2.0 (the "License");
14
- you may not use this file except in compliance with the License.
15
- You may obtain a copy of the License at
16
-
17
- http://www.apache.org/licenses/LICENSE-2.0
18
-
19
- Unless required by applicable law or agreed to in writing, software
20
- distributed under the License is distributed on an "AS IS" BASIS,
21
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
- See the License for the specific language governing permissions and
23
- limitations under the License.
24
- */
25
- function removeUnderscore(_, value) {
26
- if (_helpers.type.isObject(value) && Object.keys(value).length === 1) {
27
- var key = Object.keys(value)[0];
28
-
29
- if (key.startsWith('__')) {
30
- var newKey = key.substring(1);
31
- return {
32
- [newKey]: value[key]
33
- };
34
- }
35
- }
36
-
37
- return value;
38
- }
39
-
40
- function _function(_ref) {
41
- var {
42
- arrayIndices,
43
- event,
44
- location,
45
- params,
46
- parser
47
- } = _ref;
48
-
49
- var preparedParams = _helpers.serializer.copy(params, {
50
- reviver: removeUnderscore
51
- });
52
-
53
- return function () {
54
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
55
- args[_key] = arguments[_key];
56
- }
57
-
58
- var {
59
- output,
60
- errors
61
- } = parser.parse({
62
- arrayIndices,
63
- args,
64
- event,
65
- input: preparedParams,
66
- location
67
- });
68
-
69
- if (errors.length > 0) {
70
- throw new Error(errors[0]);
71
- }
72
-
73
- return output;
74
- };
75
- }
76
-
77
- var _default = _function;
78
- exports.default = _default;
@@ -1,61 +0,0 @@
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
- var _getFromObject = _interopRequireDefault(require("../getFromObject"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- /*
15
- Copyright 2020-2021 Lowdefy, Inc
16
-
17
- Licensed under the Apache License, Version 2.0 (the "License");
18
- you may not use this file except in compliance with the License.
19
- You may obtain a copy of the License at
20
-
21
- http://www.apache.org/licenses/LICENSE-2.0
22
-
23
- Unless required by applicable law or agreed to in writing, software
24
- distributed under the License is distributed on an "AS IS" BASIS,
25
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26
- See the License for the specific language governing permissions and
27
- limitations under the License.
28
- */
29
- function _get(_ref) {
30
- var {
31
- arrayIndices,
32
- env,
33
- location,
34
- params
35
- } = _ref;
36
-
37
- if (!_helpers.type.isObject(params)) {
38
- throw new Error("Operator Error: _get takes an object as params. Received: ".concat(JSON.stringify(params), " at ").concat(location, "."));
39
- }
40
-
41
- if (params.from === null) return (0, _helpers.get)(params, 'default', {
42
- default: null,
43
- copy: true
44
- });
45
-
46
- if (!_helpers.type.isObject(params.from) && !_helpers.type.isArray(params.from)) {
47
- throw new Error("Operator Error: _get.from is not an object or array. Received: ".concat(JSON.stringify(params), " at ").concat(location, "."));
48
- }
49
-
50
- return (0, _getFromObject.default)({
51
- arrayIndices,
52
- env,
53
- location,
54
- object: params.from,
55
- operator: '_get',
56
- params
57
- });
58
- }
59
-
60
- var _default = _get;
61
- exports.default = _default;