lib/modules/animation/patheffect/index.js
function match(pathA, pathB) {
  var minCurves = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;
  var shapesA = pathToShapes(pathA.path);
  var shapesB = pathToShapes(pathB.path);
  var lenA = shapesA.length,
      lenB = shapesB.length;

  if (lenA > lenB) {
    _subShapes(shapesB, lenA - lenB);
  } else if (lenA < lenB) {
    _upShapes(shapesA, lenB - lenA);
  }

  shapesA = (0, _sort.sort)(shapesA, shapesB);
  shapesA.forEach(function (curves, index) {
    var lenA = curves.length,
        lenB = shapesB[index].length;

    if (lenA > lenB) {
      if (lenA < minCurves) {
        _splitCurves(curves, minCurves - lenA);

        _splitCurves(shapesB[index], minCurves - lenB);
      } else {
        _splitCurves(shapesB[index], lenA - lenB);
      }
    } else if (lenA < lenB) {
      if (lenB < minCurves) {
        _splitCurves(curves, minCurves - lenA);

        _splitCurves(shapesB[index], minCurves - lenB);
      } else {
        _splitCurves(curves, lenB - lenA);
      }
    }
  });
  shapesA.forEach(function (curves, index) {
    shapesA[index] = (0, _sort.sortCurves)(curves, shapesB[index]);
  });
  return [shapesA, shapesB];
}
function match(pathA, pathB) {
  var minCurves = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;
  var shapesA = pathToShapes(pathA.path);
  var shapesB = pathToShapes(pathB.path);
  var lenA = shapesA.length,
      lenB = shapesB.length;

  if (lenA > lenB) {
    _subShapes(shapesB, lenA - lenB);
  } else if (lenA < lenB) {
    _upShapes(shapesA, lenB - lenA);
  }

  shapesA = (0, _sort.sort)(shapesA, shapesB);
  shapesA.forEach(function (curves, index) {
    var lenA = curves.length,
        lenB = shapesB[index].length;

    if (lenA > lenB) {
      if (lenA < minCurves) {
        _splitCurves(curves, minCurves - lenA);

        _splitCurves(shapesB[index], minCurves - lenB);
      } else {
        _splitCurves(shapesB[index], lenA - lenB);
      }
    } else if (lenA < lenB) {
      if (lenB < minCurves) {
        _splitCurves(curves, minCurves - lenA);

        _splitCurves(shapesB[index], minCurves - lenB);
      } else {
        _splitCurves(curves, lenB - lenA);
      }
    }
  });
  shapesA.forEach(function (curves, index) {
    shapesA[index] = (0, _sort.sortCurves)(curves, shapesB[index]);
  });
  return [shapesA, shapesB];
}
function match ( pathA , pathB ) { var minCurves = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : 100 ; var shapesA = pathToShapes ( pathA . path ) ; var shapesB = pathToShapes ( pathB . path ) ; var lenA = shapesA . length , lenB = shapesB . length ; if ( lenA > lenB ) { _subShapes ( shapesB , lenA - lenB ) ; } else if ( lenA < lenB ) { _upShapes ( shapesA , lenB - lenA ) ; } shapesA = ( 0 , _sort . sort ) ( shapesA , shapesB ) ; shapesA . forEach ( function ( curves , index ) { var lenA = curves . length , lenB = shapesB [ index ] . length ; if ( lenA > lenB ) { if ( lenA < minCurves ) { _splitCurves ( curves , minCurves - lenA ) ; _splitCurves ( shapesB [ index ] , minCurves - lenB ) ; } else { _splitCurves ( shapesB [ index ] , lenA - lenB ) ; } } else if ( lenA < lenB ) { if ( lenB < minCurves ) { _splitCurves ( curves , minCurves - lenA ) ; _splitCurves ( shapesB [ index ] , minCurves - lenB ) ; } else { _splitCurves ( curves , lenB - lenA ) ; } } } ) ; shapesA . forEach ( function ( curves , index ) { shapesA [ index ] = ( 0 , _sort . sortCurves ) ( curves , shapesB [ index ] ) ; } ) ; return [ shapesA , shapesB ] ; }
match two path
match two path