* feat(theme)!: migrate `plugin-markdown-hint` * chore: tweak * chore: tweak * chore: tweak * chore: tweak * chore: tweak * chore: tweak * chore: tweak * chore: tweak * chore: tweak * chore: tweak * fix(theme): improve `home-blog` styles in mobile, close #210 * chore: tweak * chore: tweak
13 lines
270 B
TypeScript
13 lines
270 B
TypeScript
export function deleteAttrs<
|
|
T extends Record<string, any> = Record<string, any>,
|
|
>(obj: T, ...attrs: (keyof T)[]): Omit<T, keyof T> {
|
|
const res = {} as T
|
|
|
|
for (const key in obj) {
|
|
if (!attrs.includes(key)) {
|
|
res[key] = obj[key]
|
|
}
|
|
}
|
|
return res
|
|
}
|