Find matching values for a given name key in an object.
npm i find-up-keys
const findUpKeys = require('find-up-keys');
// some random nested object
const obj = {
title: 'Hello, World!',
description: 'Hi!',
info: {
description: 'more desc',
tags: ['...'],
extras: {
description: null
}
}
};
findUpKeys(obj, 'description'); // <= ['Hi!', 'more desc', null]
Find matching values for a key in an object.
Type: object
Object to check.
Type: string
Keys to find.
MIT