MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / #load

Method #load

modules/files/preference/lin/preference.js:39–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37 }
38
39 static #load() {
40 let result = {};
41
42 try {
43 if (File.exists(Preference.#filePath)) {
44 let file = new File(Preference.#filePath, false);
45 result = JSON.parse(file.read(String));
46 file.close();
47 }
48 } catch {
49 // ignore errors
50 }
51
52 return result;
53 }
54
55 static #save() {
56 try {

Callers 1

PreferenceClass · 0.80

Calls 4

readMethod · 0.95
closeMethod · 0.95
existsMethod · 0.65
parseMethod · 0.65

Tested by

no test coverage detected