Skip to content

Commit 42ab614

Browse files
committed
Updated regex
1 parent 10b3033 commit 42ab614

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/readme.graph.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,14 @@ directive:
496496
});
497497
}
498498
499-
$ = $.replace(/await this\.Client\.(\w+)\(\s*Headers\s*,\s*([^,\s]+)[^;]+;/g,'await Microsoft.Graph.PowerShell.ModelExtensions.ModelExtensions.EnsurePropertiesAreReady($2,failOnExplicitNulls: false);\nawait this.Client.$1(Headers, $2, on2Xx, onDefault, this, Pipeline);')
499+
let nameSpacePrefixRegex = /(Microsoft(?:\.\w+)*?\.PowerShell)/gm
500+
let nameSpacePrefix = 'Microsoft.Graph.PowerShell';
501+
if($.match(nameSpacePrefixRegex)){
502+
let prefixMatch = nameSpacePrefixRegex.exec($);
503+
nameSpacePrefix = prefixMatch[1];
504+
}
505+
506+
$ = $.replace(/await this\.Client\.(\w+)\(\s*Headers\s*,\s*([^,\s]+)[^;]+;/g,'await '+nameSpacePrefix+'.ModelExtensions.ModelExtensions.EnsurePropertiesAreReady($2,failOnExplicitNulls: false);\nawait this.Client.$1(Headers, $2, on2Xx, onDefault, this, Pipeline);')
500507
501508
502509
return $;

0 commit comments

Comments
 (0)