@lowdefy/operators-js 4.0.0-rc.1 → 4.0.0-rc.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 (54) hide show
  1. package/dist/operators/build/env.js +1 -1
  2. package/dist/operators/client/_index.js +1 -1
  3. package/dist/operators/client/actions.js +1 -1
  4. package/dist/operators/client/base64.js +1 -1
  5. package/dist/operators/client/event.js +1 -1
  6. package/dist/operators/client/event_log.js +1 -1
  7. package/dist/operators/client/global.js +1 -1
  8. package/dist/operators/client/input.js +1 -1
  9. package/dist/operators/client/location.js +2 -2
  10. package/dist/operators/client/media.js +2 -2
  11. package/dist/operators/client/menu.js +1 -1
  12. package/dist/operators/client/request.js +1 -1
  13. package/dist/operators/client/request_details.js +1 -1
  14. package/dist/operators/client/state.js +1 -1
  15. package/dist/operators/client/url_query.js +2 -2
  16. package/dist/operators/server/base64.js +1 -1
  17. package/dist/operators/server/hash.js +1 -1
  18. package/dist/operators/server/payload.js +1 -1
  19. package/dist/operators/server/secret.js +2 -2
  20. package/dist/operators/shared/and.js +1 -1
  21. package/dist/operators/shared/args.js +1 -1
  22. package/dist/operators/shared/array.js +1 -1
  23. package/dist/operators/shared/date.js +1 -1
  24. package/dist/operators/shared/divide.js +1 -1
  25. package/dist/operators/shared/eq.js +1 -1
  26. package/dist/operators/shared/function.js +2 -2
  27. package/dist/operators/shared/get.js +1 -1
  28. package/dist/operators/shared/gt.js +1 -1
  29. package/dist/operators/shared/gte.js +1 -1
  30. package/dist/operators/shared/if.js +1 -1
  31. package/dist/operators/shared/if_none.js +1 -1
  32. package/dist/operators/shared/intl.js +2 -2
  33. package/dist/operators/shared/json.js +1 -1
  34. package/dist/operators/shared/log.js +1 -1
  35. package/dist/operators/shared/lt.js +1 -1
  36. package/dist/operators/shared/lte.js +1 -1
  37. package/dist/operators/shared/math.js +1 -1
  38. package/dist/operators/shared/ne.js +1 -1
  39. package/dist/operators/shared/not.js +1 -1
  40. package/dist/operators/shared/number.js +1 -1
  41. package/dist/operators/shared/object.js +1 -1
  42. package/dist/operators/shared/operator.js +1 -1
  43. package/dist/operators/shared/or.js +1 -1
  44. package/dist/operators/shared/product.js +1 -1
  45. package/dist/operators/shared/random.js +2 -2
  46. package/dist/operators/shared/regex.js +1 -1
  47. package/dist/operators/shared/string.js +1 -1
  48. package/dist/operators/shared/subtract.js +1 -1
  49. package/dist/operators/shared/sum.js +1 -1
  50. package/dist/operators/shared/switch.js +2 -2
  51. package/dist/operators/shared/type.js +1 -1
  52. package/dist/operators/shared/uri.js +1 -1
  53. package/dist/operators/shared/user.js +1 -1
  54. package/package.json +10 -10
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { getFromObject } from '@lowdefy/operators';
16
- function _env({ arrayIndices , env , location , params }) {
16
+ function _env({ arrayIndices, env, location, params }) {
17
17
  return getFromObject({
18
18
  arrayIndices,
19
19
  location,
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { getFromObject } from '@lowdefy/operators';
16
- function _index({ arrayIndices , location , params }) {
16
+ function _index({ arrayIndices, location, params }) {
17
17
  return getFromObject({
18
18
  arrayIndices,
19
19
  location,
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { getFromObject } from '@lowdefy/operators';
16
- function _actions({ actions , arrayIndices , location , params }) {
16
+ function _actions({ actions, arrayIndices, location, params }) {
17
17
  return getFromObject({
18
18
  arrayIndices,
19
19
  location,
@@ -37,7 +37,7 @@ const meta = {
37
37
  ]
38
38
  }
39
39
  };
40
- function _base64({ params , location , methodName }) {
40
+ function _base64({ params, location, methodName }) {
41
41
  return runClass({
42
42
  functions,
43
43
  location,
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { getFromObject } from '@lowdefy/operators';
16
- function _event({ arrayIndices , event , location , params }) {
16
+ function _event({ arrayIndices, event, location, params }) {
17
17
  return getFromObject({
18
18
  arrayIndices,
19
19
  location,
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { getFromObject } from '@lowdefy/operators';
16
- function _event_log({ arrayIndices , eventLog , location , params }) {
16
+ function _event_log({ arrayIndices, eventLog, location, params }) {
17
17
  return getFromObject({
18
18
  arrayIndices,
19
19
  location,
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { getFromObject } from '@lowdefy/operators';
16
- function _global({ arrayIndices , location , lowdefyGlobal , params }) {
16
+ function _global({ arrayIndices, location, lowdefyGlobal, params }) {
17
17
  return getFromObject({
18
18
  arrayIndices,
19
19
  location,
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { getFromObject } from '@lowdefy/operators';
16
- function _input({ arrayIndices , input , location , params }) {
16
+ function _input({ arrayIndices, input, location, params }) {
17
17
  return getFromObject({
18
18
  arrayIndices,
19
19
  location,
@@ -27,8 +27,8 @@ const validProperties = [
27
27
  'protocol',
28
28
  'search'
29
29
  ];
30
- function _location({ arrayIndices , basePath , home , location , pageId , params , globals }) {
31
- const { window } = globals;
30
+ function _location({ arrayIndices, basePath, home, location, pageId, params, globals }) {
31
+ const { window } = globals;
32
32
  if (!window?.location) {
33
33
  throw new Error(`Operator Error: Browser window.location not available for _location. Received: ${JSON.stringify(params)} at ${location}.`);
34
34
  }
@@ -20,8 +20,8 @@ const breakpoints = {
20
20
  lg: 1200,
21
21
  xl: 1600
22
22
  };
23
- function _media({ arrayIndices , location , params , globals }) {
24
- const { window } = globals;
23
+ function _media({ arrayIndices, location, params, globals }) {
24
+ const { window } = globals;
25
25
  if (!window?.innerWidth) {
26
26
  throw new Error(`Operator Error: device window width not available for _media. Received: ${JSON.stringify(params)} at ${location}.`);
27
27
  }
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { getFromArray } from '@lowdefy/operators';
16
- function _menu({ params , menus , location }) {
16
+ function _menu({ params, menus, location }) {
17
17
  return getFromArray({
18
18
  params,
19
19
  array: menus,
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { applyArrayIndices, get, serializer, type } from '@lowdefy/helpers';
16
- function _request({ arrayIndices , params , requests , location }) {
16
+ function _request({ arrayIndices, params, requests, location }) {
17
17
  if (!type.isString(params)) {
18
18
  throw new Error(`Operator Error: _request accepts a string value. Received: ${JSON.stringify(params)} at ${location}.`);
19
19
  }
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { getFromObject } from '@lowdefy/operators';
16
- function _request_details({ params , requests , arrayIndices , location }) {
16
+ function _request_details({ params, requests, arrayIndices, location }) {
17
17
  return getFromObject({
18
18
  arrayIndices,
19
19
  location,
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { getFromObject } from '@lowdefy/operators';
16
- function _state({ arrayIndices , location , params , state }) {
16
+ function _state({ arrayIndices, location, params, state }) {
17
17
  return getFromObject({
18
18
  arrayIndices,
19
19
  location,
@@ -14,8 +14,8 @@
14
14
  limitations under the License.
15
15
  */ import { getFromObject } from '@lowdefy/operators';
16
16
  import { urlQuery } from '@lowdefy/helpers';
17
- function _url_query({ arrayIndices , globals , location , params }) {
18
- const { window } = globals;
17
+ function _url_query({ arrayIndices, globals, location, params }) {
18
+ const { window } = globals;
19
19
  if (!window?.location) {
20
20
  throw new Error(`Operator Error: Browser window.location not available for _url_query. Received: ${JSON.stringify(params)} at ${location}.`);
21
21
  }
@@ -39,7 +39,7 @@ const meta = {
39
39
  ]
40
40
  }
41
41
  };
42
- function _base64({ params , location , methodName }) {
42
+ function _base64({ params, location, methodName }) {
43
43
  return runClass({
44
44
  functions,
45
45
  location,
@@ -71,7 +71,7 @@ const meta = {
71
71
  singleArg: true
72
72
  }
73
73
  };
74
- function _hash({ params , location , methodName }) {
74
+ function _hash({ params, location, methodName }) {
75
75
  return runClass({
76
76
  functions,
77
77
  location,
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { getFromObject } from '@lowdefy/operators';
16
- function _payload({ location , params , payload }) {
16
+ function _payload({ location, params, payload }) {
17
17
  return getFromObject({
18
18
  location,
19
19
  object: payload,
@@ -13,13 +13,13 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { getFromObject } from '@lowdefy/operators';
16
- function _secret({ location , params , secrets ={} }) {
16
+ function _secret({ location, params, secrets = {} }) {
17
17
  if (params === true || params.all) {
18
18
  throw new Error(`Operator Error: Getting all secrets is not allowed. Received: ${JSON.stringify(params)} at ${location}.`);
19
19
  }
20
20
  // Filter out OpenID Connect and JSON web token secrets
21
21
  // eslint-disable-next-line no-unused-vars
22
- const { OPENID_CLIENT_SECRET , JWT_SECRET , ...rest } = secrets;
22
+ const { OPENID_CLIENT_SECRET, JWT_SECRET, ...rest } = secrets;
23
23
  return getFromObject({
24
24
  location,
25
25
  object: {
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { type } from '@lowdefy/helpers';
16
- function _and({ params , location }) {
16
+ function _and({ params, location }) {
17
17
  if (!type.isArray(params)) {
18
18
  throw new Error(`Operator Error: _and takes an array type. Received: ${JSON.stringify(params)} at ${location}.`);
19
19
  }
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { getFromObject } from '@lowdefy/operators';
16
- function _args({ args , arrayIndices , location , params }) {
16
+ function _args({ args, arrayIndices, location, params }) {
17
17
  return getFromObject({
18
18
  arrayIndices,
19
19
  location,
@@ -250,7 +250,7 @@ const meta = {
250
250
  property: true
251
251
  }
252
252
  };
253
- function _array({ params , location , methodName }) {
253
+ function _array({ params, location, methodName }) {
254
254
  return runInstance({
255
255
  location,
256
256
  meta,
@@ -421,7 +421,7 @@ const meta = {
421
421
  ]
422
422
  }
423
423
  };
424
- function _date({ params , location , methodName }) {
424
+ function _date({ params, location, methodName }) {
425
425
  if ([
426
426
  'now',
427
427
  'parse',
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { type } from '@lowdefy/helpers';
16
- function _divide({ params , location }) {
16
+ function _divide({ params, location }) {
17
17
  if (!type.isArray(params)) {
18
18
  throw new Error(`Operator Error: _divide takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
19
19
  }
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { type } from '@lowdefy/helpers';
16
- function _eq({ params , location }) {
16
+ function _eq({ params, location }) {
17
17
  if (!type.isArray(params)) {
18
18
  throw new Error(`Operator Error: _eq takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
19
19
  }
@@ -12,9 +12,9 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ function _function({ actions , arrayIndices , event , location , operatorPrefix , params , parser }) {
15
+ */ function _function({ actions, arrayIndices, event, location, operatorPrefix, params, parser }) {
16
16
  return (...args)=>{
17
- const { output , errors } = parser.parse({
17
+ const { output, errors } = parser.parse({
18
18
  actions,
19
19
  arrayIndices,
20
20
  args,
@@ -14,7 +14,7 @@
14
14
  limitations under the License.
15
15
  */ import { get, type } from '@lowdefy/helpers';
16
16
  import { getFromObject } from '@lowdefy/operators';
17
- function _get({ arrayIndices , location , params }) {
17
+ function _get({ arrayIndices, location, params }) {
18
18
  if (!type.isObject(params)) {
19
19
  throw new Error(`Operator Error: _get takes an object as params. Received: ${JSON.stringify(params)} at ${location}.`);
20
20
  }
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { type } from '@lowdefy/helpers';
16
- function _gt({ params , location }) {
16
+ function _gt({ params, location }) {
17
17
  if (!type.isArray(params)) {
18
18
  throw new Error(`Operator Error: _gt takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
19
19
  }
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { type } from '@lowdefy/helpers';
16
- function _gte({ params , location }) {
16
+ function _gte({ params, location }) {
17
17
  if (!type.isArray(params)) {
18
18
  throw new Error(`Operator Error: _gte takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
19
19
  }
@@ -12,7 +12,7 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ function _if({ location , params }) {
15
+ */ function _if({ location, params }) {
16
16
  if (params.test === true) {
17
17
  return params.then;
18
18
  }
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { type } from '@lowdefy/helpers';
16
- function _if_none({ params , location }) {
16
+ function _if_none({ params, location }) {
17
17
  if (!type.isArray(params)) {
18
18
  throw new Error(`Operator Error: _if_none takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
19
19
  }
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { runClass } from '@lowdefy/operators';
16
- function createFormatter({ IntlClass }) {
16
+ function createFormatter({ IntlClass }) {
17
17
  const formatter = (on, options, locale)=>{
18
18
  return new IntlClass(locale, options).format(on);
19
19
  };
@@ -81,7 +81,7 @@ const functions = {
81
81
  }),
82
82
  relativeTimeFormat
83
83
  };
84
- function intl({ params , location , methodName }) {
84
+ function intl({ params, location, methodName }) {
85
85
  return runClass({
86
86
  functions,
87
87
  location,
@@ -47,7 +47,7 @@ const meta = {
47
47
  ]
48
48
  }
49
49
  };
50
- function _json({ params , location , methodName }) {
50
+ function _json({ params, location, methodName }) {
51
51
  return runClass({
52
52
  functions,
53
53
  location,
@@ -12,7 +12,7 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ function _log({ params }) {
15
+ */ function _log({ params }) {
16
16
  // eslint-disable-next-line no-console
17
17
  console.log(params);
18
18
  return params;
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { type } from '@lowdefy/helpers';
16
- function _lt({ params , location }) {
16
+ function _lt({ params, location }) {
17
17
  if (!type.isArray(params)) {
18
18
  throw new Error(`Operator Error: _lt takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
19
19
  }
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { type } from '@lowdefy/helpers';
16
- function _lte({ params , location }) {
16
+ function _lte({ params, location }) {
17
17
  if (!type.isArray(params)) {
18
18
  throw new Error(`Operator Error: _lte takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
19
19
  }
@@ -258,7 +258,7 @@ const meta = {
258
258
  property: true
259
259
  }
260
260
  };
261
- function _math({ params , location , methodName }) {
261
+ function _math({ params, location, methodName }) {
262
262
  return runClass({
263
263
  functions: Math,
264
264
  location,
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { type } from '@lowdefy/helpers';
16
- function _ne({ params , location }) {
16
+ function _ne({ params, location }) {
17
17
  if (!type.isArray(params)) {
18
18
  throw new Error(`Operator Error: _ne takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
19
19
  }
@@ -12,7 +12,7 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ function _not({ params }) {
15
+ */ function _not({ params }) {
16
16
  return !params;
17
17
  }
18
18
  export default _not;
@@ -117,7 +117,7 @@ const meta = {
117
117
  ]
118
118
  }
119
119
  };
120
- function _number({ params , location , methodName }) {
120
+ function _number({ params, location, methodName }) {
121
121
  if ([
122
122
  'toExponential',
123
123
  'toFixed',
@@ -106,7 +106,7 @@ const metaClass = {
106
106
  prep
107
107
  }
108
108
  };
109
- function _object({ params , location , methodName }) {
109
+ function _object({ params, location, methodName }) {
110
110
  if (methodName === 'hasOwnProperty') {
111
111
  return runInstance({
112
112
  location,
@@ -14,7 +14,7 @@
14
14
  limitations under the License.
15
15
  */ import { type } from '@lowdefy/helpers';
16
16
  function _operator(options) {
17
- const { operators , params , location } = options;
17
+ const { operators, params, location } = options;
18
18
  if (!type.isString(params.name)) {
19
19
  throw new Error(`Operator Error: _operator.name must be a valid operator name as string. Received: ${JSON.stringify(params)} at ${location}.`);
20
20
  }
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { type } from '@lowdefy/helpers';
16
- function _or({ location , params }) {
16
+ function _or({ location, params }) {
17
17
  if (!type.isArray(params)) {
18
18
  throw new Error(`Operator Error: _or takes an array type. Received: ${JSON.stringify(params)} at ${location}.`);
19
19
  }
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { type } from '@lowdefy/helpers';
16
- function _product({ params , location }) {
16
+ function _product({ params, location }) {
17
17
  if (!type.isArray(params)) {
18
18
  throw new Error(`Operator Error: _product takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
19
19
  }
@@ -30,7 +30,7 @@ function getRandomInt(min, max) {
30
30
  function getRandomFloat(min, max) {
31
31
  return Math.random() * (Math.ceil(max) - Math.floor(min)) + Math.floor(min);
32
32
  }
33
- function evaluateDefaultNumber({ key , defaultValue , params , location }) {
33
+ function evaluateDefaultNumber({ key, defaultValue, params, location }) {
34
34
  if (type.isUndefined(params[key])) {
35
35
  params[key] = defaultValue;
36
36
  }
@@ -38,7 +38,7 @@ function evaluateDefaultNumber({ key , defaultValue , params , location }) {
38
38
  throw new Error(`Operator Error: _random.${key} takes an number type. Received: ${JSON.stringify(params)} at ${location}.`);
39
39
  }
40
40
  }
41
- function _random({ location , params }) {
41
+ function _random({ location, params }) {
42
42
  if (!type.isString(params) && !type.isObject(params)) {
43
43
  throw new Error(`Operator Error: _random takes an string or object type. Received: ${JSON.stringify(params)} at ${location}.`);
44
44
  }
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { get, type } from '@lowdefy/helpers';
16
- function _regex({ location , params , state }) {
16
+ function _regex({ location, params, state }) {
17
17
  const pattern = type.isObject(params) ? params.pattern : params;
18
18
  if (!type.isString(pattern)) {
19
19
  throw new Error(`Operator Error: _regex.pattern must be a string. Received: ${JSON.stringify(params)} at ${location}.`);
@@ -279,7 +279,7 @@ const meta = {
279
279
  prep
280
280
  }
281
281
  };
282
- function _string({ params , location , methodName }) {
282
+ function _string({ params, location, methodName }) {
283
283
  return runInstance({
284
284
  location,
285
285
  meta,
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { type } from '@lowdefy/helpers';
16
- function _subtract({ params , location }) {
16
+ function _subtract({ params, location }) {
17
17
  if (!type.isArray(params)) {
18
18
  throw new Error(`Operator Error: _subtract takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
19
19
  }
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { type } from '@lowdefy/helpers';
16
- function _sum({ params , location }) {
16
+ function _sum({ params, location }) {
17
17
  if (!type.isArray(params)) {
18
18
  throw new Error(`Operator Error: _sum takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
19
19
  }
@@ -13,13 +13,13 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { type } from '@lowdefy/helpers';
16
- function _switch({ location , params }) {
16
+ function _switch({ location, params }) {
17
17
  if (!type.isArray(params.branches)) {
18
18
  throw new Error(`Operator Error: switch takes an array type as input for the branches. Received: ${JSON.stringify(params)} at ${location}.`);
19
19
  }
20
20
  for (const branch of params.branches){
21
21
  if (!type.isBoolean(branch.if)) {
22
- throw new Error(`Operator Error: switch takes a boolean type for parameter test. Received: ${JSON.stringify(params)} at ${location}.`);
22
+ throw new Error(`Operator Error: switch takes a boolean type for parameter "if". Received: ${JSON.stringify(params)} at ${location}.`);
23
23
  }
24
24
  if (branch.if === true) {
25
25
  return branch.then;
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { get, type } from '@lowdefy/helpers';
16
- function _type({ location , params , state }) {
16
+ function _type({ location, params, state }) {
17
17
  const typeName = type.isObject(params) ? params.type : params;
18
18
  if (!type.isString(typeName)) {
19
19
  throw new Error(`Operator Error: _type.type must be a string. Received: ${JSON.stringify(params)} at ${location}.`);
@@ -37,7 +37,7 @@ const meta = {
37
37
  ]
38
38
  }
39
39
  };
40
- function _uri({ params , location , methodName }) {
40
+ function _uri({ params, location, methodName }) {
41
41
  return runClass({
42
42
  functions,
43
43
  location,
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { getFromObject } from '@lowdefy/operators';
16
- function _user({ arrayIndices , location , params , user }) {
16
+ function _user({ arrayIndices, location, params, user }) {
17
17
  return getFromObject({
18
18
  arrayIndices,
19
19
  location,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/operators-js",
3
- "version": "4.0.0-rc.1",
3
+ "version": "4.0.0-rc.10",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -48,19 +48,19 @@
48
48
  "test": "TZ=UTC node --experimental-vm-modules node_modules/jest/bin/jest.js"
49
49
  },
50
50
  "dependencies": {
51
- "@lowdefy/helpers": "4.0.0-rc.1",
52
- "@lowdefy/operators": "4.0.0-rc.1"
51
+ "@lowdefy/helpers": "4.0.0-rc.10",
52
+ "@lowdefy/operators": "4.0.0-rc.10"
53
53
  },
54
54
  "devDependencies": {
55
- "@jest/globals": "28.1.0",
56
- "@swc/cli": "0.1.59",
57
- "@swc/core": "1.3.24",
58
- "@swc/jest": "0.2.24",
59
- "jest": "28.1.0",
60
- "jest-environment-jsdom": "28.1.0"
55
+ "@jest/globals": "28.1.3",
56
+ "@swc/cli": "0.1.62",
57
+ "@swc/core": "1.3.70",
58
+ "@swc/jest": "0.2.27",
59
+ "jest": "28.1.3",
60
+ "jest-environment-jsdom": "28.1.3"
61
61
  },
62
62
  "publishConfig": {
63
63
  "access": "public"
64
64
  },
65
- "gitHead": "ecc4f16c19eede929eda177db524cf13a8053379"
65
+ "gitHead": "537af074f27770e32da9da8d48490f2eda94b406"
66
66
  }