diff --git a/vue-project/my-kintone-plugin/src/js/helper.ts b/vue-project/my-kintone-plugin/src/js/helper.ts index 63558e1..b249e1d 100644 --- a/vue-project/my-kintone-plugin/src/js/helper.ts +++ b/vue-project/my-kintone-plugin/src/js/helper.ts @@ -168,7 +168,6 @@ const extractNoSubTableFields = (layout: Layout, baseFilter: FieldType[] | undef export function getFieldObj(fieldCode: string, { fields }: FieldsInfo, subTableCode?: string) { const meta = getMeta(fields, subTableCode); - if (!meta) return ''; return meta[fieldCode]; } @@ -177,7 +176,6 @@ export function getMeta(fields: Properties, subTableCode?: string) { return fields; } let meta = fields; - if (!meta) return fields; const table = meta[subTableCode]; if (isType.SUBTABLE(table)) { meta = table.fields; diff --git a/vue-project/my-kintone-plugin/src/js/join.ts b/vue-project/my-kintone-plugin/src/js/join.ts index ffa3cb8..5acddf2 100644 --- a/vue-project/my-kintone-plugin/src/js/join.ts +++ b/vue-project/my-kintone-plugin/src/js/join.ts @@ -1,6 +1,7 @@ +import type { CalcType } from '@/types/my-kintone'; import { isType, type FieldType, type OneOf } from './kintone-rest-api-client'; -type CalcType = 'NUMBER' | 'NUMBER_DIGIT' | 'DATETIME' | 'DATE' | 'TIME' | 'HOUR_MINUTE' | 'DAY_HOUR_MINUTE'; + export type LeftCalcJoinType = Record; export function isForceDisable(field: OneOf) { diff --git a/vue-project/my-kintone-plugin/src/js/kintone-rest-api-client.ts b/vue-project/my-kintone-plugin/src/js/kintone-rest-api-client.ts index bf7a25a..fd58f7f 100644 --- a/vue-project/my-kintone-plugin/src/js/kintone-rest-api-client.ts +++ b/vue-project/my-kintone-plugin/src/js/kintone-rest-api-client.ts @@ -54,7 +54,7 @@ export const types = typeNames.reduce( type ExtractOneOf = Extract; function createTypeGuard(type: T) { - return (value: OneOf): value is ExtractOneOf => value.type === type; + return (value: OneOf): value is ExtractOneOf => value?.type === type; } export const isType = Object.fromEntries( diff --git a/vue-project/my-kintone-plugin/src/types/my-kintone.d.ts b/vue-project/my-kintone-plugin/src/types/my-kintone.d.ts index 7cbded5..394f20c 100644 --- a/vue-project/my-kintone-plugin/src/types/my-kintone.d.ts +++ b/vue-project/my-kintone-plugin/src/types/my-kintone.d.ts @@ -1,3 +1,5 @@ export interface KucEvent { detail: T; } + +export type CalcType = 'NUMBER' | 'NUMBER_DIGIT' | 'DATETIME' | 'DATE' | 'TIME' | 'HOUR_MINUTE' | 'DAY_HOUR_MINUTE';