Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.


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

node v10.24.1
version: 1.0.1
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

    sign in to comment