@lowdefy/operators 3.23.0 → 4.0.0-alpha.5

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/common/change_case.js +114 -160
  2. package/dist/common/index.js +39 -54
  3. package/dist/common/mql.js +93 -102
  4. package/dist/common/uuid.js +48 -59
  5. package/dist/common/yaml.js +56 -63
  6. package/dist/getFromArray.js +22 -44
  7. package/dist/getFromObject.js +25 -70
  8. package/dist/index.js +18 -20
  9. package/dist/node/diff.js +30 -47
  10. package/dist/node/index.js +6 -14
  11. package/dist/nodeParser.js +83 -146
  12. package/dist/runClass.js +57 -82
  13. package/dist/runInstance.js +60 -84
  14. package/dist/web/format.js +15 -37
  15. package/dist/web/index.js +17 -21
  16. package/dist/web/js.js +10 -30
  17. package/dist/webParser.js +99 -157
  18. package/package.json +16 -15
  19. package/dist/common/_index.js +0 -45
  20. package/dist/common/and.js +0 -39
  21. package/dist/common/args.js +0 -46
  22. package/dist/common/array.js +0 -170
  23. package/dist/common/date.js +0 -75
  24. package/dist/common/divide.js +0 -51
  25. package/dist/common/eq.js +0 -43
  26. package/dist/common/event.js +0 -46
  27. package/dist/common/function.js +0 -78
  28. package/dist/common/get.js +0 -61
  29. package/dist/common/global.js +0 -50
  30. package/dist/common/gt.js +0 -43
  31. package/dist/common/gte.js +0 -43
  32. package/dist/common/if.js +0 -41
  33. package/dist/common/if_none.js +0 -47
  34. package/dist/common/input.js +0 -50
  35. package/dist/common/json.js +0 -64
  36. package/dist/common/log.js +0 -33
  37. package/dist/common/lt.js +0 -43
  38. package/dist/common/lte.js +0 -43
  39. package/dist/common/math.js +0 -210
  40. package/dist/common/ne.js +0 -43
  41. package/dist/common/not.js +0 -31
  42. package/dist/common/number.js +0 -125
  43. package/dist/common/nunjucks.js +0 -60
  44. package/dist/common/object.js +0 -118
  45. package/dist/common/operator.js +0 -49
  46. package/dist/common/or.js +0 -39
  47. package/dist/common/product.js +0 -45
  48. package/dist/common/random.js +0 -132
  49. package/dist/common/regex.js +0 -65
  50. package/dist/common/state.js +0 -50
  51. package/dist/common/string.js +0 -188
  52. package/dist/common/subtract.js +0 -47
  53. package/dist/common/sum.js +0 -45
  54. package/dist/common/switch.js +0 -49
  55. package/dist/common/type.js +0 -82
  56. package/dist/common/uri.js +0 -67
  57. package/dist/common/url_query.js +0 -50
  58. package/dist/common/user.js +0 -50
  59. package/dist/getFromOtherContext.js +0 -96
  60. package/dist/node/base64.js +0 -69
  61. package/dist/node/hash.js +0 -100
  62. package/dist/node/secret.js +0 -54
  63. package/dist/web/actions.js +0 -46
  64. package/dist/web/base64.js +0 -67
  65. package/dist/web/event_log.js +0 -50
  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
package/dist/web/js.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,25 +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 _js(_ref) {
26
- var {
27
- context,
28
- params,
29
- location,
30
- methodName
31
- } = _ref;
32
-
33
- if (!_helpers.type.isFunction(context.lowdefy.imports.jsOperators[methodName])) {
34
- throw new Error("Operator Error: _js.".concat(methodName, " is not a function."));
35
- }
36
-
37
- if (!_helpers.type.isNone(params) && !_helpers.type.isArray(params)) {
38
- throw new Error("Operator Error: _js.".concat(methodName, " takes an array as input at ").concat(location, "."));
39
- }
40
-
41
- return context.lowdefy.imports.jsOperators[methodName](...(params || []));
15
+ */ import { type } from '@lowdefy/helpers';
16
+ function _js({ context , params , location , methodName }) {
17
+ if (!type.isFunction(context.lowdefy.imports.jsOperators[methodName])) {
18
+ throw new Error(`Operator Error: _js.${methodName} is not a function.`);
19
+ }
20
+ if (!type.isNone(params) && !type.isArray(params)) {
21
+ throw new Error(`Operator Error: _js.${methodName} takes an array as input at ${location}.`);
22
+ }
23
+ return context.lowdefy.imports.jsOperators[methodName](...params || []);
42
24
  }
43
-
44
- var _default = _js;
45
- exports.default = _default;
25
+ export default _js;
package/dist/webParser.js CHANGED
@@ -1,161 +1,103 @@
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 _common = _interopRequireDefault(require("./common"));
11
-
12
- var _web = _interopRequireDefault(require("./web"));
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
17
-
18
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
19
-
20
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
21
-
22
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
23
-
24
- 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; }
25
-
26
- class WebParser {
27
- constructor(_ref) {
28
- var {
29
- context,
30
- contexts
31
- } = _ref;
32
- this.context = context;
33
- this.contexts = contexts;
34
- this.init = this.init.bind(this);
35
- this.parse = this.parse.bind(this);
36
- this.operators = _objectSpread(_objectSpread({}, _common.default), _web.default);
37
- this.operations = {};
38
- }
39
-
40
- init() {
41
- var _this = this;
42
-
43
- return _asyncToGenerator(function* () {
44
- if (!_helpers.type.isObject(_this.context.lowdefy)) {
45
- throw new Error('context.lowdefy must be an object.');
46
- }
47
-
48
- if (!_helpers.type.isArray(_this.context.operators)) {
49
- throw new Error('context.operators must be an array.');
50
- }
51
-
52
- yield Promise.all(_this.context.operators.map( /*#__PURE__*/function () {
53
- var _ref2 = _asyncToGenerator(function* (operator) {
54
- if (_this.operators[operator]) {
55
- var fn = yield import("./".concat(_this.operators[operator], ".js"));
56
- _this.operations[operator] = fn.default;
57
-
58
- if (_this.operations[operator].init) {
59
- yield _this.operations[operator].init();
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 { applyArrayIndices, serializer, type } from '@lowdefy/helpers';
16
+ let WebParser = class WebParser {
17
+ async init() {
18
+ if (!type.isObject(this.context._internal.lowdefy)) {
19
+ throw new Error('context._internal.lowdefy must be an object.');
20
+ }
21
+ await Promise.all(Object.values(this.operators).map(async (operator)=>{
22
+ if (operator.init) {
23
+ await operator.init();
60
24
  }
61
- }
62
- });
63
-
64
- return function (_x) {
65
- return _ref2.apply(this, arguments);
66
- };
67
- }()));
68
- })();
69
- }
70
-
71
- parse(_ref3) {
72
- var {
73
- actions,
74
- args,
75
- arrayIndices,
76
- event,
77
- input,
78
- location
79
- } = _ref3;
80
-
81
- if (_helpers.type.isUndefined(input)) {
82
- return {
83
- output: input,
84
- errors: []
85
- };
86
- }
87
-
88
- if (event && !_helpers.type.isObject(event)) {
89
- throw new Error('Operator parser event must be a object.');
25
+ }));
90
26
  }
91
-
92
- if (args && !_helpers.type.isArray(args)) {
93
- throw new Error('Operator parser args must be an array.');
27
+ parse({ actions , args , arrayIndices , event , input , location }) {
28
+ const operators = this.operators;
29
+ const context = this.context;
30
+ if (type.isUndefined(input)) {
31
+ return {
32
+ output: input,
33
+ errors: []
34
+ };
35
+ }
36
+ if (event && !type.isObject(event)) {
37
+ throw new Error('Operator parser event must be a object.');
38
+ }
39
+ if (args && !type.isArray(args)) {
40
+ throw new Error('Operator parser args must be an array.');
41
+ }
42
+ if (!type.isString(location)) {
43
+ throw new Error('Operator parser location must be a string.');
44
+ }
45
+ const errors = [];
46
+ const { inputs , lowdefyGlobal , menus , urlQuery , user } = context._internal.lowdefy;
47
+ const reviver = (_, value)=>{
48
+ if (type.isObject(value) && Object.keys(value).length === 1) {
49
+ const key = Object.keys(value)[0];
50
+ const [op, methodName] = key.split('.');
51
+ try {
52
+ if (!type.isUndefined(operators[op])) {
53
+ const res = operators[op]({
54
+ eventLog: context.eventLog,
55
+ actions,
56
+ args,
57
+ arrayIndices,
58
+ context: context,
59
+ env: 'web',
60
+ event,
61
+ input: inputs ? inputs[context.id] : {
62
+ },
63
+ location: applyArrayIndices(arrayIndices, location),
64
+ lowdefyGlobal: lowdefyGlobal || {
65
+ },
66
+ menus: menus || {
67
+ },
68
+ methodName,
69
+ operators: operators,
70
+ params: value[key],
71
+ requests: context.requests,
72
+ state: context.state,
73
+ urlQuery: urlQuery || {
74
+ },
75
+ user: user || {
76
+ },
77
+ parser: this
78
+ });
79
+ return res;
80
+ }
81
+ } catch (e) {
82
+ errors.push(e);
83
+ console.error(e);
84
+ return null;
85
+ }
86
+ }
87
+ return value;
88
+ };
89
+ return {
90
+ output: serializer.copy(input, {
91
+ reviver
92
+ }),
93
+ errors
94
+ };
94
95
  }
95
-
96
- if (location && !_helpers.type.isString(location)) {
97
- throw new Error('Operator parser location must be a string.');
96
+ constructor({ context , operators }){
97
+ this.context = context;
98
+ this.init = this.init.bind(this);
99
+ this.parse = this.parse.bind(this);
100
+ this.operators = operators;
98
101
  }
99
-
100
- var errors = [];
101
- var {
102
- inputs,
103
- lowdefyGlobal,
104
- menus,
105
- urlQuery,
106
- user
107
- } = this.context.lowdefy;
108
-
109
- var reviver = (_, value) => {
110
- if (_helpers.type.isObject(value) && Object.keys(value).length === 1) {
111
- var key = Object.keys(value)[0];
112
- var [op, methodName] = key.split('.');
113
-
114
- try {
115
- if (!_helpers.type.isUndefined(this.operations[op])) {
116
- var res = this.operations[op]({
117
- eventLog: this.context.eventLog,
118
- actions,
119
- args,
120
- arrayIndices,
121
- context: this.context,
122
- contexts: this.contexts,
123
- env: 'web',
124
- event,
125
- input: inputs ? inputs[this.context.id] : {},
126
- location: location ? (0, _helpers.applyArrayIndices)(arrayIndices, location) : null,
127
- lowdefyGlobal: lowdefyGlobal || {},
128
- menus: menus || {},
129
- methodName,
130
- operations: this.operations,
131
- params: value[key],
132
- requests: this.context.requests,
133
- state: this.context.state,
134
- urlQuery: urlQuery || {},
135
- user: user || {},
136
- parser: this
137
- });
138
- return res;
139
- }
140
- } catch (e) {
141
- errors.push(e);
142
- console.error(e);
143
- return null;
144
- }
145
- }
146
-
147
- return value;
148
- };
149
-
150
- return {
151
- output: _helpers.serializer.copy(input, {
152
- reviver
153
- }),
154
- errors
155
- };
156
- }
157
-
158
- }
159
-
160
- var _default = WebParser;
161
- exports.default = _default;
102
+ };
103
+ export default WebParser;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/operators",
3
- "version": "3.23.0",
3
+ "version": "4.0.0-alpha.5",
4
4
  "licence": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -24,36 +24,37 @@
24
24
  "type": "git",
25
25
  "url": "https://github.com/lowdefy/lowdefy.git"
26
26
  },
27
- "main": "dist/index.js",
27
+ "type": "module",
28
+ "exports": "./dist/index.js",
28
29
  "files": [
29
30
  "dist/*"
30
31
  ],
31
32
  "scripts": {
32
- "build": "babel src --out-dir dist",
33
+ "build": "yarn clean && yarn swc",
33
34
  "clean": "rm -rf dist",
35
+ "prepare": "yarn build",
36
+ "swc": "swc src --out-dir dist --config-file ../../.swcrc",
34
37
  "test": "jest --coverage --testTimeout=10000",
35
- "test:watch": "jest --coverage --watch",
36
- "prepare": "yarn build"
38
+ "test:watch": "jest --coverage --watch"
37
39
  },
38
40
  "dependencies": {
39
- "@lowdefy/format": "3.23.0",
40
- "@lowdefy/helpers": "3.23.0",
41
- "@lowdefy/nunjucks": "3.23.0",
41
+ "@lowdefy/format": "4.0.0-alpha.5",
42
+ "@lowdefy/helpers": "4.0.0-alpha.5",
43
+ "@lowdefy/nunjucks": "4.0.0-alpha.5",
42
44
  "change-case": "4.1.2",
43
45
  "deep-diff": "1.0.2",
44
46
  "js-yaml": "4.1.0",
45
- "mingo": "4.1.2",
47
+ "mingo": "4.2.0",
46
48
  "uuid": "8.3.2"
47
49
  },
48
50
  "devDependencies": {
49
- "@babel/cli": "7.14.3",
50
- "@babel/core": "7.14.3",
51
- "@babel/preset-env": "7.14.4",
52
- "babel-jest": "26.6.3",
53
- "jest": "26.6.3"
51
+ "@swc/cli": "0.1.52",
52
+ "@swc/core": "1.2.112",
53
+ "@swc/jest": "0.2.9",
54
+ "jest": "27.3.1"
54
55
  },
55
56
  "publishConfig": {
56
57
  "access": "public"
57
58
  },
58
- "gitHead": "9f9cc98aafbf7b0da87fb4f1252c31c1dc08638b"
59
+ "gitHead": "995fcdb020927f3cdc626fc99c15a2e4137bd962"
59
60
  }
@@ -1,45 +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 _index(_ref) {
28
- var {
29
- arrayIndices,
30
- env,
31
- location,
32
- params
33
- } = _ref;
34
- return (0, _getFromObject.default)({
35
- arrayIndices,
36
- env,
37
- location,
38
- object: arrayIndices,
39
- operator: '_index',
40
- params
41
- });
42
- }
43
-
44
- var _default = _index;
45
- exports.default = _default;
@@ -1,39 +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 _and(_ref) {
26
- var {
27
- params,
28
- location
29
- } = _ref;
30
-
31
- if (!_helpers.type.isArray(params)) {
32
- throw new Error("Operator Error: _and takes an array type. Received: ".concat(JSON.stringify(params), " at ").concat(location, "."));
33
- }
34
-
35
- return !!params.reduce((acc, el) => acc && el, true);
36
- }
37
-
38
- var _default = _and;
39
- 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 _args(_ref) {
28
- var {
29
- args,
30
- arrayIndices,
31
- env,
32
- location,
33
- params
34
- } = _ref;
35
- return (0, _getFromObject.default)({
36
- arrayIndices,
37
- env,
38
- location,
39
- object: args,
40
- operator: '_args',
41
- params
42
- });
43
- }
44
-
45
- var _default = _args;
46
- exports.default = _default;
@@ -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;