File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 11import * as api from 'src/utils/4.api.js' ;
22import Item from 'src/structures/constants/item.js' ;
3+ import Priority from 'src/structures/constants/priority' ;
34
45const constants = api . mod . constants ;
5- Object . keys ( Item ) . forEach ( ( key ) => {
6- constants [ key ] = Item [ key ] ;
7- } ) ;
6+ Object . entries ( Item ) . forEach ( ( ( [ key , value ] ) => {
7+ Object . defineProperty ( constants , key , {
8+ get ( ) {
9+ console . warn ( `'underscript.constants.${ key } ' is deprecated, use 'underscript.items.${ key } ' instead.` ) ;
10+ return value ;
11+ } ,
12+ } ) ;
13+ } ) ) ;
14+
15+ constants . getItem = ( value ) => Item . find ( value ) ;
16+ constants . isItem = ( other ) => Item . find ( other ) !== undefined ;
17+ constants . getPriority = ( value ) => Priority . find ( value ) ;
18+ constants . isPriority = ( other ) => Priority . find ( other ) !== undefined ;
You can’t perform that action at this time.
0 commit comments