From 5db8c63bffcfcc41f4107a935da644c448167357 Mon Sep 17 00:00:00 2001 From: Akiomi Kamakura Date: Fri, 5 Nov 2021 19:02:25 +0900 Subject: [PATCH] Move current bcode functions to v2 namespace --- src/custom-functions/bcode.ts | 2 +- src/custom-functions/{ => v2}/bcode-indicator.test.ts | 2 +- src/custom-functions/{ => v2}/bcode-indicator.ts | 0 src/custom-functions/{ => v2}/bcode-quarter.test.ts | 2 +- src/custom-functions/{ => v2}/bcode-quarter.ts | 0 src/custom-functions/{bcode-v2.ts => v2/bcode.ts} | 6 +++--- 6 files changed, 6 insertions(+), 6 deletions(-) rename src/custom-functions/{ => v2}/bcode-indicator.test.ts (95%) rename src/custom-functions/{ => v2}/bcode-indicator.ts (100%) rename src/custom-functions/{ => v2}/bcode-quarter.test.ts (97%) rename src/custom-functions/{ => v2}/bcode-quarter.ts (100%) rename src/custom-functions/{bcode-v2.ts => v2/bcode.ts} (96%) diff --git a/src/custom-functions/bcode.ts b/src/custom-functions/bcode.ts index 90cf674..74d1594 100644 --- a/src/custom-functions/bcode.ts +++ b/src/custom-functions/bcode.ts @@ -1,4 +1,4 @@ -import { bcodeV2 } from '~/custom-functions/bcode-v2' +import { bcode as bcodeV2 } from '~/custom-functions/v2/bcode' export function castStringAsBoolean(bool: string | boolean): boolean { return typeof bool === 'string' ? bool.toLowerCase() === 'true' : bool diff --git a/src/custom-functions/bcode-indicator.test.ts b/src/custom-functions/v2/bcode-indicator.test.ts similarity index 95% rename from src/custom-functions/bcode-indicator.test.ts rename to src/custom-functions/v2/bcode-indicator.test.ts index 90c907e..9af9c3c 100644 --- a/src/custom-functions/bcode-indicator.test.ts +++ b/src/custom-functions/v2/bcode-indicator.test.ts @@ -1,6 +1,6 @@ import { CachingBuffettCodeApiClientV2 } from '~/api/v2/caching-client' -import { bcodeIndicator } from '~/custom-functions/bcode-indicator' import { BcodeResult } from '~/custom-functions/bcode-result' +import { bcodeIndicator } from '~/custom-functions/v2/bcode-indicator' import { IndicatorCache } from '~/services/indicator-cache' import { IndicatorPropertyCache } from '~/services/indicator-property-cache' diff --git a/src/custom-functions/bcode-indicator.ts b/src/custom-functions/v2/bcode-indicator.ts similarity index 100% rename from src/custom-functions/bcode-indicator.ts rename to src/custom-functions/v2/bcode-indicator.ts diff --git a/src/custom-functions/bcode-quarter.test.ts b/src/custom-functions/v2/bcode-quarter.test.ts similarity index 97% rename from src/custom-functions/bcode-quarter.test.ts rename to src/custom-functions/v2/bcode-quarter.test.ts index 26fdc77..8493694 100644 --- a/src/custom-functions/bcode-quarter.test.ts +++ b/src/custom-functions/v2/bcode-quarter.test.ts @@ -1,7 +1,7 @@ import { QuarterCache } from '~/__mocks__/services/quarter-cache' import { CachingBuffettCodeApiClientV2 } from '~/api/v2/caching-client' -import { bcodeQuarter } from '~/custom-functions/bcode-quarter' import { BcodeResult } from '~/custom-functions/bcode-result' +import { bcodeQuarter } from '~/custom-functions/v2/bcode-quarter' import { YearQuarter } from '~/fiscal-periods/year-quarter' import { QuarterPropertyCache } from '~/services/quarter-property-cache' diff --git a/src/custom-functions/bcode-quarter.ts b/src/custom-functions/v2/bcode-quarter.ts similarity index 100% rename from src/custom-functions/bcode-quarter.ts rename to src/custom-functions/v2/bcode-quarter.ts diff --git a/src/custom-functions/bcode-v2.ts b/src/custom-functions/v2/bcode.ts similarity index 96% rename from src/custom-functions/bcode-v2.ts rename to src/custom-functions/v2/bcode.ts index 9475aa2..7b320dd 100644 --- a/src/custom-functions/bcode-v2.ts +++ b/src/custom-functions/v2/bcode.ts @@ -2,14 +2,14 @@ import { HttpError } from '~/api/http-error' import { CachingBuffettCodeApiClientV2 } from '~/api/v2/caching-client' import { CachingIndicatorProperty } from '~/api/v2/caching-indicator-property' import { QuarterProperty } from '~/api/v2/quarter-property' -import { bcodeIndicator } from '~/custom-functions/bcode-indicator' -import { bcodeQuarter } from '~/custom-functions/bcode-quarter' import { BcodeResult } from '~/custom-functions/bcode-result' import { ApiResponseError, OndemandApiNotEnabledError, UnsupportedTickerError } from '~/custom-functions/error' +import { bcodeIndicator } from '~/custom-functions/v2/bcode-indicator' +import { bcodeQuarter } from '~/custom-functions/v2/bcode-quarter' import { InvalidLYLQError, InvalidYearError, @@ -43,7 +43,7 @@ function validate( // TODO: エラーハンドリングの改善 // TODO: fiscalYearとfiscalQuarterの型をstringではなく'LY'と'LQ'に変更する -export function bcodeV2( +export function bcode( ticker: string, fiscalYear: string | number, fiscalQuarter: string | number,