@advdominion/is
This commit is contained in:
9
packages/is/README.md
Normal file
9
packages/is/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# is
|
||||
|
||||
Usage:
|
||||
|
||||
```js
|
||||
import { is } from '@advdominion/is';
|
||||
|
||||
console.log(is('Hello, world!', 'String'));
|
||||
```
|
3
packages/is/index.js
Normal file
3
packages/is/index.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export const is = (obj, type) => {
|
||||
return Object.prototype.toString.call(obj).slice(8, -1) === type && obj !== undefined && obj !== null;
|
||||
};
|
14
packages/is/package.json
Normal file
14
packages/is/package.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "@advdominion/is",
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://gitea.optiweb.ru/public/helpers.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user