Clean code.

This commit is contained in:
Lars Jung 2016-06-20 01:37:18 +02:00
parent 3246525d78
commit f6150c58f4
3 changed files with 39 additions and 37 deletions

View file

@ -1,4 +1,6 @@
const {jq, lo} = require('./globals');
const {jq} = require('./globals');
const each = (obj, fn) => Object.keys(obj).forEach(key => fn(obj[key], key));
const request = data => {
return new Promise(resolve => {
@ -16,7 +18,7 @@ const request = data => {
const formRequest = data => {
const $form = jq('<form method="post" action="?" style="display:none;"/>');
lo.each(data, (val, key) => {
each(data, (val, key) => {
jq('<input type="hidden"/>')
.attr('name', key)
.attr('value', val)