Files
hello-world-javascript-action/node_modules/is-plain-object/dist/is-plain-object.js

39 lines
850 B
JavaScript
Raw Normal View History

2022-04-05 10:05:12 +10:00
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
2019-08-06 21:05:52 -07:00
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
2022-04-05 10:05:12 +10:00
function isObject(o) {
return Object.prototype.toString.call(o) === '[object Object]';
2019-08-06 21:05:52 -07:00
}
2022-04-05 10:05:12 +10:00
function isPlainObject(o) {
2019-08-06 21:05:52 -07:00
var ctor,prot;
2022-04-05 10:05:12 +10:00
if (isObject(o) === false) return false;
2019-08-06 21:05:52 -07:00
// If has modified constructor
ctor = o.constructor;
2022-04-05 10:05:12 +10:00
if (ctor === undefined) return true;
2019-08-06 21:05:52 -07:00
// If has modified prototype
prot = ctor.prototype;
2022-04-05 10:05:12 +10:00
if (isObject(prot) === false) return false;
2019-08-06 21:05:52 -07:00
// If constructor does not have an Object-specific method
if (prot.hasOwnProperty('isPrototypeOf') === false) {
return false;
}
// Most likely a plain Object
return true;
2022-04-05 10:05:12 +10:00
}
exports.isPlainObject = isPlainObject;