"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/es5-ext/object/flatten.js" (7 Feb 2017, 355 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 isPlainObject = require('./is-plain-object')
    4   , forEach       = require('./for-each')
    5 
    6   , process;
    7 
    8 process = function self(value, key) {
    9     if (isPlainObject(value)) forEach(value, self, this);
   10     else this[key] = value;
   11 };
   12 
   13 module.exports = function (obj) {
   14     var flattened = {};
   15     forEach(obj, process, flattened);
   16     return flattened;
   17 };