@pakal/is-native
v0.2.1
Published
Is Native is package from Pakal library
Downloads
8
Maintainers
Readme
@pakal/is-native
Is Native is package from Pakal library
Install
$ yarn add @pakal/is-native
Or
$ npm install --save @pakal/is-native
Use
Module
import {
default as isNative
} from '@pakal/is-native';
Browser
<script src="https://unpkg.com/@pakal/is-native/bundle.umd.min.js"></script>
let {
isNative
} = _;
Examples
isNative(Number); // => true
isNative(Math.floor); // => true
isNative((function(){}).bind(this)); // => true
isNative(String.prototype)); // => true
isNative(Math)); // => false
isNative(Infinity)); // => false
isNative(null); // => false
isNative(() => {}); // => false
isNative({foo: 'bar'}); // => false
@pakal/is-native/assert
Module
import {
default as assertNative
} from '@pakal/is-native/assert';
Browser
<script src="https://unpkg.com/@pakal/is-native/assert/bundle.umd.min.js"></script>
let {
assertNative
} = _;
Examples
assertNative('foo'); // => throw TypeError
assertNative(function(){}); // => throw TypeError
assertNative(true); // => throw TypeError
assertNative(Promise.resolve); // => Promise.resolve
assertNative(Function); // => Function
License
Copyright © Yisrael Eliev, Licensed under the MIT license.