naming.entity: using a custom naming convention

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

no comments

    sign in to comment