sbd-npm 1.3.11 → 1.3.12
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/package.json +1 -1
- package/util.js +10 -1
package/package.json
CHANGED
package/util.js
CHANGED
@@ -632,13 +632,22 @@ const Util = {
|
|
632
632
|
return prefix === "6";
|
633
633
|
},
|
634
634
|
|
635
|
+
/**
|
636
|
+
* 是否A股股票
|
637
|
+
* @param code
|
638
|
+
* @returns {boolean}
|
639
|
+
*/
|
640
|
+
is_cn: function (code) {
|
641
|
+
return /^\d{6}$/.test(code);
|
642
|
+
},
|
643
|
+
|
635
644
|
/**
|
636
645
|
* 是否港股
|
637
646
|
* @param code
|
638
647
|
* @returns {boolean}
|
639
648
|
*/
|
640
649
|
is_hk: function (code) {
|
641
|
-
return code
|
650
|
+
return /^\d{5}$/.test(code);
|
642
651
|
},
|
643
652
|
|
644
653
|
/**
|