Files
NapCatQQ/.pnpm-store/v3/files/a6/47de16f2a5c1d84f602ae67c003e3f28235999981d5cb4c2bae7e629039ab48c354120fa0626b39ad3c0c3b5b726dce97f4b76a16ac7221ae1892b9333b1e7
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

19 lines
619 B
Plaintext

import global from '../shims/global.js';
/**
* Returns the global object associated with provided element.
*
* @param {Object} target
* @returns {Object}
*/
export default target => {
// Assume that the element is an instance of Node, which means that it
// has the "ownerDocument" property from which we can retrieve a
// corresponding global object.
const ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
// Return the local global object if it's not possible extract one from
// provided element.
return ownerGlobal || global;
};