@esposter/shared 2.9.0 → 2.11.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/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  - ⚖️ [License](#license)
11
11
 
12
- --
12
+ ---
13
13
 
14
14
  ## <a name="license">⚖️ License</a>
15
15
 
package/dist/index.d.ts CHANGED
@@ -1,9 +1,19 @@
1
+ //#region src/models/azure/BinaryOperator.d.ts
2
+ declare enum BinaryOperator {
3
+ eq = "eq",
4
+ ge = "ge",
5
+ gt = "gt",
6
+ le = "le",
7
+ lt = "lt",
8
+ }
9
+ //#endregion
1
10
  //#region src/models/shared/Operation.d.ts
2
11
  declare enum Operation {
3
12
  Create = "Create",
4
13
  Delete = "Delete",
5
14
  Push = "Push",
6
15
  Read = "Read",
16
+ Unshift = "Unshift",
7
17
  Update = "Update",
8
18
  }
9
19
  //#endregion
@@ -22,6 +32,9 @@ declare class NotInitializedError<T extends string = string> extends Error {
22
32
  constructor(name: T);
23
33
  }
24
34
  //#endregion
35
+ //#region src/services/azure/getPartitionKeyFilter.d.ts
36
+ declare const getPartitionKeyFilter: (partitionKey: string, operator?: BinaryOperator) => string;
37
+ //#endregion
25
38
  //#region src/services/prettier/css.d.ts
26
39
  declare const css: typeof String.raw;
27
40
  //#endregion
@@ -52,6 +65,9 @@ type CamelToKebab<S extends string> = S extends `${infer T}${infer U}` ? U exten
52
65
  //#region src/util/text/toKebabCase.d.ts
53
66
  declare const toKebabCase: <T extends string>(string: T) => CamelToKebab<T>;
54
67
  //#endregion
68
+ //#region src/util/text/uncapitalize.d.ts
69
+ declare const uncapitalize: <T extends string>(string: T) => Uncapitalize<T>;
70
+ //#endregion
55
71
  //#region src/util/types/FunctionProperties.d.ts
56
72
  type FunctionProperties<T> = { [K in keyof T]: T[K] extends Function ? K : never };
57
73
  //#endregion
@@ -718,9 +734,8 @@ declare const exhaustiveGuard: (value: never) => never;
718
734
  //#region src/util/id/uuid/constants.d.ts
719
735
  declare const NIL = "00000000-0000-0000-0000-000000000000";
720
736
  declare const UUIDV4_REGEX: RegExp;
721
- declare const UUIDV4_SEARCH_REGEX: RegExp;
722
737
  //#endregion
723
738
  //#region src/util/id/uuid/uuidValidateV4.d.ts
724
739
  declare const uuidValidateV4: (uuid: string) => boolean;
725
740
  //#endregion
726
- export { CamelToKebab, ExcludeFunctionProperties, FunctionProperties, ID_SEPARATOR, InvalidOperationError, KebabToCamel, MergeObjectsStrict, NIL, NotFoundError, NotInitializedError, Operation, SkipFirst, TakeFirst, TupleSlice, TupleSplit, TupleSplitHead, TupleSplitTail, UUIDV4_REGEX, UUIDV4_SEARCH_REGEX, capitalize, css, exhaustiveGuard, html, isPlainObject, mergeObjectsStrict, streamToText, toKebabCase, uuidValidateV4 };
741
+ export { BinaryOperator, CamelToKebab, ExcludeFunctionProperties, FunctionProperties, ID_SEPARATOR, InvalidOperationError, KebabToCamel, MergeObjectsStrict, NIL, NotFoundError, NotInitializedError, Operation, SkipFirst, TakeFirst, TupleSlice, TupleSplit, TupleSplitHead, TupleSplitTail, UUIDV4_REGEX, capitalize, css, exhaustiveGuard, getPartitionKeyFilter, html, isPlainObject, mergeObjectsStrict, streamToText, toKebabCase, uncapitalize, uuidValidateV4 };
package/dist/index.js CHANGED
@@ -1,3 +1,14 @@
1
+ //#region src/models/azure/BinaryOperator.ts
2
+ let BinaryOperator = /* @__PURE__ */ function(BinaryOperator$1) {
3
+ BinaryOperator$1["eq"] = "eq";
4
+ BinaryOperator$1["ge"] = "ge";
5
+ BinaryOperator$1["gt"] = "gt";
6
+ BinaryOperator$1["le"] = "le";
7
+ BinaryOperator$1["lt"] = "lt";
8
+ return BinaryOperator$1;
9
+ }({});
10
+
11
+ //#endregion
1
12
  //#region src/models/error/InvalidOperationError.ts
2
13
  var InvalidOperationError = class extends Error {
3
14
  constructor(operation, name, message) {
@@ -31,10 +42,15 @@ let Operation = /* @__PURE__ */ function(Operation$1) {
31
42
  Operation$1["Delete"] = "Delete";
32
43
  Operation$1["Push"] = "Push";
33
44
  Operation$1["Read"] = "Read";
45
+ Operation$1["Unshift"] = "Unshift";
34
46
  Operation$1["Update"] = "Update";
35
47
  return Operation$1;
36
48
  }({});
37
49
 
50
+ //#endregion
51
+ //#region src/services/azure/getPartitionKeyFilter.ts
52
+ const getPartitionKeyFilter = (partitionKey, operator = BinaryOperator.eq) => `PartitionKey ${operator} '${partitionKey}'`;
53
+
38
54
  //#endregion
39
55
  //#region src/services/prettier/css.ts
40
56
  const css = String.raw;
@@ -76,6 +92,10 @@ const streamToText = async (readable) => {
76
92
  //#region src/util/text/toKebabCase.ts
77
93
  const toKebabCase = (string) => string.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)?.map((x) => x.toLowerCase()).join("-") ?? "";
78
94
 
95
+ //#endregion
96
+ //#region src/util/text/uncapitalize.ts
97
+ const uncapitalize = (string) => `${string.charAt(0).toLowerCase()}${string.slice(1)}`;
98
+
79
99
  //#endregion
80
100
  //#region src/util/validation/exhaustiveGuard.ts
81
101
  const exhaustiveGuard = (value) => {
@@ -86,11 +106,10 @@ const exhaustiveGuard = (value) => {
86
106
  //#region src/util/id/uuid/constants.ts
87
107
  const NIL = "00000000-0000-0000-0000-000000000000";
88
108
  const UUIDV4_REGEX = /^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i;
89
- const UUIDV4_SEARCH_REGEX = /[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}/i;
90
109
 
91
110
  //#endregion
92
111
  //#region src/util/id/uuid/uuidValidateV4.ts
93
112
  const uuidValidateV4 = (uuid) => UUIDV4_REGEX.test(uuid);
94
113
 
95
114
  //#endregion
96
- export { ID_SEPARATOR, InvalidOperationError, NIL, NotFoundError, NotInitializedError, Operation, UUIDV4_REGEX, UUIDV4_SEARCH_REGEX, capitalize, css, exhaustiveGuard, html, isPlainObject, mergeObjectsStrict, streamToText, toKebabCase, uuidValidateV4 };
115
+ export { BinaryOperator, ID_SEPARATOR, InvalidOperationError, NIL, NotFoundError, NotInitializedError, Operation, UUIDV4_REGEX, capitalize, css, exhaustiveGuard, getPartitionKeyFilter, html, isPlainObject, mergeObjectsStrict, streamToText, toKebabCase, uncapitalize, uuidValidateV4 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esposter/shared",
3
- "version": "2.9.0",
3
+ "version": "2.11.0",
4
4
  "description": "A library that contains shared typescript code.",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/Esposter/Esposter/blob/main/packages/shared#readme",
@@ -30,5 +30,5 @@
30
30
  "typecheck": "tsc",
31
31
  "export:gen": "ctix build --config ../configuration/.ctirc-ts"
32
32
  },
33
- "gitHead": "9fc7b20cf4085cca521b09f7f49259b3dc488b68"
33
+ "gitHead": "e3d27b0dd40f23eebc5236a975406d0ada8e66c4"
34
34
  }