fakeChalk.js 792 B

12345678910111213141516171819202122232425262728
  1. 'use strict';
  2. var _ansiStyles = _interopRequireDefault(require('ansi-styles'));
  3. function _interopRequireDefault(obj) {
  4. return obj && obj.__esModule ? obj : {default: obj};
  5. }
  6. /**
  7. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  8. *
  9. * This source code is licensed under the MIT license found in the
  10. * LICENSE file in the root directory of this source tree.
  11. */
  12. const returnInput = str => str;
  13. const allColorsAsFunc = Object.keys(_ansiStyles.default)
  14. .map(style => ({
  15. [style]: returnInput
  16. }))
  17. .reduce((acc, cur) => Object.assign(acc, cur));
  18. Object.keys(allColorsAsFunc)
  19. .map(color => allColorsAsFunc[color])
  20. .forEach(style => {
  21. Object.assign(style, allColorsAsFunc);
  22. Object.assign(returnInput, style);
  23. });
  24. module.exports = allColorsAsFunc;