Skip to content
This repository has been archived by the owner on Feb 4, 2018. It is now read-only.

Commit

Permalink
refactor: rename BemEntity to BemEntityName
Browse files Browse the repository at this point in the history
  • Loading branch information
blond committed Jun 2, 2016
1 parent 3667914 commit 80336f3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions README.md
Expand Up @@ -28,19 +28,19 @@ Usage
-----

```js
import BemEntity from 'bem-entity-name';
const BemEntityName = require('bem-entity-name');

const entity = new BemEntity({ block: 'button', elem: 'text' });
const entityName = new BemEntityName({ block: 'button', elem: 'text' });

console.log(entity.block); // button
console.log(entity.elem); // text
console.log(entity.mod); // undefined
console.log(entityName.block); // button
console.log(entityName.elem); // text
console.log(entityName.mod); // undefined

console.log(entity.id); // button__elem
console.log(entity.type); // elem
console.log(entityName.id); // button__elem
console.log(entityName.type); // elem

console.log(entity.isEqual({ block: 'button' })); // false
console.log(entity.isEqual({ block: 'button', elem: 'text' })); // true
console.log(entityName.isEqual({ block: 'button' })); // false
console.log(entityName.isEqual({ block: 'button', elem: 'text' })); // true
```

License
Expand Down
4 changes: 2 additions & 2 deletions index.js
@@ -1,11 +1,11 @@
'use strict';

var naming = require('bem-naming');
const naming = require('bem-naming');

const stringifyEntity = naming.stringify;
const typeOfEntity = naming.typeOf;

module.exports = class BemEntity {
module.exports = class BemEntityName {
constructor(obj) {
if (!obj.block) {
throw new Error('This is not valid BEM entity: the field `block` is undefined.');
Expand Down

0 comments on commit 80336f3

Please sign in to comment.