File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,12 @@ export interface Option {
157157 * If this is falsey, do not report this option.
158158 */
159159 userAnalytics ?: number ;
160+
161+ /**
162+ * Deprecation. If this flag is not false a warning will be shown on the console. Either `true`
163+ * or a string to show the user as a notice.
164+ */
165+ deprecated ?: boolean | string ;
160166}
161167
162168/**
Original file line number Diff line number Diff line change @@ -251,6 +251,11 @@ export async function parseJsonSchemaToOptions(
251251 const xUserAnalytics = current [ 'x-user-analytics' ] ;
252252 const userAnalytics = typeof xUserAnalytics == 'number' ? xUserAnalytics : undefined ;
253253
254+ // Deprecated is set only if it's true or a string.
255+ const xDeprecated = current [ 'x-deprecated' ] ;
256+ const deprecated = ( xDeprecated === true || typeof xDeprecated === 'string' )
257+ ? xDeprecated : undefined ;
258+
254259 const option : Option = {
255260 name,
256261 description : '' + ( current . description === undefined ? '' : current . description ) ,
@@ -262,6 +267,7 @@ export async function parseJsonSchemaToOptions(
262267 ...format !== undefined ? { format } : { } ,
263268 hidden,
264269 ...userAnalytics ? { userAnalytics } : { } ,
270+ ...deprecated !== undefined ? { deprecated } : { } ,
265271 ...positional !== undefined ? { positional } : { } ,
266272 } ;
267273
You can’t perform that action at this time.
0 commit comments