Skip to content

Simplify parse and stringify methods #4

Description

@Yeti-or

original: bem/bem-sdk#181

Atm naming has shared parts of code with BemEntityName like usage of deprecated fields.
Would be better to has a tiny method for stringifying entityName with naming:

let res = e.block;
e.elem && (res += delims.elem + e.elem);
e.mod && (
  res += delims.mod.name + e.mod.name,
  e.mod.val === true || (res += delims.mod.val + e.mod.val)
);
return res;

and another tiny method for normalization old versions to the modern one as it does in BemEntityName.create: https://github.com/bem-sdk/bem-entity-name/blob/86e59d24/lib/entity-name.js#L379-L406

Perhaps we can make a separate function to let users use it with stringify as they did it before.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions