Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.

Commit 021433f

Browse files
authored
Merge pull request #79 from BuffettCode/development
Release v13
2 parents 0b2623c + 65e289b commit 021433f

4 files changed

Lines changed: 7 additions & 8 deletions

File tree

src/custom-functions/bcode.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ test('isV3Call', () => {
2929
expect(isV3Call('2020Q1', 'net_sales')).toBeTruthy()
3030
expect(isV3Call('LYLQ', 'net_sales')).toBeTruthy()
3131
expect(isV3Call('2020-09-06', 'market_capital')).toBeTruthy()
32+
expect(isV3Call('latest', 'market_capital')).toBeTruthy()
3233
})

src/fiscal-periods/period-parser.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ test('parse', () => {
1313
expect(PeriodParser.parse('2020LQ')).toEqual(new YearQuarterParam(2020, LQ))
1414
expect(PeriodParser.parse('LYQ3')).toEqual(new YearQuarterParam(LY, 3))
1515
expect(PeriodParser.parse('LYLQ')).toEqual(new YearQuarterParam(LY, LQ))
16+
expect(PeriodParser.parse('lylq')).toEqual(new YearQuarterParam(LY, LQ))
1617
expect(PeriodParser.parse('LY-1Q4')).toEqual(new YearQuarterParam(new LyWithOffset(-1), 4))
1718
expect(PeriodParser.parse('2020LQ-1')).toEqual(new YearQuarterParam(2020, new LqWithOffset(-1)))
1819
expect(PeriodParser.parse('LY-1LQ-1')).toEqual(new YearQuarterParam(new LyWithOffset(-1), new LqWithOffset(-1)))
20+
expect(PeriodParser.parse('ly-1lq-1')).toEqual(new YearQuarterParam(new LyWithOffset(-1), new LqWithOffset(-1)))
1921
expect(PeriodParser.parse('2020-09-06')).toEqual(new DateParam(new Date('2020-09-06')))
22+
expect(PeriodParser.parse('latest')).toEqual(new DateParam('latest'))
23+
expect(PeriodParser.parse('Latest')).toEqual(new DateParam('latest'))
2024
expect(() => PeriodParser.parse('foo')).toThrow(ParseError)
2125
expect(() => PeriodParser.parse('2020/09/06')).toThrow(ParseError)
22-
expect(() => PeriodParser.parse('latest')).toThrow(ParseError)
2326
expect(() => PeriodParser.parse('0Q1')).toThrow(ParseError)
2427
})

src/fiscal-periods/period-parser.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,14 @@ export class PeriodParser {
88
}
99

1010
static parse(str: string): DateParam | YearQuarterParam {
11-
str = str.toUpperCase()
12-
1311
try {
1412
return YearQuarterParam.parse(str)
1513
} catch {
1614
// noop
1715
}
1816

1917
try {
20-
const date = DateParam.parse(str)
21-
if (!date.isLatest()) {
22-
return date
23-
}
18+
return DateParam.parse(str)
2419
} catch {
2520
// noop
2621
}

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const version = 'v12'
1+
export const version = 'v13'

0 commit comments

Comments
 (0)