@fugle/node-twstock 3.0.0-alpha.2 → 3.0.0-alpha.3
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/README.md
CHANGED
|
@@ -895,8 +895,8 @@ twstock.stocks.splits({ startDate: '2022-07-01', endDate: '2022-07-31', exchange
|
|
|
895
895
|
* `haltDate`: {string} 停止買賣日期
|
|
896
896
|
* `resumeDate`: {string} 恢復買賣日期
|
|
897
897
|
* `splitRatio`: {number} 每股換發新股比例
|
|
898
|
-
* `
|
|
899
|
-
* `
|
|
898
|
+
* `parValueBefore`: {number} 變更前面額 (元)
|
|
899
|
+
* `parValueAfter`: {number} 變更後面額 (元)
|
|
900
900
|
* `referencePrice`: {number} 恢復買賣參考價 (TPEx 提供,TWSE 為 null)
|
|
901
901
|
* **當 `includeDetail=true` 時 (僅適用於 TWSE),額外包含以下欄位:**
|
|
902
902
|
* `sharesPerOldShare`: {number} 每股換發新股票
|
|
@@ -913,8 +913,8 @@ twstock.stocks.splitAnnouncement({ symbol: '1234' })
|
|
|
913
913
|
// haltDate: '2026-01-15',
|
|
914
914
|
// resumeDate: '2026-01-25',
|
|
915
915
|
// splitRatio: 0.5,
|
|
916
|
-
//
|
|
917
|
-
//
|
|
916
|
+
// parValueBefore: 10,
|
|
917
|
+
// parValueAfter: 5
|
|
918
918
|
// }
|
|
919
919
|
// ]
|
|
920
920
|
```
|
|
@@ -5,7 +5,7 @@ export interface StocksSplitAnnouncement {
|
|
|
5
5
|
haltDate: string;
|
|
6
6
|
resumeDate: string;
|
|
7
7
|
splitRatio: number | null;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
parValueBefore: number | null;
|
|
9
|
+
parValueAfter: number | null;
|
|
10
10
|
sharesPerOldShare?: number | null;
|
|
11
11
|
}
|
|
@@ -690,7 +690,7 @@ class TpexScraper extends scraper_1.Scraper {
|
|
|
690
690
|
if (!json)
|
|
691
691
|
return [];
|
|
692
692
|
const data = json.tables[0].data.map((row) => {
|
|
693
|
-
const [symbol, name, haltDate, splitRatio,
|
|
693
|
+
const [symbol, name, haltDate, splitRatio, parValueBefore, parValueAfter, resumeDate,] = row;
|
|
694
694
|
return {
|
|
695
695
|
symbol,
|
|
696
696
|
name: name.trim(),
|
|
@@ -698,8 +698,8 @@ class TpexScraper extends scraper_1.Scraper {
|
|
|
698
698
|
haltDate: (0, utils_1.rocToWestern)(haltDate),
|
|
699
699
|
resumeDate: (0, utils_1.rocToWestern)(resumeDate),
|
|
700
700
|
splitRatio: (0, utils_1.parseNumeric)(splitRatio),
|
|
701
|
-
|
|
702
|
-
|
|
701
|
+
parValueBefore: (0, utils_1.parseNumeric)(parValueBefore),
|
|
702
|
+
parValueAfter: (0, utils_1.parseNumeric)(parValueAfter),
|
|
703
703
|
};
|
|
704
704
|
});
|
|
705
705
|
return filterSymbol
|
|
@@ -505,8 +505,8 @@ class TwseScraper extends scraper_1.Scraper {
|
|
|
505
505
|
data.name = name.trim();
|
|
506
506
|
data.haltDate = (0, utils_1.rocToWestern)(values[0]);
|
|
507
507
|
data.sharesPerOldShare = (0, utils_1.parseNumeric)(values[1]);
|
|
508
|
-
data.
|
|
509
|
-
data.
|
|
508
|
+
data.parValueBefore = (0, utils_1.parseNumeric)(values[2]);
|
|
509
|
+
data.parValueAfter = (0, utils_1.parseNumeric)(values[3]);
|
|
510
510
|
return data;
|
|
511
511
|
}
|
|
512
512
|
async fetchStocksCapitalReductionAnnouncement(options) {
|
|
@@ -636,7 +636,7 @@ class TwseScraper extends scraper_1.Scraper {
|
|
|
636
636
|
if (!json || !json.data)
|
|
637
637
|
return [];
|
|
638
638
|
const data = await Promise.all(json.data.map(async (row) => {
|
|
639
|
-
const [haltDate, symbol, name, resumeDate, splitRatio,
|
|
639
|
+
const [haltDate, symbol, name, resumeDate, splitRatio, parValueBefore, parValueAfter, detailField1, // row[7]: "7780 ,20251230"
|
|
640
640
|
detailField2, // row[8]: "7780 ,20260109,20260119"
|
|
641
641
|
detailField3 // row[9]: ",10.00,1.00"
|
|
642
642
|
] = row;
|
|
@@ -647,8 +647,8 @@ class TwseScraper extends scraper_1.Scraper {
|
|
|
647
647
|
data.haltDate = (0, utils_1.rocToWestern)(haltDate);
|
|
648
648
|
data.resumeDate = (0, utils_1.rocToWestern)(resumeDate);
|
|
649
649
|
data.splitRatio = (0, utils_1.parseNumeric)(splitRatio);
|
|
650
|
-
data.
|
|
651
|
-
data.
|
|
650
|
+
data.parValueBefore = (0, utils_1.parseNumeric)(parValueBefore);
|
|
651
|
+
data.parValueAfter = (0, utils_1.parseNumeric)(parValueAfter);
|
|
652
652
|
// Extract detail query date from detailField1 (format: "symbol,date")
|
|
653
653
|
// Example: "7780 ,20251230" → extract "20251230"
|
|
654
654
|
let detailQueryDate;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fugle/node-twstock",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.3",
|
|
4
4
|
"description": "A client library for scraping Taiwan stock market data",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@commitlint/cli": "^16.3.0",
|
|
50
50
|
"@commitlint/config-conventional": "^16.2.4",
|
|
51
51
|
"@release-it/conventional-changelog": "^5.1.1",
|
|
52
|
-
"@types/jest": "^
|
|
52
|
+
"@types/jest": "^30.0.0",
|
|
53
53
|
"@types/lodash": "^4.14.200",
|
|
54
54
|
"@types/luxon": "^3.3.6",
|
|
55
55
|
"@types/node": "^16.18.18",
|
|
@@ -59,11 +59,11 @@
|
|
|
59
59
|
"codecov": "^3.8.3",
|
|
60
60
|
"eslint": "^7.32.0",
|
|
61
61
|
"husky": "^7.0.4",
|
|
62
|
-
"jest": "^
|
|
62
|
+
"jest": "^30.2.0",
|
|
63
63
|
"jest-mock-axios": "^4.7.3",
|
|
64
64
|
"release-it": "^15.10.0",
|
|
65
65
|
"rimraf": "^3.0.2",
|
|
66
|
-
"ts-jest": "^
|
|
66
|
+
"ts-jest": "^29.4.6",
|
|
67
67
|
"ts-node": "^10.9.1",
|
|
68
68
|
"typescript": "^4.9.5"
|
|
69
69
|
}
|