diginext-utils 2.1.22 → 2.1.24
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 +162 -162
- package/dist/Checker.mjs +29 -0
- package/dist/EventDispatcher.mjs +54 -0
- package/dist/FileUpload.mjs +62 -0
- package/dist/Slug.mjs +9 -0
- package/dist/Timer-7b0c4e7c.d.ts +11 -0
- package/dist/Timer.mjs +7 -0
- package/dist/Validation.mjs +35 -0
- package/dist/array-c38eff4c.d.ts +158 -0
- package/dist/array.mjs +49 -0
- package/dist/browser-8d042ffe.d.ts +22 -0
- package/dist/camera-1a859d72.d.ts +15 -0
- package/dist/chunk-24DHBJAC.mjs +35 -0
- package/dist/chunk-32BJ2V3H.mjs +195 -0
- package/dist/chunk-32PJ3FML.mjs +57 -0
- package/dist/chunk-3OYOTSDB.mjs +339 -0
- package/dist/chunk-4CWVMQ53.mjs +167 -0
- package/dist/chunk-4VQ25N7H.mjs +43 -0
- package/dist/chunk-6OZHYD5H.mjs +91 -0
- package/dist/chunk-76AY2CWV.mjs +22 -0
- package/dist/chunk-7MK72U4O.mjs +19 -0
- package/dist/chunk-7SOQVGCL.mjs +12 -0
- package/dist/chunk-7XKT3AQX.mjs +17 -0
- package/dist/chunk-AT5ZUBQL.mjs +151 -0
- package/dist/chunk-CKILLYAP.mjs +16 -0
- package/dist/chunk-D5JDP7JB.mjs +56 -0
- package/dist/chunk-DEOVENCJ.mjs +15 -0
- package/dist/chunk-FILFH56Y.mjs +21 -0
- package/dist/chunk-FTXB3IBS.mjs +20 -0
- package/dist/chunk-GJMNV2OC.mjs +35 -0
- package/dist/chunk-GNJDIUYM.mjs +40 -0
- package/dist/chunk-HN4EHJ2H.mjs +39 -0
- package/dist/chunk-HTAKHCLC.mjs +43 -0
- package/dist/chunk-JAP2EUEW.mjs +86 -0
- package/dist/chunk-JFASFX5Y.mjs +16 -0
- package/dist/chunk-JIMOWRMS.mjs +118 -0
- package/dist/chunk-K4KENOE6.mjs +20 -0
- package/dist/chunk-LGBBKRBU.mjs +40 -0
- package/dist/chunk-PMJLVOEM.mjs +25 -0
- package/dist/chunk-PSVXSTS4.mjs +51 -0
- package/dist/chunk-SNYWQI35.mjs +41 -0
- package/dist/chunk-TV4YHUBU.mjs +23 -0
- package/dist/chunk-UHUY6K7N.mjs +24 -0
- package/dist/chunk-UZ7BFUDR.mjs +258 -0
- package/dist/chunk-YLZC36RI.mjs +32 -0
- package/dist/chunk-ZNIXVHZT.mjs +24 -0
- package/dist/color.mjs +85 -0
- package/dist/console/enableConsole.mjs +9 -0
- package/dist/console/index.mjs +14 -0
- package/dist/console/log.mjs +19 -0
- package/dist/createDir-220e0081.d.ts +13 -0
- package/dist/device/browser.mjs +15 -0
- package/dist/device/camera.mjs +8 -0
- package/dist/device/index.mjs +15 -0
- package/dist/device/os.mjs +33 -0
- package/dist/enableConsole-ddc24282.d.ts +11 -0
- package/dist/file/createDir.mjs +7 -0
- package/dist/file/fileMove.mjs +7 -0
- package/dist/file/findFilesByExt.mjs +11 -0
- package/dist/file/index.mjs +17 -0
- package/dist/fileMove-3a09e429.d.ts +13 -0
- package/dist/findFilesByExt-753e91d7.d.ts +24 -0
- package/dist/gameboi/index.d.ts +2 -0
- package/dist/gameboi/index.js +5 -0
- package/dist/gameboi/index.js.map +1 -1
- package/dist/gameboi/index.mjs +65 -0
- package/dist/images/downloadByUrl.mjs +53 -0
- package/dist/images/index.mjs +14 -0
- package/dist/images/loadImage.js +1 -1
- package/dist/images/loadImage.js.map +1 -1
- package/dist/images/loadImage.mjs +21 -0
- package/dist/images/resize.mjs +9 -0
- package/dist/images/upload.mjs +13 -0
- package/dist/index-1e114d55.d.ts +26 -0
- package/dist/index-1f738e52.d.ts +22 -0
- package/dist/index-22309f0c.d.ts +23 -0
- package/dist/index-3eeb7834.d.ts +90 -0
- package/dist/index-6ae3c86b.d.ts +63 -0
- package/dist/index.mjs +87 -0
- package/dist/json.mjs +29 -0
- package/dist/math/diffDate.mjs +9 -0
- package/dist/math/index.mjs +34 -0
- package/dist/math/positiveNumber.mjs +10 -0
- package/dist/name/en.mjs +9 -0
- package/dist/name/index.mjs +20 -0
- package/dist/name/vi.mjs +14 -0
- package/dist/object-43aaaf92.d.ts +80 -0
- package/dist/object.mjs +21 -0
- package/dist/permission/index.mjs +15 -0
- package/dist/permission/requestCamera.mjs +9 -0
- package/dist/permission/requestDeviceOrientationControl.mjs +10 -0
- package/dist/requestCamera-32b7dfc7.d.ts +14 -0
- package/dist/requestDeviceOrientationControl-b6458660.d.ts +11 -0
- package/dist/response/index.mjs +16 -0
- package/dist/string/convertPathnameAndQuery.mjs +28 -0
- package/dist/string/formatNumber.mjs +10 -0
- package/dist/string/generatePassword.mjs +10 -0
- package/dist/string/generateUUID.mjs +9 -0
- package/dist/string/getTextBetweenCharByIndex.mjs +22 -0
- package/dist/string/index.mjs +31 -0
- package/dist/string/indexesOf.mjs +7 -0
- package/dist/string/makeDaySlug.mjs +9 -0
- package/dist/string/random.mjs +23 -0
- package/dist/string/trimNull.mjs +9 -0
- package/dist/string/url.mjs +21 -0
- package/dist/url-0da0be84.d.ts +43 -0
- package/esm/gameboi/index.d.ts +2 -0
- package/esm/gameboi/index.js +5 -0
- package/esm/gameboi/index.js.map +1 -1
- package/esm/images/loadImage.js +1 -1
- package/esm/images/loadImage.js.map +1 -1
- package/package.json +6 -2
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
declare const isNull: (object: string | number | {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}) => boolean;
|
|
4
|
+
declare const toBool: (object: string | {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
} | null) => boolean;
|
|
7
|
+
declare const toInt: (object: string | number | {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
} | null) => number;
|
|
10
|
+
declare const toFloat: (object: string | {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
} | null) => number;
|
|
13
|
+
declare const toArray: (obj: {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}) => {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Convert value in object to array
|
|
20
|
+
*/
|
|
21
|
+
declare const objectToArray: (obj: {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}) => any[];
|
|
24
|
+
/**
|
|
25
|
+
* Iterate through every keys & values of the object
|
|
26
|
+
*/
|
|
27
|
+
declare const iterate: (obj: {
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
}, callbackFn: (obj: any, key?: string, value?: any) => any) => {
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
};
|
|
32
|
+
declare const xobject: {
|
|
33
|
+
isNull: (object: string | number | {
|
|
34
|
+
[key: string]: any;
|
|
35
|
+
}) => boolean;
|
|
36
|
+
toBool: (object: string | {
|
|
37
|
+
[key: string]: any;
|
|
38
|
+
} | null) => boolean;
|
|
39
|
+
toInt: (object: string | number | {
|
|
40
|
+
[key: string]: any;
|
|
41
|
+
} | null) => number;
|
|
42
|
+
toFloat: (object: string | {
|
|
43
|
+
[key: string]: any;
|
|
44
|
+
} | null) => number;
|
|
45
|
+
toArray: (obj: {
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
}) => {
|
|
48
|
+
[key: string]: any;
|
|
49
|
+
};
|
|
50
|
+
objectToArray: (obj: {
|
|
51
|
+
[key: string]: any;
|
|
52
|
+
}) => any[];
|
|
53
|
+
iterate: (obj: {
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
}, callbackFn: (obj: any, key?: string, value?: any) => any) => {
|
|
56
|
+
[key: string]: any;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
declare const object_isNull: typeof isNull;
|
|
61
|
+
declare const object_iterate: typeof iterate;
|
|
62
|
+
declare const object_objectToArray: typeof objectToArray;
|
|
63
|
+
declare const object_toArray: typeof toArray;
|
|
64
|
+
declare const object_toBool: typeof toBool;
|
|
65
|
+
declare const object_toFloat: typeof toFloat;
|
|
66
|
+
declare const object_toInt: typeof toInt;
|
|
67
|
+
declare namespace object {
|
|
68
|
+
export {
|
|
69
|
+
xobject as default,
|
|
70
|
+
object_isNull as isNull,
|
|
71
|
+
object_iterate as iterate,
|
|
72
|
+
object_objectToArray as objectToArray,
|
|
73
|
+
object_toArray as toArray,
|
|
74
|
+
object_toBool as toBool,
|
|
75
|
+
object_toFloat as toFloat,
|
|
76
|
+
object_toInt as toInt,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { toInt as a, toFloat as b, toArray as c, objectToArray as d, iterate as e, isNull as i, object as o, toBool as t, xobject as x };
|
package/dist/object.mjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isNull,
|
|
3
|
+
iterate,
|
|
4
|
+
objectToArray,
|
|
5
|
+
object_default,
|
|
6
|
+
toArray,
|
|
7
|
+
toBool,
|
|
8
|
+
toFloat,
|
|
9
|
+
toInt
|
|
10
|
+
} from "./chunk-6OZHYD5H.mjs";
|
|
11
|
+
import "./chunk-4VQ25N7H.mjs";
|
|
12
|
+
export {
|
|
13
|
+
object_default as default,
|
|
14
|
+
isNull,
|
|
15
|
+
iterate,
|
|
16
|
+
objectToArray,
|
|
17
|
+
toArray,
|
|
18
|
+
toBool,
|
|
19
|
+
toFloat,
|
|
20
|
+
toInt
|
|
21
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
requestDeviceOrientationControl
|
|
3
|
+
} from "../chunk-SNYWQI35.mjs";
|
|
4
|
+
import "../chunk-32BJ2V3H.mjs";
|
|
5
|
+
import {
|
|
6
|
+
requestCamera
|
|
7
|
+
} from "../chunk-LGBBKRBU.mjs";
|
|
8
|
+
import "../chunk-4VQ25N7H.mjs";
|
|
9
|
+
|
|
10
|
+
// src/permission/index.ts
|
|
11
|
+
var permission = { requestCamera, requestDeviceOrientationControl };
|
|
12
|
+
var permission_default = permission;
|
|
13
|
+
export {
|
|
14
|
+
permission_default as default
|
|
15
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
requestDeviceOrientationControl,
|
|
3
|
+
requestDeviceOrientationControl_default
|
|
4
|
+
} from "../chunk-SNYWQI35.mjs";
|
|
5
|
+
import "../chunk-32BJ2V3H.mjs";
|
|
6
|
+
import "../chunk-4VQ25N7H.mjs";
|
|
7
|
+
export {
|
|
8
|
+
requestDeviceOrientationControl_default as default,
|
|
9
|
+
requestDeviceOrientationControl
|
|
10
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const requestCamera: ({ audio, video }: {
|
|
2
|
+
audio?: boolean | undefined;
|
|
3
|
+
video?: boolean | undefined;
|
|
4
|
+
}) => false | Promise<unknown>;
|
|
5
|
+
|
|
6
|
+
declare const requestCamera$1_requestCamera: typeof requestCamera;
|
|
7
|
+
declare namespace requestCamera$1 {
|
|
8
|
+
export {
|
|
9
|
+
requestCamera as default,
|
|
10
|
+
requestCamera$1_requestCamera as requestCamera,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { requestCamera as a, requestCamera$1 as r };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const requestDeviceOrientationControl: () => false | Promise<unknown>;
|
|
2
|
+
|
|
3
|
+
declare const requestDeviceOrientationControl$1_requestDeviceOrientationControl: typeof requestDeviceOrientationControl;
|
|
4
|
+
declare namespace requestDeviceOrientationControl$1 {
|
|
5
|
+
export {
|
|
6
|
+
requestDeviceOrientationControl as default,
|
|
7
|
+
requestDeviceOrientationControl$1_requestDeviceOrientationControl as requestDeviceOrientationControl,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { requestDeviceOrientationControl as a, requestDeviceOrientationControl$1 as r };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Response,
|
|
3
|
+
getFailedResponse,
|
|
4
|
+
getResponse,
|
|
5
|
+
getSuccessResponse,
|
|
6
|
+
response_default
|
|
7
|
+
} from "../chunk-32PJ3FML.mjs";
|
|
8
|
+
import "../chunk-GNJDIUYM.mjs";
|
|
9
|
+
import "../chunk-4VQ25N7H.mjs";
|
|
10
|
+
export {
|
|
11
|
+
Response,
|
|
12
|
+
response_default as default,
|
|
13
|
+
getFailedResponse,
|
|
14
|
+
getResponse,
|
|
15
|
+
getSuccessResponse
|
|
16
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isNull
|
|
3
|
+
} from "../chunk-6OZHYD5H.mjs";
|
|
4
|
+
import "../chunk-4VQ25N7H.mjs";
|
|
5
|
+
|
|
6
|
+
// src/string/convertPathnameAndQuery.ts
|
|
7
|
+
function convertPathnameAndQuery(url) {
|
|
8
|
+
if (isNull(url))
|
|
9
|
+
return null;
|
|
10
|
+
url = url.toString();
|
|
11
|
+
const arr = url.split("?");
|
|
12
|
+
const pathname = arr[0];
|
|
13
|
+
const query = {};
|
|
14
|
+
if (arr[1]) {
|
|
15
|
+
const _query = arr[1].split("&");
|
|
16
|
+
_query.map((item) => {
|
|
17
|
+
const __item = item.split("=");
|
|
18
|
+
query[__item[0]] = __item[1];
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
pathname,
|
|
23
|
+
query
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
convertPathnameAndQuery as default
|
|
28
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
indexesOf
|
|
3
|
+
} from "../chunk-JFASFX5Y.mjs";
|
|
4
|
+
import "../chunk-4VQ25N7H.mjs";
|
|
5
|
+
|
|
6
|
+
// src/string/getTextBetweenCharByIndex.ts
|
|
7
|
+
function getTextBetweenCharByIndex(str, char, index) {
|
|
8
|
+
const arr = indexesOf(str, char);
|
|
9
|
+
let start = 0, end = 0;
|
|
10
|
+
for (let i = 0; i < arr.length; i++) {
|
|
11
|
+
const _index = arr[i];
|
|
12
|
+
if (index > _index) {
|
|
13
|
+
start = _index;
|
|
14
|
+
end = arr[i + 1];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const result = str.substring(start + 1, end);
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
getTextBetweenCharByIndex as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
capitalize,
|
|
3
|
+
capitalizeName,
|
|
4
|
+
clearUnicodeCharacters,
|
|
5
|
+
getBetween,
|
|
6
|
+
makeString,
|
|
7
|
+
string_default,
|
|
8
|
+
titleize,
|
|
9
|
+
toLowerCase,
|
|
10
|
+
toUpperCase
|
|
11
|
+
} from "../chunk-4CWVMQ53.mjs";
|
|
12
|
+
import "../chunk-ZNIXVHZT.mjs";
|
|
13
|
+
import "../chunk-CKILLYAP.mjs";
|
|
14
|
+
import "../chunk-7XKT3AQX.mjs";
|
|
15
|
+
import "../chunk-HTAKHCLC.mjs";
|
|
16
|
+
import "../chunk-7MK72U4O.mjs";
|
|
17
|
+
import "../chunk-DEOVENCJ.mjs";
|
|
18
|
+
import "../chunk-JAP2EUEW.mjs";
|
|
19
|
+
import "../chunk-6OZHYD5H.mjs";
|
|
20
|
+
import "../chunk-4VQ25N7H.mjs";
|
|
21
|
+
export {
|
|
22
|
+
capitalize,
|
|
23
|
+
capitalizeName,
|
|
24
|
+
clearUnicodeCharacters,
|
|
25
|
+
string_default as default,
|
|
26
|
+
getBetween,
|
|
27
|
+
makeString,
|
|
28
|
+
titleize,
|
|
29
|
+
toLowerCase,
|
|
30
|
+
toUpperCase
|
|
31
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
allCharacter,
|
|
3
|
+
numeric,
|
|
4
|
+
punctuation,
|
|
5
|
+
randAllCharacterByLength,
|
|
6
|
+
randomStringAndNumberByLength,
|
|
7
|
+
randomStringByLength,
|
|
8
|
+
random_default,
|
|
9
|
+
textLowCase,
|
|
10
|
+
uniqueSortByTime
|
|
11
|
+
} from "../chunk-HTAKHCLC.mjs";
|
|
12
|
+
import "../chunk-4VQ25N7H.mjs";
|
|
13
|
+
export {
|
|
14
|
+
allCharacter,
|
|
15
|
+
random_default as default,
|
|
16
|
+
numeric,
|
|
17
|
+
punctuation,
|
|
18
|
+
randAllCharacterByLength,
|
|
19
|
+
randomStringAndNumberByLength,
|
|
20
|
+
randomStringByLength,
|
|
21
|
+
textLowCase,
|
|
22
|
+
uniqueSortByTime
|
|
23
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
addQueryParam,
|
|
3
|
+
getFileExtension,
|
|
4
|
+
getFileNameWithExtension,
|
|
5
|
+
getFileNameWithoutExtension,
|
|
6
|
+
getUrlParams,
|
|
7
|
+
isImage,
|
|
8
|
+
isLink,
|
|
9
|
+
url_default
|
|
10
|
+
} from "../chunk-JAP2EUEW.mjs";
|
|
11
|
+
import "../chunk-4VQ25N7H.mjs";
|
|
12
|
+
export {
|
|
13
|
+
addQueryParam,
|
|
14
|
+
url_default as default,
|
|
15
|
+
getFileExtension,
|
|
16
|
+
getFileNameWithExtension,
|
|
17
|
+
getFileNameWithoutExtension,
|
|
18
|
+
getUrlParams,
|
|
19
|
+
isImage,
|
|
20
|
+
isLink
|
|
21
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
declare const addQueryParam: (_url: string, key: string, value: any) => string;
|
|
2
|
+
declare const getUrlParams: (parameter: string, staticURL?: string, decode?: boolean) => string | false | undefined;
|
|
3
|
+
declare const isLink: (str: string) => boolean;
|
|
4
|
+
declare const getFileNameWithoutExtension: (url: string) => string;
|
|
5
|
+
declare const getFileNameWithExtension: (url: string) => string;
|
|
6
|
+
declare const getFileExtension: (url: string) => string | null | undefined;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param {string} url
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
declare const isImage: (url: string) => boolean;
|
|
13
|
+
declare const xurl: {
|
|
14
|
+
addQueryParam: (_url: string, key: string, value: any) => string;
|
|
15
|
+
getUrlParams: (parameter: string, staticURL?: string, decode?: boolean) => string | false | undefined;
|
|
16
|
+
isLink: (str: string) => boolean;
|
|
17
|
+
getFileNameWithoutExtension: (url: string) => string;
|
|
18
|
+
getFileNameWithExtension: (url: string) => string;
|
|
19
|
+
getFileExtension: (url: string) => string | null | undefined;
|
|
20
|
+
isImage: (url: string) => boolean;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
declare const url_addQueryParam: typeof addQueryParam;
|
|
24
|
+
declare const url_getFileExtension: typeof getFileExtension;
|
|
25
|
+
declare const url_getFileNameWithExtension: typeof getFileNameWithExtension;
|
|
26
|
+
declare const url_getFileNameWithoutExtension: typeof getFileNameWithoutExtension;
|
|
27
|
+
declare const url_getUrlParams: typeof getUrlParams;
|
|
28
|
+
declare const url_isImage: typeof isImage;
|
|
29
|
+
declare const url_isLink: typeof isLink;
|
|
30
|
+
declare namespace url {
|
|
31
|
+
export {
|
|
32
|
+
url_addQueryParam as addQueryParam,
|
|
33
|
+
xurl as default,
|
|
34
|
+
url_getFileExtension as getFileExtension,
|
|
35
|
+
url_getFileNameWithExtension as getFileNameWithExtension,
|
|
36
|
+
url_getFileNameWithoutExtension as getFileNameWithoutExtension,
|
|
37
|
+
url_getUrlParams as getUrlParams,
|
|
38
|
+
url_isImage as isImage,
|
|
39
|
+
url_isLink as isLink,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { addQueryParam as a, getFileNameWithoutExtension as b, getFileNameWithExtension as c, getFileExtension as d, isImage as e, getUrlParams as g, isLink as i, url as u, xurl as x };
|
package/esm/gameboi/index.d.ts
CHANGED
package/esm/gameboi/index.js
CHANGED
|
@@ -19,9 +19,12 @@ export default class GameBoi extends EventEmitter {
|
|
|
19
19
|
_GameBoi___onDisconnect.set(this, void 0);
|
|
20
20
|
_GameBoi___start.set(this, void 0);
|
|
21
21
|
_GameBoi_time.set(this, +new Date());
|
|
22
|
+
this.isConnected = false;
|
|
23
|
+
this.status = "";
|
|
22
24
|
__classPrivateFieldGet(this, _GameBoi_instances, "m", _GameBoi_awake).call(this);
|
|
23
25
|
}
|
|
24
26
|
onConnect(e) {
|
|
27
|
+
this.isConnected = true;
|
|
25
28
|
const gp = navigator.getGamepads()[e.gamepad.index];
|
|
26
29
|
console.log(`Gamepad connected at index ${gp.index}: ${gp.id}. It has ${gp.buttons.length} buttons and ${gp.axes.length} axes.`);
|
|
27
30
|
__classPrivateFieldSet(this, _GameBoi_time, +new Date(), "f");
|
|
@@ -29,6 +32,7 @@ export default class GameBoi extends EventEmitter {
|
|
|
29
32
|
}
|
|
30
33
|
onDisconnect() {
|
|
31
34
|
console.log("onDisconnect");
|
|
35
|
+
this.isConnected = false;
|
|
32
36
|
window.cancelAnimationFrame(__classPrivateFieldGet(this, _GameBoi___start, "f"));
|
|
33
37
|
}
|
|
34
38
|
gameLoop() {
|
|
@@ -45,6 +49,7 @@ export default class GameBoi extends EventEmitter {
|
|
|
45
49
|
}
|
|
46
50
|
dispose() {
|
|
47
51
|
//
|
|
52
|
+
this.isConnected = false;
|
|
48
53
|
this.onDisconnect();
|
|
49
54
|
window.removeEventListener("gamepadconnected", __classPrivateFieldGet(this, _GameBoi___onConnect, "f"));
|
|
50
55
|
window.removeEventListener("gamepaddisconnected", __classPrivateFieldGet(this, _GameBoi___onDisconnect, "f"));
|
package/esm/gameboi/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/gameboi/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,YAAY;IAChD;QACC,KAAK,EAAE,CAAC;;QAKT,uCAA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
{"version":3,"file":"loadImage.js","sourceRoot":"","sources":["../../src/images/loadImage.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,SAAS,CAAC,IAAmB;IAC1D,EAAE;IACF,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,CAAA;QAAE,OAAO;IAE1B,OAAO,MAAM,OAAO,CAAC,GAAG,CACvB,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QAChB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACtC,MAAM,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;YACxB,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC;YACrB,GAAG,CAAC,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"loadImage.js","sourceRoot":"","sources":["../../src/images/loadImage.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,SAAS,CAAC,IAAmB;IAC1D,EAAE;IACF,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,CAAA;QAAE,OAAO;IAE1B,OAAO,MAAM,OAAO,CAAC,GAAG,CACvB,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QAChB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACtC,MAAM,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;YACxB,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC;YACrB,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;YACrB,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC;YACd,OAAO;QACR,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CACF,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "diginext-utils",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.24",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"readme": "README.md",
|
|
6
6
|
"homepage": "https://wearetopgroup.com",
|
|
@@ -25,7 +25,10 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "npm run prebuild && tsc --module commonjs --outDir dist && tsc --module esnext --outDir esm && npm run test",
|
|
27
27
|
"build_tsup": "tsup src/**/*.ts --format esm,cjs --dts --legacy-output",
|
|
28
|
-
"prebuild": "
|
|
28
|
+
"prebuild": "run-script-os || exit 0",
|
|
29
|
+
"prebuild:win32": "rd /S /Q dist esm",
|
|
30
|
+
"prebuild:darwin:linux": "rm -rf dist && rm -rf esm",
|
|
31
|
+
"prebuild:default": "rm -rf dist && rm -rf esm",
|
|
29
32
|
"release": "npm run build && npm publish",
|
|
30
33
|
"dev": "npm run prebuild && concurrently \"tsup src/**/*.ts --format esm,cjs --dts --watch\"",
|
|
31
34
|
"test": "mocha test/*.test.js",
|
|
@@ -40,6 +43,7 @@
|
|
|
40
43
|
"@types/react": "^17.0.13",
|
|
41
44
|
"@types/react-dom": "^17.0.8",
|
|
42
45
|
"blueimp-load-image": "^5.16.0",
|
|
46
|
+
"run-script-os": "^1.1.6",
|
|
43
47
|
"chalk": "4.1.2",
|
|
44
48
|
"concurrently": "^7.2.2",
|
|
45
49
|
"config": "*",
|