MCPcopy Create free account
hub / github.com/Script-Hub-Org/Script-Hub / writedata

Method writedata

env/env.js:143–153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

141 }
142 }
143 writedata() {
144 if (this.isNode()) {
145 ;(this.fs = this.fs ? this.fs : require('fs')), (this.path = this.path ? this.path : require('path'))
146 const t = this.path.resolve(this.dataFile),
147 e = this.path.resolve(process.cwd(), this.dataFile),
148 s = this.fs.existsSync(t),
149 a = !s && this.fs.existsSync(e),
150 r = JSON.stringify(this.data)
151 s ? this.fs.writeFileSync(t, r) : a ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r)
152 }
153 }
154 lodash_get(t, e, s) {
155 const a = e.replace(/\[(\d+)\]/g, '.$1').split('.')
156 let r = t

Callers 1

setvalMethod · 0.45

Calls 1

isNodeMethod · 0.45

Tested by

no test coverage detected