naming.entity: using a custom naming convention
const createBemNaming = require('@bem/sdk.naming.entity');
const myNamingOptions = {
delims: {
mod: { val: '=' }
}
};
const myNaming = createBemNaming(myNamingOptions);
// Parse a BEM entity name to test created instance.
myNaming.parse('my-block_my-modifier=some-value');
// Stringify an object representation of the BEM entity name.
const myEntity = {
block: 'my-block',
elem: 'my-element',
mod: {
name: 'my-modifier',
val: 'some-value'
}
};
myNaming.stringify(myEntity);
no comments