common.js 636 B

12345678910111213141516
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const chalk_1 = require("chalk");
  4. exports.commonDeprecatedHandler = (keyOrPair, redirectTo, { descriptor }) => {
  5. const messages = [
  6. `${chalk_1.default.yellow(typeof keyOrPair === 'string'
  7. ? descriptor.key(keyOrPair)
  8. : descriptor.pair(keyOrPair))} is deprecated`,
  9. ];
  10. if (redirectTo) {
  11. messages.push(`we now treat it as ${chalk_1.default.blue(typeof redirectTo === 'string'
  12. ? descriptor.key(redirectTo)
  13. : descriptor.pair(redirectTo))}`);
  14. }
  15. return messages.join('; ') + '.';
  16. };