deprecated.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. 'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports.deprecationWarning = undefined;var _utils;
  2. function _load_utils() {return _utils = require('./utils');} /**
  3. * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
  4. *
  5. * This source code is licensed under the MIT license found in the
  6. * LICENSE file in the root directory of this source tree.
  7. *
  8. *
  9. */const deprecationMessage = (message, options) => {const comment = options.comment;const name = options.title && options.title.deprecation || (_utils || _load_utils()).DEPRECATION;(0, (_utils || _load_utils()).logValidationWarning)(name, message, comment);};
  10. const deprecationWarning = exports.deprecationWarning = (
  11. config,
  12. option,
  13. deprecatedOptions,
  14. options) =>
  15. {
  16. if (option in deprecatedOptions) {
  17. deprecationMessage(deprecatedOptions[option](config), options);
  18. return true;
  19. }
  20. return false;
  21. };