@omnific/utils 0.0.1
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 +3 -0
- package/dist/main.d.ts +23 -0
- package/dist/main.js +36 -0
- package/package.json +40 -0
package/README.md
ADDED
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region isArray.d.ts
|
|
2
|
+
declare const isArray: <T = unknown>(value: unknown) => value is T[];
|
|
3
|
+
//#endregion
|
|
4
|
+
//#region isBoolean.d.ts
|
|
5
|
+
declare const isBoolean: (value: unknown) => value is boolean;
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region isFunction.d.ts
|
|
8
|
+
type UnknownFunction<TArgs extends unknown[] = unknown[], TResult = unknown> = (...args: TArgs) => TResult;
|
|
9
|
+
declare const isFunction: <TArgs extends unknown[] = unknown[], TResult = unknown>(value: unknown) => value is UnknownFunction<TArgs, TResult>;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region isNil.d.ts
|
|
12
|
+
declare const isNil: (value: unknown) => value is null | undefined;
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region isNumber.d.ts
|
|
15
|
+
declare const isNumber: (value: unknown) => value is number;
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region isString.d.ts
|
|
18
|
+
declare const isString: (value: unknown) => value is string;
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region isUndefined.d.ts
|
|
21
|
+
declare const isUndefined: (value: unknown) => value is undefined;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { isArray, isBoolean, isFunction, isNil, isNumber, isString, isUndefined };
|
package/dist/main.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//#region isArray.ts
|
|
2
|
+
const isArray = (value) => {
|
|
3
|
+
return Array.isArray(value);
|
|
4
|
+
};
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region isBoolean.ts
|
|
7
|
+
const isBoolean = (value) => {
|
|
8
|
+
return typeof value === "boolean";
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region isFunction.ts
|
|
12
|
+
const isFunction = (value) => {
|
|
13
|
+
return typeof value === "function";
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region isNil.ts
|
|
17
|
+
const isNil = (value) => {
|
|
18
|
+
return value === null || value === void 0;
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region isNumber.ts
|
|
22
|
+
const isNumber = (value) => {
|
|
23
|
+
return typeof value === "number" && !Number.isNaN(value);
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region isString.ts
|
|
27
|
+
const isString = (value) => {
|
|
28
|
+
return typeof value === "string";
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region isUndefined.ts
|
|
32
|
+
const isUndefined = (value) => {
|
|
33
|
+
return value === void 0;
|
|
34
|
+
};
|
|
35
|
+
//#endregion
|
|
36
|
+
export { isArray, isBoolean, isFunction, isNil, isNumber, isString, isUndefined };
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@omnific/utils",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Shared utility predicates for Omnific packages",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"utils",
|
|
9
|
+
"type-guards",
|
|
10
|
+
"predicates"
|
|
11
|
+
],
|
|
12
|
+
"author": "monhan-97",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/monhan-97/omnific.git",
|
|
16
|
+
"directory": "packages/utils"
|
|
17
|
+
},
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/monhan-97/omnific.git/issues"
|
|
20
|
+
},
|
|
21
|
+
"main": "./dist/main.js",
|
|
22
|
+
"module": "./dist/main.js",
|
|
23
|
+
"types": "./dist/main.d.ts",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/main.d.ts",
|
|
27
|
+
"default": "./dist/main.js",
|
|
28
|
+
"import": "./dist/main.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"README.md"
|
|
35
|
+
],
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsdown -c tsdown.config.mjs",
|
|
38
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
39
|
+
}
|
|
40
|
+
}
|