@ohbug/utils 2.0.6 → 2.0.7
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/dist/index.d.mts +28 -0
- package/package.json +3 -3
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { OhbugLoggerConfig, OhbugGlobal, OhbugObject } from '@ohbug/types';
|
|
2
|
+
|
|
3
|
+
declare function error(condition: boolean, format: string, ...args: any[]): void;
|
|
4
|
+
|
|
5
|
+
declare const logger: OhbugLoggerConfig;
|
|
6
|
+
|
|
7
|
+
declare function isString(value: any): value is string;
|
|
8
|
+
declare function isNumber(value: any): value is number;
|
|
9
|
+
declare function isFunction(value: any): value is Function;
|
|
10
|
+
declare function isObject(value: any): value is Object;
|
|
11
|
+
declare function isPromise(value: any): value is Promise<any>;
|
|
12
|
+
|
|
13
|
+
declare function getGlobal<T = Window>(): T & OhbugGlobal;
|
|
14
|
+
declare function getOhbugObject<T = Window>(): OhbugObject;
|
|
15
|
+
declare function isNode(): boolean;
|
|
16
|
+
declare function isBrowser(): boolean;
|
|
17
|
+
|
|
18
|
+
declare function replace(source: any, name: string, behavior: (...args: any[]) => any): any;
|
|
19
|
+
declare function parseUrl(url: string): {
|
|
20
|
+
host?: string;
|
|
21
|
+
path?: string;
|
|
22
|
+
protocol?: string;
|
|
23
|
+
relative?: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
declare const getSelector: (event: Event) => any;
|
|
27
|
+
|
|
28
|
+
export { error, getGlobal, getOhbugObject, getSelector, isBrowser, isFunction, isNode, isNumber, isObject, isPromise, isString, logger, parseUrl, replace };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ohbug/utils",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"description": "Utilities for all Ohbug SDKs",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "chenyueban <jasonchan0527@gmail.com>",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@
|
|
34
|
-
"@types
|
|
33
|
+
"@types/node": "^20.4.0",
|
|
34
|
+
"@ohbug/types": "2.2.0"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "tsup",
|