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 @@ -153,6 +153,12 @@ export interface Option {
153
153
* If this is falsey, do not report this option.
154
154
*/
155
155
userAnalytics ?: number ;
156
+
157
+ /**
158
+ * Deprecation. If this flag is not false a warning will be shown on the console. Either `true`
159
+ * or a string to show the user as a notice.
160
+ */
161
+ deprecated ?: boolean | string ;
156
162
}
157
163
158
164
/**
Original file line number Diff line number Diff line change @@ -251,6 +251,11 @@ export async function parseJsonSchemaToOptions(
251
251
const xUserAnalytics = current [ 'x-user-analytics' ] ;
252
252
const userAnalytics = typeof xUserAnalytics == 'number' ? xUserAnalytics : undefined ;
253
253
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
+
254
259
const option : Option = {
255
260
name,
256
261
description : '' + ( current . description === undefined ? '' : current . description ) ,
@@ -262,6 +267,7 @@ export async function parseJsonSchemaToOptions(
262
267
...format !== undefined ? { format } : { } ,
263
268
hidden,
264
269
...userAnalytics ? { userAnalytics } : { } ,
270
+ ...deprecated !== undefined ? { deprecated } : { } ,
265
271
...positional !== undefined ? { positional } : { } ,
266
272
} ;
267
273
You can’t perform that action at this time.
0 commit comments