@fvilers/is-map
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@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

Package Sidebar

Install

npm i @fvilers/is-map

Weekly Downloads

1

Version

2.0.0

License

MIT

Unpacked Size

4.09 kB

Total Files

13

Last publish

Collaborators

  • fvilers