File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 5
5
getEmbedderOptions : getEmbedderOptionsFromBinding ,
6
6
} = internalBinding ( 'options' ) ;
7
7
8
+ const {
9
+ StringPrototypeSlice,
10
+ } = primordials ;
11
+
8
12
let warnOnAllowUnauthorized = true ;
9
13
10
14
let optionsMap ;
@@ -43,8 +47,15 @@ function refreshOptions() {
43
47
44
48
function getOptionValue ( optionName ) {
45
49
const options = getCLIOptionsFromBinding ( ) ;
46
- if ( optionName . startsWith ( '--no-' ) ) {
47
- const option = options . get ( '--' + optionName . slice ( 5 ) ) ;
50
+ if (
51
+ optionName . length > 5 &&
52
+ optionName [ 0 ] === '-' &&
53
+ optionName [ 1 ] === '-' &&
54
+ optionName [ 2 ] === 'n' &&
55
+ optionName [ 3 ] === 'o' &&
56
+ optionName [ 4 ] === '-'
57
+ ) {
58
+ const option = options . get ( '--' + StringPrototypeSlice ( optionName , 5 ) ) ;
48
59
return option && ! option . value ;
49
60
}
50
61
return options . get ( optionName ) ?. value ;
You can’t perform that action at this time.
0 commit comments