Choosing between global and local values
Prefers local values over global when choosing between two
Install with npm
npm install prefer-local
// or
yarn add prefer-local
Useful for places where we need to choose between boolean value of a property inside an object (if exists) and another boolean value and prefer inner property. For Example, while choosing between local option in an object and a global option. If local option is set to false
returns false
even if global option is true.
src
- source object containing inner propertykey
- key of the inner propertyprop
- value of global property