UNPKG

@modern-kit/utils

Version:
17 lines (14 loc) 333 B
'use strict'; function findLastKey(obj, condition) { const keys = Object.keys(obj); for (let i = keys.length - 1; i >= 0; i--) { const key = keys[i]; const value = obj[key]; if (condition(value)) { return key; } } return void 0; } exports.findLastKey = findLastKey; //# sourceMappingURL=index.cjs.map