@advdominion/is

This commit is contained in:
Valentin Silytuin 2024-04-27 23:44:24 +04:00
parent b9414854b2
commit 5359166f88
4 changed files with 32 additions and 0 deletions

9
packages/is/README.md Normal file
View 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
View 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
View 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"
}
}

View File

@ -5,6 +5,12 @@ __metadata:
version: 8 version: 8
cacheKey: 10c0 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": "@babel/code-frame@npm:^7.0.0":
version: 7.24.2 version: 7.24.2
resolution: "@babel/code-frame@npm:7.24.2" resolution: "@babel/code-frame@npm:7.24.2"