express-sweet 1.0.41 → 1.0.42
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/CHANGELOG.md +12 -1
- package/INSTALL-Redis.md +65 -39
- package/README.md +7 -0
- package/dist/build.common.js +66 -19
- package/dist/build.esm.js +66 -19
- package/docs/index.html +3 -3
- package/package.json +12 -20
- package/types/database/Database.d.ts +181 -181
- package/types/database/Model.d.ts +221 -221
- package/types/database/index.d.ts +3 -4
- package/types/database/loadModels.d.ts +6 -6
- package/types/exceptions/FaceCollectionCreateFailed.d.ts +25 -25
- package/types/exceptions/FaceCollectionDeleteFailed.d.ts +25 -25
- package/types/exceptions/FaceIndexFailed.d.ts +20 -20
- package/types/exceptions/FaceMissingInPhoto.d.ts +11 -11
- package/types/exceptions/FacesMultipleInPhoto.d.ts +11 -11
- package/types/exceptions/index.d.ts +5 -6
- package/types/handlebars_helpers/comparison.d.ts +351 -351
- package/types/handlebars_helpers/date.d.ts +19 -19
- package/types/handlebars_helpers/html.d.ts +12 -12
- package/types/handlebars_helpers/index.d.ts +7 -8
- package/types/handlebars_helpers/math.d.ts +81 -81
- package/types/handlebars_helpers/number.d.ts +18 -18
- package/types/handlebars_helpers/object.d.ts +21 -21
- package/types/handlebars_helpers/string.d.ts +50 -50
- package/types/index.d.ts +7 -8
- package/types/interfaces/AuthenticationConfig.d.ts +108 -108
- package/types/interfaces/BasicConfig.d.ts +74 -74
- package/types/interfaces/BoundingBox.d.ts +25 -25
- package/types/interfaces/DatabaseConfig.d.ts +7 -7
- package/types/interfaces/FaceDetails.d.ts +30 -0
- package/types/interfaces/FaceDetailsEmotions.d.ts +40 -40
- package/types/interfaces/FaceMatch.d.ts +31 -31
- package/types/interfaces/IndexFaceDetails.d.ts +29 -0
- package/types/interfaces/RekognitionOptions.d.ts +26 -26
- package/types/interfaces/SesOptions.d.ts +27 -27
- package/types/interfaces/ViewConfig.d.ts +44 -44
- package/types/interfaces/index.d.ts +8 -9
- package/types/middlewares/Authentication.d.ts +13 -13
- package/types/middlewares/CORS.d.ts +10 -10
- package/types/middlewares/Environment.d.ts +10 -10
- package/types/middlewares/ErrorHandler.d.ts +10 -10
- package/types/middlewares/Global.d.ts +13 -13
- package/types/middlewares/Http.d.ts +10 -10
- package/types/middlewares/Local.d.ts +13 -13
- package/types/middlewares/View.d.ts +14 -14
- package/types/middlewares/index.d.ts +7 -8
- package/types/mount.d.ts +7 -7
- package/types/routing/Router.d.ts +13 -13
- package/types/routing/index.d.ts +1 -2
- package/types/services/AWSRekognitionClient.d.ts +126 -126
- package/types/services/AWSSesClient.d.ts +57 -57
- package/types/services/Authentication.d.ts +34 -34
- package/types/services/index.d.ts +3 -4
- package/types/utils/Types.d.ts +24 -24
- package/types/utils/index.d.ts +9 -12
- package/types/utils/isArray.d.ts +8 -8
- package/types/utils/isAsyncFunction.d.ts +12 -12
- package/types/utils/isFunction.d.ts +13 -13
- package/types/utils/isObject.d.ts +8 -8
- package/types/utils/isString.d.ts +8 -8
- package/types/utils/loadAuthenticationConfig.d.ts +8 -8
- package/types/utils/loadBasicConfig.d.ts +8 -8
- package/types/utils/loadDatabaseConfig.d.ts +8 -8
- package/types/utils/loadViewConfig.d.ts +8 -8
- package/types/services/RedisClient.d.ts +0 -80
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Use moment to format the date.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* {{!-- results in: 2021/10/24 --}}
|
|
6
|
-
* {{formatDate 'YYYY/MM/DD' "2021-10-24T02:13:06.610Z"}}
|
|
7
|
-
*
|
|
8
|
-
* {{!-- results in: 2021/10/24 --}}
|
|
9
|
-
* {{formatDate 'YYYY/MM/DD' "2021-10-24T02:13:06.610Z" 'jp'}}
|
|
10
|
-
*
|
|
11
|
-
* {{!-- results in: 2021/10/24 --}}
|
|
12
|
-
* {{formatDate 'YYYY/MM/DD' "2021-10-24T02:13:06.610Z" 'es'}}
|
|
13
|
-
*
|
|
14
|
-
* @param {string} format A format string based on moment.
|
|
15
|
-
* @param {string} date Date string to format.
|
|
16
|
-
* @param {string|string[]} locale Language or language-country locale string (or array of strings) available in https://github.com/moment/moment/tree/develop/locale .
|
|
17
|
-
* @returns {string} Returns formatted date.
|
|
18
|
-
*/
|
|
19
|
-
export declare function formatDate(format: string, date: string, locale: string | string[]): string;
|
|
1
|
+
/**
|
|
2
|
+
* Use moment to format the date.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* {{!-- results in: 2021/10/24 --}}
|
|
6
|
+
* {{formatDate 'YYYY/MM/DD' "2021-10-24T02:13:06.610Z"}}
|
|
7
|
+
*
|
|
8
|
+
* {{!-- results in: 2021/10/24 --}}
|
|
9
|
+
* {{formatDate 'YYYY/MM/DD' "2021-10-24T02:13:06.610Z" 'jp'}}
|
|
10
|
+
*
|
|
11
|
+
* {{!-- results in: 2021/10/24 --}}
|
|
12
|
+
* {{formatDate 'YYYY/MM/DD' "2021-10-24T02:13:06.610Z" 'es'}}
|
|
13
|
+
*
|
|
14
|
+
* @param {string} format A format string based on moment.
|
|
15
|
+
* @param {string} date Date string to format.
|
|
16
|
+
* @param {string|string[]} locale Language or language-country locale string (or array of strings) available in https://github.com/moment/moment/tree/develop/locale .
|
|
17
|
+
* @returns {string} Returns formatted date.
|
|
18
|
+
*/
|
|
19
|
+
export declare function formatDate(format: string, date: string, locale: string | string[]): string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns the Assets path containing the file update time parameter.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* {{!-- results in: example.com/assets/style.css?1620526340463 --}}
|
|
6
|
-
* {{cacheBusting '/assets/style.css' '//example.com'}}
|
|
7
|
-
*
|
|
8
|
-
* @param {string} filePath Paths of Assets files such as CSS and JS in public directories.
|
|
9
|
-
* @param {string} baseUrl Application Origin URL. The default is none (undefined).
|
|
10
|
-
* @return {string} Returns the Assets file path with the update date and time parameters.
|
|
11
|
-
*/
|
|
12
|
-
export declare function cacheBusting(filePath: string, baseUrl?: string): string;
|
|
1
|
+
/**
|
|
2
|
+
* Returns the Assets path containing the file update time parameter.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* {{!-- results in: example.com/assets/style.css?1620526340463 --}}
|
|
6
|
+
* {{cacheBusting '/assets/style.css' '//example.com'}}
|
|
7
|
+
*
|
|
8
|
+
* @param {string} filePath Paths of Assets files such as CSS and JS in public directories.
|
|
9
|
+
* @param {string} baseUrl Application Origin URL. The default is none (undefined).
|
|
10
|
+
* @return {string} Returns the Assets file path with the update date and time parameters.
|
|
11
|
+
*/
|
|
12
|
+
export declare function cacheBusting(filePath: string, baseUrl?: string): string;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export { html, object, string, comparison, date, number, math, };
|
|
1
|
+
export * as html from '~/handlebars_helpers/html';
|
|
2
|
+
export * as object from '~/handlebars_helpers/object';
|
|
3
|
+
export * as string from '~/handlebars_helpers/string';
|
|
4
|
+
export * as comparison from '~/handlebars_helpers/comparison';
|
|
5
|
+
export * as date from '~/handlebars_helpers/date';
|
|
6
|
+
export * as number from '~/handlebars_helpers/number';
|
|
7
|
+
export * as math from '~/handlebars_helpers/math';
|
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Calculates the sum of two numbers.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* {{!-- results in: 3 --}}
|
|
6
|
-
* {{add 1 2}}
|
|
7
|
-
*
|
|
8
|
-
* @param {number|string} val1 The first number.
|
|
9
|
-
* @param {number|string} val2 The second number.
|
|
10
|
-
* @returns {number}
|
|
11
|
-
*/
|
|
12
|
-
export declare function add(val1: number | string, val2: number | string): number;
|
|
13
|
-
/**
|
|
14
|
-
* Calculates the difference of the given values.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* {{!-- results in: 3 --}}
|
|
18
|
-
* {{sub 5 2}}
|
|
19
|
-
*
|
|
20
|
-
* @param {number|string} val1 The first number.
|
|
21
|
-
* @param {number|string} val2 The second number.
|
|
22
|
-
* @returns {number}
|
|
23
|
-
*/
|
|
24
|
-
export declare function sub(val1: number | string, val2: number | string): number;
|
|
25
|
-
/**
|
|
26
|
-
* Calculate the multiplication of the given values.
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* {{!-- results in: 10 --}}
|
|
30
|
-
* {{multiply 5 2}}
|
|
31
|
-
*
|
|
32
|
-
* @param {number|string} val1 The first number.
|
|
33
|
-
* @param {number|string} val2 The second number.
|
|
34
|
-
* @returns {number}
|
|
35
|
-
*/
|
|
36
|
-
export declare function multiply(val1: number | string, val2: number | string): number;
|
|
37
|
-
/**
|
|
38
|
-
* Compute the division of the given values.
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* {{!-- results in: 5 --}}
|
|
42
|
-
* {{divide 10 2}}
|
|
43
|
-
*
|
|
44
|
-
* @param {number|string} val1 The first number.
|
|
45
|
-
* @param {number|string} val2 The second number.
|
|
46
|
-
* @returns {number}
|
|
47
|
-
*/
|
|
48
|
-
export declare function divide(val1: number | string, val2: number | string): number;
|
|
49
|
-
/**
|
|
50
|
-
* Round up the value.
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* {{!-- results in: 6 --}}
|
|
54
|
-
* {{ceil 5.6}}
|
|
55
|
-
*
|
|
56
|
-
* @param {number|string} val Number to be rounded to nearest greater integer.
|
|
57
|
-
* @returns {number}
|
|
58
|
-
*/
|
|
59
|
-
export declare function ceil(val: number | string): number;
|
|
60
|
-
/**
|
|
61
|
-
* Rounds down a number.
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* {{!-- results in: 5 --}}
|
|
65
|
-
* {{floor 5.6}}
|
|
66
|
-
*
|
|
67
|
-
* @param {number|string} val Number to be rounded to nearest lower integer.
|
|
68
|
-
* @returns {number}
|
|
69
|
-
*/
|
|
70
|
-
export declare function floor(val: number | string): number;
|
|
71
|
-
/**
|
|
72
|
-
* Returns an absolute value.
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* {{!-- results in: 5.6 --}}
|
|
76
|
-
* {{abs -5.6}}
|
|
77
|
-
*
|
|
78
|
-
* @param {number} val Number to perform absolute value operation on.
|
|
79
|
-
* @returns {number}
|
|
80
|
-
*/
|
|
81
|
-
export declare function abs(val: number | string): number;
|
|
1
|
+
/**
|
|
2
|
+
* Calculates the sum of two numbers.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* {{!-- results in: 3 --}}
|
|
6
|
+
* {{add 1 2}}
|
|
7
|
+
*
|
|
8
|
+
* @param {number|string} val1 The first number.
|
|
9
|
+
* @param {number|string} val2 The second number.
|
|
10
|
+
* @returns {number}
|
|
11
|
+
*/
|
|
12
|
+
export declare function add(val1: number | string, val2: number | string): number;
|
|
13
|
+
/**
|
|
14
|
+
* Calculates the difference of the given values.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* {{!-- results in: 3 --}}
|
|
18
|
+
* {{sub 5 2}}
|
|
19
|
+
*
|
|
20
|
+
* @param {number|string} val1 The first number.
|
|
21
|
+
* @param {number|string} val2 The second number.
|
|
22
|
+
* @returns {number}
|
|
23
|
+
*/
|
|
24
|
+
export declare function sub(val1: number | string, val2: number | string): number;
|
|
25
|
+
/**
|
|
26
|
+
* Calculate the multiplication of the given values.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* {{!-- results in: 10 --}}
|
|
30
|
+
* {{multiply 5 2}}
|
|
31
|
+
*
|
|
32
|
+
* @param {number|string} val1 The first number.
|
|
33
|
+
* @param {number|string} val2 The second number.
|
|
34
|
+
* @returns {number}
|
|
35
|
+
*/
|
|
36
|
+
export declare function multiply(val1: number | string, val2: number | string): number;
|
|
37
|
+
/**
|
|
38
|
+
* Compute the division of the given values.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* {{!-- results in: 5 --}}
|
|
42
|
+
* {{divide 10 2}}
|
|
43
|
+
*
|
|
44
|
+
* @param {number|string} val1 The first number.
|
|
45
|
+
* @param {number|string} val2 The second number.
|
|
46
|
+
* @returns {number}
|
|
47
|
+
*/
|
|
48
|
+
export declare function divide(val1: number | string, val2: number | string): number;
|
|
49
|
+
/**
|
|
50
|
+
* Round up the value.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* {{!-- results in: 6 --}}
|
|
54
|
+
* {{ceil 5.6}}
|
|
55
|
+
*
|
|
56
|
+
* @param {number|string} val Number to be rounded to nearest greater integer.
|
|
57
|
+
* @returns {number}
|
|
58
|
+
*/
|
|
59
|
+
export declare function ceil(val: number | string): number;
|
|
60
|
+
/**
|
|
61
|
+
* Rounds down a number.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* {{!-- results in: 5 --}}
|
|
65
|
+
* {{floor 5.6}}
|
|
66
|
+
*
|
|
67
|
+
* @param {number|string} val Number to be rounded to nearest lower integer.
|
|
68
|
+
* @returns {number}
|
|
69
|
+
*/
|
|
70
|
+
export declare function floor(val: number | string): number;
|
|
71
|
+
/**
|
|
72
|
+
* Returns an absolute value.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* {{!-- results in: 5.6 --}}
|
|
76
|
+
* {{abs -5.6}}
|
|
77
|
+
*
|
|
78
|
+
* @param {number} val Number to perform absolute value operation on.
|
|
79
|
+
* @returns {number}
|
|
80
|
+
*/
|
|
81
|
+
export declare function abs(val: number | string): number;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns the language-sensitive representation of a number as a string.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* {{!-- results in: 123,456.789 --}}
|
|
6
|
-
* {{number2locale 123456.789}}
|
|
7
|
-
*
|
|
8
|
-
* {{!-- German uses comma as decimal separator and period for thousands. --}}
|
|
9
|
-
* {{!-- results in: 123.456,789 --}}
|
|
10
|
-
* {{number2locale 123456.789 'de-DE'}}
|
|
11
|
-
*
|
|
12
|
-
* @param {number|string} val Target number or numeric string.
|
|
13
|
-
* @param {string|undefined} locales A string with a BCP 47 language tag, or an array of such strings.
|
|
14
|
-
* Corresponds to the <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales">locales</a> parameter of the Intl.NumberFormat() constructor.
|
|
15
|
-
* In implementations without Intl.NumberFormat support, this parameter is ignored and the host's locale is usually used.
|
|
16
|
-
* @return {string} A string with a language-sensitive representation of the given number.
|
|
17
|
-
*/
|
|
18
|
-
export declare function number2locale(val: number | string, locales?: string): string;
|
|
1
|
+
/**
|
|
2
|
+
* Returns the language-sensitive representation of a number as a string.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* {{!-- results in: 123,456.789 --}}
|
|
6
|
+
* {{number2locale 123456.789}}
|
|
7
|
+
*
|
|
8
|
+
* {{!-- German uses comma as decimal separator and period for thousands. --}}
|
|
9
|
+
* {{!-- results in: 123.456,789 --}}
|
|
10
|
+
* {{number2locale 123456.789 'de-DE'}}
|
|
11
|
+
*
|
|
12
|
+
* @param {number|string} val Target number or numeric string.
|
|
13
|
+
* @param {string|undefined} locales A string with a BCP 47 language tag, or an array of such strings.
|
|
14
|
+
* Corresponds to the <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales">locales</a> parameter of the Intl.NumberFormat() constructor.
|
|
15
|
+
* In implementations without Intl.NumberFormat support, this parameter is ignored and the host's locale is usually used.
|
|
16
|
+
* @return {string} A string with a language-sensitive representation of the given number.
|
|
17
|
+
*/
|
|
18
|
+
export declare function number2locale(val: number | string, locales?: string): string;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Stringify an object using JSON.stringify.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* {{jsonStringify value}}
|
|
6
|
-
*
|
|
7
|
-
* @param {any} value The value to convert to a JSON string.
|
|
8
|
-
* @param {number} indent The number of space characters to use as whitespace.
|
|
9
|
-
* @return {string} A JSON string representing the given value, or undefined.
|
|
10
|
-
*/
|
|
11
|
-
export declare function jsonStringify(value: any, indent?: number | string): string | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* Parses the given string using JSON.parse.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* {{jsonParse value}}
|
|
17
|
-
*
|
|
18
|
-
* @param {any} value Object to stringify.
|
|
19
|
-
* @return {any} JavaScript value or object described by a string.
|
|
20
|
-
*/
|
|
21
|
-
export declare function jsonParse(value: any): any;
|
|
1
|
+
/**
|
|
2
|
+
* Stringify an object using JSON.stringify.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* {{jsonStringify value}}
|
|
6
|
+
*
|
|
7
|
+
* @param {any} value The value to convert to a JSON string.
|
|
8
|
+
* @param {number} indent The number of space characters to use as whitespace.
|
|
9
|
+
* @return {string} A JSON string representing the given value, or undefined.
|
|
10
|
+
*/
|
|
11
|
+
export declare function jsonStringify(value: any, indent?: number | string): string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Parses the given string using JSON.parse.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* {{jsonParse value}}
|
|
17
|
+
*
|
|
18
|
+
* @param {any} value Object to stringify.
|
|
19
|
+
* @return {any} JavaScript value or object described by a string.
|
|
20
|
+
*/
|
|
21
|
+
export declare function jsonParse(value: any): any;
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns a new string with some or all matches of a pattern replaced by a replacement.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* {{replace 'The quick brown fox jumps over the lazy dog. If the dog reacted, was it really lazy?' 'dog' 'monkey'}}
|
|
6
|
-
*
|
|
7
|
-
* @param {string} value String.
|
|
8
|
-
* @param {string} find The string to be replaced.
|
|
9
|
-
* @param {string} replace The string to replace.
|
|
10
|
-
* @return {string} Character string after replacement.
|
|
11
|
-
*/
|
|
12
|
-
export declare function replace(value: string, find: string, replace: string): string;
|
|
13
|
-
/**
|
|
14
|
-
* Split `string` by the given `character`.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* {{!-- results in: ['a', 'b', 'c'] --}}
|
|
18
|
-
* {{split "a,b,c" ","}}
|
|
19
|
-
*
|
|
20
|
-
* {{!-- results in: <div>a</div><div>b</div><div>c</div> --}}
|
|
21
|
-
* {{#each (split list ',')}}
|
|
22
|
-
* <div>{{this}}</div>
|
|
23
|
-
* {{/each}}
|
|
24
|
-
*
|
|
25
|
-
* @param {string} value String.
|
|
26
|
-
* @param {string} separator A character that delimits the substrings in this string. Default is a comma.
|
|
27
|
-
* @return {string[]} An Array of strings, split at each point where the separator occurs in the given string. The default is a comma.
|
|
28
|
-
*/
|
|
29
|
-
export declare function split(value: string, separator: string): string[];
|
|
30
|
-
/**
|
|
31
|
-
* Convert bytes to just the right units(KB, MB, GB, TB, PB, EB, ZB, YB).
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* {{!-- results in: 1 KB --}}
|
|
35
|
-
* {{formatBytes 1024}}
|
|
36
|
-
*
|
|
37
|
-
* {{!-- results in: 1.21 KB --}}
|
|
38
|
-
* {{formatBytes 1234 2}}
|
|
39
|
-
*
|
|
40
|
-
* {{!-- results in: 1.205 KB --}}
|
|
41
|
-
* {{formatBytes 1234 3}}
|
|
42
|
-
*
|
|
43
|
-
* {{!-- results in: 0 Bytes --}}
|
|
44
|
-
* {{formatBytes 0}}
|
|
45
|
-
*
|
|
46
|
-
* @param {number} bytes Bytes.
|
|
47
|
-
* @param {number} decimals Number of decimal places to display. Default is 0.
|
|
48
|
-
* @returns {string} Returns a value with units.
|
|
49
|
-
*/
|
|
50
|
-
export declare function formatBytes(bytes: number, decimals?: number): string;
|
|
1
|
+
/**
|
|
2
|
+
* Returns a new string with some or all matches of a pattern replaced by a replacement.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* {{replace 'The quick brown fox jumps over the lazy dog. If the dog reacted, was it really lazy?' 'dog' 'monkey'}}
|
|
6
|
+
*
|
|
7
|
+
* @param {string} value String.
|
|
8
|
+
* @param {string} find The string to be replaced.
|
|
9
|
+
* @param {string} replace The string to replace.
|
|
10
|
+
* @return {string} Character string after replacement.
|
|
11
|
+
*/
|
|
12
|
+
export declare function replace(value: string, find: string, replace: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Split `string` by the given `character`.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* {{!-- results in: ['a', 'b', 'c'] --}}
|
|
18
|
+
* {{split "a,b,c" ","}}
|
|
19
|
+
*
|
|
20
|
+
* {{!-- results in: <div>a</div><div>b</div><div>c</div> --}}
|
|
21
|
+
* {{#each (split list ',')}}
|
|
22
|
+
* <div>{{this}}</div>
|
|
23
|
+
* {{/each}}
|
|
24
|
+
*
|
|
25
|
+
* @param {string} value String.
|
|
26
|
+
* @param {string} separator A character that delimits the substrings in this string. Default is a comma.
|
|
27
|
+
* @return {string[]} An Array of strings, split at each point where the separator occurs in the given string. The default is a comma.
|
|
28
|
+
*/
|
|
29
|
+
export declare function split(value: string, separator: string): string[];
|
|
30
|
+
/**
|
|
31
|
+
* Convert bytes to just the right units(KB, MB, GB, TB, PB, EB, ZB, YB).
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* {{!-- results in: 1 KB --}}
|
|
35
|
+
* {{formatBytes 1024}}
|
|
36
|
+
*
|
|
37
|
+
* {{!-- results in: 1.21 KB --}}
|
|
38
|
+
* {{formatBytes 1234 2}}
|
|
39
|
+
*
|
|
40
|
+
* {{!-- results in: 1.205 KB --}}
|
|
41
|
+
* {{formatBytes 1234 3}}
|
|
42
|
+
*
|
|
43
|
+
* {{!-- results in: 0 Bytes --}}
|
|
44
|
+
* {{formatBytes 0}}
|
|
45
|
+
*
|
|
46
|
+
* @param {number} bytes Bytes.
|
|
47
|
+
* @param {number} decimals Number of decimal places to display. Default is 0.
|
|
48
|
+
* @returns {string} Returns a value with units.
|
|
49
|
+
*/
|
|
50
|
+
export declare function formatBytes(bytes: number, decimals?: number): string;
|
package/types/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export { mount, database, services, utils, middlewares, exceptions, interfaces };
|
|
1
|
+
export { default as mount } from '~/mount';
|
|
2
|
+
export * as database from '~/database';
|
|
3
|
+
export * as services from '~/services';
|
|
4
|
+
export * as utils from '~/utils';
|
|
5
|
+
export * as middlewares from '~/middlewares';
|
|
6
|
+
export * as exceptions from '~/exceptions';
|
|
7
|
+
export * as interfaces from '~/interfaces';
|