mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
chore: minor fix
This commit is contained in:
parent
413ee74264
commit
0f5c2f5d09
2 changed files with 4 additions and 4 deletions
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* cx('class1', { class2: true, class3: false }) --> 'class1 class2'
|
||||
*/
|
||||
export default function cx(...classNames: (string | object)[]): string {
|
||||
export default function cx(...classNames: any[]): string {
|
||||
return classNames
|
||||
.filter(Boolean)
|
||||
.map(className => {
|
||||
|
|
@ -10,7 +10,7 @@ export default function cx(...classNames: (string | object)[]): string {
|
|||
return className
|
||||
case 'object':
|
||||
return cx(
|
||||
...Object.entries(className).map(([key, value]) => (Boolean(value) ? key : null))
|
||||
...Object.entries(className).map(([key, value]) => (Boolean(value) ? key : null)),
|
||||
)
|
||||
default:
|
||||
return ''
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
const localStorage = chrome.storage.local
|
||||
|
||||
function get(mapping: string | string[] | object) {
|
||||
function get(mapping: string | string[] | object): Promise<any> {
|
||||
return new Promise(resolve => localStorage.get(mapping, resolve))
|
||||
}
|
||||
|
||||
function set(value: any) {
|
||||
function set(value: any): Promise<void> {
|
||||
// it's ok
|
||||
return new Promise(resolve => localStorage.set(value, resolve))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue