MCPcopy Create free account
hub / github.com/KDE/falkon / decode

Function decode

src/plugins/GreaseMonkey/data/values.js:39–54  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

37};
38
39var decode = (val) => {
40 val = String(val);
41 if (!val.length) {
42 return val;
43 }
44 var v = val.substr(1);
45 if (val[0] == "b") {
46 return Boolean(v == "true" ? true : false);
47 } else if (val[0] == "i") {
48 return Number(v);
49 } else if (val[0] == "s") {
50 return v;
51 } else {
52 return undefined;
53 }
54};
55
56var encode = (val) => {
57 if (typeof val == "boolean") {

Callers 1

values.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected