@vuetkit/shared 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,3 +3,13 @@
3
3
  ## Description
4
4
 
5
5
  Collection of business development utilities for Vue3 projects.
6
+
7
+ ## All Functions
8
+
9
+ ### Data Type
10
+
11
+ - [getDataType](/shared/src/dataType/getDataType/)
12
+ - [isObj](/shared/src/dataType/isObj/)
13
+ - [realObj](/shared/src/dataType/realObj/)
14
+ - [isFunc](/shared/src/dataType/isFunc/)
15
+ - [isArr](/shared/src/dataType/isArr/)
package/dist/index.d.ts CHANGED
@@ -1,4 +1,16 @@
1
- //#region src/computed/add/index.d.ts
2
- declare function add(a: number, b: number): number;
1
+ //#region src/dataType/getDataType/index.d.ts
2
+ declare function getDataType<T>(val: T): string;
3
3
  //#endregion
4
- export { add };
4
+ //#region src/dataType/isArr/index.d.ts
5
+ declare function isArr<T>(val: T): boolean;
6
+ //#endregion
7
+ //#region src/dataType/isFunc/index.d.ts
8
+ declare function isFunc<T>(fn: T): boolean;
9
+ //#endregion
10
+ //#region src/dataType/isObj/index.d.ts
11
+ declare function isObj<T>(obj: T): boolean;
12
+ //#endregion
13
+ //#region src/dataType/realObj/index.d.ts
14
+ declare function realObj<T>(obj: T): boolean;
15
+ //#endregion
16
+ export { getDataType, isArr, isFunc, isObj, realObj };
package/dist/index.js CHANGED
@@ -1,6 +1,29 @@
1
- //#region src/computed/add/index.ts
2
- function add(a, b) {
3
- return a + b;
1
+ //#region src/dataType/isObj/index.ts
2
+ function isObj(obj) {
3
+ return typeof obj === "object" && obj !== null;
4
4
  }
5
5
  //#endregion
6
- export { add };
6
+ //#region src/dataType/getDataType/index.ts
7
+ function getDataType(val) {
8
+ if (val === null) return "null";
9
+ if (val === void 0) return "undefined";
10
+ if (!isObj(val)) return typeof val;
11
+ return Object.prototype.toString.call(val);
12
+ }
13
+ //#endregion
14
+ //#region src/dataType/isArr/index.ts
15
+ function isArr(val) {
16
+ return Array.isArray(val);
17
+ }
18
+ //#endregion
19
+ //#region src/dataType/isFunc/index.ts
20
+ function isFunc(fn) {
21
+ return typeof fn === "function";
22
+ }
23
+ //#endregion
24
+ //#region src/dataType/realObj/index.ts
25
+ function realObj(obj) {
26
+ return getDataType(obj) === "[object Object]";
27
+ }
28
+ //#endregion
29
+ export { getDataType, isArr, isFunc, isObj, realObj };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vuetkit/shared",
3
3
  "type": "module",
4
- "version": "0.0.1",
4
+ "version": "0.0.3",
5
5
  "description": "Collection of business development utilities for Vue3 projects",
6
6
  "author": "Kalu5",
7
7
  "license": "MIT",
@@ -10,7 +10,7 @@
10
10
  "utilities"
11
11
  ],
12
12
  "main": "dist/index.js",
13
- "module": "dist/index.mjs",
13
+ "module": "dist/index.js",
14
14
  "types": "dist/index.d.ts",
15
15
  "files": [
16
16
  "README.md",