Skip to content
This repository has been archived by the owner on Feb 4, 2018. It is now read-only.

Fix the dich with mod, mod-val, modName-modVal #121

Open
qfox opened this issue May 11, 2017 · 0 comments
Open

Fix the dich with mod, mod-val, modName-modVal #121

qfox opened this issue May 11, 2017 · 0 comments

Comments

@qfox
Copy link
Contributor

qfox commented May 11, 2017

Конструктор должен принимать только норм значения (true или строку).
create должен преобразовывать undefined к true, а при других falsy значениях — удалять модификатор.

> new q({block: 'b', mod: {name: 'qwe', val: undefined}})
BemEntityName { block: 'b', mod: { name: 'qwe', val: undefined } }
> new q({block: 'b', mod: 'qwe', val: undefined})
BemEntityName { block: 'b', mod: { name: 'qwe', val: true } }

> q.create({block: 'b', modName: 'qwe', modVal: undefined})
BemEntityName { block: 'b', mod: { name: 'qwe', val: undefined } }
> q.create({block: 'b', mod: 'qwe', val: undefined})
BemEntityName { block: 'b', mod: { name: 'qwe', val: undefined } }
> q.create({block: 'b', mod: 'qwe'})
BemEntityName { block: 'b', mod: { name: 'qwe', val: true } }

> q.create({block: 'b', mod: {name: 'qwe'}})
BemEntityName { block: 'b', mod: { name: 'qwe', val: true } }
> q.create({block: 'b', mod: {name: 'qwe', val: undefined}})
BemEntityName { block: 'b', mod: { name: 'qwe', val: undefined } }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant