core/classifiers/source.classifier.ts

core/classifiers/source.classifier.ts is a file in GovLab Stats. 8 lines of code and 2 definitions.

import { AUTHORED_ROLES, ROLE_BY_EXT } from "#configuration/constants/source.constants";
import type { FileRole } from "#types/source.types";

export const roleOf = function roleOf(ext: string): FileRole {
    return ROLE_BY_EXT.get(ext) ?? "other";
};

export const isAuthoredRole = function isAuthoredRole(role: FileRole): boolean {
    return AUTHORED_ROLES.includes(role);
};