PHP 7.4.33
Preview: index.js Size: 1.13 KB
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/is-weakmap/index.js
'use strict';

var $WeakMap = typeof WeakMap === 'function' && WeakMap.prototype ? WeakMap : null;
var $WeakSet = typeof WeakSet === 'function' && WeakSet.prototype ? WeakSet : null;

var exported;

if (!$WeakMap) {
	/** @type {import('.')} */
	// eslint-disable-next-line no-unused-vars
	exported = function isWeakMap(x) {
		// `WeakMap` is not present in this environment.
		return false;
	};
}

var $mapHas = $WeakMap ? $WeakMap.prototype.has : null;
var $setHas = $WeakSet ? $WeakSet.prototype.has : null;
if (!exported && !$mapHas) {
	/** @type {import('.')} */
	// eslint-disable-next-line no-unused-vars
	exported = function isWeakMap(x) {
		// `WeakMap` does not have a `has` method
		return false;
	};
}

/** @type {import('.')} */
module.exports = exported || function isWeakMap(x) {
	if (!x || typeof x !== 'object') {
		return false;
	}
	try {
		$mapHas.call(x, $mapHas);
		if ($setHas) {
			try {
				$setHas.call(x, $setHas);
			} catch (e) {
				return true;
			}
		}
		// @ts-expect-error TS can't figure out that $WeakMap is always truthy here
		return x instanceof $WeakMap; // core-js workaround, pre-v3
	} catch (e) {}
	return false;
};

Directory Contents

Dirs: 2 × Files: 10
Name Size Perms Modified Actions
.github DIR
- drwxr-xr-x 2025-03-28 11:04:35
Edit Download
test DIR
- drwxr-xr-x 2025-03-28 11:04:35
Edit Download
231 B lrw-r--r-- 2025-03-28 11:04:35
Edit Download
43 B lrw-r--r-- 2025-03-28 11:04:35
Edit Download
139 B lrw-r--r-- 2025-03-28 11:04:35
Edit Download
7.99 KB lrw-r--r-- 2025-03-28 11:04:35
Edit Download
129 B lrw-r--r-- 2025-03-28 11:04:35
Edit Download
1.13 KB lrw-r--r-- 2025-03-28 11:04:35
Edit Download
1.04 KB lrw-r--r-- 2025-03-28 11:04:35
Edit Download
2.25 KB lrw-r--r-- 2025-03-28 11:04:35
Edit Download
1.93 KB lrw-r--r-- 2025-03-28 11:04:35
Edit Download
3.53 KB lrw-r--r-- 2025-03-28 11:04:35
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).