@learncard/helpers 1.3.12 → 1.4.0
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/Utilities.d.ts +59 -0
- package/dist/Utilities.d.ts.map +1 -0
- package/dist/app-install/index.d.ts +62 -0
- package/dist/app-install/index.d.ts.map +1 -0
- package/dist/arrays/index.d.ts +3 -0
- package/dist/arrays/index.d.ts.map +1 -0
- package/dist/bitstring-status-list/index.d.ts +8 -0
- package/dist/bitstring-status-list/index.d.ts.map +1 -0
- package/dist/credential-format.d.ts +96 -0
- package/dist/credential-format.d.ts.map +1 -0
- package/dist/did.d.ts +3 -0
- package/dist/did.d.ts.map +1 -0
- package/dist/environment.d.ts +32 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/helpers.cjs.development.cjs +1648 -1540
- package/dist/helpers.cjs.development.cjs.map +4 -4
- package/dist/helpers.cjs.production.min.cjs +15 -11
- package/dist/helpers.cjs.production.min.cjs.map +4 -4
- package/dist/helpers.esm.js +172 -80
- package/dist/helpers.esm.js.map +4 -4
- package/dist/images/discord.helpers.d.ts +65 -0
- package/dist/images/discord.helpers.d.ts.map +1 -0
- package/dist/images/filestack.helpers.d.ts +92 -0
- package/dist/images/filestack.helpers.d.ts.map +1 -0
- package/dist/images/images.helpers.d.ts +32 -0
- package/dist/images/images.helpers.d.ts.map +1 -0
- package/dist/images/index.d.ts +2 -0
- package/dist/images/index.d.ts.map +1 -0
- package/dist/images/unsplash.helpers.d.ts +64 -0
- package/dist/images/unsplash.helpers.d.ts.map +1 -0
- package/dist/images/url.helpers.d.ts +14 -0
- package/dist/images/url.helpers.d.ts.map +1 -0
- package/dist/index.d.cts +43 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/numbers/index.d.ts +5 -0
- package/dist/numbers/index.d.ts.map +1 -0
- package/dist/state.d.ts +130 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/strings/index.d.ts +2 -0
- package/dist/strings/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +12 -17
- package/src/credential-format.ts +5 -4
- package/src/environment.ts +75 -0
- package/src/index.ts +11 -10
- package/dist/helpers.d.cts +0 -979
- package/dist/helpers.d.ts +0 -979
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fixes image rotation based on EXIF data and uses auto_image on a given srcset string
|
|
3
|
+
*
|
|
4
|
+
* @param srcSetString srcset string to fix
|
|
5
|
+
* @param mimetype MIME type (e.g. image/gif)
|
|
6
|
+
* @param webp flag to indicate whether we should manually specify conversion to webp
|
|
7
|
+
*
|
|
8
|
+
* @return fixed srcset string
|
|
9
|
+
*/
|
|
10
|
+
export declare const fixSrcSetString: (srcSetString: string, _mimetype?: string, _webp?: boolean) => string;
|
|
11
|
+
/**
|
|
12
|
+
* Returns the best format on a given URL
|
|
13
|
+
*
|
|
14
|
+
* @param url URL to fix
|
|
15
|
+
*
|
|
16
|
+
* @return fixed URL
|
|
17
|
+
*/
|
|
18
|
+
export declare const fixUrl: (url: string, _mimetype?: string, _webp?: boolean) => string;
|
|
19
|
+
export declare const VALID_DISCORD_SIZES: number[];
|
|
20
|
+
/**
|
|
21
|
+
* Resizes an Discord image to the given size
|
|
22
|
+
*
|
|
23
|
+
* @param url Discord URL to resize
|
|
24
|
+
* @param size Target output width
|
|
25
|
+
*
|
|
26
|
+
* @return Discord URL
|
|
27
|
+
*/
|
|
28
|
+
export declare const resizeUrl: (url: string, size: number) => string;
|
|
29
|
+
/**
|
|
30
|
+
* Changes an Discord image's quality to the given value
|
|
31
|
+
*
|
|
32
|
+
* @param url Discord URL to change
|
|
33
|
+
* @param quality quality value (1-100)
|
|
34
|
+
*
|
|
35
|
+
* @return Discord URL
|
|
36
|
+
*/
|
|
37
|
+
export declare const changeQuality: (url: string, _quality: number) => string;
|
|
38
|
+
/**
|
|
39
|
+
* Resizes and changes an Discord image's quality
|
|
40
|
+
*
|
|
41
|
+
* @param url Discord URL to change
|
|
42
|
+
* @param size Target output width
|
|
43
|
+
* @param quality quality value (1-100)
|
|
44
|
+
*
|
|
45
|
+
* @return Discord URL
|
|
46
|
+
*/
|
|
47
|
+
export declare const resizeAndChangeQuality: (url: string, size: number, quality: number, { fix }?: {
|
|
48
|
+
mimetype?: string;
|
|
49
|
+
fix?: boolean;
|
|
50
|
+
webp?: boolean;
|
|
51
|
+
}) => string;
|
|
52
|
+
/**
|
|
53
|
+
* Generates a responsive srcset string from an Discord URL and array of resolutions
|
|
54
|
+
*
|
|
55
|
+
* @param url Discord URL
|
|
56
|
+
* @param resolutions list of resolutions
|
|
57
|
+
*
|
|
58
|
+
* @return srcset string
|
|
59
|
+
*/
|
|
60
|
+
export declare const generateSrcSet: (url: string, resolutions: number[], { fix }?: {
|
|
61
|
+
mimetype?: string;
|
|
62
|
+
fix?: boolean;
|
|
63
|
+
webp?: boolean;
|
|
64
|
+
}) => string;
|
|
65
|
+
//# sourceMappingURL=discord.helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discord.helpers.d.ts","sourceRoot":"","sources":["../../src/images/discord.helpers.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,GACxB,cAAc,MAAM,EACpB,YAAY,MAAM,EAClB,eAAa,KACd,MAIF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,GAAI,KAAK,MAAM,EAAE,YAAY,MAAM,EAAE,eAAa,KAAG,MAEvE,CAAC;AAEF,eAAO,MAAM,mBAAmB,UAAiE,CAAC;AAElG;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,EAAE,MAAM,MAAM,KAAG,MAMrD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,EAAE,UAAU,MAAM,KAAG,MAE7D,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,GAC/B,KAAK,MAAM,EACX,MAAM,MAAM,EACZ,SAAS,MAAM,EACf,UAAiB;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,KAC3E,MAIF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GACvB,KAAK,MAAM,EACX,aAAa,MAAM,EAAE,EACrB,UAAiB;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,KAC3E,MAMF,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates an array of Filestack URL Parameters
|
|
3
|
+
*
|
|
4
|
+
* @param url Filestack URL
|
|
5
|
+
*
|
|
6
|
+
* @return Filestack URL Parameters
|
|
7
|
+
*/
|
|
8
|
+
export declare const getUrlParams: (url: string) => string[];
|
|
9
|
+
/**
|
|
10
|
+
* Converts an array of Filestack URL Parameters to a valid Filestack URL
|
|
11
|
+
*
|
|
12
|
+
* @param urlParams Filestack URL Parameters
|
|
13
|
+
*
|
|
14
|
+
* @return Filestack URL
|
|
15
|
+
*/
|
|
16
|
+
export declare const getUrlFromUrlParams: (urlParams: string[]) => string;
|
|
17
|
+
/**
|
|
18
|
+
* Gets the handle from a Filestack URL
|
|
19
|
+
*
|
|
20
|
+
* @param url Filestack URL
|
|
21
|
+
*
|
|
22
|
+
* @return Filestack handle
|
|
23
|
+
*/
|
|
24
|
+
export declare const getFilestackHandle: (url: string) => string;
|
|
25
|
+
export declare const getFileType: (url: string) => Promise<string>;
|
|
26
|
+
export declare const fileTypeSupportsPreview: (fileType: string) => boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Fixes image rotation based on EXIF data and uses auto_image on a given URL
|
|
29
|
+
*
|
|
30
|
+
* @param url URL to fix
|
|
31
|
+
* @param mimetype MIME type (e.g. image/gif)
|
|
32
|
+
* @param webp flag to indicate whether we should manually specify conversion to webp
|
|
33
|
+
*
|
|
34
|
+
* @return fixed URL
|
|
35
|
+
*/
|
|
36
|
+
export declare const fixUrl: (url: string, mimetype?: string, webp?: boolean) => string;
|
|
37
|
+
/**
|
|
38
|
+
* Fixes image rotation based on EXIF data and uses auto_image on a given srcset string
|
|
39
|
+
*
|
|
40
|
+
* @param srcSetString srcset string to fix
|
|
41
|
+
* @param mimetype MIME type (e.g. image/gif)
|
|
42
|
+
* @param webp flag to indicate whether we should manually specify conversion to webp
|
|
43
|
+
*
|
|
44
|
+
* @return fixed srcset string
|
|
45
|
+
*/
|
|
46
|
+
export declare const fixSrcSetString: (srcSetString: string, mimetype?: string, webp?: boolean) => string;
|
|
47
|
+
/**
|
|
48
|
+
* Resizes a filestack image to the given size
|
|
49
|
+
*
|
|
50
|
+
* @param url Filestack URL to resize
|
|
51
|
+
* @param size Target output width
|
|
52
|
+
*
|
|
53
|
+
* @return Filestack URL
|
|
54
|
+
*/
|
|
55
|
+
export declare const resizeUrl: (url: string, size: number) => string;
|
|
56
|
+
/**
|
|
57
|
+
* Changes a filestack image's quality to the given value
|
|
58
|
+
*
|
|
59
|
+
* @param url Filestack URL to change
|
|
60
|
+
* @param quality quality value (1-100)
|
|
61
|
+
*
|
|
62
|
+
* @return Filestack URL
|
|
63
|
+
*/
|
|
64
|
+
export declare const changeQuality: (url: string, quality: number) => string;
|
|
65
|
+
/**
|
|
66
|
+
* Resizes and changes a filestack image's quality
|
|
67
|
+
*
|
|
68
|
+
* @param url Filestack URL to change
|
|
69
|
+
* @param size Target output width
|
|
70
|
+
* @param quality quality value (1-100)
|
|
71
|
+
*
|
|
72
|
+
* @return Filestack URL
|
|
73
|
+
*/
|
|
74
|
+
export declare const resizeAndChangeQuality: (url: string, size: number, quality: number, { mimetype, fix, webp, }?: {
|
|
75
|
+
mimetype?: string;
|
|
76
|
+
fix?: boolean;
|
|
77
|
+
webp?: boolean;
|
|
78
|
+
}) => string;
|
|
79
|
+
/**
|
|
80
|
+
* Generates a responsive srcset string from a Filestack URL and array of resolutions
|
|
81
|
+
*
|
|
82
|
+
* @param url Filestack URL
|
|
83
|
+
* @param resolutions list of resolutions
|
|
84
|
+
*
|
|
85
|
+
* @return srcset string
|
|
86
|
+
*/
|
|
87
|
+
export declare const generateSrcSet: (url: string, resolutions: number[], { mimetype, fix, webp, }?: {
|
|
88
|
+
mimetype?: string;
|
|
89
|
+
fix?: boolean;
|
|
90
|
+
webp?: boolean;
|
|
91
|
+
}) => string;
|
|
92
|
+
//# sourceMappingURL=filestack.helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filestack.helpers.d.ts","sourceRoot":"","sources":["../../src/images/filestack.helpers.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,MAAM,EAAsC,CAAC;AAExF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAAI,WAAW,MAAM,EAAE,KAAG,MACG,CAAC;AAE9D;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,KAAG,MAIhD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAU,KAAK,MAAM,KAAG,OAAO,CAAC,MAAM,CAc7D,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,UAAU,MAAM,KAAG,OAQ1D,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,MAAM,GAAI,KAAK,MAAM,EAAE,WAAW,MAAM,EAAE,cAAY,KAAG,MAYrE,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,GAAI,cAAc,MAAM,EAAE,WAAW,MAAM,EAAE,cAAY,KAAG,MAIvF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,EAAE,MAAM,MAAM,KAAG,MAOrD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,EAAE,SAAS,MAAM,KAAG,MAO5D,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,GAC/B,KAAK,MAAM,EACX,MAAM,MAAM,EACZ,SAAS,MAAM,EACf,2BAIG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,WAK/D,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GACvB,KAAK,MAAM,EACX,aAAa,MAAM,EAAE,EACrB,2BAIG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,WAO/D,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as filestack from './filestack.helpers';
|
|
2
|
+
import * as unsplash from './unsplash.helpers';
|
|
3
|
+
import * as discord from './discord.helpers';
|
|
4
|
+
declare const Providers: {
|
|
5
|
+
filestack: typeof filestack;
|
|
6
|
+
unsplash: typeof unsplash;
|
|
7
|
+
discord: typeof discord;
|
|
8
|
+
};
|
|
9
|
+
export declare const getProvider: (url?: string) => keyof typeof Providers | null;
|
|
10
|
+
export declare const changeQuality: (url: string, quality: number) => string;
|
|
11
|
+
export declare const fixUrl: (url: string, mimetype?: string, webp?: boolean) => string;
|
|
12
|
+
export declare const generateSrcSet: (url: string, resolutions: number[], options?: {
|
|
13
|
+
mimetype?: string;
|
|
14
|
+
fix?: boolean;
|
|
15
|
+
webp?: boolean;
|
|
16
|
+
}) => string;
|
|
17
|
+
export declare const resizeAndChangeQuality: (url: string, size: number, quality: number, options?: {
|
|
18
|
+
mimetype?: string;
|
|
19
|
+
fix?: boolean;
|
|
20
|
+
webp?: boolean;
|
|
21
|
+
}) => string;
|
|
22
|
+
export declare const DEFAULT_RESOLUTIONS: number[];
|
|
23
|
+
/**
|
|
24
|
+
* Gets an array of URLs from a srcSet string
|
|
25
|
+
*
|
|
26
|
+
* @param srcSet HTML srcSet string (e.g. 'test.com/img 100w, test.com/img2 200w')
|
|
27
|
+
*
|
|
28
|
+
* @return URLs
|
|
29
|
+
*/
|
|
30
|
+
export declare const getUrlsFromSrcSet: (srcSet: string) => [string, string][];
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=images.helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"images.helpers.d.ts","sourceRoot":"","sources":["../../src/images/images.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAE7C,QAAA,MAAM,SAAS;;;;CAAmC,CAAC;AAEnD,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,KAAG,MAAM,OAAO,SAAS,GAAG,IAQnE,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,EAAE,SAAS,MAAM,KAAG,MAM5D,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,KAAK,MAAM,EAAE,WAAW,MAAM,EAAE,cAAY,KAAG,MAMrE,CAAC;AAEF,eAAO,MAAM,cAAc,GACvB,KAAK,MAAM,EACX,aAAa,MAAM,EAAE,EACrB,UAAS;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,KACnE,MAMF,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAC/B,KAAK,MAAM,EACX,MAAM,MAAM,EACZ,SAAS,MAAM,EACf,UAAS;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,KACnE,MAMF,CAAC;AAEF,eAAO,MAAM,mBAAmB,UAAkB,CAAC;AAEnD;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAQlE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/images/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fixes image rotation based on EXIF data and uses auto_image on a given srcset string
|
|
3
|
+
*
|
|
4
|
+
* @param srcSetString srcset string to fix
|
|
5
|
+
* @param mimetype MIME type (e.g. image/gif)
|
|
6
|
+
* @param webp flag to indicate whether we should manually specify conversion to webp
|
|
7
|
+
*
|
|
8
|
+
* @return fixed srcset string
|
|
9
|
+
*/
|
|
10
|
+
export declare const fixSrcSetString: (srcSetString: string, _mimetype?: string, _webp?: boolean) => string;
|
|
11
|
+
/**
|
|
12
|
+
* Returns the best format on a given URL
|
|
13
|
+
*
|
|
14
|
+
* @param url URL to fix
|
|
15
|
+
*
|
|
16
|
+
* @return fixed URL
|
|
17
|
+
*/
|
|
18
|
+
export declare const fixUrl: (url: string, _mimetype?: string, _webp?: boolean) => string;
|
|
19
|
+
/**
|
|
20
|
+
* Resizes an unsplash image to the given size
|
|
21
|
+
*
|
|
22
|
+
* @param url Unsplash URL to resize
|
|
23
|
+
* @param size Target output width
|
|
24
|
+
*
|
|
25
|
+
* @return Unsplash URL
|
|
26
|
+
*/
|
|
27
|
+
export declare const resizeUrl: (url: string, size: number) => string;
|
|
28
|
+
/**
|
|
29
|
+
* Changes an unsplash image's quality to the given value
|
|
30
|
+
*
|
|
31
|
+
* @param url Unsplash URL to change
|
|
32
|
+
* @param quality quality value (1-100)
|
|
33
|
+
*
|
|
34
|
+
* @return Unsplash URL
|
|
35
|
+
*/
|
|
36
|
+
export declare const changeQuality: (url: string, quality: number) => string;
|
|
37
|
+
/**
|
|
38
|
+
* Resizes and changes an unsplash image's quality
|
|
39
|
+
*
|
|
40
|
+
* @param url Unsplash URL to change
|
|
41
|
+
* @param size Target output width
|
|
42
|
+
* @param quality quality value (1-100)
|
|
43
|
+
*
|
|
44
|
+
* @return Unsplash URL
|
|
45
|
+
*/
|
|
46
|
+
export declare const resizeAndChangeQuality: (url: string, size: number, quality: number, { fix }?: {
|
|
47
|
+
mimetype?: string;
|
|
48
|
+
fix?: boolean;
|
|
49
|
+
webp?: boolean;
|
|
50
|
+
}) => string;
|
|
51
|
+
/**
|
|
52
|
+
* Generates a responsive srcset string from an Unsplash URL and array of resolutions
|
|
53
|
+
*
|
|
54
|
+
* @param url Unsplash URL
|
|
55
|
+
* @param resolutions list of resolutions
|
|
56
|
+
*
|
|
57
|
+
* @return srcset string
|
|
58
|
+
*/
|
|
59
|
+
export declare const generateSrcSet: (url: string, resolutions: number[], { fix }?: {
|
|
60
|
+
mimetype?: string;
|
|
61
|
+
fix?: boolean;
|
|
62
|
+
webp?: boolean;
|
|
63
|
+
}) => string;
|
|
64
|
+
//# sourceMappingURL=unsplash.helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unsplash.helpers.d.ts","sourceRoot":"","sources":["../../src/images/unsplash.helpers.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,GACxB,cAAc,MAAM,EACpB,YAAY,MAAM,EAClB,eAAa,KACd,MAIF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,GAAI,KAAK,MAAM,EAAE,YAAY,MAAM,EAAE,eAAa,KAAG,MAQvE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,EAAE,MAAM,MAAM,KAAG,MAMrD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,EAAE,SAAS,MAAM,KAAG,MAM5D,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,GAC/B,KAAK,MAAM,EACX,MAAM,MAAM,EACZ,SAAS,MAAM,EACf,UAAiB;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,KAC3E,MAIF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GACvB,KAAK,MAAM,EACX,aAAa,MAAM,EAAE,EACrB,UAAiB;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,KAC3E,MAMF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal URL query helpers backed by `URLSearchParams`, replacing the two
|
|
3
|
+
* `query-string` call sites in the image helpers. `query-string@9` is ESM-only
|
|
4
|
+
* and pulls in ESM-only transitive deps, which broke the CommonJS build of
|
|
5
|
+
* `@learncard/helpers` for external consumers on Node 18.
|
|
6
|
+
*/
|
|
7
|
+
export type ParsedUrl = {
|
|
8
|
+
url: string;
|
|
9
|
+
query: Record<string, string>;
|
|
10
|
+
fragmentIdentifier?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const parseUrl: (input: string) => ParsedUrl;
|
|
13
|
+
export declare const stringifyUrl: (parsed: ParsedUrl) => string;
|
|
14
|
+
//# sourceMappingURL=url.helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.helpers.d.ts","sourceRoot":"","sources":["../../src/images/url.helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,SAAS,GAAG;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,MAAM,KAAG,SAiBxC,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,QAAQ,SAAS,KAAG,MAahD,CAAC"}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { JWE, UnsignedVC, VC } from '@learncard/types';
|
|
2
|
+
import type { DataTransformer } from '@trpc/server';
|
|
3
|
+
/**
|
|
4
|
+
* Determines whether or not a string is a valid hexadecimal string
|
|
5
|
+
*
|
|
6
|
+
* E.g. 'abc123' is valid hex, 'zzz' is not
|
|
7
|
+
*/
|
|
8
|
+
export declare const isHex: (str: string) => boolean;
|
|
9
|
+
/** Determines whether or not an object is an encrypted JWE */
|
|
10
|
+
export declare const isEncrypted: (item: unknown) => item is JWE;
|
|
11
|
+
/**
|
|
12
|
+
* tRPC data transformer that handles RegExp serialization/deserialization
|
|
13
|
+
*/
|
|
14
|
+
export declare const RegExpTransformer: DataTransformer;
|
|
15
|
+
/**
|
|
16
|
+
* Determines if a credential uses VC 2.0 format by checking the context array
|
|
17
|
+
*/
|
|
18
|
+
export declare const isVC2Format: (credential: unknown) => boolean;
|
|
19
|
+
/** Unwraps a boost credential from a CertifiedBoostCredential, if it is one */
|
|
20
|
+
export declare const unwrapBoostCredential: (vc?: VC | UnsignedVC) => any;
|
|
21
|
+
export * from './images';
|
|
22
|
+
export * from './arrays';
|
|
23
|
+
export * from './types';
|
|
24
|
+
export * from './strings';
|
|
25
|
+
export * from './numbers';
|
|
26
|
+
export * from './state';
|
|
27
|
+
export * from './bitstring-status-list';
|
|
28
|
+
export * from './Utilities';
|
|
29
|
+
export * from './app-install';
|
|
30
|
+
export * from './credential-format';
|
|
31
|
+
export * from './did';
|
|
32
|
+
export * from './environment';
|
|
33
|
+
export * from './credential-format';
|
|
34
|
+
/**
|
|
35
|
+
* Checks if a DID is an app-specific did:web
|
|
36
|
+
*
|
|
37
|
+
* App did:webs follow the pattern: `did:web:learncard.app:app:<slug>`
|
|
38
|
+
*
|
|
39
|
+
* @param did - The DID to check
|
|
40
|
+
* @returns true if the DID is an app did:web, false otherwise
|
|
41
|
+
*/
|
|
42
|
+
export declare const isAppDidWeb: (did?: string) => boolean;
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { JWE, UnsignedVC, VC } from '@learncard/types';
|
|
2
|
+
import type { DataTransformer } from '@trpc/server';
|
|
3
|
+
/**
|
|
4
|
+
* Determines whether or not a string is a valid hexadecimal string
|
|
5
|
+
*
|
|
6
|
+
* E.g. 'abc123' is valid hex, 'zzz' is not
|
|
7
|
+
*/
|
|
8
|
+
export declare const isHex: (str: string) => boolean;
|
|
9
|
+
/** Determines whether or not an object is an encrypted JWE */
|
|
10
|
+
export declare const isEncrypted: (item: unknown) => item is JWE;
|
|
11
|
+
/**
|
|
12
|
+
* tRPC data transformer that handles RegExp serialization/deserialization
|
|
13
|
+
*/
|
|
14
|
+
export declare const RegExpTransformer: DataTransformer;
|
|
15
|
+
/**
|
|
16
|
+
* Determines if a credential uses VC 2.0 format by checking the context array
|
|
17
|
+
*/
|
|
18
|
+
export declare const isVC2Format: (credential: unknown) => boolean;
|
|
19
|
+
/** Unwraps a boost credential from a CertifiedBoostCredential, if it is one */
|
|
20
|
+
export declare const unwrapBoostCredential: (vc?: VC | UnsignedVC) => any;
|
|
21
|
+
export * from './images';
|
|
22
|
+
export * from './arrays';
|
|
23
|
+
export * from './types';
|
|
24
|
+
export * from './strings';
|
|
25
|
+
export * from './numbers';
|
|
26
|
+
export * from './state';
|
|
27
|
+
export * from './bitstring-status-list';
|
|
28
|
+
export * from './Utilities';
|
|
29
|
+
export * from './app-install';
|
|
30
|
+
export * from './credential-format';
|
|
31
|
+
export * from './did';
|
|
32
|
+
export * from './environment';
|
|
33
|
+
export * from './credential-format';
|
|
34
|
+
/**
|
|
35
|
+
* Checks if a DID is an app-specific did:web
|
|
36
|
+
*
|
|
37
|
+
* App did:webs follow the pattern: `did:web:learncard.app:app:<slug>`
|
|
38
|
+
*
|
|
39
|
+
* @param did - The DID to check
|
|
40
|
+
* @returns true if the DID is an app did:web, false otherwise
|
|
41
|
+
*/
|
|
42
|
+
export declare const isAppDidWeb: (did?: string) => boolean;
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAgB,UAAU,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAAI,KAAK,MAAM,YAA6B,CAAC;AAE/D,8DAA8D;AAC9D,eAAO,MAAM,WAAW,GAAI,MAAM,OAAO,KAAG,IAAI,IAAI,GAEnD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,eA8B/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,YAAY,OAAO,KAAG,OAQjD,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,qBAAqB,GAAI,KAAK,EAAE,GAAG,UAAU,QAMzD,CAAC;AAGF,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AAGxC,cAAc,aAAa,CAAC;AAG5B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAG9B,cAAc,qBAAqB,CAAC;AAEpC;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,KAAG,OAK1C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/numbers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,MAiB1C,CAAA"}
|
package/dist/state.d.ts
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { Draft } from 'immer';
|
|
3
|
+
import { DraftFunction, Updater } from 'use-immer';
|
|
4
|
+
export type SetState<T> = Dispatch<SetStateAction<T>>;
|
|
5
|
+
type UpdaterArgs<T> = T | DraftFunction<T>;
|
|
6
|
+
type CurriedReturn<ValueArg, Value> = undefined extends ValueArg ? (innerValue: Value) => void : void;
|
|
7
|
+
type InnerImmerOuterImmer<State> = <Field extends keyof Draft<State>, Value extends UpdaterArgs<Draft<State>[Field]>, ValueArg extends Value | undefined>(field: Field, value?: ValueArg) => CurriedReturn<ValueArg, Value>;
|
|
8
|
+
type InnerReactOuterImmer<State> = <Field extends keyof Draft<State>, Value extends SetStateAction<Draft<State>[Field]>, ValueArg extends Value | undefined>(field: Field, value?: ValueArg) => CurriedReturn<ValueArg, Value>;
|
|
9
|
+
type InnerImmerOuterReact<State> = <Field extends keyof State, Value extends UpdaterArgs<State[Field]>, ValueArg extends Value | undefined>(field: Field, value?: ValueArg) => CurriedReturn<ValueArg, Value>;
|
|
10
|
+
type InnerReactOuterReact<State> = <Field extends keyof State, Value extends SetStateAction<State[Field]>, ValueArg extends Value | undefined>(field: Field, value?: ValueArg) => CurriedReturn<ValueArg, Value>;
|
|
11
|
+
export declare function innerImmerOuterImmer<State, Field extends keyof Draft<State>, Value extends UpdaterArgs<Draft<State>[Field]>>(setState: Updater<State>, field: Field): (innerValue: NonNullable<Value>) => void;
|
|
12
|
+
export declare function innerImmerOuterImmer<State, Field extends keyof Draft<State>, Value extends UpdaterArgs<Draft<State>[Field]>, ValueArg extends Value | undefined>(setState: Updater<State>, field: Field, value: ValueArg): void;
|
|
13
|
+
/**
|
|
14
|
+
* Curry function to allow innerImmerOuterImmer to be used without constantly passing in setState
|
|
15
|
+
*
|
|
16
|
+
* Use like so:
|
|
17
|
+
*
|
|
18
|
+
* [state, setState] = useImmer<{ num: number; string: string; }>({ num: 1, string: 'str' });
|
|
19
|
+
*
|
|
20
|
+
* const updateField = curriedInnerImmerOuterImmer(setState);
|
|
21
|
+
*
|
|
22
|
+
* updateField('num', 3); // Updates state to { num: 3, string: 'str' }
|
|
23
|
+
*
|
|
24
|
+
* updateField(
|
|
25
|
+
* 'num',
|
|
26
|
+
* oldNum => {
|
|
27
|
+
* oldNum += 1;
|
|
28
|
+
* },
|
|
29
|
+
* ); // Updates state to { num: 4, string: 'str' }
|
|
30
|
+
*
|
|
31
|
+
* updateField(setState, 'num', 'three'); // TS Error due to invalid type
|
|
32
|
+
*/
|
|
33
|
+
export declare const curriedInnerImmerOuterImmer: <State>(setState: Updater<State>) => InnerImmerOuterImmer<State>;
|
|
34
|
+
export declare function innerReactOuterImmer<State, Field extends keyof Draft<State>, Value extends SetStateAction<Draft<State>[Field]>>(setState: Updater<State>, field: Field): (innerValue: NonNullable<Value>) => void;
|
|
35
|
+
export declare function innerReactOuterImmer<State, Field extends keyof Draft<State>, Value extends SetStateAction<Draft<State>[Field]>, ValueArg extends Value | undefined>(setState: Updater<State>, field: Field, value: ValueArg): void;
|
|
36
|
+
/**
|
|
37
|
+
* Curry function to allow innerReactOuterImmer to be used without constantly passing in setState
|
|
38
|
+
*
|
|
39
|
+
* Use like so:
|
|
40
|
+
*
|
|
41
|
+
* [state, setState] = useImmer<{ num: number; string: string; }>({ num: 1, string: 'str' });
|
|
42
|
+
*
|
|
43
|
+
* const updateField = curriedUpdateImmerSetStateField(setState);
|
|
44
|
+
*
|
|
45
|
+
* updateField('num', 3); // Updates state to { num: 3, string: 'str' }
|
|
46
|
+
*
|
|
47
|
+
* updateField('num', oldNum => oldNum + 1); // Updates state to { num: 4, string: 'str' }
|
|
48
|
+
*
|
|
49
|
+
* updateField(setState, 'num', 'three'); // TS Error due to invalid type
|
|
50
|
+
*/
|
|
51
|
+
export declare const curriedInnerReactOuterImmer: <State>(setState: Updater<State>) => InnerReactOuterImmer<State>;
|
|
52
|
+
export declare function innerImmerOuterReact<State, Field extends keyof State, Value extends UpdaterArgs<State[Field]>>(setState: SetState<State>, field: Field): (innerValue: NonNullable<Value>) => void;
|
|
53
|
+
export declare function innerImmerOuterReact<State, Field extends keyof State, Value extends UpdaterArgs<State[Field]>, ValueArg extends Value | undefined>(setState: SetState<State>, field: Field, value: ValueArg): void;
|
|
54
|
+
/**
|
|
55
|
+
* Curry function to allow innerImmerOuterReact to be used without constantly passing in setState
|
|
56
|
+
*
|
|
57
|
+
* Use like so:
|
|
58
|
+
*
|
|
59
|
+
* [state, setState] = useImmer<{ num: number; string: string; }>({ num: 1, string: 'str' });
|
|
60
|
+
*
|
|
61
|
+
* const updateField = curriedInnerImmerOuterImmer(setState);
|
|
62
|
+
*
|
|
63
|
+
* updateField('num', 3); // Updates state to { num: 3, string: 'str' }
|
|
64
|
+
*
|
|
65
|
+
* updateField(
|
|
66
|
+
* 'num',
|
|
67
|
+
* oldNum => {
|
|
68
|
+
* oldNum += 1;
|
|
69
|
+
* },
|
|
70
|
+
* ); // Updates state to { num: 4, string: 'str' }
|
|
71
|
+
*
|
|
72
|
+
* updateField(setState, 'num', 'three'); // TS Error due to invalid type
|
|
73
|
+
*/
|
|
74
|
+
export declare const curriedInnerImmerOuterReact: <State>(setState: SetState<State>) => InnerImmerOuterReact<State>;
|
|
75
|
+
export declare function innerReactOuterReact<State, Field extends keyof State, Value extends SetStateAction<State[Field]>>(setState: SetState<State>, field: Field): (innerValue: NonNullable<Value>) => void;
|
|
76
|
+
export declare function innerReactOuterReact<State, Field extends keyof State, Value extends SetStateAction<State[Field]>, ValueArg extends Value | undefined>(setState: SetState<State>, field: Field, value: ValueArg): void;
|
|
77
|
+
/**
|
|
78
|
+
* Curry function to allow updateSetStateField to be used without constantly passing in setState
|
|
79
|
+
*
|
|
80
|
+
* If possible, please consider updating your useState calls to useImmer and using the immer
|
|
81
|
+
* versions of these functions
|
|
82
|
+
*
|
|
83
|
+
* Use like so:
|
|
84
|
+
*
|
|
85
|
+
* [state, setState] = useState<{ num: number; string: string; }>({ num: 1, string: 'str' });
|
|
86
|
+
*
|
|
87
|
+
* const updateField = curriedInnerReactOuterReact(setState);
|
|
88
|
+
*
|
|
89
|
+
* updateField('num', 3); // Updates state to { num: 3, string: 'str' }
|
|
90
|
+
*
|
|
91
|
+
* updateField('num', oldNum => oldNum + 1); // Updates state to { num: 4, string: 'str' }
|
|
92
|
+
*
|
|
93
|
+
* updateField(setState, 'num', 'three'); // TS Error due to invalid type
|
|
94
|
+
*/
|
|
95
|
+
export declare const curriedInnerReactOuterReact: <State>(setState: SetState<State>) => InnerReactOuterReact<State>;
|
|
96
|
+
export declare function curriedStateSlice<State>(setState: Updater<State>): InnerImmerOuterImmer<State>;
|
|
97
|
+
export declare function curriedStateSlice<State>(setState: Updater<State>, options: {
|
|
98
|
+
inner: 'immer';
|
|
99
|
+
outer: 'immer';
|
|
100
|
+
}): InnerImmerOuterImmer<State>;
|
|
101
|
+
export declare function curriedStateSlice<State>(setState: Updater<State>, options: {
|
|
102
|
+
inner: 'immer';
|
|
103
|
+
outer: 'react';
|
|
104
|
+
}): InnerImmerOuterReact<State>;
|
|
105
|
+
export declare function curriedStateSlice<State>(setState: SetState<State>, options: {
|
|
106
|
+
inner: 'react';
|
|
107
|
+
outer: 'immer';
|
|
108
|
+
}): InnerReactOuterImmer<State>;
|
|
109
|
+
export declare function curriedStateSlice<State>(setState: SetState<State>, options: {
|
|
110
|
+
inner: 'react';
|
|
111
|
+
outer: 'react';
|
|
112
|
+
}): InnerReactOuterReact<State>;
|
|
113
|
+
type UpdateSlice<State> = {
|
|
114
|
+
(index: number): Updater<State>;
|
|
115
|
+
(index: number, value: UpdaterArgs<State>): void;
|
|
116
|
+
};
|
|
117
|
+
type CurriedArraySlice = {
|
|
118
|
+
<State>(setState: SetState<State[]>): UpdateSlice<State>;
|
|
119
|
+
<State>(setState: SetState<State[]>, index: number): Updater<State>;
|
|
120
|
+
<State>(setState: SetState<State[]>, index: number, value: State): void;
|
|
121
|
+
};
|
|
122
|
+
export declare const curriedArraySlice: CurriedArraySlice;
|
|
123
|
+
type ImmerArraySlice = {
|
|
124
|
+
<State>(setState: Updater<State[]>): UpdateSlice<State>;
|
|
125
|
+
<State>(setState: Updater<State[]>, index: number): Updater<State>;
|
|
126
|
+
<State>(setState: Updater<State[]>, index: number, value: State): void;
|
|
127
|
+
};
|
|
128
|
+
export declare const immerArraySlice: ImmerArraySlice;
|
|
129
|
+
export {};
|
|
130
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAW,KAAK,EAAa,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEnD,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;AAQtD,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;AAE3C,KAAK,aAAa,CAAC,QAAQ,EAAE,KAAK,IAAI,SAAS,SAAS,QAAQ,GAC1D,CAAC,UAAU,EAAE,KAAK,KAAK,IAAI,GAC3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/strings/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,GAAI,QAAQ,MAAM,WAGnD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,GAAI,CAAC,EAAE,QAAQ,CAAC,GAAG,IAAI,GAAG,SAAS,KAAG,KAAK,IAAI,CAC7B,CAAC;AAE1C,eAAO,MAAM,YAAY,GAAI,CAAC,EAAE,QAAQ,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,KAAG,CAAC,EACjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@learncard/helpers",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Shared helpers for LearnCard packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"development": "./src/index.ts",
|
|
11
11
|
"import": {
|
|
12
|
-
"types": "./dist/
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
13
|
"default": "./dist/helpers.esm.js"
|
|
14
14
|
},
|
|
15
15
|
"require": {
|
|
16
|
-
"types": "./dist/
|
|
16
|
+
"types": "./dist/index.d.cts",
|
|
17
17
|
"default": "./dist/index.cjs"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -23,13 +23,14 @@
|
|
|
23
23
|
"src"
|
|
24
24
|
],
|
|
25
25
|
"scripts": {
|
|
26
|
-
"build": "node ./scripts/build.mjs && shx cp ./scripts/mixedEntypoint.js ./dist/index.cjs &&
|
|
26
|
+
"build": "node ./scripts/build.mjs && shx cp ./scripts/mixedEntypoint.js ./dist/index.cjs && tsc --p tsconfig.json && shx cp ./dist/index.d.ts ./dist/index.d.cts",
|
|
27
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
27
28
|
"start": "aqu watch",
|
|
28
|
-
"lint": "
|
|
29
|
+
"lint": "bun run --cwd ../.. lint",
|
|
29
30
|
"lint:fix": "aqu lint --fix",
|
|
30
|
-
"test": "
|
|
31
|
-
"test:watch": "
|
|
32
|
-
"test:coverage": "
|
|
31
|
+
"test": "vitest run",
|
|
32
|
+
"test:watch": "vitest",
|
|
33
|
+
"test:coverage": "vitest run --coverage"
|
|
33
34
|
},
|
|
34
35
|
"author": "Learning Economy Foundation (www.learningeconomy.io)",
|
|
35
36
|
"license": "MIT",
|
|
@@ -43,23 +44,17 @@
|
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
46
|
"@esbuild-plugins/node-resolve": "^0.1.4",
|
|
46
|
-
"@types/jest": "^27.5.0",
|
|
47
47
|
"@types/node": "^18.7.19",
|
|
48
48
|
"@types/react": "^18.0.0",
|
|
49
49
|
"aqu": "0.4.3",
|
|
50
|
-
"dts-bundle-generator": "^6.10.0",
|
|
51
50
|
"esbuild": "^0.27.1",
|
|
52
|
-
"
|
|
53
|
-
"jest": "^28.1.3",
|
|
54
|
-
"jest-environment-jsdom": "^28.1.3",
|
|
55
|
-
"shx": "^0.3.4",
|
|
56
|
-
"ts-jest": "^28.0.5"
|
|
51
|
+
"shx": "^0.3.4"
|
|
57
52
|
},
|
|
58
|
-
"types": "./dist/
|
|
53
|
+
"types": "./dist/index.d.ts",
|
|
59
54
|
"dependencies": {
|
|
60
55
|
"@noble/hashes": "^1.8.0",
|
|
61
56
|
"@sd-jwt/decode": "^0.19.0",
|
|
62
|
-
"@learncard/types": "5.18.
|
|
57
|
+
"@learncard/types": "5.18.3",
|
|
63
58
|
"@trpc/server": "11.8.0",
|
|
64
59
|
"immer": "^10.0.3",
|
|
65
60
|
"use-immer": "^0.9.0",
|