2.0.0 • Published 3 years ago

@fvilers/is-map v2.0.0

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

@fvilers/is-map

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

Installation

npm install @fvilers/is-map

or

yarn add @fvilers/is-map

ECMAScript module

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

Usage

import { isMap } from "@fvilers/is-map";

const variable: any = new map();

if (isMap(variable)) {
  // From here, variable is strongly typed as a map
  console.log("Variable is a map with size of", map.size);
} else {
  console.log("Variable is not a map");
}
Variable is a map with size of 0
2.0.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago