bem-sdk icon indicating copy to clipboard operation
bem-sdk copied to clipboard

decl.normalize don't handle elems: { elem, mod, val } at v2

Open Vittly opened this issue 7 years ago • 0 comments

const decl = require('@bem/sdk.decl');
const BemCell = require('@bem/sdk.cell');
const BemEntityName = require('@bem/sdk.entity-name');

const scope = new BemCell({  entity: new BemEntityName({ block: 'foo' }), tech: null });

const content = {
  elems: { elem: 'bar', mod: 'm', val: 'v' }
};

decl.normalize(content, { scope });
// got: [ BemCell { entity: { block: 'ugc' } },
//   BemCell { entity: { block: 'ugc', elem: 'bar' } } ]

// want to: [ BemCell { entity: { block: 'ugc' } },
//   BemCell { entity: { block: 'ugc', elem: 'bar', mod: 'm' } },
//   BemCell { entity: { block: 'ugc', elem: 'bar', mod: 'm', val: 'v' } },

:(

Vittly avatar Aug 17 '18 11:08 Vittly