(x: any)
| 1276 | } |
| 1277 | case 'json_decode': { |
| 1278 | const fromJSObj = (x: any): Value => { |
| 1279 | if (Array.isArray(x)) { |
| 1280 | return list(x.map(fromJSObj)); |
| 1281 | } else if (typeof x === 'number') { |
| 1282 | return isInteger(x) ? int(x) : float(x); |
| 1283 | } else if (typeof x === 'string') { |
| 1284 | return str(x); |
| 1285 | } else { |
| 1286 | const items: Map<string, Value> = new Map(); |
| 1287 | for (const key in x) { |
| 1288 | if (Object.hasOwnProperty.call(x, key)) { |
| 1289 | // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access |
| 1290 | items.set(key, fromJSObj(x[key])); |
| 1291 | } |
| 1292 | } |
| 1293 | return dictionary(items); |
| 1294 | } |
| 1295 | }; |
| 1296 | const [expr] = getArgs(1); |
| 1297 | return fromJSObj(JSON.parse(toString(expr!))); |
| 1298 | } |
nothing calls this directly
no test coverage detected