refactor: extract remove util
This commit is contained in:
@@ -36,6 +36,13 @@ export const extend = <T extends object, U extends object>(
|
||||
return a as any
|
||||
}
|
||||
|
||||
export const remove = <T>(arr: T[], el: T) => {
|
||||
const i = arr.indexOf(el)
|
||||
if (i > -1) {
|
||||
arr.splice(i, 1)
|
||||
}
|
||||
}
|
||||
|
||||
const hasOwnProperty = Object.prototype.hasOwnProperty
|
||||
export const hasOwn = (
|
||||
val: object,
|
||||
|
||||
Reference in New Issue
Block a user