@nu-art/ts-common 0.203.112 → 0.203.113
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/core/debug-flags.d.ts +1 -0
- package/core/debug-flags.js +2 -1
- package/package.json +1 -1
- package/utils/query-params.d.ts +1 -1
- package/utils/query-params.js +3 -1
package/core/debug-flags.d.ts
CHANGED
package/core/debug-flags.js
CHANGED
|
@@ -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 =
|
|
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
package/utils/query-params.d.ts
CHANGED
|
@@ -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;
|
package/utils/query-params.js
CHANGED
|
@@ -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;
|