sbd-npm 1.1.4 → 1.1.5

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 +7 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/util.js CHANGED
@@ -209,15 +209,14 @@ let Util = {
209
209
  * @returns {string}
210
210
  */
211
211
  map_url: function (location, location_name = "") {
212
- if (location === "--") {
213
- return location;
214
- } else if (location) {
215
- location_name = location_name === "" ? location : location_name;
216
- if (location_name.length > 8) {
217
- return "<a title='" + location + "' target='_blank' class='link_cls map_link' rel='noopener noreferrer nofollow' href='https://map.baidu.com/m?fr=ps01000&word=" + location + "'>" + location_name.substr(0, 8) + "</a>";
218
- } else {
219
- return "<a target='_blank' class='link_cls map_link' rel='noopener noreferrer nofollow' href='https://map.baidu.com/m?fr=ps01000&word=" + location + "'>" + location_name + "</a>";
212
+ if (location) {
213
+ if (location === "--") {
214
+ return location;
215
+ }
216
+ if (location_name === "") {
217
+ location_name = location.length > 8 ? location.substr(0, 8) : location;
220
218
  }
219
+ return "<a target='_blank' class='link_cls map_link' rel='noopener noreferrer nofollow' href='https://map.baidu.com/m?fr=ps01000&word=" + location + "'>" + location_name + "</a>";
221
220
  }
222
221
  return "--";
223
222
  },