Skip to content

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

@Vittly

Description

@Vittly
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' } },

:(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions