@accordproject/concerto-cto 1.2.2-20220111114521 → 1.2.2-20220111153301

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.
Files changed (2) hide show
  1. package/lib/printer.js +6 -10
  2. package/package.json +1 -1
package/lib/printer.js CHANGED
@@ -157,11 +157,11 @@ function propertyFromMetaModel(mm) {
157
157
  result += '[]';
158
158
  }
159
159
  result += ` ${mm.name}`;
160
- result += defaultString;
161
- result += validatorString;
162
160
  if (mm.isOptional) {
163
161
  result += ' optional';
164
162
  }
163
+ result += defaultString;
164
+ result += validatorString;
165
165
  return result;
166
166
  }
167
167
 
@@ -199,6 +199,10 @@ function declFromMetaModel(mm) {
199
199
  result += `enum ${mm.name} `;
200
200
  break;
201
201
  }
202
+ if (mm.superType) {
203
+ result += `extends ${mm.superType.name} `;
204
+ }
205
+ // XXX Needs to be fixed to support `identified`
202
206
  if (mm.identified) {
203
207
  if (mm.identified.$class === 'concerto.metamodel.IdentifiedBy') {
204
208
  result += `identified by ${mm.identified.name} `;
@@ -206,9 +210,6 @@ function declFromMetaModel(mm) {
206
210
  result += 'identified ';
207
211
  }
208
212
  }
209
- if (mm.superType) {
210
- result += `extends ${mm.superType.name} `;
211
- }
212
213
  result += '{';
213
214
  mm.properties.forEach((property) => {
214
215
  result += `\n ${propertyFromMetaModel(property)}`;
@@ -224,11 +225,6 @@ function declFromMetaModel(mm) {
224
225
  */
225
226
  function toCTO(metaModel) {
226
227
  let result = '';
227
- if (metaModel.concertoVersion) {
228
- result += `concerto version "${metaModel.concertoVersion}"`;
229
- result += '\n';
230
- result += '\n';
231
- }
232
228
  result += `namespace ${metaModel.namespace}`;
233
229
  if (metaModel.imports && metaModel.imports.length > 0) {
234
230
  result += '\n';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@accordproject/concerto-cto",
3
- "version": "1.2.2-20220111114521",
3
+ "version": "1.2.2-20220111153301",
4
4
  "description": "Parser for Concerto CTO files",
5
5
  "homepage": "https://github.com/accordproject/concerto",
6
6
  "engines": {