@ianlucas/cs2-lib 1.0.0
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/License.txt +21 -0
- package/README.md +26 -0
- package/assets/translations/items-brazilian.json +1 -0
- package/assets/translations/items-bulgarian.json +1 -0
- package/assets/translations/items-czech.json +1 -0
- package/assets/translations/items-danish.json +1 -0
- package/assets/translations/items-dutch.json +1 -0
- package/assets/translations/items-english.json +1 -0
- package/assets/translations/items-finnish.json +1 -0
- package/assets/translations/items-french.json +1 -0
- package/assets/translations/items-german.json +1 -0
- package/assets/translations/items-greek.json +1 -0
- package/assets/translations/items-hungarian.json +1 -0
- package/assets/translations/items-italian.json +1 -0
- package/assets/translations/items-japanese.json +1 -0
- package/assets/translations/items-koreana.json +1 -0
- package/assets/translations/items-latam.json +1 -0
- package/assets/translations/items-norwegian.json +1 -0
- package/assets/translations/items-polish.json +1 -0
- package/assets/translations/items-portuguese.json +1 -0
- package/assets/translations/items-romanian.json +1 -0
- package/assets/translations/items-russian.json +1 -0
- package/assets/translations/items-schinese.json +1 -0
- package/assets/translations/items-spanish.json +1 -0
- package/assets/translations/items-swedish.json +1 -0
- package/assets/translations/items-tchinese.json +1 -0
- package/assets/translations/items-thai.json +1 -0
- package/assets/translations/items-turkish.json +1 -0
- package/assets/translations/items-ukrainian.json +1 -0
- package/assets/translations/items-vietnamese.json +1 -0
- package/dist/economy-case.d.ts +17 -0
- package/dist/economy-case.js +51 -0
- package/dist/economy.d.ts +140 -0
- package/dist/economy.js +467 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +12 -0
- package/dist/inventory.d.ts +82 -0
- package/dist/inventory.js +379 -0
- package/dist/items.d.ts +2 -0
- package/dist/items.js +7 -0
- package/dist/keyvalues.d.ts +1 -0
- package/dist/keyvalues.js +93 -0
- package/dist/maps.d.ts +20 -0
- package/dist/maps.js +88 -0
- package/dist/teams.d.ts +6 -0
- package/dist/teams.js +13 -0
- package/dist/util.d.ts +5 -0
- package/dist/util.js +15 -0
- package/dist/veto.d.ts +26 -0
- package/dist/veto.js +111 -0
- package/package.json +38 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function CS_parseValveKeyValue<T = any>(data: string): T;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Ian Lucas. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { fail } from "./util.js";
|
|
6
|
+
export function CS_parseValveKeyValue(data) {
|
|
7
|
+
data = data.replace(/\[[\$!][^\]]+\]/g, "");
|
|
8
|
+
let index = 0;
|
|
9
|
+
function skipWhitespace() {
|
|
10
|
+
while (data[index] && data[index].match(/[\s\t\r\n]/)) {
|
|
11
|
+
index += 1;
|
|
12
|
+
}
|
|
13
|
+
if (data[index] === "/" && data[index + 1] === "/") {
|
|
14
|
+
while (data[index] && data[index] !== "\n") {
|
|
15
|
+
index += 1;
|
|
16
|
+
}
|
|
17
|
+
skipWhitespace();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function parseString() {
|
|
21
|
+
if (data[index] === '"') {
|
|
22
|
+
index += 1;
|
|
23
|
+
let value = "";
|
|
24
|
+
while (data[index] && data[index] !== '"') {
|
|
25
|
+
while (data[index] && data[index] === "\\") {
|
|
26
|
+
index += 1;
|
|
27
|
+
value += data[index];
|
|
28
|
+
index += 1;
|
|
29
|
+
}
|
|
30
|
+
if (data[index] !== '"') {
|
|
31
|
+
value += data[index];
|
|
32
|
+
index += 1;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (data[index] !== '"') {
|
|
36
|
+
fail("Bad end of string.");
|
|
37
|
+
}
|
|
38
|
+
index += 1;
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
return "";
|
|
42
|
+
}
|
|
43
|
+
function parseValue() {
|
|
44
|
+
if (data[index] === '"') {
|
|
45
|
+
return parseString();
|
|
46
|
+
}
|
|
47
|
+
if (data[index] === "{") {
|
|
48
|
+
index += 1;
|
|
49
|
+
return parsePairs();
|
|
50
|
+
}
|
|
51
|
+
if (data[index] === "}") {
|
|
52
|
+
return "";
|
|
53
|
+
}
|
|
54
|
+
console.log(data.substring(Math.max(0, index - 64), index) +
|
|
55
|
+
data[index] +
|
|
56
|
+
data.substring(index + 1, Math.min(data.length, index + 63)));
|
|
57
|
+
console.log("".padStart(64, " ") + "^");
|
|
58
|
+
fail(`Unexpected character at index ${index}.`);
|
|
59
|
+
}
|
|
60
|
+
function parsePairs() {
|
|
61
|
+
const pairs = [];
|
|
62
|
+
while (data[index]) {
|
|
63
|
+
if (data[index] === "}") {
|
|
64
|
+
index += 1;
|
|
65
|
+
return pairs;
|
|
66
|
+
}
|
|
67
|
+
skipWhitespace();
|
|
68
|
+
const key = parseString();
|
|
69
|
+
skipWhitespace();
|
|
70
|
+
const value = parseValue();
|
|
71
|
+
skipWhitespace();
|
|
72
|
+
pairs.push([key, value]);
|
|
73
|
+
}
|
|
74
|
+
return pairs;
|
|
75
|
+
}
|
|
76
|
+
function walk(context, pairs) {
|
|
77
|
+
return pairs.reduce((object, pair) => {
|
|
78
|
+
const [key, value] = pair;
|
|
79
|
+
if (object[key] && !Array.isArray(object[key])) {
|
|
80
|
+
object[key] = [object[key]];
|
|
81
|
+
}
|
|
82
|
+
const newValue = typeof value === "string" ? value : walk({}, value);
|
|
83
|
+
if (Array.isArray(object[key])) {
|
|
84
|
+
object[key].push(newValue);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
object[key] = newValue;
|
|
88
|
+
}
|
|
89
|
+
return object;
|
|
90
|
+
}, context);
|
|
91
|
+
}
|
|
92
|
+
return walk({}, parsePairs());
|
|
93
|
+
}
|
package/dist/maps.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface CS_Map {
|
|
2
|
+
mapname: string;
|
|
3
|
+
name: string;
|
|
4
|
+
image: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const CS_ANCIENT_MAP: CS_Map;
|
|
7
|
+
export declare const CS_ANUBIS_MAP: CS_Map;
|
|
8
|
+
export declare const CS_INFERNO_MAP: CS_Map;
|
|
9
|
+
export declare const CS_MIRAGE_MAP: CS_Map;
|
|
10
|
+
export declare const CS_DUST2_MAP: CS_Map;
|
|
11
|
+
export declare const CS_NUKE_MAP: CS_Map;
|
|
12
|
+
export declare const CS_OVERPASS_MAP: CS_Map;
|
|
13
|
+
export declare const CS_VERTIGO_MAP: CS_Map;
|
|
14
|
+
export declare const CS_TRAIN_MAP: CS_Map;
|
|
15
|
+
export declare const CS_OLD_CBBLE_MAP: CS_Map;
|
|
16
|
+
export declare const CS_OLD_CACHE_MAP: CS_Map;
|
|
17
|
+
export declare const CS_ACTIVE_MAP_POOL: CS_Map[];
|
|
18
|
+
export declare const CS_ALL_MAPS: CS_Map[];
|
|
19
|
+
export declare function CS_getChangeLevelCommand(map: CS_Map | string): string;
|
|
20
|
+
export declare function CS_getMapnameName(mapname: string): string;
|
package/dist/maps.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export const CS_ANCIENT_MAP = {
|
|
2
|
+
mapname: "de_ancient",
|
|
3
|
+
name: "Ancient",
|
|
4
|
+
image: "/de_ancient.jpg"
|
|
5
|
+
};
|
|
6
|
+
export const CS_ANUBIS_MAP = {
|
|
7
|
+
mapname: "de_anubis",
|
|
8
|
+
name: "Anubis",
|
|
9
|
+
image: "/de_anubis.jpg"
|
|
10
|
+
};
|
|
11
|
+
export const CS_INFERNO_MAP = {
|
|
12
|
+
mapname: "de_inferno",
|
|
13
|
+
name: "Inferno",
|
|
14
|
+
image: "/de_inferno.jpg"
|
|
15
|
+
};
|
|
16
|
+
export const CS_MIRAGE_MAP = {
|
|
17
|
+
mapname: "de_mirage",
|
|
18
|
+
name: "Mirage",
|
|
19
|
+
image: "/de_mirage.jpg"
|
|
20
|
+
};
|
|
21
|
+
export const CS_DUST2_MAP = {
|
|
22
|
+
mapname: "de_dust2",
|
|
23
|
+
name: "Dust 2",
|
|
24
|
+
image: "/de_dust2.jpg"
|
|
25
|
+
};
|
|
26
|
+
export const CS_NUKE_MAP = {
|
|
27
|
+
mapname: "de_nuke",
|
|
28
|
+
name: "Nuke",
|
|
29
|
+
image: "/de_nuke.jpg"
|
|
30
|
+
};
|
|
31
|
+
export const CS_OVERPASS_MAP = {
|
|
32
|
+
mapname: "de_overpass",
|
|
33
|
+
name: "Overpass",
|
|
34
|
+
image: "/de_overpass.jpg"
|
|
35
|
+
};
|
|
36
|
+
export const CS_VERTIGO_MAP = {
|
|
37
|
+
mapname: "de_vertigo",
|
|
38
|
+
name: "Vertigo",
|
|
39
|
+
image: "/de_vertigo.jpg"
|
|
40
|
+
};
|
|
41
|
+
export const CS_TRAIN_MAP = {
|
|
42
|
+
mapname: "de_train",
|
|
43
|
+
name: "Train",
|
|
44
|
+
image: "/de_train.jpg"
|
|
45
|
+
};
|
|
46
|
+
export const CS_OLD_CBBLE_MAP = {
|
|
47
|
+
mapname: "workshop/855577410/de_cbble",
|
|
48
|
+
name: "Cobblestone",
|
|
49
|
+
image: "/855577410_de_cbble.jpg"
|
|
50
|
+
};
|
|
51
|
+
export const CS_OLD_CACHE_MAP = {
|
|
52
|
+
mapname: "workshop/951327114/de_cache",
|
|
53
|
+
name: "Cache",
|
|
54
|
+
image: "/951327114_de_cache.jpg"
|
|
55
|
+
};
|
|
56
|
+
export const CS_ACTIVE_MAP_POOL = [
|
|
57
|
+
CS_ANCIENT_MAP,
|
|
58
|
+
CS_ANUBIS_MAP,
|
|
59
|
+
CS_INFERNO_MAP,
|
|
60
|
+
CS_MIRAGE_MAP,
|
|
61
|
+
CS_NUKE_MAP,
|
|
62
|
+
CS_OVERPASS_MAP,
|
|
63
|
+
CS_VERTIGO_MAP
|
|
64
|
+
];
|
|
65
|
+
export const CS_ALL_MAPS = [
|
|
66
|
+
CS_ANCIENT_MAP,
|
|
67
|
+
CS_ANUBIS_MAP,
|
|
68
|
+
CS_DUST2_MAP,
|
|
69
|
+
CS_INFERNO_MAP,
|
|
70
|
+
CS_MIRAGE_MAP,
|
|
71
|
+
CS_NUKE_MAP,
|
|
72
|
+
CS_TRAIN_MAP,
|
|
73
|
+
CS_OLD_CACHE_MAP,
|
|
74
|
+
CS_OLD_CBBLE_MAP,
|
|
75
|
+
CS_OVERPASS_MAP,
|
|
76
|
+
CS_VERTIGO_MAP
|
|
77
|
+
];
|
|
78
|
+
export function CS_getChangeLevelCommand(map) {
|
|
79
|
+
const mapstring = typeof map === "string" ? map : map.mapname;
|
|
80
|
+
const matches = mapstring.match(/workshop\/(\d+)\/[\w_]+/);
|
|
81
|
+
if (matches) {
|
|
82
|
+
return `host_workshop_map ${matches[1]}`;
|
|
83
|
+
}
|
|
84
|
+
return `changelevel ${mapstring}`;
|
|
85
|
+
}
|
|
86
|
+
export function CS_getMapnameName(mapname) {
|
|
87
|
+
return CS_ALL_MAPS.find((map) => map.mapname.includes(mapname))?.name ?? "undefined";
|
|
88
|
+
}
|
package/dist/teams.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type CS_Team = 0 | 2 | 3;
|
|
2
|
+
export declare const CS_TEAM_NONE: CS_Team;
|
|
3
|
+
export declare const CS_TEAM_T: CS_Team;
|
|
4
|
+
export declare const CS_TEAM_CT: CS_Team;
|
|
5
|
+
export declare function CS_toggleTeam(team: CS_Team): CS_Team;
|
|
6
|
+
export declare function CS_getTeamLabel(team: CS_Team): string;
|
package/dist/teams.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Ian Lucas. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
export const CS_TEAM_NONE = 0;
|
|
6
|
+
export const CS_TEAM_T = 2;
|
|
7
|
+
export const CS_TEAM_CT = 3;
|
|
8
|
+
export function CS_toggleTeam(team) {
|
|
9
|
+
return team === CS_TEAM_CT ? CS_TEAM_T : CS_TEAM_CT;
|
|
10
|
+
}
|
|
11
|
+
export function CS_getTeamLabel(team) {
|
|
12
|
+
return team === CS_TEAM_CT ? "ct" : "t";
|
|
13
|
+
}
|
package/dist/util.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import invariant from "tiny-invariant";
|
|
2
|
+
export declare function compare<T, U>(var1: T, var2: U): boolean;
|
|
3
|
+
export declare function float(literal: number, fractionDigits?: number): number;
|
|
4
|
+
export declare const assert: typeof invariant;
|
|
5
|
+
export declare function fail(message: string): never;
|
package/dist/util.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Ian Lucas. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import invariant from "tiny-invariant";
|
|
6
|
+
export function compare(var1, var2) {
|
|
7
|
+
return var1 === undefined || var1 === (typeof var1 === "boolean" ? var2 || false : var2);
|
|
8
|
+
}
|
|
9
|
+
export function float(literal, fractionDigits = 2) {
|
|
10
|
+
return parseFloat(literal.toFixed(fractionDigits));
|
|
11
|
+
}
|
|
12
|
+
export const assert = invariant;
|
|
13
|
+
export function fail(message) {
|
|
14
|
+
throw new Error(message);
|
|
15
|
+
}
|
package/dist/veto.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CS_Map } from "./maps.js";
|
|
2
|
+
export declare const CS_VETO_AVAILABLE = 0;
|
|
3
|
+
export declare const CS_VETO_PICK = 1;
|
|
4
|
+
export declare const CS_VETO_BAN = 2;
|
|
5
|
+
export type CS_VetoValue = 0 | 1 | 2;
|
|
6
|
+
export type CS_VetoType = "bo1" | "bo3" | "bo5" | "custom";
|
|
7
|
+
export interface CS_VetoMap {
|
|
8
|
+
mapname: string;
|
|
9
|
+
value: CS_VetoValue;
|
|
10
|
+
team?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare class CS_Veto {
|
|
13
|
+
private maps;
|
|
14
|
+
private actions;
|
|
15
|
+
private pickedMaps;
|
|
16
|
+
constructor(type: CS_VetoType, maps: CS_Map[], actions?: CS_VetoValue[]);
|
|
17
|
+
private getAvailableMaps;
|
|
18
|
+
private getMap;
|
|
19
|
+
private getAvailableMapnames;
|
|
20
|
+
getCurrentTeam(): number;
|
|
21
|
+
choose(mapname?: string): boolean;
|
|
22
|
+
random(): boolean;
|
|
23
|
+
getState(): CS_VetoMap[];
|
|
24
|
+
getMaps(): string[];
|
|
25
|
+
done(): boolean;
|
|
26
|
+
}
|
package/dist/veto.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Ian Lucas. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { assert, fail } from "./util.js";
|
|
6
|
+
export const CS_VETO_AVAILABLE = 0;
|
|
7
|
+
export const CS_VETO_PICK = 1;
|
|
8
|
+
export const CS_VETO_BAN = 2;
|
|
9
|
+
export class CS_Veto {
|
|
10
|
+
maps;
|
|
11
|
+
actions;
|
|
12
|
+
pickedMaps = [];
|
|
13
|
+
constructor(type, maps, actions) {
|
|
14
|
+
if (type !== "custom" && actions !== undefined) {
|
|
15
|
+
console.warn('stack provided, but the type is not "custom".');
|
|
16
|
+
}
|
|
17
|
+
if (type === "custom" && actions === undefined) {
|
|
18
|
+
fail("provide the stack for the custom type.");
|
|
19
|
+
}
|
|
20
|
+
if (maps.length !== 7) {
|
|
21
|
+
fail("you need to provide 7 maps to veto.");
|
|
22
|
+
}
|
|
23
|
+
if (actions !== undefined && actions.length !== 6) {
|
|
24
|
+
fail("you need to provide 6 actions to veto.");
|
|
25
|
+
}
|
|
26
|
+
this.maps = maps.map((map) => ({
|
|
27
|
+
mapname: map.mapname,
|
|
28
|
+
value: CS_VETO_AVAILABLE
|
|
29
|
+
}));
|
|
30
|
+
switch (type) {
|
|
31
|
+
case "bo1":
|
|
32
|
+
this.actions = [CS_VETO_BAN, CS_VETO_BAN, CS_VETO_BAN, CS_VETO_BAN, CS_VETO_BAN, CS_VETO_BAN];
|
|
33
|
+
break;
|
|
34
|
+
case "bo3":
|
|
35
|
+
this.actions = [CS_VETO_BAN, CS_VETO_BAN, CS_VETO_PICK, CS_VETO_PICK, CS_VETO_BAN, CS_VETO_BAN];
|
|
36
|
+
break;
|
|
37
|
+
case "bo5":
|
|
38
|
+
this.actions = [CS_VETO_BAN, CS_VETO_BAN, CS_VETO_PICK, CS_VETO_PICK, CS_VETO_PICK, CS_VETO_PICK];
|
|
39
|
+
break;
|
|
40
|
+
case "custom":
|
|
41
|
+
this.actions = actions;
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
getAvailableMaps() {
|
|
46
|
+
return this.maps.filter((map) => map.value === CS_VETO_AVAILABLE);
|
|
47
|
+
}
|
|
48
|
+
getMap(mapname) {
|
|
49
|
+
return this.maps.find((map) => map.mapname === mapname);
|
|
50
|
+
}
|
|
51
|
+
getAvailableMapnames() {
|
|
52
|
+
return this.getAvailableMaps().map((map) => map.mapname);
|
|
53
|
+
}
|
|
54
|
+
getCurrentTeam() {
|
|
55
|
+
return this.actions.length % 2;
|
|
56
|
+
}
|
|
57
|
+
choose(mapname) {
|
|
58
|
+
if (this.actions.length === 0) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
if (mapname === undefined) {
|
|
62
|
+
return this.random();
|
|
63
|
+
}
|
|
64
|
+
const map = this.getMap(mapname);
|
|
65
|
+
if (map === undefined || map.value !== CS_VETO_AVAILABLE) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
const team = this.getCurrentTeam();
|
|
69
|
+
const value = this.actions.shift();
|
|
70
|
+
if (value === undefined) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
if (value === CS_VETO_PICK) {
|
|
74
|
+
this.pickedMaps.push(mapname);
|
|
75
|
+
}
|
|
76
|
+
this.maps = this.maps.map((map) => {
|
|
77
|
+
if (map.mapname !== mapname) {
|
|
78
|
+
return map;
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
...map,
|
|
82
|
+
value,
|
|
83
|
+
team
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
random() {
|
|
89
|
+
const available = this.getAvailableMapnames();
|
|
90
|
+
if (!available.length) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
const index = Math.floor(Math.random() * available.length);
|
|
94
|
+
const mapname = available[index];
|
|
95
|
+
assert(mapname, "Unable to get random mapname.");
|
|
96
|
+
return this.choose(mapname);
|
|
97
|
+
}
|
|
98
|
+
getState() {
|
|
99
|
+
return this.maps;
|
|
100
|
+
}
|
|
101
|
+
getMaps() {
|
|
102
|
+
if (this.actions.length > 0) {
|
|
103
|
+
return this.pickedMaps;
|
|
104
|
+
}
|
|
105
|
+
const available = this.getAvailableMapnames();
|
|
106
|
+
return [...this.pickedMaps, ...available];
|
|
107
|
+
}
|
|
108
|
+
done() {
|
|
109
|
+
return this.actions.length === 0;
|
|
110
|
+
}
|
|
111
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ianlucas/cs2-lib",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A TypeScript library for manipulating Counter-Strike 2 data",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Ian Lucas",
|
|
7
|
+
"repository": "ianlucas/cslib",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"format": "prettier . --write",
|
|
12
|
+
"prepack": "([ -d dist ] && rm -rf dist); tsc",
|
|
13
|
+
"test": "jest",
|
|
14
|
+
"case-scraper": "tsx scripts/case-scraper.ts",
|
|
15
|
+
"item-generator": "tsx scripts/item-generator.ts > generate-log.txt",
|
|
16
|
+
"non-legacy-paint-scraper": "tsx scripts/non-legacy-paints-scraper.ts",
|
|
17
|
+
"tint-graffiti-image-scraper": "tsx scripts/tint-graffiti-image-scraper.ts",
|
|
18
|
+
"tint-graffiti-name-generator": "tsx scripts/tint-graffiti-name-generator.ts",
|
|
19
|
+
"upgrade": "npx npm-check-updates@latest --target minor -u"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/jest": "^29.5.12",
|
|
23
|
+
"@types/node": "^18.19.30",
|
|
24
|
+
"@types/node-fetch": "^2.6.11",
|
|
25
|
+
"cheerio": "^1.0.0-rc.12",
|
|
26
|
+
"dotenv": "^16.4.5",
|
|
27
|
+
"html-entities": "^2.5.2",
|
|
28
|
+
"jest": "^29.7.0",
|
|
29
|
+
"node-fetch": "^2.7.0",
|
|
30
|
+
"prettier": "3.2.5",
|
|
31
|
+
"ts-jest": "^29.1.2",
|
|
32
|
+
"tsx": "^4.7.2",
|
|
33
|
+
"typescript": "^5.4.4"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"tiny-invariant": "^1.3.3"
|
|
37
|
+
}
|
|
38
|
+
}
|