function removeFeet({ maxStroke = 10, longestFoot = 100, angleTol = 2 } = {}) {
  return glyph =>  {
    /** @type { [ number, number ][] } Indices of left feet of the glyph */ 
    const gLeftFeet = [];
    /** @type { [ number, number ][] } Indices of right feet of the glyph */ 
    const gRightFeet = [];
    /** @type { number[] } Corresponding left feet lengths */ 
    const gLeftFeetLen = [];
    /** @type { number[] } Corresponding right feet lengths */ 
    const gRightFeetLen = [];

    // Initial feet removal
    const feetRemovedGlyph = glyph.map((contour, cid) => {
      let [ leftFeet, rightFeet ] = detectFeet(contour, 
        { maxStroke, longestFoot, angleTol });
      /** Contour with feet removed */
      const feetRemoved = removeContourFeet(contour, leftFeet, rightFeet);
      const [ leftFeetLen, rightFeetLen ] = 
        feetLengths(contour, leftFeet, rightFeet);
      [ leftFeet, rightFeet ] = updateFeetIndices(contour, leftFeet, rightFeet);
      leftFeet.forEach(pid => gLeftFeet.push([ cid, pid ]));
      rightFeet.forEach(pid => gRightFeet.push([ cid, pid ]));
      gLeftFeetLen.push(...leftFeetLen); gRightFeetLen.push(...rightFeetLen);
      return feetRemoved;
    });

    return sinkFeet(feetRemovedGlyph, gLeftFeet, gRightFeet, gLeftFeetLen, 
      gRightFeetLen, { maxStroke });
  }
}
Remove feet filter
@param { { maxStroke: number?, longestFoot: number?, 
angleTol: number? }) } config
@returns { PostFilter }