fake_chalk.js 817 B

1234567891011121314151617181920212223242526272829303132
  1. 'use strict';
  2. var _ansiStyles = require('ansi-styles');
  3. var _ansiStyles2 = _interopRequireDefault(_ansiStyles);
  4. function _interopRequireDefault(obj) {
  5. return obj && obj.__esModule ? obj : {default: obj};
  6. }
  7. const returnInput = str => str;
  8. /**
  9. * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
  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. */
  15. const allColorsAsFunc = Object.keys(_ansiStyles2.default)
  16. .map(style => ({[style]: returnInput}))
  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;