Update exportMaterial amount to number | string (#583)

This commit is contained in:
Kateract 2023-06-07 10:48:23 -07:00 committed by GitHub
parent c67f32cdc1
commit cc5247ac89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

@ -15,7 +15,7 @@ exportMaterial(
targetDivision: string, targetDivision: string,
targetCity: CityName | `${CityName}`, targetCity: CityName | `${CityName}`,
materialName: string, materialName: string,
amt: number, amt: number | string,
): void; ): void;
``` ```
@ -28,7 +28,7 @@ exportMaterial(
| targetDivision | string | Target division | | targetDivision | string | Target division |
| targetCity | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)<!-- -->}\` | Target city | | targetCity | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)<!-- -->}\` | Target city |
| materialName | string | Name of the material | | materialName | string | Name of the material |
| amt | number | Amount of material to export. | | amt | number \| string | Amount of material to export. |
**Returns:** **Returns:**

@ -478,7 +478,7 @@ Attempted export amount: ${amount}`);
let sanitizedAmt = amount.replace(/\s+/g, "").toUpperCase(); let sanitizedAmt = amount.replace(/\s+/g, "").toUpperCase();
sanitizedAmt = sanitizedAmt.replace(/[^-()\d/*+.MAXEPRODINV]/g, ""); sanitizedAmt = sanitizedAmt.replace(/[^-()\d/*+.MAXEPRODINV]/g, "");
for (const testReplacement of ["(1.23)", "(-1.23)"]) { for (const testReplacement of ["(1.23)", "(-1.23)"]) {
const replaced = sanitizedAmt.replace(/(IPROD|EPROD|IINV|EINV)/g, testReplacement); const replaced = sanitizedAmt.replace(/(MAX|IPROD|EPROD|IINV|EINV)/g, testReplacement);
let evaluated, error; let evaluated, error;
try { try {
evaluated = eval(replaced); evaluated = eval(replaced);

@ -7084,7 +7084,7 @@ export interface WarehouseAPI {
targetDivision: string, targetDivision: string,
targetCity: CityName | `${CityName}`, targetCity: CityName | `${CityName}`,
materialName: string, materialName: string,
amt: number, amt: number | string,
): void; ): void;
/** /**
* Cancel material export * Cancel material export