2.0.0 • Published 7 years ago

isa-plain-function v2.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

isa-plain-function

Build Status

Simple check to see if a function has any prototype members.

Sometimes it's useful to check if a function can be considered "class-like". This is the case when the prototype of that function has been modified.

Installation

npm install isa-plain-function

Usage

var isaPlainFunction = require('isa-plain-function');

isaPlainFunction( function(){} ); // true

var Foo = function(){};

Foo.prototype = {
    awesome: true,
};

isaPlainFunction( Foo ); // false

Check the test for edge cases.

Note

This module uses Object.getOwnPropertyNames when available to detect any non-ennumerable properties created using Object.defineProperty and co.

2.0.0

7 years ago

0.0.1

9 years ago