MCPcopy Create free account
hub / github.com/Maccoder3/MAC-MD / constructor

Method constructor

lib/database.js:11–27  ·  view source on GitHub ↗

* Create new Database * @param {String} filepath Path to specified json database * @param {...any} args JSON.stringify arguments

(filepath, ...args)

Source from the content-addressed store, hash-verified

9 * @param {...any} args JSON.stringify arguments
10 */
11 constructor(filepath, ...args) {
12 this.file = resolve(filepath)
13 this.logger = console
14
15 this._load()
16
17 this._jsonargs = args
18 this._state = false
19 this._queue = []
20 this._interval = setInterval(async () => {
21 if (!this._state && this._queue && this._queue[0]) {
22 this._state = true
23 await this[this._queue.shift()]().catch(this.logger.error)
24 this._state = false
25 }
26 }, 1000)
27 }
28
29 get data() {
30 return this._data

Callers

nothing calls this directly

Calls 1

_loadMethod · 0.95

Tested by

no test coverage detected