This repository was archived by the owner on Feb 4, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ const util = require('util');
4
4
5
5
const ExtendableError = require ( 'es6-error' ) ;
6
6
const stringifyEntity = require ( '@bem/naming' ) . stringify ;
7
+ const deprecate = require ( 'depd' ) ( require ( './package.json' ) . name ) ;
7
8
8
9
/**
9
10
* Enum for types of BEM entities.
@@ -114,19 +115,27 @@ class BemEntityName {
114
115
* If entity is not modifier then returns `undefined`.
115
116
*
116
117
* @returns {?string } - entity modifier name.
117
- * @deprecated - use ` mod.name` instead.
118
+ * @deprecated use { @link BemEntityName# mod.name}
118
119
*/
119
- get modName ( ) { return this . mod && this . mod . name ; }
120
+ get modName ( ) {
121
+ deprecate ( `modName is kept just for compatibility and can be dropped in the future. Use mod.name instead in ${ this . inspect ( ) } at` ) ;
122
+
123
+ return this . mod && this . mod . name ;
124
+ }
120
125
121
126
/**
122
127
* Returns the modifier value of this entity.
123
128
*
124
129
* If entity is not modifier then returns `undefined`.
125
130
*
126
131
* @returns {?(string|true) } - entity modifier name.
127
- * @deprecated - use ` mod.val` instead.
132
+ * @deprecated use { @link BemEntityName# mod.val}
128
133
*/
129
- get modVal ( ) { return this . mod && this . mod . val ; }
134
+ get modVal ( ) {
135
+ deprecate ( `modVal is kept just for compatibility and can be dropped in the future. Use mod.val instead in ${ this . inspect ( ) } at` ) ;
136
+
137
+ return this . mod && this . mod . val ;
138
+ }
130
139
131
140
/**
132
141
* Returns id for this entity.
Original file line number Diff line number Diff line change 33
33
},
34
34
"dependencies" : {
35
35
"@bem/naming" : " 2.0.0-5" ,
36
+ "depd" : " 1.1.0" ,
36
37
"es6-error" : " 4.0.2"
37
38
},
38
39
"devDependencies" : {
You can’t perform that action at this time.
0 commit comments