lib/tools.js
function compareMappingsDeep(mapping1, mapping2) {
  return _.isEqualWith(mapping1, mapping2, (object1, object2, prop) => {
    let mapping1 = { [prop]: object1 }
    let mapping2 = { [prop]: object2 }
    if (prop == "from" || prop == "to") {
      if (!_.isEqual(Object.getOwnPropertyNames(_.get(object1, prop, {})), Object.getOwnPropertyNames(_.get(object2, prop, {})))) {
        return false
      }
      return _.isEqualWith(conceptsOfMapping(mapping1, prop), conceptsOfMapping(mapping2, prop), (concept1, concept2, index) => {
        if (index != undefined) {
          return compare(concept1, concept2)
        }
        return undefined
      })
    }
    if (prop == "fromScheme" || prop == "toScheme") {
      return compare(object1, object2)
    }
    // Let lodash's isEqual do the comparison
    return undefined
  })
}
function compareMappingsDeep(mapping1, mapping2) {
  return _.isEqualWith(mapping1, mapping2, (object1, object2, prop) => {
    let mapping1 = { [prop]: object1 }
    let mapping2 = { [prop]: object2 }
    if (prop == "from" || prop == "to") {
      if (!_.isEqual(Object.getOwnPropertyNames(_.get(object1, prop, {})), Object.getOwnPropertyNames(_.get(object2, prop, {})))) {
        return false
      }
      return _.isEqualWith(conceptsOfMapping(mapping1, prop), conceptsOfMapping(mapping2, prop), (concept1, concept2, index) => {
        if (index != undefined) {
          return compare(concept1, concept2)
        }
        return undefined
      })
    }
    if (prop == "fromScheme" || prop == "toScheme") {
      return compare(object1, object2)
    }
    // Let lodash's isEqual do the comparison
    return undefined
  })
}
function compareMappingsDeep ( mapping1 , mapping2 ) { return _ . isEqualWith ( mapping1 , mapping2 , ( object1 , object2 , prop ) => { let mapping1 = { [ prop ] : object1 } let mapping2 = { [ prop ] : object2 } if ( prop == "from" || prop == "to" ) { if ( ! _ . isEqual ( Object . getOwnPropertyNames ( _ . get ( object1 , prop , { } ) ) , Object . getOwnPropertyNames ( _ . get ( object2 , prop , { } ) ) ) ) { return false } return _ . isEqualWith ( conceptsOfMapping ( mapping1 , prop ) , conceptsOfMapping ( mapping2 , prop ) , ( concept1 , concept2 , index ) => { if ( index != undefined ) { return compare ( concept1 , concept2 ) } return undefined } ) } if ( prop == "fromScheme" || prop == "toScheme" ) { return compare ( object1 , object2 ) } // Let lodash's isEqual do the comparison return undefined } ) }
Compare two mappings based on their properties. Concept sets and schemes are compared by URI.

@memberof module:jskos-tools
Compare two mappings based on their properties . Concept sets and schemes are compared by URI .