type-crafter 0.13.1 → 0.13.2
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/index.js
CHANGED
|
@@ -21521,18 +21521,19 @@ async function generateAdditionalPropertiesType(typeName, typeInfo, parentTypes)
|
|
|
21521
21521
|
type: 'string'
|
|
21522
21522
|
}).templateInput.type;
|
|
21523
21523
|
if (typeof typeInfo.additionalProperties === 'boolean') {
|
|
21524
|
+
const unknownType = getPrimitiveType(typeName, {
|
|
21525
|
+
...placeholderTypeInfo,
|
|
21526
|
+
type: 'unknown'
|
|
21527
|
+
});
|
|
21524
21528
|
return {
|
|
21525
21529
|
templateInput: {
|
|
21526
21530
|
keyType: stringKeyType,
|
|
21527
|
-
valueType:
|
|
21528
|
-
...placeholderTypeInfo,
|
|
21529
|
-
type: 'unknown'
|
|
21530
|
-
}).templateInput.type,
|
|
21531
|
+
valueType: unknownType.templateInput.type,
|
|
21531
21532
|
valueTypeReferenced: false,
|
|
21532
21533
|
valuePrimitiveType: 'unknown',
|
|
21533
21534
|
valueComposerType: null
|
|
21534
21535
|
},
|
|
21535
|
-
primitives:
|
|
21536
|
+
primitives: unknownType.primitives
|
|
21536
21537
|
};
|
|
21537
21538
|
}
|
|
21538
21539
|
else if (valueIsKeyedAdditionalProperties(typeInfo.additionalProperties)) {
|
|
@@ -22486,7 +22487,7 @@ async function runner(language, inputFilePath, outputDirectory, _typesWriterMode
|
|
|
22486
22487
|
}
|
|
22487
22488
|
}
|
|
22488
22489
|
greeting();
|
|
22489
|
-
const program = new Command().version('0.13.
|
|
22490
|
+
const program = new Command().version('0.13.2');
|
|
22490
22491
|
program
|
|
22491
22492
|
.command('generate')
|
|
22492
22493
|
.description('Generate types for your language from a type spec file')
|
|
@@ -10,7 +10,9 @@ pub struct {{typeName}} {
|
|
|
10
10
|
{{#if this.description}}
|
|
11
11
|
/// {{{this.description}}}
|
|
12
12
|
{{/if}}
|
|
13
|
+
{{#unless (eq @key (toSnakeCase @key))}}
|
|
13
14
|
#[serde(rename = "{{@key}}")]
|
|
15
|
+
{{/unless}}
|
|
14
16
|
{{#unless this.required}}
|
|
15
17
|
#[serde(skip_serializing_if = "Option::is_none")]
|
|
16
18
|
{{/unless}}
|