import pathlib
from typing import List


def get_nested_directories(directory: pathlib.Path) -> List[pathlib.Path]:
    """Return all directories inside directory and its child directories."""
    nested_directories = []
    for item in directory.iterdir():
        if item.is_dir():
            nested_directories.append(item)
    for nested_directory in nested_directories:
        for item in nested_directory.iterdir():
            if item.is_dir():
                nested_directories.append(item)
    return nested_directories