mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-11-14 06:23:55 +01:00
18 lines
353 B
Plaintext
18 lines
353 B
Plaintext
function json_load(path) {
|
|
if(!file_exists(path)) return {};
|
|
|
|
var f = file_text_open_read(path);
|
|
var s = file_text_read_all(f);
|
|
file_text_close(f);
|
|
|
|
var js = json_decode(s);
|
|
return js;
|
|
}
|
|
|
|
function json_save(path, struct) {
|
|
var s = json_encode(struct);
|
|
|
|
var f = file_text_open_write(path);
|
|
file_text_write_string(f, s);
|
|
file_text_close(f);
|
|
} |