code: function(input, isPolygon) {
          if (isCoordArray(input)) {
              // Leaflet Polygons don't need the first point to be repeated, but we do
              const coords = isPolygon ? input.concat([input[0]]) : input;
              return [coords];
          }
          if (input instanceof L.Polyline) {
              // we need some recursivity to support multi-poly*
              return this._initPaths(input.getLatLngs(), (input instanceof L.Polygon));
          }
          if (Array.isArray(input)) {
              // flatten everything, we just need coordinate lists to apply patterns
              return input.reduce((flatArray, p) =>
                  flatArray.concat(this._initPaths(p, isPolygon)),
              []);
          }
          return [];
      }
docs: Deals with all the different cases. input can be one of these types:
  array of LatLng, array of 2-number arrays, Polyline, Polygon,
  array of one of the previous.