Skip to content

Commit 90d3b6b

Browse files
committed
Release. Bump version number
1 parent 75e8901 commit 90d3b6b

File tree

5 files changed

+106
-4
lines changed

5 files changed

+106
-4
lines changed

docs/_coverpage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Barchart Market Data SDK <small>JavaScript 6.2.4</small>
1+
# Barchart Market Data SDK <small>JavaScript 6.2.5</small>
22

33
> Inject real-time market data into your JavaScript applications
44

example/browser/example.js

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5310,7 +5310,7 @@ module.exports = (() => {
53105310
'use strict';
53115311

53125312
return {
5313-
version: '6.2.4'
5313+
version: '6.2.5'
53145314
};
53155315
})();
53165316

@@ -7379,6 +7379,20 @@ module.exports = (() => {
73797379
return '[SymbolParser]';
73807380
}
73817381
}
7382+
const distantFuturesMonths = {
7383+
F: 'A',
7384+
G: 'B',
7385+
H: 'C',
7386+
J: 'D',
7387+
K: 'E',
7388+
M: 'I',
7389+
N: 'L',
7390+
Q: 'O',
7391+
U: 'P',
7392+
V: 'R',
7393+
X: 'S',
7394+
Z: 'T'
7395+
};
73827396
const alternateFuturesMonths = {
73837397
A: 'F',
73847398
B: 'G',
@@ -7583,6 +7597,24 @@ module.exports = (() => {
75837597
return definition;
75847598
});
75857599
const converters = [];
7600+
converters.push(symbol => {
7601+
let converted = null;
7602+
if (SymbolParser.getIsFuture(symbol) && SymbolParser.getIsConcrete(symbol)) {
7603+
const matches = symbol.match(types.futures.concrete);
7604+
if (matches !== null) {
7605+
const root = matches[1];
7606+
const month = matches[2];
7607+
const year = getFuturesYear(matches[3], month);
7608+
if (year > getCurrentYear() + 9) {
7609+
const distant = distantFuturesMonths[month];
7610+
if (distant) {
7611+
converted = `${root}${distant}${getYearDigits(year, 1)}`;
7612+
}
7613+
}
7614+
}
7615+
}
7616+
return converted;
7617+
});
75867618
converters.push(symbol => {
75877619
let converted = null;
75887620
if (SymbolParser.getIsFuture(symbol) && SymbolParser.getIsConcrete(symbol)) {

lib/meta.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ module.exports = (() => {
22
'use strict';
33

44
return {
5-
version: '6.2.4'
5+
version: '6.2.5'
66
};
77
})();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@barchart/marketdata-api-js",
3-
"version": "6.2.4",
3+
"version": "6.2.5",
44
"description": "SDK for streaming market data from Barchart.com",
55
"author": {
66
"name": "Eero Pikat",

test/dist/barchart-marketdata-api-tests-6.js

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3016,6 +3016,20 @@ module.exports = (() => {
30163016
return '[SymbolParser]';
30173017
}
30183018
}
3019+
const distantFuturesMonths = {
3020+
F: 'A',
3021+
G: 'B',
3022+
H: 'C',
3023+
J: 'D',
3024+
K: 'E',
3025+
M: 'I',
3026+
N: 'L',
3027+
Q: 'O',
3028+
U: 'P',
3029+
V: 'R',
3030+
X: 'S',
3031+
Z: 'T'
3032+
};
30193033
const alternateFuturesMonths = {
30203034
A: 'F',
30213035
B: 'G',
@@ -3220,6 +3234,24 @@ module.exports = (() => {
32203234
return definition;
32213235
});
32223236
const converters = [];
3237+
converters.push(symbol => {
3238+
let converted = null;
3239+
if (SymbolParser.getIsFuture(symbol) && SymbolParser.getIsConcrete(symbol)) {
3240+
const matches = symbol.match(types.futures.concrete);
3241+
if (matches !== null) {
3242+
const root = matches[1];
3243+
const month = matches[2];
3244+
const year = getFuturesYear(matches[3], month);
3245+
if (year > getCurrentYear() + 9) {
3246+
const distant = distantFuturesMonths[month];
3247+
if (distant) {
3248+
converted = `${root}${distant}${getYearDigits(year, 1)}`;
3249+
}
3250+
}
3251+
}
3252+
}
3253+
return converted;
3254+
});
32233255
converters.push(symbol => {
32243256
let converted = null;
32253257
if (SymbolParser.getIsFuture(symbol) && SymbolParser.getIsConcrete(symbol)) {
@@ -16641,6 +16673,44 @@ describe('When checking the display format for the symbol', () => {
1664116673
});
1664216674
});
1664316675
describe('When getting a producer symbol', () => {
16676+
describe('When the year distant (futures expiration in 10 or more years)', () => {
16677+
it('CLG2034 should map to CLB4', () => {
16678+
expect(SymbolParser.getProducerSymbol('CLG2034')).toEqual('CLB4');
16679+
});
16680+
it('CLG34 should map to CLB4', () => {
16681+
expect(SymbolParser.getProducerSymbol('CLG34')).toEqual('CLB4');
16682+
});
16683+
it('CLH35 should map to CLC5', () => {
16684+
expect(SymbolParser.getProducerSymbol('CLH35')).toEqual('CLC5');
16685+
});
16686+
it('CLJ36 should map to CLD6', () => {
16687+
expect(SymbolParser.getProducerSymbol('CLJ36')).toEqual('CLD6');
16688+
});
16689+
it('CLK37 should map to CLE7', () => {
16690+
expect(SymbolParser.getProducerSymbol('CLK37')).toEqual('CLE7');
16691+
});
16692+
it('CLM38 should map to CLI8', () => {
16693+
expect(SymbolParser.getProducerSymbol('CLM38')).toEqual('CLI8');
16694+
});
16695+
it('CLN39 should map to CLL9', () => {
16696+
expect(SymbolParser.getProducerSymbol('CLN39')).toEqual('CLL9');
16697+
});
16698+
it('CLQ40 should map to CLO0', () => {
16699+
expect(SymbolParser.getProducerSymbol('CLQ40')).toEqual('CLO0');
16700+
});
16701+
it('CLU41 should map to CLP1', () => {
16702+
expect(SymbolParser.getProducerSymbol('CLU41')).toEqual('CLP1');
16703+
});
16704+
it('CLV42 should map to CLR2', () => {
16705+
expect(SymbolParser.getProducerSymbol('CLV42')).toEqual('CLR2');
16706+
});
16707+
it('CLX43 should map to CLS3', () => {
16708+
expect(SymbolParser.getProducerSymbol('CLX43')).toEqual('CLS3');
16709+
});
16710+
it('CLZ44 should map to CLT4', () => {
16711+
expect(SymbolParser.getProducerSymbol('CLZ44')).toEqual('CLT4');
16712+
});
16713+
});
1664416714
describe('When the year is unimportant', () => {
1664516715
it('TSLA should map to TSLA', () => {
1664616716
expect(SymbolParser.getProducerSymbol('TSLA')).toEqual('TSLA');

0 commit comments

Comments
 (0)