naming.entity: convert a string to the Two Dashes style

node v10.16.0
version: 1.0.1
endpointsharetweet
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);
Loading…

no comments

    sign in to comment