DEV: Add deprecation notice to discourse-common/utils/decorators (#17052)
This commit is contained in:
parent
6ae761604a
commit
9cd165d6b4
|
@ -1,4 +1,5 @@
|
|||
import isDescriptor from "discourse-common/utils/is-descriptor";
|
||||
import deprecated from "discourse-common/lib/deprecated";
|
||||
|
||||
function handleDescriptor(target, property, desc, fn, params = []) {
|
||||
return {
|
||||
|
@ -16,6 +17,9 @@ export default function macroAlias(fn) {
|
|||
if (isDescriptor(params[params.length - 1])) {
|
||||
return handleDescriptor(...params, fn);
|
||||
} else {
|
||||
deprecated(
|
||||
`Importing ${fn.name} from 'discourse-common/utils/decorators' is deprecated. You should instead import it from '@ember/object/computed' directly.`
|
||||
);
|
||||
return function (target, property, desc) {
|
||||
return handleDescriptor(target, property, desc, fn, params);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue