@ianlucas/cs2-lib 7.32.0 → 7.33.1

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.
@@ -9457,7 +9457,7 @@ $ТРЕЛЯЙxРАЗРУШАЙ//СТРАХАxНЕТ-НАПАДАЙЖГИ!ТЕР
9457
9457
 
9458
9458
  Примерно 1991 год`,collectionName:`Коллекция «Мёртвая рука»`},15398:{name:`M4A1-S | Электрум`,desc:`На корпус нанесена зелёная основа с мраморным узором, а также золотистыми и красными деталями.
9459
9459
 
9460
- «Они платят недостаточно, чтобы это нести, но я всё равно буду», — Валерия Дженнер, революционерка`,collectionName:`Коллекция «Мёртвая рука»`},15399:{name:`Автомат «Галиль» | Галлигатор`,desc:`На корпус поверх жёлто-зелёной основы нанесены аллигатор и символы радиационного загрязнения.
9460
+ «Они платят недостаточно, чтобы это нести, но я всё равно буду», — Валерия Дженнер, революционерка`,collectionName:`Коллекция «Мёртвая рука»`},15399:{name:`Автомат «Галиль» | Галлигатор`,desc:`На корпусе поверх жёлто-зелёной основы изображены аллигатор и символы радиационного загрязнения.
9461
9461
 
9462
9462
  ХРУМ! ХРУМ! ХРУМ!`,collectionName:`Коллекция «Мёртвая рука»`},15400:{name:`M249 | Птицеблоки`,desc:`На корпус нанесён фиолетовый геометрический узор.
9463
9463
 
package/dist/veto.mjs CHANGED
@@ -1 +1 @@
1
- import{assert as e,ensure as t}from"./utils.mjs";import{randomBoolean as n}from"./economy-container.mjs";const r={Available:0,Pick:1,Ban:2},i={BO1:`bo1`,BO2:`bo2`,BO3:`bo3`,BO5:`bo5`,Custom:`custom`};var a=class{actions;maps;pickedMaps=[];toggleTeam=!1;constructor(a,o,s){switch(e(a!==`custom`||s!==void 0),e(o.length===7),e(s===void 0||s.length===6),this.maps=o.map(e=>({mapname:e.mapname,value:r.Available})),a){case i.BO1:this.actions=[r.Ban,r.Ban,r.Ban,r.Ban,r.Ban,r.Ban];break;case i.BO2:this.toggleTeam=n(),this.actions=[r.Ban,r.Ban,r.Ban,r.Ban,r.Ban];break;case i.BO3:this.actions=[r.Ban,r.Ban,r.Pick,r.Pick,r.Ban,r.Ban];break;case i.BO5:this.actions=[r.Ban,r.Ban,r.Pick,r.Pick,r.Pick,r.Pick];break;case i.Custom:this.actions=t(s);break}}getAvailableMaps(){return this.maps.filter(e=>e.value===r.Available)}getMap(e){return this.maps.find(t=>t.mapname===e)}getAvailableMapnames(){return this.getAvailableMaps().map(e=>e.mapname)}getCurrentAction(){return this.actions[0]}getCurrentTeam(){return(this.toggleTeam?1:0)+this.actions.length%2*(this.toggleTeam?-1:1)}getRandomAvailableMapname(){let e=this.getAvailableMapnames();if(e.length)return e[Math.floor(Math.random()*e.length)]}choose(e){if(this.actions.length===0)return!1;if(e===void 0)return this.random();let t=this.getMap(e);if(t===void 0||t.value!==r.Available)return!1;let n=this.getCurrentTeam(),i=this.actions.shift();return i===void 0?!1:(i===r.Pick&&this.pickedMaps.push(e),this.maps=this.maps.map(t=>t.mapname===e?{...t,value:i,team:n}:t),!0)}random(){var e=this.getRandomAvailableMapname();return e===void 0?!1:this.choose(e)}getState(){return this.maps}getMaps(){if(this.actions.length>0)return this.pickedMaps;let e=this.getAvailableMapnames();return[...this.pickedMaps,...e]}done(){return this.actions.length===0}};export{a as CS2Veto,r as CS2VetoAction,i as CS2VetoType};
1
+ import{assert as e,ensure as t}from"./utils.mjs";import{randomBoolean as n}from"./economy-container.mjs";const r={Available:0,Pick:1,Ban:2},i={BO1:`bo1`,BO2:`bo2`,BO3:`bo3`,BO5:`bo5`,Custom:`custom`};var a=class{actions;maps;pickedMaps=[];toggleTeam=!1;constructor(a,o,s){switch(e(a!==`custom`||s!==void 0),e(o.length===7),e(s===void 0||s.length===6),this.maps=o.map(e=>({mapname:e.mapname,value:r.Available})),a){case i.BO1:this.actions=[r.Ban,r.Ban,r.Ban,r.Ban,r.Ban,r.Ban];break;case i.BO2:this.toggleTeam=n(),this.actions=[r.Ban,r.Ban,r.Ban,r.Ban,r.Ban];break;case i.BO3:this.actions=[r.Ban,r.Ban,r.Pick,r.Pick,r.Ban,r.Ban];break;case i.BO5:this.actions=[r.Ban,r.Ban,r.Pick,r.Pick,r.Pick,r.Pick];break;case i.Custom:this.actions=t(s);break}}getAvailableMaps(){return this.maps.filter(e=>e.value===r.Available)}getMap(e){return this.maps.find(t=>t.mapname===e)}getAvailableMapnames(){return this.getAvailableMaps().map(e=>e.mapname)}getCurrentAction(){return this.actions[0]}getCurrentTeam(){return+!!this.toggleTeam+this.actions.length%2*(this.toggleTeam?-1:1)}getRandomAvailableMapname(){let e=this.getAvailableMapnames();if(e.length)return e[Math.floor(Math.random()*e.length)]}choose(e){if(this.actions.length===0)return!1;if(e===void 0)return this.random();let t=this.getMap(e);if(t===void 0||t.value!==r.Available)return!1;let n=this.getCurrentTeam(),i=this.actions.shift();return i===void 0?!1:(i===r.Pick&&this.pickedMaps.push(e),this.maps=this.maps.map(t=>t.mapname===e?{...t,value:i,team:n}:t),!0)}random(){var e=this.getRandomAvailableMapname();return e===void 0?!1:this.choose(e)}getState(){return this.maps}getMaps(){if(this.actions.length>0)return this.pickedMaps;let e=this.getAvailableMapnames();return[...this.pickedMaps,...e]}done(){return this.actions.length===0}};export{a as CS2Veto,r as CS2VetoAction,i as CS2VetoType};
package/package.json CHANGED
@@ -52,24 +52,24 @@
52
52
  "@ianlucas/depot-downloader": "^3.4.0",
53
53
  "@ianlucas/vrf-decompiler": "^18.0.0",
54
54
  "@total-typescript/tsconfig": "^1.0.4",
55
- "@types/node": "^22.19.15",
55
+ "@types/node": "^22.19.17",
56
56
  "cheerio": "^1.2.0",
57
- "dotenv": "^17.3.1",
57
+ "dotenv": "^17.4.2",
58
58
  "html-entities": "^2.6.0",
59
59
  "javascript-stringify": "^2.1.0",
60
- "prettier": "3.8.1",
61
- "rolldown": "^1.0.0-rc.10",
62
- "rolldown-plugin-dts": "^0.23.0",
60
+ "prettier": "3.8.3",
61
+ "rolldown": "^1.0.0-rc.16",
62
+ "rolldown-plugin-dts": "^0.23.2",
63
63
  "rollup-plugin-delete": "^3.0.2",
64
64
  "sharp": "^0.34.5",
65
65
  "string-strip-html": "^13.5.3",
66
66
  "tsx": "^4.21.0",
67
- "typedoc": "^0.28.18",
68
- "typescript": "^5.9.3",
69
- "vitest": "^4.1.1"
67
+ "typedoc": "^0.28.19",
68
+ "typescript": "^6.0.3",
69
+ "vitest": "^4.1.5"
70
70
  },
71
71
  "engines": {
72
72
  "node": ">=20"
73
73
  },
74
- "version": "7.32.0"
74
+ "version": "7.33.1"
75
75
  }