0.3.1 • Published 5 years ago

responds v0.3.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

respond Build Status Maintainability

A library to test for deeply nested properties of complicated JavaScript objects.

Installation

From within your project directory run:

npm install --save responds

Usage

Responds exposes two functions to test for the existence of properties buried deep within JavaScript objects.

const testable = new Responds(myObject);

testable.has('path.to.my.deeply.nested.property');
testable.hasFunction('path.to.my.deeply.nested.function');

The first of these functions tests that the object responds to any type of property, whilst the second specifically tests that the object responds to a function.

In addition to retrieve a property its path can be used.

const testable = new Responds(myObject);
testable.get('path.to.my.deeply.nested.property');

License

This project is licensed under the MIT License.