abbott-methods
Version:
abbott,methods,method,functions,function
21 lines (19 loc) • 509 B
text/typescript
import {typeArray} from '../type/typeArray'
import {typeObject} from '../type/typeObject'
/**
* @desc 清除键值-全部
* @param {[]|{}} ao array或object
* @returns {[]}
*/
export const aoCleanKeyAll = (ao: any[] | Record<string | number | symbol, any>): any[] => {
const result = []
let count = 0
for (const key in ao) {
result[count] =
typeArray(ao[key]) || typeObject(ao[key])
? aoCleanKeyAll(ao[key])
: ao[key]
count++
}
return result
}