Sha256: 880bddcd2412976daca266859d52eab836685390b6f1f38b930b39c71bc97897

Contents?: true

Size: 363 Bytes

Versions: 7

Compression:

Stored size: 363 Bytes

Contents

define(function () {

    /**
     * get "nested" object property
     */
    function get(obj, prop){
        var parts = prop.split('.'),
            last = parts.pop();

        while (prop = parts.shift()) {
            obj = obj[prop];
            if (typeof obj !== 'object' || !obj) return;
        }

        return obj[last];
    }

    return get;

});

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
entangled-0.0.16 spec/dummy/public/node_modules/bower/node_modules/mout/src/object/get.js
entangled-0.0.15 spec/dummy/public/node_modules/bower/node_modules/mout/src/object/get.js
entangled-0.0.14 spec/dummy/public/node_modules/bower/node_modules/mout/src/object/get.js
entangled-0.0.13 spec/dummy/public/node_modules/bower/node_modules/mout/src/object/get.js
entangled-0.0.12 spec/dummy/public/node_modules/bower/node_modules/mout/src/object/get.js
entangled-0.0.11 spec/dummy/public/node_modules/bower/node_modules/mout/src/object/get.js
entangled-0.0.10 spec/dummy/public/node_modules/bower/node_modules/mout/src/object/get.js