reports/frontend/node_modules/es-toolkit/dist/predicate/isWeakSet.js
jtricerolph 1c411e402e Add settings page for managing forecasting API key and URL via UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-20 14:37:36 +00:00

26 lines
817 B
JavaScript

//#region src/predicate/isWeakSet.ts
/**
* Checks if the given value is a `WeakSet`.
*
* This function tests whether the provided value is an instance of `WeakSet`.
* It returns `true` if the value is a `WeakSet`, and `false` otherwise.
*
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `WeakSet`.
*
* @param value - The value to test if it is a `WeakSet`.
* @returns true if the value is a `WeakSet`, false otherwise.
*
* @example
* const value1 = new WeakSet();
* const value2 = new Map();
* const value3 = new Set();
*
* console.log(isWeakSet(value1)); // true
* console.log(isWeakSet(value2)); // false
* console.log(isWeakSet(value3)); // false
*/
function isWeakSet(value) {
return value instanceof WeakSet;
}
//#endregion
exports.isWeakSet = isWeakSet;