2.0.1 • Published 3 years ago

@fvilers/is-set v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@fvilers/is-set

A TypeScript type guard that validates if the given value is a Set

Installation

npm install @fvilers/is-set

or

yarn add @fvilers/is-set

ECMAScript module

Starting with version 2.0.0, this library will be published as an ECMAScript module.

Usage

import { isSet } from "@fvilers/is-set";

const variable: any = new Set();

if (isSet(variable)) {
  // From here, variable is strongly typed as a Set
  console.log("Variable is a set with size of", set.size);
} else {
  console.log("Variable is not a set");
}
Variable is a set with size of 0
2.0.1

3 years ago

2.0.0

3 years ago

1.0.0

3 years ago