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