```ts
/**
 * Removes the specified piece from the end of the text repeatedly until the text no longer ends with that piece.
 * If the text is made up entirely of the piece, it will return an empty string.
 * 
 * @param text - The text to process.
 * @param piece - The piece to remove from the end of the text.
 * @returns The processed text after removing the piece from the end as many times as possible.
 */
export function shedTail(text: string, piece: string): string {
    while (text.endsWith(piece)) {
        text = text.slice(0, -piece.length);
    }
    return text;
}
```