from typing import Iterable
from typing import List
import copy


def safe_log_wpscan_args(wpscan_args: Iterable[str]) -> List[str]:
    """Replace `--api-token` param with `"***"` for safer logging"""
    args = [val.strip() for val in copy.deepcopy(wpscan_args)]
    if "--api-token" in args:
        args[args.index("--api-token") + 1] = "***"
    return args