import { join } from 'path' ; import { categories } from '../util/categories' ; import { files } from '../util/category' ; import { directories } from '../util/directories' ; import { get } from '../util/get' ; import { readdir } from '../util/readdir' ; import { width } from '../util/width' ; import { write } from '../util/write' ; let sanitized = readdir ( directories . sanitized ) ; for ( const category in categories ) { const paths = files ( category as keyof typeof categories , directories . sanitized ) ; sanitized = sanitized . filter ( ( file ) => ! paths . includes ( file ) ) ; write ( join ( directories . combined , `${ category }.json` ) , get ( paths ) , width ( category ) ) ; } if ( sanitized . length ) { write ( join ( directories . combined , 'Other.json' ) , get ( sanitized ) ) ; }