MCPcopy Index your code
hub / github.com/NobyDa/Script / read

Function read

JD-DailyBonus/JD_DailyBonus.js:1829–1845  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

1827 }
1828 }
1829 const read = (key) => {
1830 if (isQuanX) return $prefs.valueForKey(key)
1831 if (isSurge) return $persistentStore.read(key)
1832 if (isNode) {
1833 try {
1834 if (!node.fs.existsSync(node.path.resolve(__dirname, NodeSet))) return null;
1835 const dataValue = JSON.parse(node.fs.readFileSync(node.path.resolve(__dirname, NodeSet)))
1836 return dataValue[key]
1837 } catch (er) {
1838 return AnError('Node.js持久化读取', null, er)
1839 }
1840 }
1841 if (isJSBox) {
1842 if (!$file.exists(`shared://${key}.txt`)) return null;
1843 return $file.read(`shared://${key}.txt`).string
1844 }
1845 }
1846 const adapterStatus = (response) => {
1847 if (response) {
1848 if (response.status) {

Callers

nothing calls this directly

Calls 2

AnErrorFunction · 0.85
readMethod · 0.45

Tested by

no test coverage detected