omit 函数用于从对象中排除指定的键,返回新对象。
import { omit } from '@movk/core'
const user = {
id: 1,
name: 'John',
password: 'secret',
email: 'john@example.com'
}
const publicUser = omit(user, ['password'])
console.log(publicUser) // { id: 1, name: 'John', email: 'john@example.com' }
const basicInfo = omit(user, ['password', 'email'])
console.log(basicInfo) // { id: 1, name: 'John' }
omit<T, K>(obj, keys)从对象中排除指定的键,返回新对象。
7c832 — refactor!: 重构模块架构,拆分 utils 为专业化模块