1.0.4 • Published 4 years ago

@js-util/fetch-nested-value v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

fetch-nested-value

Fetch nested value within an object, using a dot notation string, eg: "hello.world"

npm install

npm install --save @js-util/fetch-nested-value

Example usage

// Importing the module
const fetchNestedValue = require("@js-util/fetch-nested-value");

// Example object to fetch from
const obj = {
	"hello": {
		"world" : "its ok!"
	}
};

// This fetches and return a nested value
fetchNestedValue( obj, "hello.world" ); // > "its ok!"