@advdominion/is
This commit is contained in:
parent
b9414854b2
commit
5359166f88
|
@ -0,0 +1,9 @@
|
|||
# is
|
||||
|
||||
Usage:
|
||||
|
||||
```js
|
||||
import { is } from '@advdominion/is';
|
||||
|
||||
console.log(is('Hello, world!', 'String'));
|
||||
```
|
|
@ -0,0 +1,3 @@
|
|||
export const is = (obj, type) => {
|
||||
return Object.prototype.toString.call(obj).slice(8, -1) === type && obj !== undefined && obj !== null;
|
||||
};
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -5,6 +5,12 @@ __metadata:
|
|||
version: 8
|
||||
cacheKey: 10c0
|
||||
|
||||
"@advdominion/is@workspace:packages/is":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@advdominion/is@workspace:packages/is"
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@babel/code-frame@npm:^7.0.0":
|
||||
version: 7.24.2
|
||||
resolution: "@babel/code-frame@npm:7.24.2"
|
||||
|
|
Loading…
Reference in New Issue