import { NoTarget } from "@typespec/compiler";
export function logWarning(program, msg) {
    trace(program, msg);
    program.reportDiagnostic({
        code: "typespec-java",
        severity: "warning",
        message: msg,
        target: NoTarget,
    });
}
export function trace(program, msg) {
    program.trace("typespec-java", msg);
}
export function pascalCase(name) {
    if (name.length > 0) {
        return name[0].toUpperCase() + name.slice(1);
    }
    else {
        return name;
    }
}
export function getNamespace(type) {
    let namespaceRef = type.namespace;
    let namespaceStr = undefined;
    while (namespaceRef && namespaceRef.name.length !== 0) {
        namespaceStr = namespaceRef.name + (namespaceStr ? "." + namespaceStr : "");
        namespaceRef = namespaceRef.namespace;
    }
    return namespaceStr;
}
export function getJavaNamespace(namespace) {
    return namespace ? "com." + namespace.toLowerCase() : undefined;
}
export function stringArrayContainsIgnoreCase(stringList, str) {
    return stringList && str ? stringList.findIndex((s) => s.toLowerCase() === str.toLowerCase()) != -1 : false;
}
//# sourceMappingURL=utils.js.map