1.0.0 • Published 6 years ago

@ianwalter/find-key v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
6 years ago

@ianwalter/find-key

A utility that searches through nested layers for a keyed value

About

findKey is a simple recursive function that returns the first value found that is assigned to a key that matches the given key. I wrote this in order to more easily retrieve values with unique keys from JSON objects with multiple layers of nesting that were generated from converting API Blueprints to JSON through blueline.

Installation

npm install @ianwalter/find-key

Usage

const findKey = require('@ianwalter/find-key')

findKey(obj, 'someKeyName')

 

ISC © Ian Walter