json_script: add "isdir" support