PHP 7.4.33
Preview: index.js Size: 696 B
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/is-weakref/test/index.js
'use strict';

var test = require('tape');
var inspect = require('object-inspect');
var forEach = require('for-each');

var isWeakRef = require('..');

test('isWeakRef', function (t) {
	t.equal(typeof isWeakRef, 'function', 'is a function');

	var nonWeakRefs = [undefined, null, true, false, 42, 0, Infinity, NaN, /a/g, function () {}, {}, []];
	forEach(nonWeakRefs, function (nonWeakRef) {
		t.equal(isWeakRef(nonWeakRef), false, inspect(nonWeakRef) + ' is not a WeakRef');
	});

	t.test('actual WeakRefs', { skip: typeof WeakRef === 'undefined' }, function (st) {
		var ref = new WeakRef({});

		st.equal(isWeakRef(ref), true, inspect(ref) + ' is a WeakRef');

		st.end();
	});

	t.end();
});

Directory Contents

Dirs: 0 × Files: 1
Name Size Perms Modified Actions
696 B lrw-r--r-- 2025-03-28 11:04:36
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).