@etsoo/shared 1.1.93 → 1.1.94

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
@@ -105,7 +105,7 @@ Array related utilities
105
105
  |toUnique|Make all items are unique|
106
106
 
107
107
  ## DataTypes
108
- Data type definitions and type safe functions. ListItemType and ListItemType1 are sugar types.
108
+ Data type definitions and type safe functions. ListItemType, ListItemType1 and ListItemType2 are sugar types.
109
109
 
110
110
  |Name|Description|
111
111
  |---:|---|
@@ -395,6 +395,16 @@ export type ListType = DataTypes.IdLabelItem<number>;
395
395
  * List item with string id type
396
396
  */
397
397
  export type ListType1 = DataTypes.IdLabelItem<string>;
398
+ /**
399
+ * List item with compatible id and name / label
400
+ */
401
+ export type ListType2 = {
402
+ id: DataTypes.IdType;
403
+ } & ({
404
+ label: string;
405
+ } | {
406
+ name: string;
407
+ });
398
408
  /**
399
409
  * Id default type
400
410
  */
@@ -395,6 +395,16 @@ export type ListType = DataTypes.IdLabelItem<number>;
395
395
  * List item with string id type
396
396
  */
397
397
  export type ListType1 = DataTypes.IdLabelItem<string>;
398
+ /**
399
+ * List item with compatible id and name / label
400
+ */
401
+ export type ListType2 = {
402
+ id: DataTypes.IdType;
403
+ } & ({
404
+ label: string;
405
+ } | {
406
+ name: string;
407
+ });
398
408
  /**
399
409
  * Id default type
400
410
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/shared",
3
- "version": "1.1.93",
3
+ "version": "1.1.94",
4
4
  "description": "TypeScript shared utilities and functions",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
package/src/DataTypes.ts CHANGED
@@ -754,6 +754,13 @@ export type ListType = DataTypes.IdLabelItem<number>;
754
754
  */
755
755
  export type ListType1 = DataTypes.IdLabelItem<string>;
756
756
 
757
+ /**
758
+ * List item with compatible id and name / label
759
+ */
760
+ export type ListType2 = {
761
+ id: DataTypes.IdType;
762
+ } & ({ label: string } | { name: string });
763
+
757
764
  /**
758
765
  * Id default type
759
766
  */