Skip to content

Commit 099ee42

Browse files
author
blond
committed
docs(naming object): rename BEM-naming to naming object
1 parent 2d74024 commit 099ee42

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ bem-naming
1717
About
1818
-----
1919

20-
This tool allows getting information about BEM entity using [string](#string-representation) as well as forming string representation based on [BEM-naming](#bem-naming).
20+
This tool allows getting information about BEM entity using [string](#string-representation) as well as forming string representation based on [naming object](#object-representation-of-bem-entity).
2121

2222
Install
2323
-------
@@ -42,7 +42,7 @@ Table of Contents
4242

4343
* [String representation](#string-representation)
4444
* [Common misconceptions](#common-misconceptions)
45-
* [BEM-naming](#bem-naming-1)
45+
* [Object representation of BEM entity](#object-representation-of-bem-entity)
4646
* [API](#api)
4747
* [Custom naming convention](#custom-naming-convention)
4848
* [Convention by Harry Roberts](#convention-by-harry-roberts)
@@ -81,10 +81,10 @@ Also there is no such BEM entity as a modifier and an element modifier simultane
8181
'block_block-mod-name_block-mod-val__elem-name_elem-mod-name_elem-mod-val'
8282
```
8383

84-
BEM-naming
85-
----------
84+
Object representation of BEM entity
85+
-----------------------------------
8686

87-
BEM entities can be defined with a help of js-object with the following fields:
87+
BEM entities can be defined with a help of JS object with the following fields:
8888

8989
* `block` — a block name. The field is required because only a block exists as an independent BEM entity
9090
* `elem` — an element name.
@@ -169,7 +169,7 @@ bemNaming.validate('^*^'); // false
169169

170170
### parse(str)
171171

172-
It parses string `str` into BEM-naming.
172+
It parses string into naming object.
173173

174174
Example:
175175

@@ -180,7 +180,7 @@ bemNaming.parse('block__elem_mod_val'); // { block: 'block', elem: 'elem',
180180

181181
### stringify(obj)
182182

183-
It forms a string according to BEM-naming `obj`.
183+
It forms a string according to naming object.
184184

185185
Example:
186186

@@ -219,7 +219,7 @@ bemNaming.typeOf({ block: 'block', elem: 'elem', modName: 'mod' }); // elemMod
219219

220220
### isBlock(str)
221221

222-
Checks whether string `str` is a block.
222+
Checks whether string is a block.
223223

224224
Example:
225225

@@ -230,7 +230,7 @@ bemNaming.isBlock('block__elem'); // false
230230

231231
### isBlock(obj)
232232

233-
Checks whether BEM-naming `obj` is a block.
233+
Checks whether naming object is a block.
234234

235235
Example:
236236

@@ -241,7 +241,7 @@ bemNaming.isBlock({ block: 'block', elem: 'elem' }); // false
241241

242242
### isBlockMod(str)
243243

244-
Checks whether string `str` is modifier of a block.
244+
Checks whether string is modifier of a block.
245245

246246
Example:
247247

@@ -252,7 +252,7 @@ bemNaming.isBlockMod('block__elem_mod'); // false
252252

253253
### isBlockMod(obj)
254254

255-
Checks whether BEM-naming `obj` is modifier of a block.
255+
Checks whether naming object is modifier of a block.
256256

257257
Example:
258258

@@ -266,7 +266,7 @@ bemNaming.isBlockMod({ block: 'block', elem: 'elem',
266266

267267
### isElem(str)
268268

269-
Checks whether string `str` is element of a block.
269+
Checks whether string is element of a block.
270270

271271
Example:
272272

@@ -277,7 +277,7 @@ bemNaming.isElem('block-name'); // false
277277

278278
### isElem(obj)
279279

280-
Checks whether BEM-naming `obj` is element of a block.
280+
Checks whether naming object is element of a block.
281281

282282
Example:
283283

@@ -288,7 +288,7 @@ bemNaming.isElem({ block: 'block-name' }); // false
288288

289289
### isElemMod(str)
290290

291-
Checks whether string `str` is modifier of an element.
291+
Checks whether string is modifier of an element.
292292

293293
Example:
294294

@@ -299,7 +299,7 @@ bemNaming.isElemMod('block__elem'); // false
299299

300300
### isElemMod(obj)
301301

302-
Checks whether BEM-naming `obj` is modifier of an element.
302+
Checks whether naming object is modifier of an element.
303303

304304
Example:
305305

index.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ var cache = {};
4949

5050
/**
5151
* Creates namespace with methods which allows getting information about BEM entity using string as well
52-
* as forming string representation based on BEM-naming object.
52+
* as forming string representation based on naming object.
5353
*
5454
* @param {Object} [options] Options.
5555
* @param {String} [options.elem=__] Separates element's name from block.
@@ -73,17 +73,17 @@ function createNaming(options) {
7373
/**
7474
* Checks a string to be valid BEM notation.
7575
*
76-
* @param {String} str String representation of BEM entity.
76+
* @param {String} str - String representation of BEM entity.
7777
* @returns {Boolean}
7878
*/
7979
function validate(str) {
8080
return regex.test(str);
8181
}
8282

8383
/**
84-
* Parses string into BEM-naming object.
84+
* Parses string into naming object.
8585
*
86-
* @param {String} str String representation of BEM entity.
86+
* @param {String} str - string representation of BEM entity.
8787
* @returns {Object|undefined}
8888
*/
8989
function parse(str) {
@@ -110,9 +110,9 @@ function createNaming(options) {
110110
}
111111

112112
/**
113-
* Forms a string according to BEM-naming object.
113+
* Forms a string according to naming object.
114114
*
115-
* @param {Object} obj BEM-naming object
115+
* @param {Object} obj - naming object
116116
* @returns {String}
117117
*/
118118
function stringify(obj) {
@@ -144,7 +144,7 @@ function createNaming(options) {
144144
/**
145145
* Returns a string indicating type of a BEM entity.
146146
*
147-
* @param {Object|String|undefined} obj BEM-naming object or string representation of BEM entity.
147+
* @param {Object|String|undefined} obj - naming object or string representation of BEM entity.
148148
* @returns {String}
149149
*/
150150
function typeOf(obj) {
@@ -167,39 +167,39 @@ function createNaming(options) {
167167
}
168168

169169
/**
170-
* Checks whether BEM-naming object or string is a block.
170+
* Checks whether naming object or string is a block.
171171
*
172-
* @param {Object|String} obj BEM-naming object or string representation of BEM entity.
172+
* @param {Object|String} obj - naming object or string representation of BEM entity.
173173
* @returns {Boolean}
174174
*/
175175
function isBlock(obj) {
176176
return typeOf(obj) === TYPES.BLOCK;
177177
}
178178

179179
/**
180-
* Checks whether BEM-naming object or string is modifier of a block.
180+
* Checks whether naming object or string is modifier of a block.
181181
*
182-
* @param {Object|String} obj BEM-naming object or string representation of BEM entity.
182+
* @param {Object|String} obj - naming object or string representation of BEM entity.
183183
* @returns {Boolean}
184184
*/
185185
function isBlockMod(obj) {
186186
return typeOf(obj) === TYPES.BLOCK_MOD;
187187
}
188188

189189
/**
190-
* Checks whether BEM-naming object or string is element of a block.
190+
* Checks whether naming object or string is element of a block.
191191
*
192-
* @param {Object|String} obj BEM-naming object or string representation of BEM entity.
192+
* @param {Object|String} obj - naming object or string representation of BEM entity.
193193
* @returns {Boolean}
194194
*/
195195
function isElem(obj) {
196196
return typeOf(obj) === TYPES.ELEM;
197197
}
198198

199199
/**
200-
* Checks whether BEM-naming object or string is element of a block.
200+
* Checks whether naming object or string is element of a block.
201201
*
202-
* @param {Object|String} obj BEM-naming object or string representation of BEM entity.
202+
* @param {Object|String} obj - naming object or string representation of BEM entity.
203203
* @returns {Boolean}
204204
*/
205205
function isElemMod(obj) {

0 commit comments

Comments
 (0)