"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/es5-ext/object/safe-traverse.js" (7 Feb 2017, 338 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 'use strict';
    2 
    3 var value = require('./valid-value');
    4 
    5 module.exports = function (obj/*, …names*/) {
    6     var length, current = 1;
    7     value(obj);
    8     length = arguments.length - 1;
    9     if (!length) return obj;
   10     while (current < length) {
   11         obj = obj[arguments[current++]];
   12         if (obj == null) return undefined;
   13     }
   14     return obj[arguments[current]];
   15 };