|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
644 bytes
|
| Line | |
|---|
| 1 | /**
|
|---|
| 2 | * Prints a warning in the console if it exists.
|
|---|
| 3 | *
|
|---|
| 4 | * @param {String} message The warning message.
|
|---|
| 5 | * @returns {void}
|
|---|
| 6 | */
|
|---|
| 7 | export default function warning(message: string) {
|
|---|
| 8 | /* eslint-disable no-console */
|
|---|
| 9 | if (typeof console !== 'undefined' && typeof console.error === 'function') {
|
|---|
| 10 | console.error(message)
|
|---|
| 11 | }
|
|---|
| 12 | /* eslint-enable no-console */
|
|---|
| 13 | try {
|
|---|
| 14 | // This error was thrown as a convenience so that if you enable
|
|---|
| 15 | // "break on all exceptions" in your console,
|
|---|
| 16 | // it would pause the execution at this line.
|
|---|
| 17 | throw new Error(message)
|
|---|
| 18 | /* eslint-disable no-empty */
|
|---|
| 19 | } catch (e) {}
|
|---|
| 20 | /* eslint-enable no-empty */
|
|---|
| 21 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.