Modular CSS and JS in Child Themes

Putting aside the question of what should and should not be part of a theme, I don’t see why something like this wouldn’t work with a child theme. Use get_stylesheet_directory, which will return the child theme path if it exists and otherwise will return the parent path, to build the path for scandir and I don’t see the problem.