@nu-art/ts-common 0.203.112 → 0.203.114

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.
@@ -1,5 +1,6 @@
1
1
  import { LogLevel } from './logger/types';
2
2
  export declare class DebugFlag {
3
+ static DefaultLogLevel: LogLevel;
3
4
  private readonly key;
4
5
  private minLogLevel;
5
6
  private constructor();
@@ -21,7 +21,7 @@ exports.DebugFlags = exports.DebugFlag = void 0;
21
21
  const array_tools_1 = require("../utils/array-tools");
22
22
  const types_1 = require("./logger/types");
23
23
  class DebugFlag {
24
- constructor(key, minLogLevel = types_1.LogLevel.Info) {
24
+ constructor(key, minLogLevel = DebugFlag.DefaultLogLevel) {
25
25
  this.key = key;
26
26
  this.minLogLevel = minLogLevel;
27
27
  DebugFlags.add(this);
@@ -56,6 +56,7 @@ class DebugFlag {
56
56
  (0, array_tools_1.removeItemFromArray)(DebugFlags.instance.ActiveDebugFlags, this.key);
57
57
  }
58
58
  }
59
+ DebugFlag.DefaultLogLevel = types_1.LogLevel.Info;
59
60
  exports.DebugFlag = DebugFlag;
60
61
  class DebugFlags {
61
62
  constructor() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nu-art/ts-common",
3
- "version": "0.203.112",
3
+ "version": "0.203.114",
4
4
  "description": "js and ts infra",
5
5
  "keywords": [
6
6
  "TacB0sS",
@@ -2,4 +2,4 @@ export type RouteParams = {
2
2
  [key: string]: string | number | boolean | undefined | (() => string | number);
3
3
  };
4
4
  export declare function composeQueryParams(params?: RouteParams): string;
5
- export declare function composeUrl(url: string, params?: RouteParams): string;
5
+ export declare function composeUrl(url: string, params?: RouteParams, hash?: string): string;
@@ -12,10 +12,12 @@ function composeQueryParams(params = {}) {
12
12
  }).join('&');
13
13
  }
14
14
  exports.composeQueryParams = composeQueryParams;
15
- function composeUrl(url, params = {}) {
15
+ function composeUrl(url, params = {}, hash = '') {
16
16
  const queryAsEncodedString = composeQueryParams(params);
17
17
  if (queryAsEncodedString.length)
18
18
  return `${url}?${queryAsEncodedString}`;
19
+ if (hash.length)
20
+ return `${url}${hash.startsWith('#') ? hash : `#${hash}`}`;
19
21
  return url;
20
22
  }
21
23
  exports.composeUrl = composeUrl;