@hvedinich/utils 0.0.47 → 0.0.50
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/.eslintrc.js +8 -0
- package/.prettierrc +6 -0
- package/package.json +1 -1
- package/src/constants/regExp.js +2 -3
- package/src/error/index.js +2 -2
package/.eslintrc.js
ADDED
package/.prettierrc
ADDED
package/package.json
CHANGED
package/src/constants/regExp.js
CHANGED
|
@@ -2,16 +2,15 @@ const lettersAndSpaceRegExp = '^[ёЁА-Яа-яa-zA-Z]{2,20}(\\s)?([ёЁА-Яа-
|
|
|
2
2
|
const onlyLettersRegExp = '^[А-Яа-яёЁa-zA-Z]{2,30}$';
|
|
3
3
|
const companyNameRegExp = '^[0-9- ёЁА-Яа-яa-zA-Z"]{2,50}$';
|
|
4
4
|
const passwordRegExp = '^(?=.*[a-zа-яё])(?=.*[A-ZА-ЯЁ])(?=.*\\d)[|{_`\\-=+}?№!@#\\$%\\^&\\*\\(\\)\\[\\]:;\'",\\.A-Za-zа-яА-ЯёЁ\\d]{8,30}$';
|
|
5
|
+
const titleRegExp = '^[А-Яа-яa-zA-ZёЁ0-9_!@#№*&.,/?();:\'"=-\\s+]{2,80}$';
|
|
5
6
|
const descriptionRegExp = '^[А-Яа-яёЁa-zA-Z0-9_!@#№*&.,/?();:\'"=-\\s+]{2,1500}$';
|
|
6
7
|
const enumRegExp = '^[А-Яа-яёЁa-zA-Z0-9_]{2,30}$';
|
|
7
8
|
const numberLetterSymbolRegExp = '^[a-zA-ZА-Яа-яёЁ0-9_!.№,?():\'"-\\s+]{2,100}$';
|
|
8
9
|
const phoneRegExp = '^[+]{0,1}[0-9-]{4,20}$';
|
|
9
10
|
const cityNameRegExp = '^[А-Яа-яёЁa-zA-Z -]{2,30}$';
|
|
10
|
-
const titleRegExp = '^[a-zA-ZА-Яа-яёЁ0-9_!.№,?():\'"-\\s+]{2,80}$';
|
|
11
|
-
|
|
12
11
|
|
|
13
12
|
module.exports = {
|
|
14
|
-
|
|
13
|
+
companyNameRegExp,
|
|
15
14
|
lettersAndSpaceRegExp,
|
|
16
15
|
onlyLettersRegExp,
|
|
17
16
|
passwordRegExp,
|
package/src/error/index.js
CHANGED
|
@@ -27,9 +27,9 @@ class Unauthorized extends ServerError {
|
|
|
27
27
|
|
|
28
28
|
class InternalServerError extends ServerError {
|
|
29
29
|
constructor({
|
|
30
|
-
error, sanitized, ctx, message,
|
|
30
|
+
error, sanitized, ctx, message, code = 500,
|
|
31
31
|
}) {
|
|
32
|
-
super(ctx, 'InternalServerError', 500, error, sanitized, message);
|
|
32
|
+
super(ctx, 'InternalServerError', 500, error, sanitized, message, code);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|