Skip to content

Commit f1819de

Browse files
committed
fix: review update
1 parent fa5431a commit f1819de

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/__tests__/__snapshots__/options.defaults.test.ts.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ exports[`options defaults should return specific properties: defaults 1`] = `
6868
"@patternfly/patternfly",
6969
],
7070
},
71-
"urlWhiteListProtocols": [
72-
"http",
73-
"https",
74-
],
7571
"urlWhitelist": [
7672
"https://patternfly.org",
7773
"https://github.com/patternfly",
7874
"https://raw.githubusercontent.com/patternfly",
7975
],
76+
"urlWhitelistProtocols": [
77+
"http",
78+
"https",
79+
],
8080
},
8181
"pluginHost": {
8282
"gracePeriodMs": 2000,

src/options.context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const optionsContext = new AsyncLocalStorage<GlobalOptions>();
8686
const setOptions = (options?: DefaultOptionsOverrides): GlobalOptions => {
8787
const base = mergeObjects(DEFAULT_OPTIONS, options, { allowNullValues: false, allowUndefinedValues: false });
8888

89-
assertProtocol(base.patternflyOptions.urlWhitelist, base.patternflyOptions.urlWhiteListProtocols);
89+
assertProtocol(base.patternflyOptions.urlWhitelist, base.patternflyOptions.urlWhitelistProtocols);
9090

9191
const baseLogging = isPlainObject(base.logging) ? base.logging : DEFAULT_OPTIONS.logging;
9292
const basePluginIsolation = ['strict', 'none'].includes(base.pluginIsolation) ? base.pluginIsolation : DEFAULT_OPTIONS.pluginIsolation;

src/options.defaults.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ type WhitelistUrl = `${'http' | 'https'}://${string}`;
188188
* - 'highest': Use the highest major version found.
189189
* - 'lowest': Use the lowest major version found.
190190
* @property {WhitelistUrl[]} urlWhitelist List of allowed URLs to fetch PatternFly resources from.
191-
* @property urlWhiteListProtocols List of allowed URL protocols to validate against when fetching PatternFly resources.
191+
* @property urlWhitelistProtocols List of allowed URL protocols to validate against when fetching PatternFly resources.
192192
*/
193193
interface PatternFlyOptions {
194194
availableResourceVersions: ('6.0.0')[];
@@ -202,7 +202,7 @@ interface PatternFlyOptions {
202202
versionStrategy: 'highest' | 'lowest';
203203
},
204204
urlWhitelist: WhitelistUrl[];
205-
urlWhiteListProtocols: string[];
205+
urlWhitelistProtocols: string[];
206206
}
207207

208208
/**
@@ -439,7 +439,7 @@ const PATTERNFLY_OPTIONS: PatternFlyOptions = {
439439
'https://github.com/patternfly',
440440
'https://raw.githubusercontent.com/patternfly'
441441
],
442-
urlWhiteListProtocols: ['http', 'https']
442+
urlWhitelistProtocols: ['http', 'https']
443443
};
444444

445445
/**

src/server.assertions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ function assertInputStringNumberEnumLike(
151151
function assertInputUrlWhiteListed(
152152
input: unknown,
153153
whitelist: WhitelistUrl[],
154-
{ allowedProtocols = DEFAULT_OPTIONS.patternflyOptions.urlWhiteListProtocols, inputDisplayName, message, urlDisplayMaxLength = 50 }: {
154+
{ allowedProtocols = DEFAULT_OPTIONS.patternflyOptions.urlWhitelistProtocols, inputDisplayName, message, urlDisplayMaxLength = 50 }: {
155155
allowedProtocols?: string[]; inputDisplayName?: string; message?: string; urlDisplayMaxLength?: number
156156
} = {}
157157
): asserts input is string | string[] {

0 commit comments

Comments
 (0)