@sjtdev/koishi-plugin-dota2tracker 1.5.0 → 1.5.2

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/lib/index.js CHANGED
@@ -2217,7 +2217,7 @@ async function apply(ctx, config) {
2217
2217
  (item) => alias?.some((a) => item.name_loc.trim().toLowerCase() == a.toLowerCase()) || item.name_loc.trim().toLowerCase() === keyword.trim().toLowerCase() || Number.isInteger(Number(keyword)) && item.id === Number(keyword)
2218
2218
  );
2219
2219
  if (exactMatch.length) return exactMatch;
2220
- return fuzzySearchItems([...alias ?? keyword], items);
2220
+ return fuzzySearchItems(alias.length ? alias : [keyword], items);
2221
2221
  }
2222
2222
  __name(searchItems, "searchItems");
2223
2223
  function fuzzySearchItems(keywords, items) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sjtdev/koishi-plugin-dota2tracker",
3
3
  "description": "koishi插件-追踪群友的DOTA2对局",
4
- "version": "1.5.0",
4
+ "version": "1.5.2",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -823,7 +823,7 @@
823
823
  `<p>
824
824
  <span class="heading">${sv.heading_loc}</span>
825
825
  <span class="values">
826
- ${!(sv.values_float.every(value => value === 0) || sv.values_float.length == 0) ?
826
+ ${!(sv.values_float?.every(value => value === 0) || sv.values_float.length == 0) ?
827
827
  `<span class="primary${(sv.values_float.every(value => value === 0) || sv.values_float.length == 0)?" empty":""}">
828
828
  ${(!((sv.values_float.every(value => value === 0) || sv.values_float.length == 0) && (sv.values_scepter.length || sv.values_shard.length || sv.facet_bonus.name))
829
829
  ? (sv.values_float.map(value => value + (sv.is_percentage ? "%" : "")).join(" / ")) : "")}
@@ -849,10 +849,10 @@
849
849
  .join("")}
850
850
  </div>
851
851
  <p>
852
- ${item.special_values.find(sv=>sv.name=="AbilityCooldown").values_float.length && !(item.special_values.find(sv=>sv.name=="AbilityCooldown").values_float.length === 1 && item.special_values.find(sv=>sv.name=="AbilityCooldown").values_float[0] === 0) ?
852
+ ${item.special_values.find(sv=>sv.name=="AbilityCooldown")?.values_float.length && !(item.special_values.find(sv=>sv.name=="AbilityCooldown").values_float.length === 1 && item.special_values.find(sv=>sv.name=="AbilityCooldown").values_float[0] === 0) ?
853
853
  `<span class="cooldown"> ${item.special_values.find(sv=>sv.name=="AbilityCooldown").values_float.join(" / ")}
854
854
  </span>` : ""}
855
- ${item.special_values.find(sv=>sv.name=="AbilityManaCost").values_float.length && !(item.special_values.find(sv=>sv.name=="AbilityManaCost").values_float.length === 1 && item.special_values.find(sv=>sv.name=="AbilityManaCost").values_float[0] === 0) ?
855
+ ${item.special_values.find(sv=>sv.name=="AbilityManaCost")?.values_float.length && !(item.special_values.find(sv=>sv.name=="AbilityManaCost").values_float.length === 1 && item.special_values.find(sv=>sv.name=="AbilityManaCost").values_float[0] === 0) ?
856
856
  `<span class="mana_cost"> ${item.special_values.find(sv=>sv.name=="AbilityManaCost").values_float.join(" / ")}
857
857
  </span>` : ""}
858
858
  </p>