UNPKG

@yookue/ts-lang-utils

Version:

Common lang utilities for typescript

11 lines 349 B
import { isPlain } from "./isPlain"; export function mapEachProp(object, callback) { if (!object || !isPlain(object) || !callback) { return undefined; } return Object.keys(object).filter(function (key) { return Object.prototype.hasOwnProperty.call(object, key); }).map(function (key, index) { return callback(key, index); }); }