bem / bem-sdk

BEM SDK packages
https://en.bem.info/toolbox/sdk/
88 stars 25 forks source link

keyset: add merge #350

Open Yeti-or opened 6 years ago

Yeti-or commented 6 years ago

this is ugly right now =(

            const keyset = keysets.reduce((acc, k) => {
                const langs = k.langs;
                langs.forEach(lang => {
                    const langKeys = acc.getLangKeysForLang(lang);
                    const keys = langKeys ? acc.getKeysForLang(lang) : [];
                    const _keys = k.getKeysForLang(lang);
                    acc.addKeysForLang(lang, new LangKeys(lang, [...keys, ..._keys]));
                });
                return acc;
            }, new Keyset('', move));