File tree Expand file tree Collapse file tree
frontend/src/modules/scaffold Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -86,24 +86,13 @@ define([
8686
8787 function convertStringsToRegExDeep ( arr ) {
8888 function processEntry ( [ key , value ] ) {
89- if ( typeof value === "string" ) {
90- return [
91- key ,
92- new RegExp ( value , 'i' )
93- ] ;
94- }
95- if ( Array . isArray ( value ) ) {
96- return [
97- key ,
98- arr . map ( ( value , index ) => processEntry ( [ index , value ] ) [ 1 ] )
99- ] ;
100- }
101- if ( typeof value === "object" && value !== null ) {
102- return [
103- key ,
104- Object . fromEntries ( Object . entries ( value ) . map ( processEntry ) )
105- ] ;
106- }
89+ value = ( typeof value === "string" )
90+ ? new RegExp ( value , 'i' )
91+ : Array . isArray ( value )
92+ ? arr . map ( ( value , index ) => processEntry ( [ index , value ] ) [ 1 ] )
93+ : ( typeof value === "object" && value !== null )
94+ ? Object . fromEntries ( Object . entries ( value ) . map ( processEntry ) )
95+ : value ;
10796 return [ key , value ] ;
10897 }
10998 return arr . map ( ( value , index ) => processEntry ( [ index , value ] ) [ 1 ] )
You can’t perform that action at this time.
0 commit comments