naming.entity: convert a string to the Two Dashes style
const originNaming = require('@bem/sdk.naming.entity');
const twoDashesNaming = require('@bem/sdk.naming.entity')('two-dashes');
const bemEntityNameStr = 'my-block__my-element_my-modifier_some-value'
const bemEntityNameObj = originNaming.parse(bemEntityName);
// => BemEntityName {
// block: 'my-block',
// elem: 'my-element',
// mod: { name: 'my-modifier', val: 'some-value' }
// }
twoDashesNaming.stringify(bemEntityNameObj);
no comments