bem-sdk-archive / bem-entity-name

BEM entity name representation. DEPRECATED →
https://github.com/bem/bem-sdk/tree/master/packages/entity-name
Other
5 stars 3 forks source link

Add typeOf method #25

Closed blond closed 8 years ago

blond commented 8 years ago

We should move typeOf method from bem-naming (https://github.com/bem-sdk/bem-naming/issues/98).

API:

const BemEntityPart = require('bem-entity-part');

BemEntityPart.typeOf({ block: 'button', elem: 'text' }); // elem

This method should support BemEntityName instances and objects with block, elem, mod properties.

qfox commented 8 years ago

Guess we can close this since

> new BemEntityName({block: 'b'}).type
'block'

right?