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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/util.js +10 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.3.11",
3
+ "version": "1.3.12",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
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.length === 5;
650
+ return /^\d{5}$/.test(code);
642
651
  },
643
652
 
644
653
  /**