Closed blond closed 7 years ago
@tadatuta @zxqfox what do you think?
Is it necessary to repeat the same behavior?
I'm not sure what these two record means:
{ block: 'block', mod: { name: 'mod', val: false } }
{ block: 'block', mod: {} })
At the moment we need 3 states: some specific modifier, any modifier, and no modifier:
{ mod: 'm', val: 'v' }
{ mod: 'm', val: true } or { mod: 'm' }
{ }
val: false
is more than we need at my pov. What is the purpose of that?
{ block: 'block', mod: {} })
It is mean { block: 'block' }
.
{ block: 'block', mod: { name: 'mod', val: false } }
In bem-naming
it is mean { block: 'block' }
.
Now in bem-entity-name
it is mean { block: 'block', mod: { name: 'mod', val: false } }
.
Now in bem-entity-name it is mean { block: 'block', mod: { name: 'mod', val: false } }.
What the heck is that?
What the heck is that?
Modifier with false
value.
We decided not to change the normalize logic. If necessary, this can be done in higher-level packages.
Actual:
> q = new BemEntityName({ block: 'block', mod: { name: 'mod', val: false } });
BemEntityName { block: 'block', mod: { name: 'mod', val: undefined } }
> q.mod
{ name: 'mod', val: undefined }
> q.id
'block_mod'
>
We decided to assert modifier value: it should be nothing, or a string, or boolean true
value.
Closed in favor of #80
Now
bem-naming
turn off modifier if modifier value is falsy.Actual
BemEntityName
:bem-naming
expected: