Would you like to clone this notebook?

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

Cancel

@bem.decl: using assign function

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