@esposter/shared 2.10.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/dist/index.d.ts CHANGED
@@ -1,3 +1,12 @@
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",
@@ -23,6 +32,9 @@ declare class NotInitializedError<T extends string = string> extends Error {
23
32
  constructor(name: T);
24
33
  }
25
34
  //#endregion
35
+ //#region src/services/azure/getPartitionKeyFilter.d.ts
36
+ declare const getPartitionKeyFilter: (partitionKey: string, operator?: BinaryOperator) => string;
37
+ //#endregion
26
38
  //#region src/services/prettier/css.d.ts
27
39
  declare const css: typeof String.raw;
28
40
  //#endregion
@@ -53,6 +65,9 @@ type CamelToKebab<S extends string> = S extends `${infer T}${infer U}` ? U exten
53
65
  //#region src/util/text/toKebabCase.d.ts
54
66
  declare const toKebabCase: <T extends string>(string: T) => CamelToKebab<T>;
55
67
  //#endregion
68
+ //#region src/util/text/uncapitalize.d.ts
69
+ declare const uncapitalize: <T extends string>(string: T) => Uncapitalize<T>;
70
+ //#endregion
56
71
  //#region src/util/types/FunctionProperties.d.ts
57
72
  type FunctionProperties<T> = { [K in keyof T]: T[K] extends Function ? K : never };
58
73
  //#endregion
@@ -723,4 +738,4 @@ declare const UUIDV4_REGEX: RegExp;
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, 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) {
@@ -36,6 +47,10 @@ let Operation = /* @__PURE__ */ function(Operation$1) {
36
47
  return Operation$1;
37
48
  }({});
38
49
 
50
+ //#endregion
51
+ //#region src/services/azure/getPartitionKeyFilter.ts
52
+ const getPartitionKeyFilter = (partitionKey, operator = BinaryOperator.eq) => `PartitionKey ${operator} '${partitionKey}'`;
53
+
39
54
  //#endregion
40
55
  //#region src/services/prettier/css.ts
41
56
  const css = String.raw;
@@ -77,6 +92,10 @@ const streamToText = async (readable) => {
77
92
  //#region src/util/text/toKebabCase.ts
78
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("-") ?? "";
79
94
 
95
+ //#endregion
96
+ //#region src/util/text/uncapitalize.ts
97
+ const uncapitalize = (string) => `${string.charAt(0).toLowerCase()}${string.slice(1)}`;
98
+
80
99
  //#endregion
81
100
  //#region src/util/validation/exhaustiveGuard.ts
82
101
  const exhaustiveGuard = (value) => {
@@ -93,4 +112,4 @@ const UUIDV4_REGEX = /^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-
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, 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.10.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": "ccf4ffe4c50cf43881b91045207eb5814ecf1cd3"
33
+ "gitHead": "e3d27b0dd40f23eebc5236a975406d0ada8e66c4"
34
34
  }