UNPKG

unity-find-fault

Version:

A tool to find fault in unity project.

26 lines 646 B
import fs from 'fs-extra'; export class Relatives { _isUsed = false; _relatedGuids = []; beginUse() { this._isUsed = true; this._relatedGuids.length = 0; } stopUse() { this._isUsed = false; } async collect(file) { const content = await fs.readFile(file, 'utf-8'); const guids = content.matchAll(/guid: (\w{32})/g); for (const g of guids) { this._relatedGuids.push(g[1]); } } get isUsed() { return this._isUsed; } isRelated(guid) { return this._relatedGuids.includes(guid); } } //# sourceMappingURL=Relatives.js.map