Ohm-Management - Projektarbeit B-ME
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.

console.js 3.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.consoleInfo = consoleInfo;
  6. exports.consoleWarn = consoleWarn;
  7. exports.consoleError = consoleError;
  8. exports.deprecate = deprecate;
  9. function createMessage(message, vm, parent) {
  10. if (parent) {
  11. vm = {
  12. _isVue: true,
  13. $parent: parent,
  14. $options: vm
  15. };
  16. }
  17. if (vm) {
  18. // Only show each message once per instance
  19. vm.$_alreadyWarned = vm.$_alreadyWarned || [];
  20. if (vm.$_alreadyWarned.includes(message)) return;
  21. vm.$_alreadyWarned.push(message);
  22. }
  23. return '[Vuetify] ' + message + (vm ? generateComponentTrace(vm) : '');
  24. }
  25. function consoleInfo(message, vm, parent) {
  26. var newMessage = createMessage(message, vm, parent);
  27. newMessage != null && console.info(newMessage);
  28. }
  29. function consoleWarn(message, vm, parent) {
  30. var newMessage = createMessage(message, vm, parent);
  31. newMessage != null && console.warn(newMessage);
  32. }
  33. function consoleError(message, vm, parent) {
  34. var newMessage = createMessage(message, vm, parent);
  35. newMessage != null && console.error(newMessage);
  36. }
  37. function deprecate(original, replacement, vm, parent) {
  38. consoleWarn('\'' + original + '\' is deprecated, use \'' + replacement + '\' instead', vm, parent);
  39. }
  40. /**
  41. * Shamelessly stolen from vuejs/vue/blob/dev/src/core/util/debug.js
  42. */
  43. var classifyRE = /(?:^|[-_])(\w)/g;
  44. var classify = function classify(str) {
  45. return str.replace(classifyRE, function (c) {
  46. return c.toUpperCase();
  47. }).replace(/[-_]/g, '');
  48. };
  49. function formatComponentName(vm, includeFile) {
  50. if (vm.$root === vm) {
  51. return '<Root>';
  52. }
  53. var options = typeof vm === 'function' && vm.cid != null ? vm.options : vm._isVue ? vm.$options || vm.constructor.options : vm || {};
  54. var name = options.name || options._componentTag;
  55. var file = options.__file;
  56. if (!name && file) {
  57. var match = file.match(/([^/\\]+)\.vue$/);
  58. name = match && match[1];
  59. }
  60. return (name ? '<' + classify(name) + '>' : '<Anonymous>') + (file && includeFile !== false ? ' at ' + file : '');
  61. }
  62. function generateComponentTrace(vm) {
  63. if (vm._isVue && vm.$parent) {
  64. var tree = [];
  65. var currentRecursiveSequence = 0;
  66. while (vm) {
  67. if (tree.length > 0) {
  68. var last = tree[tree.length - 1];
  69. if (last.constructor === vm.constructor) {
  70. currentRecursiveSequence++;
  71. vm = vm.$parent;
  72. continue;
  73. } else if (currentRecursiveSequence > 0) {
  74. tree[tree.length - 1] = [last, currentRecursiveSequence];
  75. currentRecursiveSequence = 0;
  76. }
  77. }
  78. tree.push(vm);
  79. vm = vm.$parent;
  80. }
  81. return '\n\nfound in\n\n' + tree.map(function (vm, i) {
  82. return '' + (i === 0 ? '---> ' : ' '.repeat(5 + i * 2)) + (Array.isArray(vm) ? formatComponentName(vm[0]) + '... (' + vm[1] + ' recursive calls)' : formatComponentName(vm));
  83. }).join('\n');
  84. } else {
  85. return '\n\n(found in ' + formatComponentName(vm) + ')';
  86. }
  87. }
  88. //# sourceMappingURL=console.js.map