MCPcopy Create free account
hub / github.com/GamerHack/GamerHack.github.io / set_target

Function set_target

g2all/700/config.js:52–67  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

50}
51
52export function set_target(value) {
53 if (!Number.isInteger(value)) {
54 throw TypeError(`value not an integer: ${value}`);
55 }
56
57 if (value >= 0x20000 || value < 0) {
58 throw RangeError(`value >= 0x20000 or value < 0: ${value}`);
59 }
60
61 const version = value & 0xffff;
62 if (!check_bcd(version)) {
63 throw RangeError(`value & 0xffff not in BCD format ${version}`);
64 }
65
66 target = value;
67}
68
69function get_target_from_ua(useragent) {
70 const pattern = /^Mozilla\/5\.0 \(?(?:PlayStation; )?PlayStation (4|5)[ \/]([0-9]{1,2}\.[0-9]{2})\)? AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\)(?: Version\/[0-9.]+ Safari\/[0-9.]+)?$/;

Callers 1

config.jsFile · 0.70

Calls 1

check_bcdFunction · 0.70

Tested by

no test coverage detected