@minimaltech/node-infra 0.5.8-10 → 0.5.8-11

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.
@@ -23,10 +23,9 @@ export type ClassType<T> = Function & {
23
23
  prototype: T;
24
24
  };
25
25
  export type TStatusFromClass<T extends ClassType<AnyObject>> = ValueOf<Omit<T, 'prototype' | 'isValid' | 'SCHEME_SET' | 'TYPE_SET'>>;
26
- /**
27
- * Alternative for {@link TStatusFromClass<T>}
28
- */
29
- export type TConstValue<T extends ClassType<AnyObject>> = ValueOf<Omit<T, 'prototype' | 'isValid' | 'SCHEME_SET' | 'TYPE_SET'>>;
26
+ export type TStringConstValue<T extends ClassType<any>> = Extract<ValueOf<T>, string>;
27
+ export type TNumberConstValue<T extends ClassType<any>> = Extract<ValueOf<T>, number>;
28
+ export type TConstValue<T extends ClassType<any>> = Extract<ValueOf<T>, string | number>;
30
29
  export type TPrettify<T> = {
31
30
  [K in keyof T]: T[K];
32
31
  } & {};
@@ -1,4 +1,4 @@
1
- import { TStatusFromClass } from '../../../common/types';
1
+ import { TConstValue } from '../../../common/types';
2
2
  export declare class LogLevels {
3
3
  static readonly ERROR = "error";
4
4
  static readonly ALERT = "alert";
@@ -12,4 +12,4 @@ export declare class LogLevels {
12
12
  static readonly SCHEME_SET: Set<string>;
13
13
  static isValid(input: string): boolean;
14
14
  }
15
- export type TLogLevel = TStatusFromClass<typeof LogLevels>;
15
+ export type TLogLevel = TConstValue<typeof LogLevels>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minimaltech/node-infra",
3
- "version": "0.5.8-10",
3
+ "version": "0.5.8-11",
4
4
  "description": "Minimal Technology NodeJS Infrastructure - Loopback 4 Framework",
5
5
  "keywords": [
6
6
  "web",