package
find value inside nested object from key name
npm install find-keyGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Estimated unpacked size across 1 packages.
5.7 kB
Includes dependencies.
#find-key
Finds matching value of supplied key inside deep nested object
npm install find-keyThe return value will be an array of values matching the key name supplied
const Find = require('find-key');
const obj = {
type: 'object',
properties: {
first: {type: 'string', format: 'lookup'},
extra: {type: 'string', format: 'lookup'},
test: {type: 'string', format: 'dbRef'},
},
additionaProperties: false,
format: 'dbRef',
title: 'country schema',
};
const res = Find(obj, 'format');
console.log(res); // should equal an array with the following values ['lookup', 'dbRef']