"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/es5-ext/object/is-plain-object.js" (11 Apr 2017, 574 Bytes) of package /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 getPrototypeOf = Object.getPrototypeOf, prototype = Object.prototype
    4   , toString = prototype.toString
    5 
    6   , id = Object().toString();
    7 
    8 module.exports = function (value) {
    9     var proto, constructor;
   10     if (!value || (typeof value !== 'object') || (toString.call(value) !== id)) {
   11         return false;
   12     }
   13     proto = getPrototypeOf(value);
   14     if (proto === null) {
   15         constructor = value.constructor;
   16         if (typeof constructor !== 'function') return true;
   17         return (constructor.prototype !== value);
   18     }
   19     return (proto === prototype) || (getPrototypeOf(proto) === null);
   20 };