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
@bem.decl: using assign function
node v10.24.1
version:
1.0.1
endpoint
share
tweet
Fills missed BEM cell fields with the fields from the scope except the `layer` field.
const bemDecl = require('@bem/sdk.decl'); bemDecl.assign( { entity: { elem: '1'}, tech: 'js'}, { entity: { block: 'a'}} ).valueOf();
bemDecl.assign( { tech: 'js'}, { entity: { block: 'a'}, tech: 'css'} ).valueOf();
bemDecl.assign( { entity: { mod: { name: 'test'}}}, { entity: { block: 'a', elem: '1'}, tech: 'js' } ).valueOf();
// If you pass only a `block` field, it will dominate over the other BemEntityName fields. bemDecl.assign( { entity: { block: 'a'}}, { entity: { block: 'b', elem: '1'}, tech: 'js' } ).valueOf();
Loading…
no comments
sign in
to comment