4995da0252ed770aa7e9430279e02952.json 8.02 KB
{"ast":null,"code":"var SetCache = require('./_SetCache'),\n    arraySome = require('./_arraySome'),\n    cacheHas = require('./_cacheHas');\n/** Used to compose bitmasks for value comparisons. */\n\n\nvar COMPARE_PARTIAL_FLAG = 1,\n    COMPARE_UNORDERED_FLAG = 2;\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n  var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n      arrLength = array.length,\n      othLength = other.length;\n\n  if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n    return false;\n  } // Check that cyclic values are equal.\n\n\n  var arrStacked = stack.get(array);\n  var othStacked = stack.get(other);\n\n  if (arrStacked && othStacked) {\n    return arrStacked == other && othStacked == array;\n  }\n\n  var index = -1,\n      result = true,\n      seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined;\n  stack.set(array, other);\n  stack.set(other, array); // Ignore non-index properties.\n\n  while (++index < arrLength) {\n    var arrValue = array[index],\n        othValue = other[index];\n\n    if (customizer) {\n      var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);\n    }\n\n    if (compared !== undefined) {\n      if (compared) {\n        continue;\n      }\n\n      result = false;\n      break;\n    } // Recursively compare arrays (susceptible to call stack limits).\n\n\n    if (seen) {\n      if (!arraySome(other, function (othValue, othIndex) {\n        if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n          return seen.push(othIndex);\n        }\n      })) {\n        result = false;\n        break;\n      }\n    } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n      result = false;\n      break;\n    }\n  }\n\n  stack['delete'](array);\n  stack['delete'](other);\n  return result;\n}\n\nmodule.exports = equalArrays;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/lodash/_equalArrays.js"],"names":["SetCache","require","arraySome","cacheHas","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","equalArrays","array","other","bitmask","customizer","equalFunc","stack","isPartial","arrLength","length","othLength","arrStacked","get","othStacked","index","result","seen","undefined","set","arrValue","othValue","compared","othIndex","push","module","exports"],"mappings":"AAAA,IAAIA,QAAQ,GAAGC,OAAO,CAAC,aAAD,CAAtB;AAAA,IACIC,SAAS,GAAGD,OAAO,CAAC,cAAD,CADvB;AAAA,IAEIE,QAAQ,GAAGF,OAAO,CAAC,aAAD,CAFtB;AAIA;;;AACA,IAAIG,oBAAoB,GAAG,CAA3B;AAAA,IACIC,sBAAsB,GAAG,CAD7B;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,WAAT,CAAqBC,KAArB,EAA4BC,KAA5B,EAAmCC,OAAnC,EAA4CC,UAA5C,EAAwDC,SAAxD,EAAmEC,KAAnE,EAA0E;AACxE,MAAIC,SAAS,GAAGJ,OAAO,GAAGL,oBAA1B;AAAA,MACIU,SAAS,GAAGP,KAAK,CAACQ,MADtB;AAAA,MAEIC,SAAS,GAAGR,KAAK,CAACO,MAFtB;;AAIA,MAAID,SAAS,IAAIE,SAAb,IAA0B,EAAEH,SAAS,IAAIG,SAAS,GAAGF,SAA3B,CAA9B,EAAqE;AACnE,WAAO,KAAP;AACD,GAPuE,CAQxE;;;AACA,MAAIG,UAAU,GAAGL,KAAK,CAACM,GAAN,CAAUX,KAAV,CAAjB;AACA,MAAIY,UAAU,GAAGP,KAAK,CAACM,GAAN,CA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AX,EAAqBjB,OAArB,EAA8BC,UAA9B,EAA0CE,KAA1C,CADnC,CAAJ,EAC0F;AACxF,iBAAOU,IAAI,CAACO,IAAL,CAAUD,QAAV,CAAP;AACD;AACF,OALS,CAAd,EAKQ;AACNP,QAAAA,MAAM,GAAG,KAAT;AACA;AACD;AACF,KAVD,MAUO,IAAI,EACLI,QAAQ,KAAKC,QAAb,IACEf,SAAS,CAACc,QAAD,EAAWC,QAAX,EAAqBjB,OAArB,EAA8BC,UAA9B,EAA0CE,KAA1C,CAFN,CAAJ,EAGA;AACLS,MAAAA,MAAM,GAAG,KAAT;AACA;AACD;AACF;;AACDT,EAAAA,KAAK,CAAC,QAAD,CAAL,CAAgBL,KAAhB;AACAK,EAAAA,KAAK,CAAC,QAAD,CAAL,CAAgBJ,KAAhB;AACA,SAAOa,MAAP;AACD;;AAEDS,MAAM,CAACC,OAAP,GAAiBzB,WAAjB","sourcesContent":["var SetCache = require('./_SetCache'),\n    arraySome = require('./_arraySome'),\n    cacheHas = require('./_cacheHas');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n    COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n  var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n      arrLength = array.length,\n      othLength = other.length;\n\n  if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n    return false;\n  }\n  // Check that cyclic values are equal.\n  var arrStacked = stack.get(array);\n  var othStacked = stack.get(other);\n  if (arrStacked && othStacked) {\n    return arrStacked == other && othStacked == array;\n  }\n  var index = -1,\n      result = true,\n      seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n  stack.set(array, other);\n  stack.set(other, array);\n\n  // Ignore non-index properties.\n  while (++index < arrLength) {\n    var arrValue = array[index],\n        othValue = other[index];\n\n    if (customizer) {\n      var compared = isPartial\n        ? customizer(othValue, arrValue, index, other, array, stack)\n        : customizer(arrValue, othValue, index, array, other, stack);\n    }\n    if (compared !== undefined) {\n      if (compared) {\n        continue;\n      }\n      result = false;\n      break;\n    }\n    // Recursively compare arrays (susceptible to call stack limits).\n    if (seen) {\n      if (!arraySome(other, function(othValue, othIndex) {\n            if (!cacheHas(seen, othIndex) &&\n                (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n              return seen.push(othIndex);\n            }\n          })) {\n        result = false;\n        break;\n      }\n    } else if (!(\n          arrValue === othValue ||\n            equalFunc(arrValue, othValue, bitmask, customizer, stack)\n        )) {\n      result = false;\n      break;\n    }\n  }\n  stack['delete'](array);\n  stack['delete'](other);\n  return result;\n}\n\nmodule.exports = equalArrays;\n"]},"metadata":{},"sourceType":"script"}