File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ export {
104
104
} from './lib/reports/generate-md-reports-diff.js' ;
105
105
export { loadReport } from './lib/reports/load-report.js' ;
106
106
export { logStdoutSummary } from './lib/reports/log-stdout-summary.js' ;
107
- export { scoreReport , scoreAuditsWithTarget } from './lib/reports/scoring.js' ;
107
+ export { scoreAuditsWithTarget , scoreReport } from './lib/reports/scoring.js' ;
108
108
export { sortReport } from './lib/reports/sorting.js' ;
109
109
export type {
110
110
ScoredCategoryConfig ,
@@ -142,6 +142,7 @@ export type {
142
142
ExtractArray ,
143
143
ExtractArrays ,
144
144
ItemOrArray ,
145
+ LooseAutocomplete ,
145
146
Prettify ,
146
147
WithRequired ,
147
148
} from './lib/types.js' ;
Original file line number Diff line number Diff line change @@ -27,3 +27,14 @@ export type KebabCaseToCamelCase<T extends string> =
27
27
T extends `${infer First } -${infer Rest } `
28
28
? `${First } ${Capitalize < KebabCaseToCamelCase < Rest > > } `
29
29
: T ;
30
+
31
+ /**
32
+ * Autocompletes string from union, while allowing any other string to be assigned.
33
+ *
34
+ * @example
35
+ * let color: LooseAutocomplete< 'red' | 'green' | 'blue'>;
36
+ *
37
+ * color = 'green'; // IDE autocompletes 'red', 'green', 'blue'
38
+ * color = '#516bc6'; // any string passes type check
39
+ */
40
+ export type LooseAutocomplete < T extends string > = T | ( string & { } ) ;
You can’t perform that action at this time.
0 commit comments