Skip to content

gearcase/is-native

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

is-native

Checks if the given value is a native function.

MIT License

build:? coverage:?

Install

$ npm install --save is-native 

Usage

var isNative = require('is-native');

var obj = { a: 1 };
var arr = [1, 2, 3];

isNative(obj.valueOf); // => true
isNative(arr.push);    // => true
isNative(Math.min);    // => true
isNative(console.log); // => true

isNative(function () { console.log(123); });              
// => false

isNative();          // => false
isNative(obj);       // => false
isNative(arr);       // => false
isNative(/x/);       // => false
isNative(new Date);  // => false
isNative(new Error); // => false

Related

  • to-source-code - Converts function to its source code.
  • is-nil - Checks if the given value is null or undefined.
  • is-null - Checks if the given value is null.
  • is-window - Checks if the given value is a window object.
  • is-index - Checks if the given value is a valid array-like index.
  • is-length - Checks if the given value is a valid array-like length.
  • is-array-like - Checks if the given value is an array or an array-like object.

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.

About

Checks if the given value is a native function.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages