Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
naming.cell.match: using origin naming convention
node v10.24.1
version:
1.0.0
endpoint
share
tweet
const originNaming = require('@bem/sdk.naming.presets/origin'); const match = require('@bem/sdk.naming.cell.match')(originNaming);
Examples with correct paths.
let correctPath = 'my-layer.blocks/my-block/my-block.js'; match(correctPath).isMatch;
match(correctPath).cell.valueOf();
correctPath = 'common.blocks/my-block/_my-modifier/my-block_my-modifier.css'; match(correctPath).isMatch;
match(correctPath).cell.valueOf();
Examples with incorrect paths.
let incorrectPath = 'my-layer.blocks/my-block/my-block.js_some-text'; match(incorrectPath);
match(incorrectPath).cell.valueOf();
incorrectPath = 'some incorrect string'; match(incorrectPath);
incorrectPath = 'my-block/my-block.js'; match(incorrectPath);
Loading…
no comments
sign in
to comment