This repository has been archived on 2020-04-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Vim-Vixen/src/content/actions/setting.js
2017-11-13 19:44:19 +09:00

23 lines
447 B
JavaScript

import actions from 'content/actions';
import * as keyUtils from 'shared/utils/keys';
const set = (value) => {
let entries = [];
if (value.keymaps) {
entries = Object.entries(value.keymaps).map((entry) => {
return [
keyUtils.fromMapKeys(entry[0]),
entry[1],
];
});
}
return {
type: actions.SETTING_SET,
value: Object.assign({}, value, {
keymaps: entries,
})
};
};
export { set };