main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
746 bytes
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | /*eslint no-console:0*/
|
---|
| 4 |
|
---|
| 5 | /**
|
---|
| 6 | * Supply a warning to the developer that a method they are using
|
---|
| 7 | * has been deprecated.
|
---|
| 8 | *
|
---|
| 9 | * @param {string} method The name of the deprecated method
|
---|
| 10 | * @param {string} [instead] The alternate method to use if applicable
|
---|
| 11 | * @param {string} [docs] The documentation URL to get further details
|
---|
| 12 | *
|
---|
| 13 | * @returns {void}
|
---|
| 14 | */
|
---|
| 15 | export default function deprecatedMethod(method, instead, docs) {
|
---|
| 16 | try {
|
---|
| 17 | console.warn(
|
---|
| 18 | 'DEPRECATED method `' + method + '`.' +
|
---|
| 19 | (instead ? ' Use `' + instead + '` instead.' : '') +
|
---|
| 20 | ' This method will be removed in a future release.');
|
---|
| 21 |
|
---|
| 22 | if (docs) {
|
---|
| 23 | console.warn('For more information about usage see ' + docs);
|
---|
| 24 | }
|
---|
| 25 | } catch (e) { /* Ignore */ }
|
---|
| 26 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.