mirror of
https://github.com/github/codeql-action.git
synced 2026-01-01 20:20:07 +08:00
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com> Co-authored-by: Henry Mercer <henrymercer@github.com>
32 lines
934 B
JavaScript
32 lines
934 B
JavaScript
"use strict";
|
|
/*!
|
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
*
|
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
* Released under the MIT License.
|
|
*/
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.isPlainObject = void 0;
|
|
function isPlainObject(o) {
|
|
if (o === null || o === undefined)
|
|
return false;
|
|
if (!isObject(o))
|
|
return false;
|
|
// If has modified constructor
|
|
const ctor = o.constructor;
|
|
if (ctor === undefined)
|
|
return true;
|
|
// If has modified prototype
|
|
if (!isObject(ctor.prototype))
|
|
return false;
|
|
// If constructor does not have an Object-specific method
|
|
if (!ctor.prototype.hasOwnProperty('isPrototypeOf'))
|
|
return false;
|
|
// Most likely a plain Object
|
|
return true;
|
|
}
|
|
exports.isPlainObject = isPlainObject;
|
|
function isObject(o) {
|
|
return Object.prototype.toString.call(o) === '[object Object]';
|
|
}
|