github.com/jfrog/frogbot@v1.1.1-0.20231221090046-821a26f50338/action/node_modules/is-plain-object/dist/is-plain-object.mjs (about)

     1  /*!
     2   * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
     3   *
     4   * Copyright (c) 2014-2017, Jon Schlinkert.
     5   * Released under the MIT License.
     6   */
     7  
     8  function isObject(o) {
     9    return Object.prototype.toString.call(o) === '[object Object]';
    10  }
    11  
    12  function isPlainObject(o) {
    13    var ctor,prot;
    14  
    15    if (isObject(o) === false) return false;
    16  
    17    // If has modified constructor
    18    ctor = o.constructor;
    19    if (ctor === undefined) return true;
    20  
    21    // If has modified prototype
    22    prot = ctor.prototype;
    23    if (isObject(prot) === false) return false;
    24  
    25    // If constructor does not have an Object-specific method
    26    if (prot.hasOwnProperty('isPrototypeOf') === false) {
    27      return false;
    28    }
    29  
    30    // Most likely a plain Object
    31    return true;
    32  }
    33  
    34  export { isPlainObject };