SmartStorage/node_modules/has-proto/index.js

16 lines
298 B
JavaScript
Raw Normal View History

2023-12-24 13:23:39 +08:00
'use strict';
var test = {
2024-12-02 17:23:01 +08:00
__proto__: null,
2023-12-24 13:23:39 +08:00
foo: {}
};
2024-12-02 17:23:01 +08:00
// @ts-expect-error: TS errors on an inherited property for some reason
var result = { __proto__: test }.foo === test.foo
&& !(test instanceof Object);
2023-12-24 13:23:39 +08:00
2024-12-02 17:23:01 +08:00
/** @type {import('.')} */
2023-12-24 13:23:39 +08:00
module.exports = function hasProto() {
2024-12-02 17:23:01 +08:00
return result;
2023-12-24 13:23:39 +08:00
};