0.0.2 • Published 9 years ago

bem-entity-name v0.0.2

Weekly downloads
4
License
MPL-2.0
Repository
github
Last release
9 years ago

bem-entity-name

NPM Status Travis Status Coverage Status

Install

$ npm install --save bem-entity-name

Usage

const BemEntityName = require('bem-entity-name');

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

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

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

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

License

Code and documentation © 2016 YANDEX LLC. Code released under the Mozilla Public License 2.0.