Parse a string using Origin naming convention

node v8.17.0
version: 2.0.0
endpointsharetweet
const originNaming = require('@bem/sdk.naming.presets/origin'); const parse = require('@bem/sdk.naming.entity.parse')(originNaming); // Parse a block name. parse('my-block');
// Parse an element name. parse('my-block__my-element');
// Parse a block modifier name. parse('my-block_my-modifier');
// Parse a block modifier name with a value. parse('my-block_my-modifier_some-value');
// Parse an element modifier name. parse('my-block__my-element_my-modifier');
// Parse an element modifier name with a value. parse('my-block__my-element_my-modifier_some-value');
// Normalize a returned BemEntityName object. parse('my-block__my-element_my-modifier_some-value').valueOf();
Loading…

no comments

    sign in to comment