0.0.1 • Published 2 years ago

get-constructor-name v0.0.1

Weekly downloads
-
License
CC0-1.0
Repository
github
Last release
2 years ago

get-constructor-name

Get the Name of a JavaScript Function's Constructor. Returns String or Undefined.

features

  • guaranteed to return string or undefined
  • doesn't throw errors

install

npm install get-constructor-name

usage

import getConstructorName from "get-constructor-name";

const arrayBuffer = new ArrayBuffer();

getConstructorName(arrayBuffer) // ArrayBuffer
getConstructorName(100) // undefined
getConstructorName(null) // undefined