mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 23:53:48 +01:00
Merge pull request #4172 from Snarling/IPs-fix
CCT: Generate IPs contract type accepts properly formatted js array
This commit is contained in:
commit
4d1e72bf7a
@ -490,8 +490,8 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
|
|||||||
"Note that an octet cannot begin with a '0' unless the number",
|
"Note that an octet cannot begin with a '0' unless the number",
|
||||||
"itself is actually 0. For example, '192.168.010.1' is not a valid IP.\n\n",
|
"itself is actually 0. For example, '192.168.010.1' is not a valid IP.\n\n",
|
||||||
"Examples:\n\n",
|
"Examples:\n\n",
|
||||||
"25525511135 -> [255.255.11.135, 255.255.111.35]\n",
|
'25525511135 -> ["255.255.11.135", "255.255.111.35"]\n',
|
||||||
"1938718066 -> [193.87.180.66]",
|
'1938718066 -> ["193.87.180.66"]',
|
||||||
].join(" ");
|
].join(" ");
|
||||||
},
|
},
|
||||||
difficulty: 3,
|
difficulty: 3,
|
||||||
@ -532,7 +532,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
|
|||||||
}
|
}
|
||||||
|
|
||||||
const sanitizedAns: string = removeBracketsFromArrayString(ans).replace(/\s/g, "");
|
const sanitizedAns: string = removeBracketsFromArrayString(ans).replace(/\s/g, "");
|
||||||
const ansArr: string[] = sanitizedAns.split(",");
|
const ansArr: string[] = sanitizedAns.split(",").map((ip) => ip.replace(/^"|"$/g, ""));
|
||||||
if (ansArr.length !== ret.length) {
|
if (ansArr.length !== ret.length) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user