mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
chore(cloudcmd) lint
This commit is contained in:
parent
ed58853acc
commit
901fd252f1
4 changed files with 18 additions and 8 deletions
|
|
@ -5,7 +5,7 @@ const tryCatch = require('try-catch');
|
|||
const {parse, stringify} = JSON;
|
||||
const isObj = (a) => typeof a === 'object';
|
||||
|
||||
module.exports.set = async (name, data) => {
|
||||
module.exports.set = (name, data) => {
|
||||
const primitive = !isObj(data) ? data : stringify(data);
|
||||
|
||||
localStorage.setItem(name, primitive);
|
||||
|
|
@ -18,11 +18,11 @@ module.exports.get = async (name) => {
|
|||
return result;
|
||||
};
|
||||
|
||||
module.exports.clear = async () => {
|
||||
module.exports.clear = () => {
|
||||
localStorage.clear();
|
||||
};
|
||||
|
||||
module.exports.remove = async(item) => {
|
||||
module.exports.remove = (item) => {
|
||||
localStorage.removeItem(item);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,11 @@ module.exports = (key, operations) => {
|
|||
}
|
||||
|
||||
if (key === 'j') {
|
||||
const {count, isDelete, isVisual} = handleDelete(prevStore);
|
||||
const {
|
||||
count,
|
||||
isDelete,
|
||||
isVisual,
|
||||
} = handleDelete(prevStore);
|
||||
|
||||
!isNaN(count) && moveNext({
|
||||
count,
|
||||
|
|
@ -60,7 +64,11 @@ module.exports = (key, operations) => {
|
|||
}
|
||||
|
||||
if (key === 'k') {
|
||||
const {count, isDelete, isVisual} = handleDelete(prevStore);
|
||||
const {
|
||||
count,
|
||||
isDelete,
|
||||
isVisual,
|
||||
} = handleDelete(prevStore);
|
||||
|
||||
!isNaN(count) && movePrevious({
|
||||
count,
|
||||
|
|
@ -72,7 +80,10 @@ module.exports = (key, operations) => {
|
|||
}
|
||||
|
||||
if (/^gg$/.test(value)) {
|
||||
const {count, isDelete, isVisual} = handleDelete(prevStore);
|
||||
const {
|
||||
isDelete,
|
||||
isVisual,
|
||||
} = handleDelete(prevStore);
|
||||
|
||||
movePrevious({
|
||||
count: Infinity,
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ async function show(data, options) {
|
|||
}
|
||||
}
|
||||
|
||||
async function viewPDF(src) {
|
||||
function viewPDF(src) {
|
||||
const element = createElement('iframe', {
|
||||
src,
|
||||
width: '100%',
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ const DIR = DIR_SERVER + '../';
|
|||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const Emitter = require('events');
|
||||
const {promisify} = require('util');
|
||||
const {homedir} = require('os');
|
||||
|
||||
const exit = require(DIR_SERVER + 'exit');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue