"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/es5-ext/object/is-copy.js" (7 Feb 2017, 499 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 eq     = require('./eq')
    4   , value  = require('./valid-value')
    5 
    6   , keys = Object.keys
    7   , propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
    8 
    9 module.exports = function (a, b) {
   10     var k1, k2;
   11 
   12     if (eq(value(a), value(b))) return true;
   13 
   14     a = Object(a);
   15     b = Object(b);
   16 
   17     k1 = keys(a);
   18     k2 = keys(b);
   19     if (k1.length !== k2.length) return false;
   20     return k1.every(function (key) {
   21         if (!propertyIsEnumerable.call(b, key)) return false;
   22         return eq(a[key], b[key]);
   23     });
   24 };