assert.js 551 B

123456789101112131415
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.assertDeprecated = assertDeprecated;
  4. const deprecations = new Set();
  5. /**
  6. * Asserts that some condition is true, and if not, prints a warning about it being deprecated.
  7. * The message is printed only once.
  8. */
  9. function assertDeprecated(check, name, message) {
  10. if (!check && !deprecations.has(name)) {
  11. // eslint-disable-next-line no-console
  12. console.warn(`[concurrently] ${name} is deprecated. ${message}`);
  13. deprecations.add(name);
  14. }
  15. }