```ts
export function drainFrames(chunks: string[], marker: string): { frames: string[]; pending: string } {
    if (marker.length !== 1) throw new Error("Marker must be a single character");

    let joinedText = chunks.join("");
    const regex = new RegExp(`(?<!${RegExp.escape(marker)})(${marker}){2}([^${marker}]*)`, 'gm');
    const frames: string[] = [];
    let pending = "";

    while ((match = regex.exec(joinedText)) !== null) {
        frames.push(match[0].substring(1));
        joinedText = joinedText.substring(regex.lastIndex);
    }

    if (joinedText && !/^$/.test(joinText)) {
        pending = joinedText;
    }

    return { frames, pending };
}
```