@@ -22,35 +22,37 @@ Win.Function.prototype.toString = new Proxy(Win.Function.prototype.toString, {
2222
2323Win . Map . prototype . get = new Proxy ( Win . Map . prototype . get , {
2424 apply ( Target : ( key : unknown ) => unknown , ThisArg : Map < unknown , unknown > , Args : [ unknown ] ) {
25+ let ArgText = ''
2526 try {
26- let ArgText = OriginalArrayToString . call ( Args ) as string
27- for ( const Item of [ '{"inventoryId":' , '({inventoryId:this' ] ) {
28- if ( OriginalStringIncludes . call ( ArgText , Item ) ) {
29- console . debug ( '[tinyShield]: Map.prototype.get:' , ThisArg , Args )
30- throw new Error ( )
31- }
32- }
27+ ArgText = OriginalArrayToString . call ( Args ) as string
28+
3329 } catch {
3430 console . warn ( '[tinyShield]: Map.prototype.get:' , ThisArg , Args )
3531 }
36-
32+ for ( const Item of [ '{"inventoryId":' , '({inventoryId:this' ] ) {
33+ if ( OriginalStringIncludes . call ( ArgText , Item ) ) {
34+ console . debug ( '[tinyShield]: Map.prototype.get:' , ThisArg , Args )
35+ throw new Error ( )
36+ }
37+ }
3738 return Reflect . apply ( Target , ThisArg , Args )
3839 }
3940} )
4041
4142Win . Map . prototype . set = new Proxy ( Win . Map . prototype . set , {
4243 apply ( Target : ( key : unknown , value : unknown ) => Map < unknown , unknown > , ThisArg : Map < unknown , unknown > , Args : [ unknown , unknown ] ) {
44+ let ArgText = ''
4345 try {
44- let ArgText = OriginalArrayToString . call ( Args ) as string
45- for ( const Item of [ 'inventory_id' ] ) {
46- if ( OriginalStringIncludes . call ( ArgText , Item ) ) {
47- console . debug ( '[tinyShield]: Map.prototype.set:' , ThisArg , Args )
48- throw new Error ( )
49- }
50- }
46+ ArgText = OriginalArrayToString . call ( Args ) as string
5147 } catch {
5248 console . warn ( '[tinyShield]: Map.prototype.get:' , ThisArg , Args )
5349 }
50+ for ( const Item of [ 'inventory_id' ] ) {
51+ if ( OriginalStringIncludes . call ( ArgText , Item ) ) {
52+ console . debug ( '[tinyShield]: Map.prototype.set:' , ThisArg , Args )
53+ throw new Error ( )
54+ }
55+ }
5456
5557 return Reflect . apply ( Target , ThisArg , Args )
5658 }
0 commit comments