@lowdefy/operators-js 4.0.0-alpha.12 → 4.0.0-alpha.13

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.
@@ -28,7 +28,7 @@ const validProperties = [
28
28
  'search',
29
29
  ];
30
30
  function _location({ arrayIndices , basePath , home , location , pageId , params , window }) {
31
- if (!window || !window.location) {
31
+ if (!window?.location) {
32
32
  throw new Error(`Operator Error: Browser window.location not available for _location. Received: ${JSON.stringify(params)} at ${location}.`);
33
33
  }
34
34
  if (!validProperties.includes(params)) {
@@ -20,8 +20,8 @@ const breakpoints = {
20
20
  lg: 1200,
21
21
  xl: 1600
22
22
  };
23
- function _media({ arrayIndices , location , params }) {
24
- if (!window || !window.innerWidth) {
23
+ function _media({ arrayIndices , location , params , window }) {
24
+ if (!window?.innerWidth) {
25
25
  throw new Error(`Operator Error: device window width not available for _media. Received: ${JSON.stringify(params)} at ${location}.`);
26
26
  }
27
27
  let size;
@@ -19,13 +19,12 @@ function _request({ arrayIndices , params , requests , location }) {
19
19
  }
20
20
  const splitKey = params.split('.');
21
21
  const [requestId, ...keyParts] = splitKey;
22
- if (requestId in requests && !requests[requestId].loading) {
22
+ if (requestId in requests && !requests[requestId][0].loading) {
23
23
  if (splitKey.length === 1) {
24
- return serializer.copy(requests[requestId].response);
24
+ return serializer.copy(requests[requestId][0].response);
25
25
  }
26
- const key = keyParts.reduce((acc, value)=>acc === '' ? value : acc.concat('.', value)
27
- , '');
28
- return get(requests[requestId].response, applyArrayIndices(arrayIndices, key), {
26
+ const key = keyParts.reduce((acc, value)=>acc === '' ? value : acc.concat('.', value), '');
27
+ return get(requests[requestId][0].response, applyArrayIndices(arrayIndices, key), {
29
28
  copy: true,
30
29
  default: null
31
30
  });
@@ -17,7 +17,6 @@ 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
  }
20
- return !!params.reduce((acc, el)=>acc && el
21
- , true);
20
+ return !!params.reduce((acc, el)=>acc && el, true);
22
21
  }
23
22
  export default _and;
@@ -17,7 +17,6 @@ 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
  }
20
- return !!params.reduce((acc, el)=>acc || el
21
- , false);
20
+ return !!params.reduce((acc, el)=>acc || el, false);
22
21
  }
23
22
  export default _or;
@@ -22,8 +22,7 @@ const prepRegex = (regexIndex, flagsIndex)=>(args)=>{
22
22
  args[0] = '';
23
23
  }
24
24
  return args;
25
- }
26
- ;
25
+ };
27
26
  const prep = (args)=>{
28
27
  if (type.isNone(args[0])) {
29
28
  args[0] = '';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lowdefy/operators-js",
3
- "version": "4.0.0-alpha.12",
4
- "licence": "Apache-2.0",
3
+ "version": "4.0.0-alpha.13",
4
+ "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
7
7
  "keywords": [
@@ -49,17 +49,18 @@
49
49
  "test": "jest --coverage"
50
50
  },
51
51
  "dependencies": {
52
- "@lowdefy/helpers": "4.0.0-alpha.12",
53
- "@lowdefy/operators": "4.0.0-alpha.12"
52
+ "@lowdefy/helpers": "4.0.0-alpha.13",
53
+ "@lowdefy/operators": "4.0.0-alpha.13"
54
54
  },
55
55
  "devDependencies": {
56
- "@swc/cli": "0.1.55",
57
- "@swc/core": "1.2.135",
58
- "@swc/jest": "0.2.17",
59
- "jest": "27.5.1"
56
+ "@swc/cli": "0.1.57",
57
+ "@swc/core": "1.2.194",
58
+ "@swc/jest": "0.2.21",
59
+ "jest": "28.1.0",
60
+ "jest-environment-jsdom": "28.1.0"
60
61
  },
61
62
  "publishConfig": {
62
63
  "access": "public"
63
64
  },
64
- "gitHead": "41b6138a81bee7da362dad06345bc9f87b2c2133"
65
+ "gitHead": "e99b4b6c1f59804982fc148c0fe39dcf13b35d77"
65
66
  }