@trackunit/shared-utils 0.0.71 → 0.0.73

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
@@ -1,7 +1,3 @@
1
- > **⚠️ Beta**
2
- >
3
- > This is a beta version and subject to change without notice.
4
-
5
1
  # Shared utils
6
2
 
7
3
  This library is meant for utility functions that can be used across the sdk not meant for use by external developers.
package/index.cjs.js CHANGED
@@ -411,7 +411,7 @@ const enumOrUndefinedFromValue = (_enum, val) => {
411
411
  * @example enumFromValue("MACHINE", AssetType) // AssetType.MACHINE
412
412
  */
413
413
  const enumFromValueTypesafe = (val, _enum) => {
414
- const enumName = (objectKeys(_enum)).find(k => _enum[k] === val);
414
+ const enumName = objectKeys(_enum).find(k => _enum[k] === val);
415
415
  if (!enumName) {
416
416
  throw Error(`Unknown enum value: ${String(val)} expect one of: ${JSON.stringify(objectValues(_enum))}`);
417
417
  }
package/index.esm.js CHANGED
@@ -409,7 +409,7 @@ const enumOrUndefinedFromValue = (_enum, val) => {
409
409
  * @example enumFromValue("MACHINE", AssetType) // AssetType.MACHINE
410
410
  */
411
411
  const enumFromValueTypesafe = (val, _enum) => {
412
- const enumName = (objectKeys(_enum)).find(k => _enum[k] === val);
412
+ const enumName = objectKeys(_enum).find(k => _enum[k] === val);
413
413
  if (!enumName) {
414
414
  throw Error(`Unknown enum value: ${String(val)} expect one of: ${JSON.stringify(objectValues(_enum))}`);
415
415
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/shared-utils",
3
- "version": "0.0.71",
3
+ "version": "0.0.73",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -6,7 +6,7 @@
6
6
  * @returns {Record<string, string>} The enum value.
7
7
  * @example enumFromValue("MACHINE", AssetType) // AssetType.MACHINE
8
8
  */
9
- export declare const enumFromValue: <T extends Record<string, string>>(val: string, _enum: T) => T[keyof T];
9
+ export declare const enumFromValue: <T extends Record<string, string | number>>(val: string | number, _enum: T) => T[keyof T];
10
10
  /**
11
11
  * Returns the enum value from a string value or undefined if the string value is undefined or null.
12
12
  *