@travetto/runtime 7.0.0-rc.0 → 7.0.0-rc.1
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/package.json +2 -2
- package/src/function.ts +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/runtime",
|
|
3
|
-
"version": "7.0.0-rc.
|
|
3
|
+
"version": "7.0.0-rc.1",
|
|
4
4
|
"description": "Runtime for travetto applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"console-manager",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"debug": "^4.4.3"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@travetto/transformer": "^7.0.0-rc.
|
|
33
|
+
"@travetto/transformer": "^7.0.0-rc.1"
|
|
34
34
|
},
|
|
35
35
|
"peerDependenciesMeta": {
|
|
36
36
|
"@travetto/transformer": {
|
package/src/function.ts
CHANGED
|
@@ -62,3 +62,12 @@ export function describeFunction(fn?: Function): FunctionMetadata | undefined {
|
|
|
62
62
|
const _fn: (Function & { [MetadataSymbol]?: FunctionMetadata }) | undefined = fn;
|
|
63
63
|
return _fn?.[MetadataSymbol];
|
|
64
64
|
}
|
|
65
|
+
|
|
66
|
+
const foreignTypeRegistry = new Map<string, Function>();
|
|
67
|
+
export function foreignType(id: string): Function {
|
|
68
|
+
if (!foreignTypeRegistry.has(id)) {
|
|
69
|
+
const type = class { static Ⲑid = id; };
|
|
70
|
+
foreignTypeRegistry.set(id, type);
|
|
71
|
+
}
|
|
72
|
+
return foreignTypeRegistry.get(id)!;
|
|
73
|
+
}
|