MCPcopy Create free account
hub / github.com/FSGModding/FSG_Mod_Assistant / getConflictInCollection

Method getConflictInCollection

lib/modCheckLib.js:817–836  ·  view source on GitHub ↗

* Get conflicts in a given collection * @param {modRecord_collectKey} collectKey * @param {modRecord} modRecord * @returns {Array. }

(collectKey, modRecord)

Source from the content-addressed store, hash-verified

815 * @returns {Array.<modRecord_shortName>}
816 */
817 getConflictInCollection(collectKey, modRecord) {
818 const conflictList = this.#bindConflict[collectKey][modRecord.fileDetail.shortName]
819
820 if ( typeof conflictList !== 'object' ) { return false }
821
822 const theseConflicts = this.#bindConflict[collectKey]
823 const badKeys = Object.keys(conflictList)
824 const confMods = new Set()
825
826 for ( const badKey of badKeys ) {
827 for ( const potential in theseConflicts ) {
828 if ( Object.hasOwn(theseConflicts[potential], badKey) ) {
829 confMods.add(potential)
830 }
831 }
832 }
833 confMods.delete(modRecord.fileDetail.shortName)
834
835 return [...confMods]
836 }
837
838 /**
839 * Get if depended on mods are in a collection

Callers 1

#doBadgesMethod · 0.95

Calls 2

keysMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected