tx · YqnaqEPcV9BeUzUCQsyn7HJBvPwPvxc7ev5fbLyugUn 3MrGaZVRhknEGfHJ19ttUPNnDRoFqcHhVN7: -0.01000000 Waves 2023.03.17 21:11 [2494347] smart account 3MrGaZVRhknEGfHJ19ttUPNnDRoFqcHhVN7 > SELF 0.00000000 Waves
{ "type": 13, "id": "YqnaqEPcV9BeUzUCQsyn7HJBvPwPvxc7ev5fbLyugUn", "fee": 1000000, "feeAssetId": null, "timestamp": 1679076703655, "version": 2, "chainId": 84, "sender": "3MrGaZVRhknEGfHJ19ttUPNnDRoFqcHhVN7", "senderPublicKey": "CrHxACS7bWTh8cgmgqstvybmgMqR9KtDryGFt5svZhBW", "proofs": [ "NqhmFY5oc1TZ8EfFjyj7vcAUFmGMFHcn9Mz71J9hxQSw9rmzA84ZVL9aG6JsD8vUy6Pebmab3PA3YC36XiLdvmt" ], "script": "base64:BgIkCAISBwoFGBgBAQgSBAoCGBgSBQoDCBgYEgQKAggIEgQKAggIFQAIa0pzb25SZXMCB2pzb25SZXMABXF1b3RlCQCwCQEBASIBCW1ha2VGaWVsZAEJbmV4dFZhbHVlCQCsAgIJAKwCAgkArAICCQCsAgIJAKwCAgkArAICCQCsAgIFBXF1b3RlCAUJbmV4dFZhbHVlAl8xBQVxdW90ZQIBOgUFcXVvdGUIBQluZXh0VmFsdWUCXzIFBXF1b3RlAgEsAQ9yZWR1Y2VyTWFrZUpTT04CBWFjY3VtCW5leHRWYWx1ZQkArAICBQVhY2N1bQkBCW1ha2VGaWVsZAEFCW5leHRWYWx1ZQEPaXRlcmF0ZU1ha2VKU09OAwZwYXJhbXMDcmVzBmxlbmd0aAMJAAACBQZsZW5ndGgAAAkAAgECDUVtcHR5ICBwYXJhbXMDCQAAAgUGbGVuZ3RoAAEKAAIkbAUGcGFyYW1zCgACJHMJAJADAQUCJGwKAAUkYWNjMAUDcmVzCgEFJGYwXzECAiRhAiRpAwkAZwIFAiRpBQIkcwUCJGEJAQ9yZWR1Y2VyTWFrZU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AoCBQNuaWwFA3JlcwkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgFpAQ1yZWFkQnlKU09OS2V5AgRqc29uA2tleQQKdmFsdWVCeUtleQkBEXJlYWRCeUtleUludGVybmFsAgUEanNvbgUDa2V5CQCUCgIJAMwIAgkBC1N0cmluZ0VudHJ5AgIKdmFsdWVCeUtleQUKdmFsdWVCeUtleQUDbmlsBQp2YWx1ZUJ5S2V5AWkBD2RlbGV0ZUJ5SlNPTktleQIEanNvbgNrZXkEDSR0MDEyOTE5MTMyNzAJARNkZWxldGVCeUtleUludGVybmFsAgUEanNvbgUDa2V5BBFkZWxldGVkVmFsdWVCeUtleQgFDSR0MDEyOTE5MTMyNzACXzEEB25ld0pzb24IBQ0kdDAxMjkxOTEzMjcwAl8yCQCUCgIJAMwIAgkBC1N0cmluZ0VudHJ5AgIMZGVsZXRlZFZhbHVlBRFkZWxldGVkVmFsdWVCeUtleQkAzAgCCQELU3RyaW5nRW50cnkCBQhrSnNvblJlcwUHbmV3SnNvbgUDbmlsCQCUCgIFEWRlbGV0ZWRWYWx1ZUJ5S2V5BQduZXdKc29uANedF9U=", "height": 2494347, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2j51bHgAjCD2SZpYmUpJPKZbnWBmJmQxhSeYcsTNPLGb Next: HLUgGNAPKgj69aEY19sqfVVBxvkudqAmCwmHQMDGCHvf Diff:
Old | New | Differences | |
---|---|---|---|
254 | 254 | func getStartAndEndIndexes (json,key) = { | |
255 | 255 | let keyLen = size(key) | |
256 | 256 | let startIndex = value(indexOf(json, key)) | |
257 | - | let $t062076637 = $Tuple2(valueOrElse(indexOf(json, ",", startIndex), value(indexOf(json, "}", startIndex))), 3) | |
258 | - | let endIndex = $t062076637._1 | |
259 | - | let k = $t062076637._2 | |
260 | - | $Tuple4(keyLen, startIndex, endIndex, k) | |
257 | + | let endIndex = valueOrElse(indexOf(json, ",", startIndex), value(indexOf(json, "}", startIndex))) | |
258 | + | $Tuple4(keyLen, startIndex, endIndex, 3) | |
261 | 259 | } | |
262 | 260 | ||
263 | 261 | ||
264 | 262 | func readByKeyInternal (json,key) = { | |
265 | - | let $ | |
266 | - | let keyLen = $ | |
267 | - | let startIndex = $ | |
268 | - | let endIndex = $ | |
269 | - | let k = $ | |
263 | + | let $t067226838 = getStartAndEndIndexes(json, key) | |
264 | + | let keyLen = $t067226838._1 | |
265 | + | let startIndex = $t067226838._2 | |
266 | + | let endIndex = $t067226838._3 | |
267 | + | let k = $t067226838._4 | |
270 | 268 | drop(take(json, (endIndex - 1)), ((startIndex + keyLen) + k)) | |
271 | 269 | } | |
272 | 270 | ||
273 | 271 | ||
274 | 272 | func deleteByKeyInternal (json,key) = { | |
275 | - | let $ | |
276 | - | let keyLen = $ | |
277 | - | let startIndex = $ | |
278 | - | let endIndex = $ | |
279 | - | let k = $ | |
273 | + | let $t071127239 = getStartAndEndIndexes(json, key) | |
274 | + | let keyLen = $t071127239._1 | |
275 | + | let startIndex = $t071127239._2 | |
276 | + | let endIndex = $t071127239._3 | |
277 | + | let k = $t071127239._4 | |
280 | 278 | let deletedValue = drop(take(json, (endIndex - 1)), ((startIndex + keyLen) + k)) | |
281 | 279 | let newJson = if (((size(json) - endIndex) == 1)) | |
282 | 280 | then (take(json, (startIndex - 2)) + drop(json, endIndex)) | |
288 | 286 | @Callable(i) | |
289 | 287 | func makeJSONInternal (arrKeys,arrValues,iterationsCount,lastIterationLen,res) = valueOrElse(onlyInternal(i.caller), if ((iterationsCount > 0)) | |
290 | 288 | then { | |
291 | - | let $ | |
292 | - | let currentArrPartKeys = $ | |
293 | - | let arrTailKeys = $ | |
294 | - | let $ | |
295 | - | let currentArrPartValues = $ | |
296 | - | let arrTailValues = $ | |
289 | + | let $t083388500 = getPartAndTail(arrKeys) | |
290 | + | let currentArrPartKeys = $t083388500._1 | |
291 | + | let arrTailKeys = $t083388500._2 | |
292 | + | let $t085098624 = getPartAndTail(arrValues) | |
293 | + | let currentArrPartValues = $t085098624._1 | |
294 | + | let arrTailValues = $t085098624._2 | |
297 | 295 | let params = prepareParams(currentArrPartKeys, currentArrPartValues, 10) | |
298 | 296 | let newString = iterateMakeJSON(params, res, 10) | |
299 | 297 | let result = invoke(this, "makeJSONInternal", [arrTailKeys, arrTailValues, (iterationsCount - 1), lastIterationLen, newString], nil) | |
351 | 349 | ||
352 | 350 | @Callable(i) | |
353 | 351 | func deleteByJSONKey (json,key) = { | |
354 | - | let $ | |
355 | - | let deletedValueByKey = $ | |
356 | - | let newJson = $ | |
352 | + | let $t01291913270 = deleteByKeyInternal(json, key) | |
353 | + | let deletedValueByKey = $t01291913270._1 | |
354 | + | let newJson = $t01291913270._2 | |
357 | 355 | $Tuple2([StringEntry("deletedValue", deletedValueByKey), StringEntry(kJsonRes, newJson)], $Tuple2(deletedValueByKey, newJson)) | |
358 | 356 | } | |
359 | 357 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let kJsonRes = "jsonRes" | |
5 | 5 | ||
6 | 6 | let quote = toUtf8String(base58'b') | |
7 | 7 | ||
8 | 8 | func makeField (nextValue) = (((((((quote + nextValue._1) + quote) + ":") + quote) + nextValue._2) + quote) + ",") | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | func reducerMakeJSON (accum,nextValue) = (accum + makeField(nextValue)) | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | func iterateMakeJSON (params,res,length) = if ((length == 0)) | |
15 | 15 | then throw("Empty params") | |
16 | 16 | else if ((length == 1)) | |
17 | 17 | then { | |
18 | 18 | let $l = params | |
19 | 19 | let $s = size($l) | |
20 | 20 | let $acc0 = res | |
21 | 21 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
22 | 22 | then $a | |
23 | 23 | else reducerMakeJSON($a, $l[$i]) | |
24 | 24 | ||
25 | 25 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
26 | 26 | then $a | |
27 | 27 | else throw("List size exceeds 1") | |
28 | 28 | ||
29 | 29 | $f0_2($f0_1($acc0, 0), 1) | |
30 | 30 | } | |
31 | 31 | else if ((length == 2)) | |
32 | 32 | then { | |
33 | 33 | let $l = params | |
34 | 34 | let $s = size($l) | |
35 | 35 | let $acc0 = res | |
36 | 36 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
37 | 37 | then $a | |
38 | 38 | else reducerMakeJSON($a, $l[$i]) | |
39 | 39 | ||
40 | 40 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
41 | 41 | then $a | |
42 | 42 | else throw("List size exceeds 2") | |
43 | 43 | ||
44 | 44 | $f0_2($f0_1($f0_1($acc0, 0), 1), 2) | |
45 | 45 | } | |
46 | 46 | else if ((length == 3)) | |
47 | 47 | then { | |
48 | 48 | let $l = params | |
49 | 49 | let $s = size($l) | |
50 | 50 | let $acc0 = res | |
51 | 51 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
52 | 52 | then $a | |
53 | 53 | else reducerMakeJSON($a, $l[$i]) | |
54 | 54 | ||
55 | 55 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
56 | 56 | then $a | |
57 | 57 | else throw("List size exceeds 3") | |
58 | 58 | ||
59 | 59 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
60 | 60 | } | |
61 | 61 | else if ((length == 4)) | |
62 | 62 | then { | |
63 | 63 | let $l = params | |
64 | 64 | let $s = size($l) | |
65 | 65 | let $acc0 = res | |
66 | 66 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
67 | 67 | then $a | |
68 | 68 | else reducerMakeJSON($a, $l[$i]) | |
69 | 69 | ||
70 | 70 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
71 | 71 | then $a | |
72 | 72 | else throw("List size exceeds 4") | |
73 | 73 | ||
74 | 74 | $f0_2($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4) | |
75 | 75 | } | |
76 | 76 | else if ((length == 5)) | |
77 | 77 | then { | |
78 | 78 | let $l = params | |
79 | 79 | let $s = size($l) | |
80 | 80 | let $acc0 = res | |
81 | 81 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
82 | 82 | then $a | |
83 | 83 | else reducerMakeJSON($a, $l[$i]) | |
84 | 84 | ||
85 | 85 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
86 | 86 | then $a | |
87 | 87 | else throw("List size exceeds 5") | |
88 | 88 | ||
89 | 89 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
90 | 90 | } | |
91 | 91 | else if ((length == 6)) | |
92 | 92 | then { | |
93 | 93 | let $l = params | |
94 | 94 | let $s = size($l) | |
95 | 95 | let $acc0 = res | |
96 | 96 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
97 | 97 | then $a | |
98 | 98 | else reducerMakeJSON($a, $l[$i]) | |
99 | 99 | ||
100 | 100 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
101 | 101 | then $a | |
102 | 102 | else throw("List size exceeds 6") | |
103 | 103 | ||
104 | 104 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
105 | 105 | } | |
106 | 106 | else if ((length == 7)) | |
107 | 107 | then { | |
108 | 108 | let $l = params | |
109 | 109 | let $s = size($l) | |
110 | 110 | let $acc0 = res | |
111 | 111 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
112 | 112 | then $a | |
113 | 113 | else reducerMakeJSON($a, $l[$i]) | |
114 | 114 | ||
115 | 115 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
116 | 116 | then $a | |
117 | 117 | else throw("List size exceeds 7") | |
118 | 118 | ||
119 | 119 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7) | |
120 | 120 | } | |
121 | 121 | else if ((length == 8)) | |
122 | 122 | then { | |
123 | 123 | let $l = params | |
124 | 124 | let $s = size($l) | |
125 | 125 | let $acc0 = res | |
126 | 126 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
127 | 127 | then $a | |
128 | 128 | else reducerMakeJSON($a, $l[$i]) | |
129 | 129 | ||
130 | 130 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
131 | 131 | then $a | |
132 | 132 | else throw("List size exceeds 8") | |
133 | 133 | ||
134 | 134 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8) | |
135 | 135 | } | |
136 | 136 | else if ((length == 9)) | |
137 | 137 | then { | |
138 | 138 | let $l = params | |
139 | 139 | let $s = size($l) | |
140 | 140 | let $acc0 = res | |
141 | 141 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
142 | 142 | then $a | |
143 | 143 | else reducerMakeJSON($a, $l[$i]) | |
144 | 144 | ||
145 | 145 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
146 | 146 | then $a | |
147 | 147 | else throw("List size exceeds 9") | |
148 | 148 | ||
149 | 149 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9) | |
150 | 150 | } | |
151 | 151 | else if ((length == 10)) | |
152 | 152 | then { | |
153 | 153 | let $l = params | |
154 | 154 | let $s = size($l) | |
155 | 155 | let $acc0 = res | |
156 | 156 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
157 | 157 | then $a | |
158 | 158 | else reducerMakeJSON($a, $l[$i]) | |
159 | 159 | ||
160 | 160 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
161 | 161 | then $a | |
162 | 162 | else throw("List size exceeds 10") | |
163 | 163 | ||
164 | 164 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
165 | 165 | } | |
166 | 166 | else throw("The max number of parameters exceeded") | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | func getPartAndTail (arr) = { | |
170 | 170 | let el0 = arr[0] | |
171 | 171 | let el1 = arr[1] | |
172 | 172 | let el2 = arr[2] | |
173 | 173 | let el3 = arr[3] | |
174 | 174 | let el4 = arr[4] | |
175 | 175 | let el5 = arr[5] | |
176 | 176 | let el6 = arr[6] | |
177 | 177 | let el7 = arr[7] | |
178 | 178 | let el8 = arr[8] | |
179 | 179 | let el9 = arr[9] | |
180 | 180 | let arr0 = removeByIndex(arr, 0) | |
181 | 181 | let arr1 = removeByIndex(arr0, 0) | |
182 | 182 | let arr2 = removeByIndex(arr1, 0) | |
183 | 183 | let arr3 = removeByIndex(arr2, 0) | |
184 | 184 | let arr4 = removeByIndex(arr3, 0) | |
185 | 185 | let arr5 = removeByIndex(arr4, 0) | |
186 | 186 | let arr6 = removeByIndex(arr5, 0) | |
187 | 187 | let arr7 = removeByIndex(arr6, 0) | |
188 | 188 | let arr8 = removeByIndex(arr7, 0) | |
189 | 189 | let arr9 = removeByIndex(arr8, 0) | |
190 | 190 | $Tuple2([el0, el1, el2, el3, el4, el5, el6, el7, el8, el9], arr9) | |
191 | 191 | } | |
192 | 192 | ||
193 | 193 | ||
194 | 194 | func onlyInternal (caller) = if ((caller == this)) | |
195 | 195 | then unit | |
196 | 196 | else throw("Only internal call") | |
197 | 197 | ||
198 | 198 | ||
199 | 199 | func prepare_1 (arr,arr2) = [$Tuple2(arr[0], arr2[0])] | |
200 | 200 | ||
201 | 201 | ||
202 | 202 | func prepare_2 (arr,arr2) = [$Tuple2(arr[0], arr2[0]), $Tuple2(arr[1], arr2[1])] | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | func prepare_3 (arr,arr2) = [$Tuple2(arr[0], arr2[0]), $Tuple2(arr[1], arr2[1]), $Tuple2(arr[2], arr2[2])] | |
206 | 206 | ||
207 | 207 | ||
208 | 208 | func prepare_4 (arr,arr2) = [$Tuple2(arr[0], arr2[0]), $Tuple2(arr[1], arr2[1]), $Tuple2(arr[2], arr2[2]), $Tuple2(arr[3], arr2[3])] | |
209 | 209 | ||
210 | 210 | ||
211 | 211 | func prepare_5 (arr,arr2) = [$Tuple2(arr[0], arr2[0]), $Tuple2(arr[1], arr2[1]), $Tuple2(arr[2], arr2[2]), $Tuple2(arr[3], arr2[3]), $Tuple2(arr[4], arr2[4])] | |
212 | 212 | ||
213 | 213 | ||
214 | 214 | func prepare_6 (arr,arr2) = [$Tuple2(arr[0], arr2[0]), $Tuple2(arr[1], arr2[1]), $Tuple2(arr[2], arr2[2]), $Tuple2(arr[3], arr2[3]), $Tuple2(arr[4], arr2[4]), $Tuple2(arr[5], arr2[5])] | |
215 | 215 | ||
216 | 216 | ||
217 | 217 | func prepare_7 (arr,arr2) = [$Tuple2(arr[0], arr2[0]), $Tuple2(arr[1], arr2[1]), $Tuple2(arr[2], arr2[2]), $Tuple2(arr[3], arr2[3]), $Tuple2(arr[4], arr2[4]), $Tuple2(arr[5], arr2[5]), $Tuple2(arr[6], arr2[6])] | |
218 | 218 | ||
219 | 219 | ||
220 | 220 | func prepare_8 (arr,arr2) = [$Tuple2(arr[0], arr2[0]), $Tuple2(arr[1], arr2[1]), $Tuple2(arr[2], arr2[2]), $Tuple2(arr[3], arr2[3]), $Tuple2(arr[4], arr2[4]), $Tuple2(arr[5], arr2[5]), $Tuple2(arr[6], arr2[6]), $Tuple2(arr[7], arr2[7])] | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | func prepare_9 (arr,arr2) = [$Tuple2(arr[0], arr2[0]), $Tuple2(arr[1], arr2[1]), $Tuple2(arr[2], arr2[2]), $Tuple2(arr[3], arr2[3]), $Tuple2(arr[4], arr2[4]), $Tuple2(arr[5], arr2[5]), $Tuple2(arr[6], arr2[6]), $Tuple2(arr[7], arr2[7]), $Tuple2(arr[8], arr2[8])] | |
224 | 224 | ||
225 | 225 | ||
226 | 226 | func prepare_10 (arr,arr2) = [$Tuple2(arr[0], arr2[0]), $Tuple2(arr[1], arr2[1]), $Tuple2(arr[2], arr2[2]), $Tuple2(arr[3], arr2[3]), $Tuple2(arr[4], arr2[4]), $Tuple2(arr[5], arr2[5]), $Tuple2(arr[6], arr2[6]), $Tuple2(arr[7], arr2[7]), $Tuple2(arr[8], arr2[8]), $Tuple2(arr[9], arr2[9])] | |
227 | 227 | ||
228 | 228 | ||
229 | 229 | func prepareParams (currentArrPartKeys,currentArrPartValues,length) = if ((length == 0)) | |
230 | 230 | then throw("Empty params") | |
231 | 231 | else if ((length == 1)) | |
232 | 232 | then prepare_1(currentArrPartKeys, currentArrPartValues) | |
233 | 233 | else if ((length == 2)) | |
234 | 234 | then prepare_2(currentArrPartKeys, currentArrPartValues) | |
235 | 235 | else if ((length == 3)) | |
236 | 236 | then prepare_3(currentArrPartKeys, currentArrPartValues) | |
237 | 237 | else if ((length == 4)) | |
238 | 238 | then prepare_4(currentArrPartKeys, currentArrPartValues) | |
239 | 239 | else if ((length == 5)) | |
240 | 240 | then prepare_5(currentArrPartKeys, currentArrPartValues) | |
241 | 241 | else if ((length == 6)) | |
242 | 242 | then prepare_6(currentArrPartKeys, currentArrPartValues) | |
243 | 243 | else if ((length == 7)) | |
244 | 244 | then prepare_7(currentArrPartKeys, currentArrPartValues) | |
245 | 245 | else if ((length == 8)) | |
246 | 246 | then prepare_8(currentArrPartKeys, currentArrPartValues) | |
247 | 247 | else if ((length == 9)) | |
248 | 248 | then prepare_9(currentArrPartKeys, currentArrPartValues) | |
249 | 249 | else if ((length == 10)) | |
250 | 250 | then prepare_10(currentArrPartKeys, currentArrPartValues) | |
251 | 251 | else throw("Max number of parameters exceeded") | |
252 | 252 | ||
253 | 253 | ||
254 | 254 | func getStartAndEndIndexes (json,key) = { | |
255 | 255 | let keyLen = size(key) | |
256 | 256 | let startIndex = value(indexOf(json, key)) | |
257 | - | let $t062076637 = $Tuple2(valueOrElse(indexOf(json, ",", startIndex), value(indexOf(json, "}", startIndex))), 3) | |
258 | - | let endIndex = $t062076637._1 | |
259 | - | let k = $t062076637._2 | |
260 | - | $Tuple4(keyLen, startIndex, endIndex, k) | |
257 | + | let endIndex = valueOrElse(indexOf(json, ",", startIndex), value(indexOf(json, "}", startIndex))) | |
258 | + | $Tuple4(keyLen, startIndex, endIndex, 3) | |
261 | 259 | } | |
262 | 260 | ||
263 | 261 | ||
264 | 262 | func readByKeyInternal (json,key) = { | |
265 | - | let $ | |
266 | - | let keyLen = $ | |
267 | - | let startIndex = $ | |
268 | - | let endIndex = $ | |
269 | - | let k = $ | |
263 | + | let $t067226838 = getStartAndEndIndexes(json, key) | |
264 | + | let keyLen = $t067226838._1 | |
265 | + | let startIndex = $t067226838._2 | |
266 | + | let endIndex = $t067226838._3 | |
267 | + | let k = $t067226838._4 | |
270 | 268 | drop(take(json, (endIndex - 1)), ((startIndex + keyLen) + k)) | |
271 | 269 | } | |
272 | 270 | ||
273 | 271 | ||
274 | 272 | func deleteByKeyInternal (json,key) = { | |
275 | - | let $ | |
276 | - | let keyLen = $ | |
277 | - | let startIndex = $ | |
278 | - | let endIndex = $ | |
279 | - | let k = $ | |
273 | + | let $t071127239 = getStartAndEndIndexes(json, key) | |
274 | + | let keyLen = $t071127239._1 | |
275 | + | let startIndex = $t071127239._2 | |
276 | + | let endIndex = $t071127239._3 | |
277 | + | let k = $t071127239._4 | |
280 | 278 | let deletedValue = drop(take(json, (endIndex - 1)), ((startIndex + keyLen) + k)) | |
281 | 279 | let newJson = if (((size(json) - endIndex) == 1)) | |
282 | 280 | then (take(json, (startIndex - 2)) + drop(json, endIndex)) | |
283 | 281 | else (take(json, (startIndex - 1)) + drop(json, (endIndex + 1))) | |
284 | 282 | $Tuple2(deletedValue, newJson) | |
285 | 283 | } | |
286 | 284 | ||
287 | 285 | ||
288 | 286 | @Callable(i) | |
289 | 287 | func makeJSONInternal (arrKeys,arrValues,iterationsCount,lastIterationLen,res) = valueOrElse(onlyInternal(i.caller), if ((iterationsCount > 0)) | |
290 | 288 | then { | |
291 | - | let $ | |
292 | - | let currentArrPartKeys = $ | |
293 | - | let arrTailKeys = $ | |
294 | - | let $ | |
295 | - | let currentArrPartValues = $ | |
296 | - | let arrTailValues = $ | |
289 | + | let $t083388500 = getPartAndTail(arrKeys) | |
290 | + | let currentArrPartKeys = $t083388500._1 | |
291 | + | let arrTailKeys = $t083388500._2 | |
292 | + | let $t085098624 = getPartAndTail(arrValues) | |
293 | + | let currentArrPartValues = $t085098624._1 | |
294 | + | let arrTailValues = $t085098624._2 | |
297 | 295 | let params = prepareParams(currentArrPartKeys, currentArrPartValues, 10) | |
298 | 296 | let newString = iterateMakeJSON(params, res, 10) | |
299 | 297 | let result = invoke(this, "makeJSONInternal", [arrTailKeys, arrTailValues, (iterationsCount - 1), lastIterationLen, newString], nil) | |
300 | 298 | if ((result == result)) | |
301 | 299 | then $Tuple2(nil, result) | |
302 | 300 | else throw("Strict value is not equal to itself.") | |
303 | 301 | } | |
304 | 302 | else if ((lastIterationLen != 0)) | |
305 | 303 | then { | |
306 | 304 | let params = prepareParams(arrKeys, arrValues, lastIterationLen) | |
307 | 305 | let newString = iterateMakeJSON(params, res, lastIterationLen) | |
308 | 306 | $Tuple2(nil, (("{" + dropRight(newString, 1)) + "}")) | |
309 | 307 | } | |
310 | 308 | else $Tuple2(nil, (("{" + dropRight(res, 1)) + "}"))) | |
311 | 309 | ||
312 | 310 | ||
313 | 311 | ||
314 | 312 | @Callable(i) | |
315 | 313 | func makeJSON (arrKeys,arrValues) = if ((size(arrKeys) != size(arrValues))) | |
316 | 314 | then throw("ArrayKeys and ArrayValues length must be equal") | |
317 | 315 | else { | |
318 | 316 | let len = size(arrKeys) | |
319 | 317 | let iterationsCount = fraction(1, len, 10) | |
320 | 318 | let lastIterationLen = (len % 10) | |
321 | 319 | let res = invoke(this, "makeJSONInternal", [arrKeys, arrValues, iterationsCount, lastIterationLen, ""], nil) | |
322 | 320 | if ((res == res)) | |
323 | 321 | then $Tuple2(nil, res) | |
324 | 322 | else throw("Strict value is not equal to itself.") | |
325 | 323 | } | |
326 | 324 | ||
327 | 325 | ||
328 | 326 | ||
329 | 327 | @Callable(i) | |
330 | 328 | func addToJSON (json,arrKeys,arrValues) = if ((size(arrKeys) != size(arrValues))) | |
331 | 329 | then throw("ArrayKeys and ArrayValues length must be equal") | |
332 | 330 | else { | |
333 | 331 | let len = size(arrKeys) | |
334 | 332 | let iterationsCount = fraction(1, len, 10) | |
335 | 333 | let lastIterationLen = (len % 10) | |
336 | 334 | let res = invoke(this, "makeJSONInternal", [arrKeys, arrValues, iterationsCount, lastIterationLen, (drop(dropRight(json, 1), 1) + ",")], nil) | |
337 | 335 | if ((res == res)) | |
338 | 336 | then $Tuple2(nil, res) | |
339 | 337 | else throw("Strict value is not equal to itself.") | |
340 | 338 | } | |
341 | 339 | ||
342 | 340 | ||
343 | 341 | ||
344 | 342 | @Callable(i) | |
345 | 343 | func readByJSONKey (json,key) = { | |
346 | 344 | let valueByKey = readByKeyInternal(json, key) | |
347 | 345 | $Tuple2([StringEntry("valueByKey", valueByKey)], valueByKey) | |
348 | 346 | } | |
349 | 347 | ||
350 | 348 | ||
351 | 349 | ||
352 | 350 | @Callable(i) | |
353 | 351 | func deleteByJSONKey (json,key) = { | |
354 | - | let $ | |
355 | - | let deletedValueByKey = $ | |
356 | - | let newJson = $ | |
352 | + | let $t01291913270 = deleteByKeyInternal(json, key) | |
353 | + | let deletedValueByKey = $t01291913270._1 | |
354 | + | let newJson = $t01291913270._2 | |
357 | 355 | $Tuple2([StringEntry("deletedValue", deletedValueByKey), StringEntry(kJsonRes, newJson)], $Tuple2(deletedValueByKey, newJson)) | |
358 | 356 | } | |
359 | 357 | ||
360 | 358 |
github/deemru/w8io/169f3d6 64.29 ms ◑