File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed
Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,18 @@ ProifyLocals.Description = "This Step wraps all locals into Proxy Objects";
1717ProifyLocals .Name = " Proxify Locals" ;
1818
1919ProifyLocals .SettingsDescriptor = {
20-
20+ LiteralType = {
21+ name = " LiteralType" ,
22+ description = " The type of the randomly generated literals" ,
23+ type = " enum" ,
24+ values = {
25+ " dictionary" ,
26+ " number" ,
27+ " string" ,
28+ " any" ,
29+ },
30+ default = " string" ,
31+ },
2132}
2233
2334local function shallowcopy (orig )
@@ -249,7 +260,17 @@ function ProifyLocals:apply(ast, pipeline)
249260 local localMetatableInfo = getLocalMetatableInfo (node .scope , node .id );
250261 -- Apply Only to Some Variables if Treshold is non 1
251262 if localMetatableInfo then
252- return localMetatableInfo .getValue .constructor (node , RandomLiterals .Any ());
263+ local literal ;
264+ if self .LiteralType == " dictionary" then
265+ literal = RandomLiterals .Dictionary ();
266+ elseif self .LiteralType == " number" then
267+ literal = RandomLiterals .Number ();
268+ elseif self .LiteralType == " string" then
269+ literal = RandomLiterals .String (pipeline );
270+ else
271+ literal = RandomLiterals .Any (pipeline );
272+ end
273+ return localMetatableInfo .getValue .constructor (node , literal );
253274 end
254275 end
255276
You can’t perform that action at this time.
0 commit comments