@naturalcycles/nodejs-lib 12.46.0 → 12.47.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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [12.47.0](https://github.com/NaturalCycles/nodejs-lib/compare/v12.46.0...v12.47.0) (2021-10-25)
2
+
3
+
4
+ ### Features
5
+
6
+ * idSchema to allow uppercase characters too ([80111c3](https://github.com/NaturalCycles/nodejs-lib/commit/80111c3d601fbb6e417b7ebb38b42ae1451c8866))
7
+
1
8
  # [12.46.0](https://github.com/NaturalCycles/nodejs-lib/compare/v12.45.1...v12.46.0) (2021-10-25)
2
9
 
3
10
 
@@ -17,7 +17,7 @@ export declare function oneOfSchema<T = any>(...schemas: AnySchemaTyped<any>[]):
17
17
  export declare const anySchema: import("joi").AnySchema;
18
18
  export declare const anyObjectSchema: import("joi").ObjectSchema<any>;
19
19
  /**
20
- * [a-z0-9_]*
20
+ * [a-zA-Z0-9_]*
21
21
  * 6-64 length
22
22
  */
23
23
  export declare const idSchema: import("./string.extensions").ExtendedStringSchema;
@@ -28,13 +28,10 @@ exports.anySchema = joi_extensions_1.Joi.any();
28
28
  exports.anyObjectSchema = joi_extensions_1.Joi.object().options({ stripUnknown: false });
29
29
  // 1g498efj5sder3324zer
30
30
  /**
31
- * [a-z0-9_]*
31
+ * [a-zA-Z0-9_]*
32
32
  * 6-64 length
33
33
  */
34
- exports.idSchema = exports.stringSchema
35
- .regex(/^[a-z0-9_]*$/)
36
- .min(6)
37
- .max(64);
34
+ exports.idSchema = exports.stringSchema.regex(/^[a-zA-Z0-9_]{6,64}$/);
38
35
  /**
39
36
  * `_` should NOT be allowed to be able to use slug-ids as part of natural ids with `_` separator.
40
37
  */
@@ -42,7 +39,7 @@ exports.SLUG_PATTERN = /^[a-z0-9-]*$/;
42
39
  /**
43
40
  * "Slug" - a valid URL, filename, etc.
44
41
  */
45
- exports.slugSchema = exports.stringSchema.regex(exports.SLUG_PATTERN).min(1).max(255);
42
+ exports.slugSchema = exports.stringSchema.regex(/^[a-z0-9-]{1,255}$/);
46
43
  // 16725225600 is 2500-01-01
47
44
  exports.unixTimestampSchema = exports.numberSchema.integer().min(0).max(16725225600);
48
45
  // 2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/nodejs-lib",
3
- "version": "12.46.0",
3
+ "version": "12.47.0",
4
4
  "scripts": {
5
5
  "prepare": "husky install",
6
6
  "docs-serve": "vuepress dev docs",
@@ -42,13 +42,10 @@ export const anyObjectSchema = Joi.object().options({ stripUnknown: false })
42
42
 
43
43
  // 1g498efj5sder3324zer
44
44
  /**
45
- * [a-z0-9_]*
45
+ * [a-zA-Z0-9_]*
46
46
  * 6-64 length
47
47
  */
48
- export const idSchema = stringSchema
49
- .regex(/^[a-z0-9_]*$/)
50
- .min(6)
51
- .max(64)
48
+ export const idSchema = stringSchema.regex(/^[a-zA-Z0-9_]{6,64}$/)
52
49
 
53
50
  /**
54
51
  * `_` should NOT be allowed to be able to use slug-ids as part of natural ids with `_` separator.
@@ -58,7 +55,7 @@ export const SLUG_PATTERN = /^[a-z0-9-]*$/
58
55
  /**
59
56
  * "Slug" - a valid URL, filename, etc.
60
57
  */
61
- export const slugSchema = stringSchema.regex(SLUG_PATTERN).min(1).max(255)
58
+ export const slugSchema = stringSchema.regex(/^[a-z0-9-]{1,255}$/)
62
59
 
63
60
  // 16725225600 is 2500-01-01
64
61
  export const unixTimestampSchema = numberSchema.integer().min(0).max(16725225600)