clan-app: whitelist necessary any usage in api./index.tsx
This commit is contained in:
@@ -27,8 +27,11 @@ function isMachine(obj: unknown): obj is Machine {
|
|||||||
return (
|
return (
|
||||||
!!obj &&
|
!!obj &&
|
||||||
typeof obj === "object" &&
|
typeof obj === "object" &&
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
typeof (obj as any).name === "string" &&
|
typeof (obj as any).name === "string" &&
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
typeof (obj as any).flake === "object" &&
|
typeof (obj as any).flake === "object" &&
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
typeof (obj as any).flake.identifier === "string"
|
typeof (obj as any).flake.identifier === "string"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -47,6 +50,8 @@ interface BackendOpts {
|
|||||||
|
|
||||||
interface BackendReturnType<K extends OperationNames> {
|
interface BackendReturnType<K extends OperationNames> {
|
||||||
body: OperationResponse<K>;
|
body: OperationResponse<K>;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
header: Record<string, any>;
|
header: Record<string, any>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,7 +85,7 @@ const _callApi = <K extends OperationNames>(
|
|||||||
let header: BackendOpts = {};
|
let header: BackendOpts = {};
|
||||||
if (backendOpts != undefined) {
|
if (backendOpts != undefined) {
|
||||||
header = { ...backendOpts };
|
header = { ...backendOpts };
|
||||||
let group = backendOpts?.logging?.group;
|
const group = backendOpts?.logging?.group;
|
||||||
if (group != undefined && isMachine(group)) {
|
if (group != undefined && isMachine(group)) {
|
||||||
header = {
|
header = {
|
||||||
logging: { group: group.flake.identifier + "#" + group.name },
|
logging: { group: group.flake.identifier + "#" + group.name },
|
||||||
|
|||||||
@@ -27,8 +27,11 @@ function isMachine(obj: unknown): obj is Machine {
|
|||||||
return (
|
return (
|
||||||
!!obj &&
|
!!obj &&
|
||||||
typeof obj === "object" &&
|
typeof obj === "object" &&
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
typeof (obj as any).name === "string" &&
|
typeof (obj as any).name === "string" &&
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
typeof (obj as any).flake === "object" &&
|
typeof (obj as any).flake === "object" &&
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
typeof (obj as any).flake.identifier === "string"
|
typeof (obj as any).flake.identifier === "string"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -47,6 +50,8 @@ interface BackendOpts {
|
|||||||
|
|
||||||
interface BackendReturnType<K extends OperationNames> {
|
interface BackendReturnType<K extends OperationNames> {
|
||||||
body: OperationResponse<K>;
|
body: OperationResponse<K>;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
header: Record<string, any>;
|
header: Record<string, any>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,7 +85,7 @@ const _callApi = <K extends OperationNames>(
|
|||||||
let header: BackendOpts = {};
|
let header: BackendOpts = {};
|
||||||
if (backendOpts != undefined) {
|
if (backendOpts != undefined) {
|
||||||
header = { ...backendOpts };
|
header = { ...backendOpts };
|
||||||
let group = backendOpts?.logging?.group;
|
const group = backendOpts?.logging?.group;
|
||||||
if (group != undefined && isMachine(group)) {
|
if (group != undefined && isMachine(group)) {
|
||||||
header = {
|
header = {
|
||||||
logging: { group: group.flake.identifier + "#" + group.name },
|
logging: { group: group.flake.identifier + "#" + group.name },
|
||||||
|
|||||||
Reference in New Issue
Block a user