@mimicprotocol/cli 0.0.1-rc.29 → 0.0.1-rc.30
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/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NameContext = void 0;
|
|
4
|
+
const types_1 = require("../../types");
|
|
4
5
|
var NameContext;
|
|
5
6
|
(function (NameContext) {
|
|
6
7
|
NameContext["FUNCTION_PARAMETER"] = "function_parameter";
|
|
7
8
|
NameContext["LOCAL_VARIABLE"] = "local_variable";
|
|
8
9
|
NameContext["CLASS_PROPERTY"] = "class_property";
|
|
9
10
|
NameContext["METHOD_NAME"] = "method_name";
|
|
11
|
+
NameContext["TUPLE_CLASS_NAME"] = "tuple_class_name";
|
|
10
12
|
})(NameContext || (exports.NameContext = NameContext = {}));
|
|
11
13
|
class NameManager {
|
|
12
14
|
static resolveNameConflicts(names, context) {
|
|
@@ -66,6 +68,8 @@ class NameManager {
|
|
|
66
68
|
return '_prop';
|
|
67
69
|
case NameContext.METHOD_NAME:
|
|
68
70
|
return '_';
|
|
71
|
+
case NameContext.TUPLE_CLASS_NAME:
|
|
72
|
+
return '_class';
|
|
69
73
|
default:
|
|
70
74
|
return '_safe';
|
|
71
75
|
}
|
|
@@ -93,6 +97,7 @@ NameManager.RESERVED_BY_CONTEXT = {
|
|
|
93
97
|
'timestamp',
|
|
94
98
|
]),
|
|
95
99
|
[NameContext.METHOD_NAME]: new Set(['constructor']),
|
|
100
|
+
[NameContext.TUPLE_CLASS_NAME]: new Set([...Object.values(types_1.LibTypes), 'JSON']),
|
|
96
101
|
};
|
|
97
102
|
NameManager.INTERNAL_NAME_PATTERNS = [/^item\d+$/, /^s\d+$/];
|
|
98
103
|
exports.default = NameManager;
|
|
@@ -103,6 +103,7 @@ class TupleHandler {
|
|
|
103
103
|
if (structMatch && structMatch[1])
|
|
104
104
|
className = structMatch[1];
|
|
105
105
|
}
|
|
106
|
+
className = NameManager_1.default.escapeName(className, NameManager_1.NameContext.TUPLE_CLASS_NAME);
|
|
106
107
|
const key = baseInternalType || className;
|
|
107
108
|
const components = this.resolveComponentNames(tupleToDefine.components, NameManager_1.NameContext.CLASS_PROPERTY);
|
|
108
109
|
tupleDefinitions.set(key, {
|
package/dist/types.js
CHANGED
|
@@ -9,6 +9,7 @@ var LibTypes;
|
|
|
9
9
|
LibTypes["ChainId"] = "ChainId";
|
|
10
10
|
LibTypes["TokenAmount"] = "TokenAmount";
|
|
11
11
|
LibTypes["Void"] = "Void";
|
|
12
|
+
LibTypes["Result"] = "Result";
|
|
12
13
|
})(LibTypes || (exports.LibTypes = LibTypes = {}));
|
|
13
14
|
var AssemblyPrimitiveTypes;
|
|
14
15
|
(function (AssemblyPrimitiveTypes) {
|