UNPKG

849 BJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, '__esModule', {
4 value: true
5});
6exports.deprecationWarning = void 0;
7var _utils = require('./utils');
8/**
9 * Copyright (c) Meta Platforms, Inc. and affiliates.
10 *
11 * This source code is licensed under the MIT license found in the
12 * LICENSE file in the root directory of this source tree.
13 */
14
15const deprecationMessage = (message, options) => {
16 const comment = options.comment;
17 const name =
18 (options.title && options.title.deprecation) || _utils.DEPRECATION;
19 (0, _utils.logValidationWarning)(name, message, comment);
20};
21const deprecationWarning = (config, option, deprecatedOptions, options) => {
22 if (option in deprecatedOptions) {
23 deprecationMessage(deprecatedOptions[option](config), options);
24 return true;
25 }
26 return false;
27};
28exports.deprecationWarning = deprecationWarning;