react-native-divkit 0.1.0-alpha.1 → 0.1.0-alpha.2

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 (145) hide show
  1. package/README.md +135 -137
  2. package/dist/DivKit.d.ts.map +1 -1
  3. package/dist/DivKit.js +24 -7
  4. package/dist/DivKit.js.map +1 -1
  5. package/dist/actions/array.d.ts.map +1 -1
  6. package/dist/actions/array.js +1 -1
  7. package/dist/actions/array.js.map +1 -1
  8. package/dist/actions/copyToClipboard.d.ts.map +1 -1
  9. package/dist/actions/copyToClipboard.js +2 -1
  10. package/dist/actions/copyToClipboard.js.map +1 -1
  11. package/dist/actions/dict.d.ts.map +1 -1
  12. package/dist/actions/dict.js.map +1 -1
  13. package/dist/actions/updateStructure.d.ts.map +1 -1
  14. package/dist/actions/updateStructure.js.map +1 -1
  15. package/dist/components/container/DivContainer.d.ts.map +1 -1
  16. package/dist/components/container/DivContainer.js +3 -5
  17. package/dist/components/container/DivContainer.js.map +1 -1
  18. package/dist/components/image/DivImage.d.ts.map +1 -1
  19. package/dist/components/image/DivImage.js +1 -6
  20. package/dist/components/image/DivImage.js.map +1 -1
  21. package/dist/components/state/DivState.d.ts.map +1 -1
  22. package/dist/components/state/DivState.js +3 -5
  23. package/dist/components/state/DivState.js.map +1 -1
  24. package/dist/components/text/DivText.d.ts.map +1 -1
  25. package/dist/components/text/DivText.js +4 -4
  26. package/dist/components/text/DivText.js.map +1 -1
  27. package/dist/components/utilities/Outer.d.ts.map +1 -1
  28. package/dist/components/utilities/Outer.js +6 -5
  29. package/dist/components/utilities/Outer.js.map +1 -1
  30. package/dist/context/index.d.ts.map +1 -1
  31. package/dist/context/index.js.map +1 -1
  32. package/dist/expressions/eval.d.ts.map +1 -1
  33. package/dist/expressions/eval.js +19 -11
  34. package/dist/expressions/eval.js.map +1 -1
  35. package/dist/expressions/funcs/array.d.ts.map +1 -1
  36. package/dist/expressions/funcs/array.js +72 -168
  37. package/dist/expressions/funcs/array.js.map +1 -1
  38. package/dist/expressions/funcs/colors.d.ts.map +1 -1
  39. package/dist/expressions/funcs/colors.js.map +1 -1
  40. package/dist/expressions/funcs/customFuncs.d.ts.map +1 -1
  41. package/dist/expressions/funcs/customFuncs.js +6 -4
  42. package/dist/expressions/funcs/customFuncs.js.map +1 -1
  43. package/dist/expressions/funcs/datetime.d.ts.map +1 -1
  44. package/dist/expressions/funcs/datetime.js +1 -1
  45. package/dist/expressions/funcs/datetime.js.map +1 -1
  46. package/dist/expressions/funcs/dict.d.ts.map +1 -1
  47. package/dist/expressions/funcs/dict.js.map +1 -1
  48. package/dist/expressions/funcs/funcs.d.ts.map +1 -1
  49. package/dist/expressions/funcs/funcs.js +21 -13
  50. package/dist/expressions/funcs/funcs.js.map +1 -1
  51. package/dist/expressions/funcs/math.d.ts.map +1 -1
  52. package/dist/expressions/funcs/math.js +40 -20
  53. package/dist/expressions/funcs/math.js.map +1 -1
  54. package/dist/expressions/funcs/std.d.ts.map +1 -1
  55. package/dist/expressions/funcs/std.js +4 -4
  56. package/dist/expressions/funcs/std.js.map +1 -1
  57. package/dist/expressions/funcs/strings.d.ts.map +1 -1
  58. package/dist/expressions/funcs/strings.js +1 -2
  59. package/dist/expressions/funcs/strings.js.map +1 -1
  60. package/dist/expressions/funcs/trigonometry.js +2 -2
  61. package/dist/expressions/funcs/trigonometry.js.map +1 -1
  62. package/dist/expressions/json.d.ts +2 -2
  63. package/dist/expressions/json.d.ts.map +1 -1
  64. package/dist/expressions/json.js +6 -4
  65. package/dist/expressions/json.js.map +1 -1
  66. package/dist/expressions/utils.d.ts.map +1 -1
  67. package/dist/expressions/utils.js +9 -10
  68. package/dist/expressions/utils.js.map +1 -1
  69. package/dist/expressions/variable.d.ts.map +1 -1
  70. package/dist/expressions/variable.js +3 -7
  71. package/dist/expressions/variable.js.map +1 -1
  72. package/dist/expressions/walk.d.ts.map +1 -1
  73. package/dist/expressions/walk.js.map +1 -1
  74. package/dist/hooks/index.d.ts.map +1 -1
  75. package/dist/hooks/index.js.map +1 -1
  76. package/dist/hooks/useAction.d.ts.map +1 -1
  77. package/dist/hooks/useAction.js.map +1 -1
  78. package/dist/hooks/useDerivedFromVars.d.ts.map +1 -1
  79. package/dist/hooks/useDerivedFromVars.js.map +1 -1
  80. package/dist/hooks/useVariable.d.ts.map +1 -1
  81. package/dist/hooks/useVariable.js +4 -4
  82. package/dist/hooks/useVariable.js.map +1 -1
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js.map +1 -1
  85. package/dist/stores/createObservable.d.ts.map +1 -1
  86. package/dist/stores/createObservable.js.map +1 -1
  87. package/dist/utils/applyTemplate.d.ts +2 -2
  88. package/dist/utils/applyTemplate.d.ts.map +1 -1
  89. package/dist/utils/applyTemplate.js +13 -13
  90. package/dist/utils/applyTemplate.js.map +1 -1
  91. package/dist/utils/correctColor.d.ts.map +1 -1
  92. package/dist/utils/correctColor.js +8 -6
  93. package/dist/utils/correctColor.js.map +1 -1
  94. package/dist/utils/formatDate.d.ts.map +1 -1
  95. package/dist/utils/formatDate.js +7 -10
  96. package/dist/utils/formatDate.js.map +1 -1
  97. package/dist/utils/wrapError.d.ts.map +1 -1
  98. package/dist/utils/wrapError.js.map +1 -1
  99. package/package.json +2 -2
  100. package/src/DivKit.tsx +258 -220
  101. package/src/actions/array.ts +91 -64
  102. package/src/actions/copyToClipboard.ts +28 -19
  103. package/src/actions/dict.ts +36 -26
  104. package/src/actions/updateStructure.ts +86 -61
  105. package/src/components/README.md +38 -18
  106. package/src/components/container/DivContainer.tsx +4 -14
  107. package/src/components/image/DivImage.tsx +1 -11
  108. package/src/components/state/DivState.tsx +3 -9
  109. package/src/components/text/DivText.tsx +8 -20
  110. package/src/components/utilities/Outer.tsx +9 -19
  111. package/src/components/utilities/README.md +33 -29
  112. package/src/context/index.ts +2 -11
  113. package/src/expressions/ast.d.ts +16 -9
  114. package/src/expressions/eval.ts +82 -37
  115. package/src/expressions/funcs/array.ts +129 -209
  116. package/src/expressions/funcs/colors.ts +1 -3
  117. package/src/expressions/funcs/customFuncs.ts +6 -4
  118. package/src/expressions/funcs/datetime.ts +10 -3
  119. package/src/expressions/funcs/dict.ts +16 -2
  120. package/src/expressions/funcs/funcs.ts +75 -89
  121. package/src/expressions/funcs/math.ts +103 -43
  122. package/src/expressions/funcs/std.ts +4 -7
  123. package/src/expressions/funcs/strings.ts +9 -25
  124. package/src/expressions/funcs/trigonometry.ts +2 -2
  125. package/src/expressions/json.ts +60 -53
  126. package/src/expressions/utils.ts +24 -22
  127. package/src/expressions/variable.ts +5 -21
  128. package/src/expressions/walk.ts +6 -3
  129. package/src/hooks/README.md +61 -53
  130. package/src/hooks/index.ts +3 -18
  131. package/src/hooks/useAction.ts +1 -3
  132. package/src/hooks/useDerivedFromVars.ts +3 -13
  133. package/src/hooks/useVariable.ts +7 -17
  134. package/src/index.ts +10 -48
  135. package/src/stores/createObservable.ts +35 -35
  136. package/src/types/alignment.d.ts +15 -6
  137. package/src/types/background.d.ts +6 -2
  138. package/src/types/base.d.ts +41 -9
  139. package/src/types/componentContext.d.ts +27 -22
  140. package/src/types/container.d.ts +1 -4
  141. package/src/types/text.d.ts +1 -1
  142. package/src/utils/applyTemplate.ts +103 -109
  143. package/src/utils/correctColor.ts +9 -8
  144. package/src/utils/formatDate.ts +175 -86
  145. package/src/utils/wrapError.ts +7 -4
@@ -1,4 +1,9 @@
1
- import type { ActionArrayInsertValue, ActionArrayRemoveValue, ActionArraySetValue, WrappedError } from '../../typings/common';
1
+ import type {
2
+ ActionArrayInsertValue,
3
+ ActionArrayRemoveValue,
4
+ ActionArraySetValue,
5
+ WrappedError
6
+ } from '../../typings/common';
2
7
  import type { ArrayVariable, Variable } from '../../typings/variables';
3
8
  import type { MaybeMissing } from '../expressions/json';
4
9
  import { convertTypedValue } from '../expressions/utils';
@@ -13,31 +18,37 @@ export function arrayInsert(
13
18
  ): void {
14
19
  const { variable_name: name, index, value } = actionTyped;
15
20
 
16
- if (!value || typeof index !== 'number' && index !== undefined) {
17
- logError(wrapError(new Error('Incorrect array_insert_value action'), {
18
- additional: {
19
- name
20
- }
21
- }));
21
+ if (!value || (typeof index !== 'number' && index !== undefined)) {
22
+ logError(
23
+ wrapError(new Error('Incorrect array_insert_value action'), {
24
+ additional: {
25
+ name
26
+ }
27
+ })
28
+ );
22
29
  return;
23
30
  }
24
31
 
25
32
  handle(componentContext, variables, logError, actionTyped, variableInstance => {
26
33
  const list = variableInstance.getValue();
27
34
  if (typeof index === 'number' && (index < 0 || index > list.length)) {
28
- logError(wrapError(new Error(`Index out of bound for mutation ${actionTyped.type}`), {
29
- additional: {
30
- name,
31
- index,
32
- length: list.length
33
- }
34
- }));
35
+ logError(
36
+ wrapError(new Error(`Index out of bound for mutation ${actionTyped.type}`), {
37
+ additional: {
38
+ name,
39
+ index,
40
+ length: list.length
41
+ }
42
+ })
43
+ );
35
44
  } else if (!value.type) {
36
- logError(wrapError(new Error('Incorrect value type'), {
37
- additional: {
38
- name
39
- }
40
- }));
45
+ logError(
46
+ wrapError(new Error('Incorrect value type'), {
47
+ additional: {
48
+ name
49
+ }
50
+ })
51
+ );
41
52
  } else {
42
53
  const newList = list.slice();
43
54
  const val = convertTypedValue(value);
@@ -60,24 +71,28 @@ export function arrayRemove(
60
71
  const { variable_name: name, index } = actionTyped;
61
72
 
62
73
  if (typeof index !== 'number') {
63
- logError(wrapError(new Error('Incorrect array_remove_value action'), {
64
- additional: {
65
- name
66
- }
67
- }));
74
+ logError(
75
+ wrapError(new Error('Incorrect array_remove_value action'), {
76
+ additional: {
77
+ name
78
+ }
79
+ })
80
+ );
68
81
  return;
69
82
  }
70
83
 
71
84
  handle(componentContext, variables, logError, actionTyped, variableInstance => {
72
85
  const list = variableInstance.getValue();
73
86
  if (typeof index === 'number' && (index < 0 || index >= list.length)) {
74
- logError(wrapError(new Error(`Index out of bound for mutation ${actionTyped.type}`), {
75
- additional: {
76
- name,
77
- index,
78
- length: list.length
79
- }
80
- }));
87
+ logError(
88
+ wrapError(new Error(`Index out of bound for mutation ${actionTyped.type}`), {
89
+ additional: {
90
+ name,
91
+ index,
92
+ length: list.length
93
+ }
94
+ })
95
+ );
81
96
  } else {
82
97
  const newList = list.slice();
83
98
  newList.splice(index, 1);
@@ -95,30 +110,36 @@ export function arraySet(
95
110
  const { variable_name: name, index, value } = actionTyped;
96
111
 
97
112
  if (!value || typeof index !== 'number') {
98
- logError(wrapError(new Error('Incorrect array_set_value action'), {
99
- additional: {
100
- name
101
- }
102
- }));
113
+ logError(
114
+ wrapError(new Error('Incorrect array_set_value action'), {
115
+ additional: {
116
+ name
117
+ }
118
+ })
119
+ );
103
120
  return;
104
121
  }
105
122
 
106
123
  handle(componentContext, variables, logError, actionTyped, variableInstance => {
107
124
  const list = variableInstance.getValue();
108
125
  if (typeof index === 'number' && (index < 0 || index >= list.length)) {
109
- logError(wrapError(new Error(`Index out of bound for mutation ${actionTyped.type}`), {
110
- additional: {
111
- name,
112
- index,
113
- length: list.length
114
- }
115
- }));
126
+ logError(
127
+ wrapError(new Error(`Index out of bound for mutation ${actionTyped.type}`), {
128
+ additional: {
129
+ name,
130
+ index,
131
+ length: list.length
132
+ }
133
+ })
134
+ );
116
135
  } else if (!value.type) {
117
- logError(wrapError(new Error('Incorrect value type'), {
118
- additional: {
119
- name
120
- }
121
- }));
136
+ logError(
137
+ wrapError(new Error('Incorrect value type'), {
138
+ additional: {
139
+ name
140
+ }
141
+ })
142
+ );
122
143
  } else {
123
144
  const newList = list.slice();
124
145
  newList[index] = convertTypedValue(value);
@@ -137,22 +158,26 @@ function handle(
137
158
  const { variable_name: name } = actionTyped;
138
159
 
139
160
  if (!name) {
140
- logError(wrapError(new Error(`Incorrect ${actionTyped.type} action`), {
141
- additional: {
142
- name
143
- }
144
- }));
161
+ logError(
162
+ wrapError(new Error(`Incorrect ${actionTyped.type} action`), {
163
+ additional: {
164
+ name
165
+ }
166
+ })
167
+ );
145
168
  return;
146
169
  }
147
170
 
148
171
  const variableInstance = componentContext?.getVariable(name) || variables.get(name);
149
172
 
150
173
  if (!variableInstance) {
151
- logError(wrapError(new Error('Cannot find variable'), {
152
- additional: {
153
- name
154
- }
155
- }));
174
+ logError(
175
+ wrapError(new Error('Cannot find variable'), {
176
+ additional: {
177
+ name
178
+ }
179
+ })
180
+ );
156
181
  return;
157
182
  }
158
183
 
@@ -160,11 +185,13 @@ function handle(
160
185
  if (type === 'array') {
161
186
  cb(variableInstance as ArrayVariable);
162
187
  } else {
163
- logError(wrapError(new Error('Trying to insert value into the non-array'), {
164
- additional: {
165
- name,
166
- type
167
- }
168
- }));
188
+ logError(
189
+ wrapError(new Error('Trying to insert value into the non-array'), {
190
+ additional: {
191
+ name,
192
+ type
193
+ }
194
+ })
195
+ );
169
196
  }
170
197
  }
@@ -44,15 +44,20 @@ export function copyToClipboard(
44
44
  logError: (error: WrappedError) => void,
45
45
  actionTyped: MaybeMissing<ActionCopyToClipboard>
46
46
  ): void {
47
- if (!(
48
- actionTyped.content && (actionTyped.content.type === 'text' || actionTyped.content.type === 'url') &&
49
- typeof actionTyped.content.value === 'string'
50
- )) {
51
- logError(wrapError(new Error('Incorrect action'), {
52
- additional: {
53
- action: actionTyped
54
- }
55
- }));
47
+ if (
48
+ !(
49
+ actionTyped.content &&
50
+ (actionTyped.content.type === 'text' || actionTyped.content.type === 'url') &&
51
+ typeof actionTyped.content.value === 'string'
52
+ )
53
+ ) {
54
+ logError(
55
+ wrapError(new Error('Incorrect action'), {
56
+ additional: {
57
+ action: actionTyped
58
+ }
59
+ })
60
+ );
56
61
  return;
57
62
  }
58
63
 
@@ -62,21 +67,25 @@ export function copyToClipboard(
62
67
  }
63
68
 
64
69
  if (!Clipboard) {
65
- logError(wrapError(new Error('Clipboard is unavailable. Install @react-native-clipboard/clipboard'), {
66
- additional: {
67
- action: actionTyped
68
- }
69
- }));
70
+ logError(
71
+ wrapError(new Error('Clipboard is unavailable. Install @react-native-clipboard/clipboard'), {
72
+ additional: {
73
+ action: actionTyped
74
+ }
75
+ })
76
+ );
70
77
  return;
71
78
  }
72
79
 
73
80
  try {
74
81
  Clipboard.setString(actionTyped.content.value);
75
82
  } catch (err) {
76
- logError(wrapError(new Error('Failed to copy to the clipboard'), {
77
- additional: {
78
- originalError: String(err)
79
- }
80
- }));
83
+ logError(
84
+ wrapError(new Error('Failed to copy to the clipboard'), {
85
+ additional: {
86
+ originalError: String(err)
87
+ }
88
+ })
89
+ );
81
90
  }
82
91
  }
@@ -14,39 +14,47 @@ export function dictSetValue(
14
14
  const { variable_name: name, key, value } = actionTyped;
15
15
 
16
16
  if (typeof key !== 'string') {
17
- logError(wrapError(new Error('Incorrect dict_set_value action'), {
18
- additional: {
19
- name
20
- }
21
- }));
17
+ logError(
18
+ wrapError(new Error('Incorrect dict_set_value action'), {
19
+ additional: {
20
+ name
21
+ }
22
+ })
23
+ );
22
24
  return;
23
25
  }
24
26
 
25
27
  if (!name) {
26
- logError(wrapError(new Error(`Incorrect ${actionTyped.type} action`), {
27
- additional: {
28
- name
29
- }
30
- }));
28
+ logError(
29
+ wrapError(new Error(`Incorrect ${actionTyped.type} action`), {
30
+ additional: {
31
+ name
32
+ }
33
+ })
34
+ );
31
35
  return;
32
36
  }
33
37
 
34
38
  if (value && !value.type) {
35
- logError(wrapError(new Error('Incorrect value type'), {
36
- additional: {
37
- name
38
- }
39
- }));
39
+ logError(
40
+ wrapError(new Error('Incorrect value type'), {
41
+ additional: {
42
+ name
43
+ }
44
+ })
45
+ );
40
46
  }
41
47
 
42
48
  const variableInstance = componentContext?.getVariable(name) || variables.get(name);
43
49
 
44
50
  if (!variableInstance) {
45
- logError(wrapError(new Error('Cannot find variable'), {
46
- additional: {
47
- name
48
- }
49
- }));
51
+ logError(
52
+ wrapError(new Error('Cannot find variable'), {
53
+ additional: {
54
+ name
55
+ }
56
+ })
57
+ );
50
58
  return;
51
59
  }
52
60
 
@@ -61,11 +69,13 @@ export function dictSetValue(
61
69
  }
62
70
  variableInstance.setValue(newDict);
63
71
  } else {
64
- logError(wrapError(new Error('Trying to set value into the non-dict'), {
65
- additional: {
66
- name,
67
- type
68
- }
69
- }));
72
+ logError(
73
+ wrapError(new Error('Trying to set value into the non-dict'), {
74
+ additional: {
75
+ name,
76
+ type
77
+ }
78
+ })
79
+ );
70
80
  }
71
81
  }
@@ -14,40 +14,48 @@ export function updateStructure(
14
14
  const { variable_name: name, path, value } = actionTyped;
15
15
 
16
16
  if (!value?.value) {
17
- logError(wrapError(new Error('Missing value for an action'), {
18
- additional: {
19
- name
20
- }
21
- }));
17
+ logError(
18
+ wrapError(new Error('Missing value for an action'), {
19
+ additional: {
20
+ name
21
+ }
22
+ })
23
+ );
22
24
  return;
23
25
  }
24
26
 
25
27
  if (typeof path !== 'string' || !path || path.charAt(0) === '/' || path.charAt(path.length - 1) === '/') {
26
- logError(wrapError(new Error(`Value '${path}' for key 'path' is not valid`), {
27
- additional: {
28
- name
29
- }
30
- }));
28
+ logError(
29
+ wrapError(new Error(`Value '${path}' for key 'path' is not valid`), {
30
+ additional: {
31
+ name
32
+ }
33
+ })
34
+ );
31
35
  return;
32
36
  }
33
37
 
34
38
  if (!name) {
35
- logError(wrapError(new Error(`Incorrect ${actionTyped.type} action`), {
36
- additional: {
37
- name
38
- }
39
- }));
39
+ logError(
40
+ wrapError(new Error(`Incorrect ${actionTyped.type} action`), {
41
+ additional: {
42
+ name
43
+ }
44
+ })
45
+ );
40
46
  return;
41
47
  }
42
48
 
43
49
  const variableInstance = componentContext?.getVariable(name) || variables.get(name);
44
50
 
45
51
  if (!variableInstance) {
46
- logError(wrapError(new Error('Cannot find variable'), {
47
- additional: {
48
- name
49
- }
50
- }));
52
+ logError(
53
+ wrapError(new Error('Cannot find variable'), {
54
+ additional: {
55
+ name
56
+ }
57
+ })
58
+ );
51
59
  return;
52
60
  }
53
61
 
@@ -56,13 +64,15 @@ export function updateStructure(
56
64
  const obj = variableInstance.getValue() as Record<string, unknown>;
57
65
  const processed = path.replace(/\/+/g, '/');
58
66
  if (processed === '/') {
59
- logError(wrapError(new Error(`Value '${path}' for key 'path' is not valid`), {
60
- additional: {
61
- name,
62
- type,
63
- path
64
- }
65
- }));
67
+ logError(
68
+ wrapError(new Error(`Value '${path}' for key 'path' is not valid`), {
69
+ additional: {
70
+ name,
71
+ type,
72
+ path
73
+ }
74
+ })
75
+ );
66
76
  return;
67
77
  }
68
78
  const parts = processed.split('/');
@@ -72,46 +82,59 @@ export function updateStructure(
72
82
  const part = parts[i];
73
83
 
74
84
  if (!part) {
75
- logError(wrapError(new Error('Path is empty'), {
76
- additional: {
77
- name,
78
- type,
79
- path
80
- }
81
- }));
85
+ logError(
86
+ wrapError(new Error('Path is empty'), {
87
+ additional: {
88
+ name,
89
+ type,
90
+ path
91
+ }
92
+ })
93
+ );
82
94
  return;
83
95
  }
84
96
 
85
97
  if (!temp || typeof temp !== 'object') {
86
- logError(wrapError(new Error(`Element with path '${parts.slice(0, i).join('/')}' is not ${temp === undefined ? 'found' : 'a structure'}`), {
87
- additional: {
88
- name,
89
- type,
90
- path
91
- }
92
- }));
98
+ logError(
99
+ wrapError(
100
+ new Error(
101
+ `Element with path '${parts.slice(0, i).join('/')}' is not ${temp === undefined ? 'found' : 'a structure'}`
102
+ ),
103
+ {
104
+ additional: {
105
+ name,
106
+ type,
107
+ path
108
+ }
109
+ }
110
+ )
111
+ );
93
112
  return;
94
113
  }
95
114
  if (Array.isArray(temp)) {
96
115
  const int = Number(part);
97
116
  if (Number.isNaN(int)) {
98
- logError(wrapError(new Error(`Unable to use '${part}' as array index`), {
99
- additional: {
100
- name,
101
- type,
102
- path
103
- }
104
- }));
117
+ logError(
118
+ wrapError(new Error(`Unable to use '${part}' as array index`), {
119
+ additional: {
120
+ name,
121
+ type,
122
+ path
123
+ }
124
+ })
125
+ );
105
126
  return;
106
127
  }
107
128
  if (i + 1 === parts.length && (int < 0 || int > temp.length)) {
108
- logError(wrapError(new Error(`Position '${int}' is out of array bounds`), {
109
- additional: {
110
- name,
111
- type,
112
- path
113
- }
114
- }));
129
+ logError(
130
+ wrapError(new Error(`Position '${int}' is out of array bounds`), {
131
+ additional: {
132
+ name,
133
+ type,
134
+ path
135
+ }
136
+ })
137
+ );
115
138
  return;
116
139
  }
117
140
  }
@@ -124,11 +147,13 @@ export function updateStructure(
124
147
  temp[parts[parts.length - 1]] = convertTypedValue(value);
125
148
  variableInstance.setValue(newObj);
126
149
  } else {
127
- logError(wrapError(new Error('Action requires array or dictionary variable'), {
128
- additional: {
129
- name,
130
- type
131
- }
132
- }));
150
+ logError(
151
+ wrapError(new Error('Action requires array or dictionary variable'), {
152
+ additional: {
153
+ name,
154
+ type
155
+ }
156
+ })
157
+ );
133
158
  }
134
159
  }