@oanda/labs-currency-cross-table 1.0.27 → 1.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,122 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 1.0.28 (2025-01-10)
7
+
8
+
9
+
10
+ ## 1.0.176 (2025-01-10)
11
+
12
+
13
+
14
+ ## 1.0.175 (2025-01-08)
15
+
16
+
17
+
18
+ ## 1.0.174 (2024-12-16)
19
+
20
+
21
+
22
+ ## 1.0.173 (2024-12-11)
23
+
24
+
25
+
26
+ ## 1.0.172 (2024-11-29)
27
+
28
+
29
+
30
+ ## 1.0.171 (2024-11-28)
31
+
32
+
33
+
34
+ ## 1.0.170 (2024-11-28)
35
+
36
+
37
+
38
+ ## 1.0.169 (2024-11-20)
39
+
40
+
41
+
42
+ ## 1.0.168 (2024-11-19)
43
+
44
+
45
+
46
+ ## 1.0.167 (2024-10-14)
47
+
48
+
49
+
50
+ ## 1.0.166 (2024-10-07)
51
+
52
+
53
+
54
+ ## 1.0.165 (2024-10-03)
55
+
56
+
57
+
58
+ ## 1.0.164 (2024-09-26)
59
+
60
+
61
+
62
+ ## 1.0.163 (2024-09-18)
63
+
64
+
65
+
66
+ ## 1.0.162 (2024-09-12)
67
+
68
+
69
+
70
+ ## 1.0.161 (2024-09-11)
71
+
72
+
73
+
74
+ ## 1.0.160 (2024-09-10)
75
+
76
+
77
+
78
+ ## 1.0.159 (2024-09-09)
79
+
80
+
81
+
82
+ ## 1.0.158 (2024-09-04)
83
+
84
+
85
+
86
+ ## 1.0.157 (2024-09-04)
87
+
88
+
89
+
90
+ ## 1.0.156 (2024-09-02)
91
+
92
+
93
+
94
+ ## 1.0.155 (2024-08-29)
95
+
96
+
97
+
98
+ ## 1.0.154 (2024-08-29)
99
+
100
+
101
+
102
+ ## 1.0.153 (2024-08-23)
103
+
104
+
105
+
106
+ ## 1.0.152 (2024-08-23)
107
+
108
+
109
+
110
+ ## 1.0.151 (2024-08-20)
111
+
112
+
113
+
114
+ ## 1.0.150 (2024-08-19)
115
+
116
+ **Note:** Version bump only for package @oanda/labs-currency-cross-table
117
+
118
+
119
+
120
+
121
+
6
122
  ## 1.0.27 (2025-01-10)
7
123
 
8
124
 
@@ -26,7 +26,7 @@ const getPriceMovement = _ref => {
26
26
  } = _ref;
27
27
  const roundedPrevious = getBuyPrice(previous, isReversed)?.toFixed(displayPrecision);
28
28
  const roundedUpdate = getBuyPrice(update, isReversed)?.toFixed(displayPrecision);
29
- if (roundedPrevious === roundedUpdate || update === undefined) {
29
+ if (roundedPrevious === roundedUpdate || update === undefined || previous === undefined) {
30
30
  return 0;
31
31
  }
32
32
  return roundedUpdate > roundedPrevious ? 1 : -1;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":["_constant","require","validCurrencies","currencies","every","currency","MAJOR_CURRENCIES","includes","exports","divisionMapper","division","currenciesToInstruments","pairs","reduce","acc","cV","index","array","unique","filter","_item","idx","map","el","getPriceMovement","_ref","previous","update","displayPrecision","isReversed","roundedPrevious","getBuyPrice","toFixed","roundedUpdate","undefined","price"],"sources":["../../../src/CurrencyCrossTableWidget/utils.ts"],"sourcesContent":["import type { Division } from '../gql/types/graphql';\nimport { MAJOR_CURRENCIES } from './constant';\n\nconst validCurrencies = (currencies: string[]) =>\n currencies.every((currency) => MAJOR_CURRENCIES.includes(currency));\n\nconst divisionMapper = (division: Division) => (division === 'OGM' ? '' : '_');\n\nconst currenciesToInstruments = (currencies: string[], division: Division) => {\n const pairs = currencies.reduce((acc, cV, index, array) => {\n const unique = array.filter((_item, idx) => index !== idx);\n\n return [\n ...acc,\n ...unique.map((el) => `${cV}${divisionMapper(division)}${el}`),\n ];\n }, [] as string[]);\n\n return pairs;\n};\n\nconst getPriceMovement = ({\n previous,\n update,\n displayPrecision,\n isReversed,\n}: {\n previous?: number;\n update?: number;\n displayPrecision?: number;\n isReversed: boolean;\n}) => {\n const roundedPrevious = getBuyPrice(previous, isReversed)?.toFixed(\n displayPrecision\n );\n const roundedUpdate = getBuyPrice(update, isReversed)?.toFixed(\n displayPrecision\n );\n\n if (roundedPrevious === roundedUpdate || update === undefined) {\n return 0;\n }\n\n return roundedUpdate > roundedPrevious ? 1 : -1;\n};\n\nconst getBuyPrice = (price: number | undefined, isReversed: boolean) => {\n if (price === undefined) return 0;\n\n return isReversed ? 1 / price : price;\n};\n\nexport {\n currenciesToInstruments,\n divisionMapper,\n getBuyPrice,\n getPriceMovement,\n validCurrencies,\n};\n"],"mappings":";;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AAEA,MAAMC,eAAe,GAAIC,UAAoB,IAC3CA,UAAU,CAACC,KAAK,CAAEC,QAAQ,IAAKC,0BAAgB,CAACC,QAAQ,CAACF,QAAQ,CAAC,CAAC;AAACG,OAAA,CAAAN,eAAA,GAAAA,eAAA;AAEtE,MAAMO,cAAc,GAAIC,QAAkB,IAAMA,QAAQ,KAAK,KAAK,GAAG,EAAE,GAAG,GAAI;AAACF,OAAA,CAAAC,cAAA,GAAAA,cAAA;AAE/E,MAAME,uBAAuB,GAAGA,CAACR,UAAoB,EAAEO,QAAkB,KAAK;EAC5E,MAAME,KAAK,GAAGT,UAAU,CAACU,MAAM,CAAC,CAACC,GAAG,EAAEC,EAAE,EAAEC,KAAK,EAAEC,KAAK,KAAK;IACzD,MAAMC,MAAM,GAAGD,KAAK,CAACE,MAAM,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAKL,KAAK,KAAKK,GAAG,CAAC;IAE1D,OAAO,CACL,GAAGP,GAAG,EACN,GAAGI,MAAM,CAACI,GAAG,CAAEC,EAAE,IAAK,GAAGR,EAAE,GAAGN,cAAc,CAACC,QAAQ,CAAC,GAAGa,EAAE,EAAE,CAAC,CAC/D;EACH,CAAC,EAAE,EAAc,CAAC;EAElB,OAAOX,KAAK;AACd,CAAC;AAACJ,OAAA,CAAAG,uBAAA,GAAAA,uBAAA;AAEF,MAAMa,gBAAgB,GAAGC,IAAA,IAUnB;EAAA,IAVoB;IACxBC,QAAQ;IACRC,MAAM;IACNC,gBAAgB;IAChBC;EAMF,CAAC,GAAAJ,IAAA;EACC,MAAMK,eAAe,GAAGC,WAAW,CAACL,QAAQ,EAAEG,UAAU,CAAC,EAAEG,OAAO,CAChEJ,gBACF,CAAC;EACD,MAAMK,aAAa,GAAGF,WAAW,CAACJ,MAAM,EAAEE,UAAU,CAAC,EAAEG,OAAO,CAC5DJ,gBACF,CAAC;EAED,IAAIE,eAAe,KAAKG,aAAa,IAAIN,MAAM,KAAKO,SAAS,EAAE;IAC7D,OAAO,CAAC;EACV;EAEA,OAAOD,aAAa,GAAGH,eAAe,GAAG,CAAC,GAAG,CAAC,CAAC;AACjD,CAAC;AAACtB,OAAA,CAAAgB,gBAAA,GAAAA,gBAAA;AAEF,MAAMO,WAAW,GAAGA,CAACI,KAAyB,EAAEN,UAAmB,KAAK;EACtE,IAAIM,KAAK,KAAKD,SAAS,EAAE,OAAO,CAAC;EAEjC,OAAOL,UAAU,GAAG,CAAC,GAAGM,KAAK,GAAGA,KAAK;AACvC,CAAC;AAAC3B,OAAA,CAAAuB,WAAA,GAAAA,WAAA","ignoreList":[]}
1
+ {"version":3,"file":"utils.js","names":["_constant","require","validCurrencies","currencies","every","currency","MAJOR_CURRENCIES","includes","exports","divisionMapper","division","currenciesToInstruments","pairs","reduce","acc","cV","index","array","unique","filter","_item","idx","map","el","getPriceMovement","_ref","previous","update","displayPrecision","isReversed","roundedPrevious","getBuyPrice","toFixed","roundedUpdate","undefined","price"],"sources":["../../../src/CurrencyCrossTableWidget/utils.ts"],"sourcesContent":["import type { Division } from '../gql/types/graphql';\nimport { MAJOR_CURRENCIES } from './constant';\n\nconst validCurrencies = (currencies: string[]) =>\n currencies.every((currency) => MAJOR_CURRENCIES.includes(currency));\n\nconst divisionMapper = (division: Division) => (division === 'OGM' ? '' : '_');\n\nconst currenciesToInstruments = (currencies: string[], division: Division) => {\n const pairs = currencies.reduce((acc, cV, index, array) => {\n const unique = array.filter((_item, idx) => index !== idx);\n\n return [\n ...acc,\n ...unique.map((el) => `${cV}${divisionMapper(division)}${el}`),\n ];\n }, [] as string[]);\n\n return pairs;\n};\n\nconst getPriceMovement = ({\n previous,\n update,\n displayPrecision,\n isReversed,\n}: {\n previous?: number;\n update?: number;\n displayPrecision?: number;\n isReversed: boolean;\n}) => {\n const roundedPrevious = getBuyPrice(previous, isReversed)?.toFixed(\n displayPrecision\n );\n const roundedUpdate = getBuyPrice(update, isReversed)?.toFixed(\n displayPrecision\n );\n\n if (\n roundedPrevious === roundedUpdate ||\n update === undefined ||\n previous === undefined\n ) {\n return 0;\n }\n\n return roundedUpdate > roundedPrevious ? 1 : -1;\n};\n\nconst getBuyPrice = (price: number | undefined, isReversed: boolean) => {\n if (price === undefined) return 0;\n\n return isReversed ? 1 / price : price;\n};\n\nexport {\n currenciesToInstruments,\n divisionMapper,\n getBuyPrice,\n getPriceMovement,\n validCurrencies,\n};\n"],"mappings":";;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AAEA,MAAMC,eAAe,GAAIC,UAAoB,IAC3CA,UAAU,CAACC,KAAK,CAAEC,QAAQ,IAAKC,0BAAgB,CAACC,QAAQ,CAACF,QAAQ,CAAC,CAAC;AAACG,OAAA,CAAAN,eAAA,GAAAA,eAAA;AAEtE,MAAMO,cAAc,GAAIC,QAAkB,IAAMA,QAAQ,KAAK,KAAK,GAAG,EAAE,GAAG,GAAI;AAACF,OAAA,CAAAC,cAAA,GAAAA,cAAA;AAE/E,MAAME,uBAAuB,GAAGA,CAACR,UAAoB,EAAEO,QAAkB,KAAK;EAC5E,MAAME,KAAK,GAAGT,UAAU,CAACU,MAAM,CAAC,CAACC,GAAG,EAAEC,EAAE,EAAEC,KAAK,EAAEC,KAAK,KAAK;IACzD,MAAMC,MAAM,GAAGD,KAAK,CAACE,MAAM,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAKL,KAAK,KAAKK,GAAG,CAAC;IAE1D,OAAO,CACL,GAAGP,GAAG,EACN,GAAGI,MAAM,CAACI,GAAG,CAAEC,EAAE,IAAK,GAAGR,EAAE,GAAGN,cAAc,CAACC,QAAQ,CAAC,GAAGa,EAAE,EAAE,CAAC,CAC/D;EACH,CAAC,EAAE,EAAc,CAAC;EAElB,OAAOX,KAAK;AACd,CAAC;AAACJ,OAAA,CAAAG,uBAAA,GAAAA,uBAAA;AAEF,MAAMa,gBAAgB,GAAGC,IAAA,IAUnB;EAAA,IAVoB;IACxBC,QAAQ;IACRC,MAAM;IACNC,gBAAgB;IAChBC;EAMF,CAAC,GAAAJ,IAAA;EACC,MAAMK,eAAe,GAAGC,WAAW,CAACL,QAAQ,EAAEG,UAAU,CAAC,EAAEG,OAAO,CAChEJ,gBACF,CAAC;EACD,MAAMK,aAAa,GAAGF,WAAW,CAACJ,MAAM,EAAEE,UAAU,CAAC,EAAEG,OAAO,CAC5DJ,gBACF,CAAC;EAED,IACEE,eAAe,KAAKG,aAAa,IACjCN,MAAM,KAAKO,SAAS,IACpBR,QAAQ,KAAKQ,SAAS,EACtB;IACA,OAAO,CAAC;EACV;EAEA,OAAOD,aAAa,GAAGH,eAAe,GAAG,CAAC,GAAG,CAAC,CAAC;AACjD,CAAC;AAACtB,OAAA,CAAAgB,gBAAA,GAAAA,gBAAA;AAEF,MAAMO,WAAW,GAAGA,CAACI,KAAyB,EAAEN,UAAmB,KAAK;EACtE,IAAIM,KAAK,KAAKD,SAAS,EAAE,OAAO,CAAC;EAEjC,OAAOL,UAAU,GAAG,CAAC,GAAGM,KAAK,GAAGA,KAAK;AACvC,CAAC;AAAC3B,OAAA,CAAAuB,WAAA,GAAAA,WAAA","ignoreList":[]}
@@ -17,7 +17,7 @@ const getPriceMovement = _ref => {
17
17
  } = _ref;
18
18
  const roundedPrevious = getBuyPrice(previous, isReversed)?.toFixed(displayPrecision);
19
19
  const roundedUpdate = getBuyPrice(update, isReversed)?.toFixed(displayPrecision);
20
- if (roundedPrevious === roundedUpdate || update === undefined) {
20
+ if (roundedPrevious === roundedUpdate || update === undefined || previous === undefined) {
21
21
  return 0;
22
22
  }
23
23
  return roundedUpdate > roundedPrevious ? 1 : -1;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":["MAJOR_CURRENCIES","validCurrencies","currencies","every","currency","includes","divisionMapper","division","currenciesToInstruments","pairs","reduce","acc","cV","index","array","unique","filter","_item","idx","map","el","getPriceMovement","_ref","previous","update","displayPrecision","isReversed","roundedPrevious","getBuyPrice","toFixed","roundedUpdate","undefined","price"],"sources":["../../../src/CurrencyCrossTableWidget/utils.ts"],"sourcesContent":["import type { Division } from '../gql/types/graphql';\nimport { MAJOR_CURRENCIES } from './constant';\n\nconst validCurrencies = (currencies: string[]) =>\n currencies.every((currency) => MAJOR_CURRENCIES.includes(currency));\n\nconst divisionMapper = (division: Division) => (division === 'OGM' ? '' : '_');\n\nconst currenciesToInstruments = (currencies: string[], division: Division) => {\n const pairs = currencies.reduce((acc, cV, index, array) => {\n const unique = array.filter((_item, idx) => index !== idx);\n\n return [\n ...acc,\n ...unique.map((el) => `${cV}${divisionMapper(division)}${el}`),\n ];\n }, [] as string[]);\n\n return pairs;\n};\n\nconst getPriceMovement = ({\n previous,\n update,\n displayPrecision,\n isReversed,\n}: {\n previous?: number;\n update?: number;\n displayPrecision?: number;\n isReversed: boolean;\n}) => {\n const roundedPrevious = getBuyPrice(previous, isReversed)?.toFixed(\n displayPrecision\n );\n const roundedUpdate = getBuyPrice(update, isReversed)?.toFixed(\n displayPrecision\n );\n\n if (roundedPrevious === roundedUpdate || update === undefined) {\n return 0;\n }\n\n return roundedUpdate > roundedPrevious ? 1 : -1;\n};\n\nconst getBuyPrice = (price: number | undefined, isReversed: boolean) => {\n if (price === undefined) return 0;\n\n return isReversed ? 1 / price : price;\n};\n\nexport {\n currenciesToInstruments,\n divisionMapper,\n getBuyPrice,\n getPriceMovement,\n validCurrencies,\n};\n"],"mappings":"AACA,SAASA,gBAAgB,QAAQ,YAAY;AAE7C,MAAMC,eAAe,GAAIC,UAAoB,IAC3CA,UAAU,CAACC,KAAK,CAAEC,QAAQ,IAAKJ,gBAAgB,CAACK,QAAQ,CAACD,QAAQ,CAAC,CAAC;AAErE,MAAME,cAAc,GAAIC,QAAkB,IAAMA,QAAQ,KAAK,KAAK,GAAG,EAAE,GAAG,GAAI;AAE9E,MAAMC,uBAAuB,GAAGA,CAACN,UAAoB,EAAEK,QAAkB,KAAK;EAC5E,MAAME,KAAK,GAAGP,UAAU,CAACQ,MAAM,CAAC,CAACC,GAAG,EAAEC,EAAE,EAAEC,KAAK,EAAEC,KAAK,KAAK;IACzD,MAAMC,MAAM,GAAGD,KAAK,CAACE,MAAM,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAKL,KAAK,KAAKK,GAAG,CAAC;IAE1D,OAAO,CACL,GAAGP,GAAG,EACN,GAAGI,MAAM,CAACI,GAAG,CAAEC,EAAE,IAAK,GAAGR,EAAE,GAAGN,cAAc,CAACC,QAAQ,CAAC,GAAGa,EAAE,EAAE,CAAC,CAC/D;EACH,CAAC,EAAE,EAAc,CAAC;EAElB,OAAOX,KAAK;AACd,CAAC;AAED,MAAMY,gBAAgB,GAAGC,IAAA,IAUnB;EAAA,IAVoB;IACxBC,QAAQ;IACRC,MAAM;IACNC,gBAAgB;IAChBC;EAMF,CAAC,GAAAJ,IAAA;EACC,MAAMK,eAAe,GAAGC,WAAW,CAACL,QAAQ,EAAEG,UAAU,CAAC,EAAEG,OAAO,CAChEJ,gBACF,CAAC;EACD,MAAMK,aAAa,GAAGF,WAAW,CAACJ,MAAM,EAAEE,UAAU,CAAC,EAAEG,OAAO,CAC5DJ,gBACF,CAAC;EAED,IAAIE,eAAe,KAAKG,aAAa,IAAIN,MAAM,KAAKO,SAAS,EAAE;IAC7D,OAAO,CAAC;EACV;EAEA,OAAOD,aAAa,GAAGH,eAAe,GAAG,CAAC,GAAG,CAAC,CAAC;AACjD,CAAC;AAED,MAAMC,WAAW,GAAGA,CAACI,KAAyB,EAAEN,UAAmB,KAAK;EACtE,IAAIM,KAAK,KAAKD,SAAS,EAAE,OAAO,CAAC;EAEjC,OAAOL,UAAU,GAAG,CAAC,GAAGM,KAAK,GAAGA,KAAK;AACvC,CAAC;AAED,SACExB,uBAAuB,EACvBF,cAAc,EACdsB,WAAW,EACXP,gBAAgB,EAChBpB,eAAe","ignoreList":[]}
1
+ {"version":3,"file":"utils.js","names":["MAJOR_CURRENCIES","validCurrencies","currencies","every","currency","includes","divisionMapper","division","currenciesToInstruments","pairs","reduce","acc","cV","index","array","unique","filter","_item","idx","map","el","getPriceMovement","_ref","previous","update","displayPrecision","isReversed","roundedPrevious","getBuyPrice","toFixed","roundedUpdate","undefined","price"],"sources":["../../../src/CurrencyCrossTableWidget/utils.ts"],"sourcesContent":["import type { Division } from '../gql/types/graphql';\nimport { MAJOR_CURRENCIES } from './constant';\n\nconst validCurrencies = (currencies: string[]) =>\n currencies.every((currency) => MAJOR_CURRENCIES.includes(currency));\n\nconst divisionMapper = (division: Division) => (division === 'OGM' ? '' : '_');\n\nconst currenciesToInstruments = (currencies: string[], division: Division) => {\n const pairs = currencies.reduce((acc, cV, index, array) => {\n const unique = array.filter((_item, idx) => index !== idx);\n\n return [\n ...acc,\n ...unique.map((el) => `${cV}${divisionMapper(division)}${el}`),\n ];\n }, [] as string[]);\n\n return pairs;\n};\n\nconst getPriceMovement = ({\n previous,\n update,\n displayPrecision,\n isReversed,\n}: {\n previous?: number;\n update?: number;\n displayPrecision?: number;\n isReversed: boolean;\n}) => {\n const roundedPrevious = getBuyPrice(previous, isReversed)?.toFixed(\n displayPrecision\n );\n const roundedUpdate = getBuyPrice(update, isReversed)?.toFixed(\n displayPrecision\n );\n\n if (\n roundedPrevious === roundedUpdate ||\n update === undefined ||\n previous === undefined\n ) {\n return 0;\n }\n\n return roundedUpdate > roundedPrevious ? 1 : -1;\n};\n\nconst getBuyPrice = (price: number | undefined, isReversed: boolean) => {\n if (price === undefined) return 0;\n\n return isReversed ? 1 / price : price;\n};\n\nexport {\n currenciesToInstruments,\n divisionMapper,\n getBuyPrice,\n getPriceMovement,\n validCurrencies,\n};\n"],"mappings":"AACA,SAASA,gBAAgB,QAAQ,YAAY;AAE7C,MAAMC,eAAe,GAAIC,UAAoB,IAC3CA,UAAU,CAACC,KAAK,CAAEC,QAAQ,IAAKJ,gBAAgB,CAACK,QAAQ,CAACD,QAAQ,CAAC,CAAC;AAErE,MAAME,cAAc,GAAIC,QAAkB,IAAMA,QAAQ,KAAK,KAAK,GAAG,EAAE,GAAG,GAAI;AAE9E,MAAMC,uBAAuB,GAAGA,CAACN,UAAoB,EAAEK,QAAkB,KAAK;EAC5E,MAAME,KAAK,GAAGP,UAAU,CAACQ,MAAM,CAAC,CAACC,GAAG,EAAEC,EAAE,EAAEC,KAAK,EAAEC,KAAK,KAAK;IACzD,MAAMC,MAAM,GAAGD,KAAK,CAACE,MAAM,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAKL,KAAK,KAAKK,GAAG,CAAC;IAE1D,OAAO,CACL,GAAGP,GAAG,EACN,GAAGI,MAAM,CAACI,GAAG,CAAEC,EAAE,IAAK,GAAGR,EAAE,GAAGN,cAAc,CAACC,QAAQ,CAAC,GAAGa,EAAE,EAAE,CAAC,CAC/D;EACH,CAAC,EAAE,EAAc,CAAC;EAElB,OAAOX,KAAK;AACd,CAAC;AAED,MAAMY,gBAAgB,GAAGC,IAAA,IAUnB;EAAA,IAVoB;IACxBC,QAAQ;IACRC,MAAM;IACNC,gBAAgB;IAChBC;EAMF,CAAC,GAAAJ,IAAA;EACC,MAAMK,eAAe,GAAGC,WAAW,CAACL,QAAQ,EAAEG,UAAU,CAAC,EAAEG,OAAO,CAChEJ,gBACF,CAAC;EACD,MAAMK,aAAa,GAAGF,WAAW,CAACJ,MAAM,EAAEE,UAAU,CAAC,EAAEG,OAAO,CAC5DJ,gBACF,CAAC;EAED,IACEE,eAAe,KAAKG,aAAa,IACjCN,MAAM,KAAKO,SAAS,IACpBR,QAAQ,KAAKQ,SAAS,EACtB;IACA,OAAO,CAAC;EACV;EAEA,OAAOD,aAAa,GAAGH,eAAe,GAAG,CAAC,GAAG,CAAC,CAAC;AACjD,CAAC;AAED,MAAMC,WAAW,GAAGA,CAACI,KAAyB,EAAEN,UAAmB,KAAK;EACtE,IAAIM,KAAK,KAAKD,SAAS,EAAE,OAAO,CAAC;EAEjC,OAAOL,UAAU,GAAG,CAAC,GAAGM,KAAK,GAAGA,KAAK;AACvC,CAAC;AAED,SACExB,uBAAuB,EACvBF,cAAc,EACdsB,WAAW,EACXP,gBAAgB,EAChBpB,eAAe","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oanda/labs-currency-cross-table",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "Labs Currency Cross Table",
5
5
  "main": "dist/main/index.js",
6
6
  "module": "dist/module/index.js",
@@ -12,7 +12,7 @@
12
12
  "author": "OANDA",
13
13
  "license": "UNLICENSED",
14
14
  "dependencies": {
15
- "@oanda/labs-widget-common": "^1.0.176",
15
+ "@oanda/labs-widget-common": "^1.0.177",
16
16
  "@oanda/mono-i18n": "10.0.1",
17
17
  "graphql": "16.8.1"
18
18
  },
@@ -20,5 +20,5 @@
20
20
  "@graphql-codegen/cli": "5.0.0",
21
21
  "@graphql-codegen/client-preset": "4.1.0"
22
22
  },
23
- "gitHead": "1f4de950884abacb03c4a930e3d2984f433ff6ec"
23
+ "gitHead": "e1568a944573675226db214bea0022af67a3ca2f"
24
24
  }
@@ -37,7 +37,11 @@ const getPriceMovement = ({
37
37
  displayPrecision
38
38
  );
39
39
 
40
- if (roundedPrevious === roundedUpdate || update === undefined) {
40
+ if (
41
+ roundedPrevious === roundedUpdate ||
42
+ update === undefined ||
43
+ previous === undefined
44
+ ) {
41
45
  return 0;
42
46
  }
43
47
 
@@ -154,6 +154,7 @@ describe('getPriceMovement()', () => {
154
154
  [1, 163.204, 163.173, 6, true],
155
155
  [0, 163.219, 163.219, 3, false],
156
156
  [0, 163.219, 163.22, 6, true],
157
+ [0, undefined, 163.22, 2, false],
157
158
  ])(
158
159
  'should return %s when previous = %s, update = %s, displayPrecision = %s, isReversed = %s',
159
160
  (expected, previous, update, displayPrecision, isReversed) => {