@twin.org/tools-core 0.0.2-next.2 → 0.0.2-next.4
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/dist/cjs/index.cjs
CHANGED
|
@@ -5,7 +5,7 @@ var core = require('@twin.org/core');
|
|
|
5
5
|
// Copyright 2024 IOTA Stiftung.
|
|
6
6
|
// SPDX-License-Identifier: Apache-2.0.
|
|
7
7
|
/**
|
|
8
|
-
* Helper class for JSON Schema processing.
|
|
8
|
+
* Helper class for JSON Schema processing.
|
|
9
9
|
*/
|
|
10
10
|
class JsonSchemaHelper {
|
|
11
11
|
/**
|
|
@@ -72,18 +72,21 @@ class JsonSchemaHelper {
|
|
|
72
72
|
*/
|
|
73
73
|
static normaliseTypeName(typeName) {
|
|
74
74
|
// Remove the partial markers
|
|
75
|
-
let sTypeName = typeName.replace(/^Partial<(.*?)>/g, "$1");
|
|
75
|
+
let sTypeName = typeName.replace(/^Partial<I(.*?)>/g, "$1");
|
|
76
76
|
sTypeName = sTypeName.replace(/Partial%3CI(.*?)%3E/g, "$1");
|
|
77
77
|
// Remove the omit markers
|
|
78
|
-
sTypeName = sTypeName.replace(/^Omit<(.*?),.*>/g, "$1");
|
|
78
|
+
sTypeName = sTypeName.replace(/^Omit<I(.*?),.*>/g, "$1");
|
|
79
79
|
sTypeName = sTypeName.replace(/Omit%3CI(.*?)%2C.*%3E/g, "$1");
|
|
80
80
|
// Remove the pick markers
|
|
81
|
-
sTypeName = sTypeName.replace(/^Pick<(.*?),.*>/g, "$1");
|
|
81
|
+
sTypeName = sTypeName.replace(/^Pick<I(.*?),.*>/g, "$1");
|
|
82
82
|
sTypeName = sTypeName.replace(/Pick%3CI(.*?)%2C.*%3E/g, "$1");
|
|
83
|
+
// Cleanup the generic markers
|
|
84
|
+
sTypeName = sTypeName.replace(/^(.*?)<I(.*?)>/g, "$1<$2>");
|
|
85
|
+
sTypeName = sTypeName.replace(/(.*?)%3CI(.*?)%3E/g, "$1<$2>");
|
|
83
86
|
// Cleanup the unknown markers
|
|
84
87
|
sTypeName = sTypeName.replace(/<unknown>/g, "");
|
|
85
88
|
sTypeName = sTypeName.replace(/%3Cunknown%3E/g, "");
|
|
86
|
-
// Replace the
|
|
89
|
+
// Replace the other url markers
|
|
87
90
|
sTypeName = sTypeName.replace(/%7C/g, "|").replace(/%3C/g, "<").replace(/%3E/g, ">");
|
|
88
91
|
return sTypeName;
|
|
89
92
|
}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { Is, ArrayHelper } from '@twin.org/core';
|
|
|
3
3
|
// Copyright 2024 IOTA Stiftung.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0.
|
|
5
5
|
/**
|
|
6
|
-
* Helper class for JSON Schema processing.
|
|
6
|
+
* Helper class for JSON Schema processing.
|
|
7
7
|
*/
|
|
8
8
|
class JsonSchemaHelper {
|
|
9
9
|
/**
|
|
@@ -70,18 +70,21 @@ class JsonSchemaHelper {
|
|
|
70
70
|
*/
|
|
71
71
|
static normaliseTypeName(typeName) {
|
|
72
72
|
// Remove the partial markers
|
|
73
|
-
let sTypeName = typeName.replace(/^Partial<(.*?)>/g, "$1");
|
|
73
|
+
let sTypeName = typeName.replace(/^Partial<I(.*?)>/g, "$1");
|
|
74
74
|
sTypeName = sTypeName.replace(/Partial%3CI(.*?)%3E/g, "$1");
|
|
75
75
|
// Remove the omit markers
|
|
76
|
-
sTypeName = sTypeName.replace(/^Omit<(.*?),.*>/g, "$1");
|
|
76
|
+
sTypeName = sTypeName.replace(/^Omit<I(.*?),.*>/g, "$1");
|
|
77
77
|
sTypeName = sTypeName.replace(/Omit%3CI(.*?)%2C.*%3E/g, "$1");
|
|
78
78
|
// Remove the pick markers
|
|
79
|
-
sTypeName = sTypeName.replace(/^Pick<(.*?),.*>/g, "$1");
|
|
79
|
+
sTypeName = sTypeName.replace(/^Pick<I(.*?),.*>/g, "$1");
|
|
80
80
|
sTypeName = sTypeName.replace(/Pick%3CI(.*?)%2C.*%3E/g, "$1");
|
|
81
|
+
// Cleanup the generic markers
|
|
82
|
+
sTypeName = sTypeName.replace(/^(.*?)<I(.*?)>/g, "$1<$2>");
|
|
83
|
+
sTypeName = sTypeName.replace(/(.*?)%3CI(.*?)%3E/g, "$1<$2>");
|
|
81
84
|
// Cleanup the unknown markers
|
|
82
85
|
sTypeName = sTypeName.replace(/<unknown>/g, "");
|
|
83
86
|
sTypeName = sTypeName.replace(/%3Cunknown%3E/g, "");
|
|
84
|
-
// Replace the
|
|
87
|
+
// Replace the other url markers
|
|
85
88
|
sTypeName = sTypeName.replace(/%7C/g, "|").replace(/%3C/g, "<").replace(/%3E/g, ">");
|
|
86
89
|
return sTypeName;
|
|
87
90
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IJsonSchema } from "../models/IJsonSchema";
|
|
2
2
|
/**
|
|
3
|
-
* Helper class for JSON Schema processing.
|
|
3
|
+
* Helper class for JSON Schema processing.
|
|
4
4
|
*/
|
|
5
5
|
export declare class JsonSchemaHelper {
|
|
6
6
|
/**
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.2-next.4](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.2-next.3...tools-core-v0.0.2-next.4) (2025-08-19)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* update framework core ([559cb98](https://github.com/twinfoundation/tools/commit/559cb98612c05a05458b37462cda806b9591b18a))
|
|
9
|
+
|
|
10
|
+
## [0.0.2-next.3](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.2-next.2...tools-core-v0.0.2-next.3) (2025-08-05)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* improve type name normalisation ([1fe28e5](https://github.com/twinfoundation/tools/commit/1fe28e567593e46a41a833fbba95fe4cd958f525))
|
|
16
|
+
|
|
3
17
|
## [0.0.2-next.2](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.2-next.1...tools-core-v0.0.2-next.2) (2025-07-17)
|
|
4
18
|
|
|
5
19
|
|