@watsonserve/stock-base 0.0.19 → 0.0.20
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/dao.js +2 -2
- package/package.json +1 -1
- package/types/dao.d.ts +1 -0
package/dao.js
CHANGED
|
@@ -53,7 +53,7 @@ export function toBonusPoint(fullNc, data) {
|
|
|
53
53
|
.floatField('radio', ratio)
|
|
54
54
|
.timestamp(ex);
|
|
55
55
|
}
|
|
56
|
-
function groupBy(key, list, delKey = false) {
|
|
56
|
+
export function groupBy(key, list, delKey = false) {
|
|
57
57
|
return list.reduce((pre, item) => {
|
|
58
58
|
const foo = item[key];
|
|
59
59
|
const fooList = pre[foo] || [];
|
|
@@ -156,7 +156,7 @@ export class InfluxDAO {
|
|
|
156
156
|
});
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
|
-
static ignore = new Set(['BRK.B']);
|
|
159
|
+
static ignore = new Set(['BRK.B.US', 'BRK_B.US']);
|
|
160
160
|
async readDividend(ncs) {
|
|
161
161
|
const divs = await this._readDividend(ncs);
|
|
162
162
|
// const none = ncs.filter(nc => !divs[nc]);
|
package/package.json
CHANGED
package/types/dao.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export declare function toFxPoint(sgd: number, hkd: number, cny: number, timesta
|
|
|
29
29
|
export declare function toStockPoint(market: EnMarket, st: IStock, timestamp: number): Point;
|
|
30
30
|
export declare function toDivPoints(market: string, nc: string, data: IDividend): Point[];
|
|
31
31
|
export declare function toBonusPoint(fullNc: string, data: IDividend): Point;
|
|
32
|
+
export declare function groupBy<T extends Record<string, any>>(key: string, list: T[], delKey?: boolean): Record<string, T[]>;
|
|
32
33
|
export declare class InfluxDAO {
|
|
33
34
|
private origin;
|
|
34
35
|
private org;
|