UNPKG
cpt-waffle-lotide
Version:
latest (1.0.0)
1.0.0
LoTide in Typescript
github.com/vasiliy-klimkin/lotide-ts
vasiliy-klimkin/lotide-ts
cpt-waffle-lotide
/
dist
/
findKey.ts
8 lines
(6 loc)
•
186 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
const
findKey = (
obj
:{[
key
:
string
]:
any
},
cb
:
(
arg
:
any
) =>
any
):
string
|
undefined
=>
{
for
(
let
key
of
Object
.
keys
(obj)) {
if
(
cb
(obj[key]))
return
key; } }
export
default
findKey;