From 4e31415b31031dab1d505d3064e45431b6585431 Mon Sep 17 00:00:00 2001 From: Akiomi Kamakura Date: Fri, 19 Nov 2021 16:41:07 +0900 Subject: [PATCH 1/2] Update JSDoc --- src/main.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main.ts b/src/main.ts index 14d9203..ffa0db4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -42,30 +42,27 @@ global.exportCsv = exportCsv * @param {"net_sales"} propertyName 項目名 * @param {TRUE} isRawValue (オプション) 数値をRAWデータで表示するかどうか (デフォルト値: FALSE) * @param {TRUE} isWithUnits (オプション) 単位を末尾に付加するかどうか (デフォルト値: FALSE) + * @param {TRUE} param5 (オプション) 廃止予定のオプション * @return 指定した銘柄の財務数字または指標 * @customfunction */ global.BCODE = ( ticker, - fiscalYear, - fiscalQuarter, + period, propertyName, isRawValue = false, - isWithUnits = false + isWithUnits = false, + param5 = false ): number | string => { - return bcode( - ticker, - fiscalYear, - fiscalQuarter, - propertyName, - isRawValue, - isWithUnits - ) + return bcode(ticker, period, propertyName, isRawValue, isWithUnits, param5) } /** + * **近日廃止予定です。** + * * 指定した項目の名称を日本語で取得します。 * + * @deprecated 近日廃止予定です * @param {"net_sales"} propertyName 項目名 * @return 指定した項目の名称 * @customfunction @@ -75,8 +72,11 @@ global.BCODE_LABEL = (propertyName: string): string => { } /** + * **近日廃止予定です。** + * * 指定した項目の単位を取得します。 * + * @deprecated 近日廃止予定です * @param {"net_sales"} propertyName 項目名 * @return 指定した項目の単位 * @customfunction From 8132afefb066a12e9752b64fb3eb2b98da1134f8 Mon Sep 17 00:00:00 2001 From: Akiomi Kamakura Date: Fri, 19 Nov 2021 16:41:17 +0900 Subject: [PATCH 2/2] Improve error handling --- src/custom-functions/bcode.ts | 4 +++- src/main.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/custom-functions/bcode.ts b/src/custom-functions/bcode.ts index 79bd1be..6246977 100644 --- a/src/custom-functions/bcode.ts +++ b/src/custom-functions/bcode.ts @@ -9,7 +9,9 @@ export function isV3Call( param1: string | number, param2: string | number ): boolean { - if (typeof param1 === 'number' || typeof param2 === 'number') { + if (param1 == undefined || param2 == undefined) { + throw new Error('引数が正しくありません') + } else if (typeof param1 === 'number' || typeof param2 === 'number') { return false } else if (param1 === '' || param2 === '') { return false diff --git a/src/main.ts b/src/main.ts index ffa0db4..0db9b6c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -58,7 +58,7 @@ global.BCODE = ( } /** - * **近日廃止予定です。** + * 近日廃止予定です。 * * 指定した項目の名称を日本語で取得します。 * @@ -72,7 +72,7 @@ global.BCODE_LABEL = (propertyName: string): string => { } /** - * **近日廃止予定です。** + * 近日廃止予定です。 * * 指定した項目の単位を取得します。 *