@ganuz/get
Get is package from Ganuz library
Install
$ yarn add @ganuz/get
Or
$ npm install --save @ganuz/get
Use
Module
import {
default as get
} from '@ganuz/get';
Browser
<script src="https://unpkg.com/@ganuz/get/bundle.umd.min.js"></script>
let {
get
} = G;
Examples
get(undefined, 'foo'); // throw TypeError
get({foo: 'bar'}, 'foo'); // => 'bar'
get(['a', 'b', 'c'], 1); // => 'b'
get({get color(){ return this._c; }, _c: 'red'}, 'color', {_c: 'green'}); // => 'green'
get({get color(){ return this._c; }, _c: 'red'}, 'color', 55); // => undefined
get({name: 'bob'}, 'name', {name: 'alice'}); // => 'bob'
get(Object.create(null), 'constructor'); // => undefined
@ganuz/get/polyfill
Module
import '@ganuz/get/polyfill';
Browser
<script src="https://unpkg.com/@ganuz/get/polyfill/bundle.umd.min.js"></script>
License
Copyright © Yisrael Eliev, Licensed under the MIT license.