function parseJSON(filename: string, contents: string): unknown {
    try {
        debug('parsing as JSON: %o', filename);
        return JSON.parse(contents);
    } catch (error) {