updated format and lint scripts and applied them
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
export default sort => {
|
||||
let key, ascDesc;
|
||||
switch(typeof sort) {
|
||||
case 'object': {
|
||||
key = Object.keys(sort).pop();
|
||||
ascDesc = sort[key];
|
||||
break;
|
||||
let key, ascDesc
|
||||
switch (typeof sort) {
|
||||
case 'object': {
|
||||
key = Object.keys(sort).pop()
|
||||
ascDesc = sort[key]
|
||||
break
|
||||
}
|
||||
case 'string': {
|
||||
const parts = sort.split(':')
|
||||
key = parts[0]
|
||||
ascDesc = parts[1]
|
||||
break
|
||||
}
|
||||
default:
|
||||
break
|
||||
}
|
||||
case 'string': {
|
||||
const parts = sort.split(':');
|
||||
key = parts[0];
|
||||
ascDesc = parts[1];
|
||||
break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
return `$sort[${key}]=${ascDesc}`;
|
||||
};
|
||||
return `$sort[${key}]=${ascDesc}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user