web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
743 B

  1. /*
  2. * MIT License http://opensource.org/licenses/MIT
  3. * Author: Ben Holloway @bholloway
  4. */
  5. 'use strict';
  6. var stream = require('stream');
  7. var maybeStream = process[process.env.RESOLVE_URL_LOADER_TEST_HARNESS];
  8. function logToTestHarness(options) {
  9. if (!!maybeStream && (typeof maybeStream === 'object') && (maybeStream instanceof stream.Writable)) {
  10. Object.keys(options).map(eachOptionKey);
  11. maybeStream = null; // ensure we log only once
  12. }
  13. function eachOptionKey(key) {
  14. var value = options[key];
  15. var text = (typeof value === 'undefined') ?
  16. String(value) :
  17. (JSON.stringify(value.valueOf()) || '-unstringifyable-');
  18. maybeStream.write(key + ': ' + text + '\n');
  19. }
  20. }
  21. module.exports = logToTestHarness;