typia 15.1.0 → 15.2.0
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/lib/TypeGuardError.js.map +1 -1
- package/lib/basic.js.map +1 -1
- package/lib/compare.js.map +1 -1
- package/lib/functional.js.map +1 -1
- package/lib/http.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/internal/_IProtobufWriter.js.map +1 -1
- package/lib/internal/_ProtobufReader.js.map +1 -1
- package/lib/internal/_ProtobufSizer.js.map +1 -1
- package/lib/internal/_ProtobufWriter.js.map +1 -1
- package/lib/internal/_accessExpressionAsString.js.map +1 -1
- package/lib/internal/_assertGuard.js.map +1 -1
- package/lib/internal/_coerceLlmArguments.js.map +1 -1
- package/lib/internal/_createLlmEvaluation.js.map +1 -1
- package/lib/internal/_createStandardSchema.js.map +1 -1
- package/lib/internal/_decimal.js.map +1 -1
- package/lib/internal/_functionalTypeGuardErrorFactory.js.map +1 -1
- package/lib/internal/_httpFormDataReadArray.js.map +1 -1
- package/lib/internal/_httpFormDataReadBigint.js.map +1 -1
- package/lib/internal/_httpFormDataReadBlob.js.map +1 -1
- package/lib/internal/_httpFormDataReadBoolean.js.map +1 -1
- package/lib/internal/_httpFormDataReadFile.js.map +1 -1
- package/lib/internal/_httpFormDataReadNumber.js.map +1 -1
- package/lib/internal/_httpFormDataReadString.js.map +1 -1
- package/lib/internal/_httpHeaderReadBigint.js.map +1 -1
- package/lib/internal/_httpHeaderReadBoolean.js.map +1 -1
- package/lib/internal/_httpHeaderReadNumber.js.map +1 -1
- package/lib/internal/_httpParameterReadBigint.js.map +1 -1
- package/lib/internal/_httpParameterReadBoolean.js.map +1 -1
- package/lib/internal/_httpParameterReadNumber.js.map +1 -1
- package/lib/internal/_httpParameterReadString.js.map +1 -1
- package/lib/internal/_httpQueryParseURLSearchParams.js.map +1 -1
- package/lib/internal/_httpQueryReadArray.js.map +1 -1
- package/lib/internal/_httpQueryReadBigint.js.map +1 -1
- package/lib/internal/_httpQueryReadBoolean.js.map +1 -1
- package/lib/internal/_httpQueryReadNumber.js.map +1 -1
- package/lib/internal/_httpQueryReadString.js.map +1 -1
- package/lib/internal/_isBetween.js.map +1 -1
- package/lib/internal/_isBigintString.js.map +1 -1
- package/lib/internal/_isFormatByte.js.map +1 -1
- package/lib/internal/_isFormatDate.js.map +1 -1
- package/lib/internal/_isFormatDateTime.js.map +1 -1
- package/lib/internal/_isFormatDuration.js.map +1 -1
- package/lib/internal/_isFormatEmail.js.map +1 -1
- package/lib/internal/_isFormatHostname.js.map +1 -1
- package/lib/internal/_isFormatIdnEmail.js.map +1 -1
- package/lib/internal/_isFormatIdnHostname.js.map +1 -1
- package/lib/internal/_isFormatIpv4.js.map +1 -1
- package/lib/internal/_isFormatIpv6.js.map +1 -1
- package/lib/internal/_isFormatIri.js.map +1 -1
- package/lib/internal/_isFormatIriReference.js.map +1 -1
- package/lib/internal/_isFormatJsonPointer.js.map +1 -1
- package/lib/internal/_isFormatPassword.js.map +1 -1
- package/lib/internal/_isFormatRegex.js.map +1 -1
- package/lib/internal/_isFormatRelativeJsonPointer.js.map +1 -1
- package/lib/internal/_isFormatTime.js.map +1 -1
- package/lib/internal/_isFormatUri.js.map +1 -1
- package/lib/internal/_isFormatUriReference.js.map +1 -1
- package/lib/internal/_isFormatUriTemplate.js.map +1 -1
- package/lib/internal/_isFormatUrl.js.map +1 -1
- package/lib/internal/_isFormatUuid.js.map +1 -1
- package/lib/internal/_isMultipleOf.js.map +1 -1
- package/lib/internal/_isTypeFloat.js.map +1 -1
- package/lib/internal/_isTypeInt16.js.map +1 -1
- package/lib/internal/_isTypeInt32.js.map +1 -1
- package/lib/internal/_isTypeInt64.js.map +1 -1
- package/lib/internal/_isTypeInt64Bigint.js.map +1 -1
- package/lib/internal/_isTypeInt8.js.map +1 -1
- package/lib/internal/_isTypeUint16.js.map +1 -1
- package/lib/internal/_isTypeUint32.js.map +1 -1
- package/lib/internal/_isTypeUint64.js.map +1 -1
- package/lib/internal/_isTypeUint64Bigint.js.map +1 -1
- package/lib/internal/_isTypeUint8.js.map +1 -1
- package/lib/internal/_isUniqueItems.js.map +1 -1
- package/lib/internal/_jsonStringifyArray.js.map +1 -1
- package/lib/internal/_jsonStringifyElement.js.map +1 -1
- package/lib/internal/_jsonStringifyNumber.js.map +1 -1
- package/lib/internal/_jsonStringifyProperty.js.map +1 -1
- package/lib/internal/_jsonStringifyRest.js.map +1 -1
- package/lib/internal/_jsonStringifyString.js.map +1 -1
- package/lib/internal/_jsonStringifyTail.js.map +1 -1
- package/lib/internal/_llmApplicationFinalize.js +8 -1
- package/lib/internal/_llmApplicationFinalize.js.map +1 -1
- package/lib/internal/_notationAny.js.map +1 -1
- package/lib/internal/_notationAssign.js.map +1 -1
- package/lib/internal/_notationCamel.js.map +1 -1
- package/lib/internal/_notationKebab.js.map +1 -1
- package/lib/internal/_notationKeyCollision.js.map +1 -1
- package/lib/internal/_notationPascal.js.map +1 -1
- package/lib/internal/_notationSnake.js.map +1 -1
- package/lib/internal/_parseLlmArguments.js.map +1 -1
- package/lib/internal/_plainCloneAny.js.map +1 -1
- package/lib/internal/_randomArray.js.map +1 -1
- package/lib/internal/_randomBigint.js.map +1 -1
- package/lib/internal/_randomBoolean.js.map +1 -1
- package/lib/internal/_randomFormatByte.js.map +1 -1
- package/lib/internal/_randomFormatDate.js.map +1 -1
- package/lib/internal/_randomFormatDatetime.js.map +1 -1
- package/lib/internal/_randomFormatDuration.js.map +1 -1
- package/lib/internal/_randomFormatEmail.js.map +1 -1
- package/lib/internal/_randomFormatHostname.js.map +1 -1
- package/lib/internal/_randomFormatIdnEmail.js.map +1 -1
- package/lib/internal/_randomFormatIdnHostname.js.map +1 -1
- package/lib/internal/_randomFormatIpv4.js.map +1 -1
- package/lib/internal/_randomFormatIpv6.js.map +1 -1
- package/lib/internal/_randomFormatIri.js.map +1 -1
- package/lib/internal/_randomFormatIriReference.js.map +1 -1
- package/lib/internal/_randomFormatJsonPointer.js.map +1 -1
- package/lib/internal/_randomFormatPassword.js.map +1 -1
- package/lib/internal/_randomFormatRegex.js.map +1 -1
- package/lib/internal/_randomFormatRelativeJsonPointer.js.map +1 -1
- package/lib/internal/_randomFormatTime.js.map +1 -1
- package/lib/internal/_randomFormatUri.js.map +1 -1
- package/lib/internal/_randomFormatUriReference.js.map +1 -1
- package/lib/internal/_randomFormatUriTemplate.js.map +1 -1
- package/lib/internal/_randomFormatUrl.js.map +1 -1
- package/lib/internal/_randomFormatUuid.js.map +1 -1
- package/lib/internal/_randomInteger.js.map +1 -1
- package/lib/internal/_randomMultiple.js.map +1 -1
- package/lib/internal/_randomNumber.js.map +1 -1
- package/lib/internal/_randomPattern.js.map +1 -1
- package/lib/internal/_randomPick.js.map +1 -1
- package/lib/internal/_randomString.js.map +1 -1
- package/lib/internal/_randomStringLength.js.map +1 -1
- package/lib/internal/_stringLength.js.map +1 -1
- package/lib/internal/_stringLengthGte.js.map +1 -1
- package/lib/internal/_stringLengthLte.js.map +1 -1
- package/lib/internal/_throwTypeGuardError.js.map +1 -1
- package/lib/internal/_validateReport.js.map +1 -1
- package/lib/internal/private/__notationRename.js.map +1 -1
- package/lib/internal/private/__randomComposition.js.map +1 -1
- package/lib/internal/private/__randomEpoch.js.map +1 -1
- package/lib/json.js.map +1 -1
- package/lib/llm.js.map +1 -1
- package/lib/module.js.map +1 -1
- package/lib/notations.js.map +1 -1
- package/lib/plain.js.map +1 -1
- package/lib/protobuf.js.map +1 -1
- package/lib/re-exports.js.map +1 -1
- package/lib/reflect.js.map +1 -1
- package/lib/transform.d.ts +5 -2
- package/lib/transform.js +6 -2
- package/lib/transform.js.map +1 -1
- package/lib/transform.mjs +7 -3
- package/lib/transform.mjs.map +1 -1
- package/lib/transformers/NoTransformConfigurationError.js.map +1 -1
- package/native/cmd/ttsc-typia/build.go +3 -1
- package/native/cmd/ttsc-typia/content_mapper_transform_ts71_test.go +102 -0
- package/native/cmd/ttsc-typia/diagnostics.go +1 -1
- package/native/cmd/ttsc-typia/distinct_programs_concurrent_emit_test.go +167 -0
- package/native/cmd/ttsc-typia/exact_optional_family_emission_contract_test.go +2 -1
- package/native/cmd/ttsc-typia/project_dependencies_heritage_forms_transform_test.go +84 -0
- package/native/cmd/ttsc-typia/schema_literal_helpers_test.go +2 -1
- package/native/cmd/ttsc-typia/transform.go +7 -6
- package/native/core/context/EmitFactory.go +20 -29
- package/native/core/context/ImportProgrammer.go +5 -7
- package/native/core/context/NodeFactory.go +25 -0
- package/native/core/context/node_factory_ownership_test.go +45 -0
- package/native/core/factories/ExpressionFactory.go +13 -14
- package/native/core/factories/IdentifierFactory.go +3 -5
- package/native/core/factories/LiteralFactory.go +6 -8
- package/native/core/factories/NumericRangeFactory.go +8 -10
- package/native/core/factories/StatementFactory.go +5 -7
- package/native/core/factories/TemplateFactory.go +1 -3
- package/native/core/factories/TypeFactory.go +7 -9
- package/native/core/factories/ValueFactory.go +5 -7
- package/native/core/factories/factory_utility_coverage_test.go +21 -20
- package/native/core/factories/internal/metadata/MetadataHelper.go +13 -13
- package/native/core/factories/internal/metadata/comment_tags_coverage_test.go +7 -16
- package/native/core/factories/internal/metadata/emplace_metadata_object.go +36 -27
- package/native/core/factories/internal/metadata/iterate_metadata_alias.go +2 -2
- package/native/core/factories/internal/metadata/iterate_metadata_constant.go +4 -4
- package/native/core/factories/internal/metadata/iterate_metadata_function.go +2 -2
- package/native/core/factories/internal/metadata/iterate_metadata_intersection.go +11 -11
- package/native/core/factories/internal/metadata/js_doc_link_text_test.go +6 -16
- package/native/core/factories/internal/metadata/js_doc_parameter_name_reads_qualified_name_test.go +2 -1
- package/native/core/factories/internal/metadata/js_doc_source_helpers_test.go +44 -0
- package/native/core/factories/internal/metadata/js_doc_type_tag_blank_separation_test.go +16 -22
- package/native/core/factories/numeric_range_factory_enforces_64bit_bounds_test.go +2 -1
- package/native/core/programmers/AssertProgrammer.go +16 -18
- package/native/core/programmers/IsProgrammer.go +10 -12
- package/native/core/programmers/RandomProgrammer.go +29 -31
- package/native/core/programmers/ValidateProgrammer.go +20 -22
- package/native/core/programmers/compare/CompareEqualProgrammer.go +1 -3
- package/native/core/programmers/compare/CompareLessProgrammer.go +1 -3
- package/native/core/programmers/functional/FunctionalAssertFunctionProgrammer.go +3 -5
- package/native/core/programmers/functional/FunctionalAssertParametersProgrammer.go +2 -2
- package/native/core/programmers/functional/FunctionalAssertReturnProgrammer.go +2 -2
- package/native/core/programmers/functional/FunctionalIsFunctionProgrammer.go +2 -2
- package/native/core/programmers/functional/FunctionalIsParametersProgrammer.go +8 -10
- package/native/core/programmers/functional/FunctionalIsReturnProgrammer.go +2 -2
- package/native/core/programmers/functional/FunctionalValidateFunctionProgrammer.go +4 -6
- package/native/core/programmers/functional/FunctionalValidateParametersProgrammer.go +2 -2
- package/native/core/programmers/functional/FunctionalValidateReturnProgrammer.go +2 -2
- package/native/core/programmers/helpers/ClassifyJoiner.go +1 -3
- package/native/core/programmers/helpers/CloneJoiner.go +8 -14
- package/native/core/programmers/helpers/FunctionProgrammer.go +3 -5
- package/native/core/programmers/helpers/NotationJoiner.go +6 -12
- package/native/core/programmers/helpers/PruneJoiner.go +10 -12
- package/native/core/programmers/helpers/RandomJoiner.go +5 -7
- package/native/core/programmers/helpers/StringifyJoinder.go +15 -17
- package/native/core/programmers/helpers/UnionExplorer.go +24 -26
- package/native/core/programmers/http/HttpAssertFormDataProgrammer.go +2 -4
- package/native/core/programmers/http/HttpAssertHeadersProgrammer.go +1 -1
- package/native/core/programmers/http/HttpAssertQueryProgrammer.go +1 -1
- package/native/core/programmers/http/HttpFormDataProgrammer.go +9 -11
- package/native/core/programmers/http/HttpHeadersProgrammer.go +7 -9
- package/native/core/programmers/http/HttpIsFormDataProgrammer.go +2 -4
- package/native/core/programmers/http/HttpIsHeadersProgrammer.go +1 -1
- package/native/core/programmers/http/HttpIsQueryProgrammer.go +1 -1
- package/native/core/programmers/http/HttpParameterProgrammer.go +2 -4
- package/native/core/programmers/http/HttpQueryProgrammer.go +8 -10
- package/native/core/programmers/http/HttpValidateFormDataProgrammer.go +2 -4
- package/native/core/programmers/http/HttpValidateHeadersProgrammer.go +1 -1
- package/native/core/programmers/http/HttpValidateQueryProgrammer.go +1 -1
- package/native/core/programmers/internal/CheckerProgrammer.go +26 -28
- package/native/core/programmers/internal/FeatureProgrammer.go +32 -34
- package/native/core/programmers/iterate/check_array_length.go +1 -1
- package/native/core/programmers/iterate/check_bigint.go +2 -4
- package/native/core/programmers/iterate/check_dynamic_key.go +5 -7
- package/native/core/programmers/iterate/check_dynamic_properties.go +43 -57
- package/native/core/programmers/iterate/check_everything.go +3 -5
- package/native/core/programmers/iterate/check_exclude.go +2 -4
- package/native/core/programmers/iterate/check_native.go +2 -4
- package/native/core/programmers/iterate/check_number.go +2 -4
- package/native/core/programmers/iterate/check_object.go +3 -5
- package/native/core/programmers/iterate/check_object_type_tags.go +1 -1
- package/native/core/programmers/iterate/check_string.go +2 -4
- package/native/core/programmers/iterate/check_template.go +7 -9
- package/native/core/programmers/iterate/decode_union_object.go +2 -4
- package/native/core/programmers/iterate/feature_object_entries.go +2 -4
- package/native/core/programmers/json/JsonAssertParseProgrammer.go +2 -2
- package/native/core/programmers/json/JsonAssertStringifyProgrammer.go +2 -4
- package/native/core/programmers/json/JsonIsParseProgrammer.go +4 -6
- package/native/core/programmers/json/JsonIsStringifyProgrammer.go +2 -4
- package/native/core/programmers/json/JsonStringifyProgrammer.go +37 -39
- package/native/core/programmers/json/JsonValidateParseProgrammer.go +2 -2
- package/native/core/programmers/json/JsonValidateStringifyProgrammer.go +2 -4
- package/native/core/programmers/llm/LlmApplicationProgrammer.go +1 -3
- package/native/core/programmers/llm/LlmCoerceProgrammer.go +2 -4
- package/native/core/programmers/llm/LlmControllerProgrammer.go +1 -3
- package/native/core/programmers/llm/LlmEvaluationProgrammer.go +1 -3
- package/native/core/programmers/llm/LlmParametersProgrammer.go +1 -3
- package/native/core/programmers/llm/LlmParseProgrammer.go +3 -5
- package/native/core/programmers/llm/LlmSchemaProgrammer.go +5 -7
- package/native/core/programmers/llm/LlmStructuredOutputProgrammer.go +2 -4
- package/native/core/programmers/llm/llm_schema_programmer_coverage_test.go +1 -1
- package/native/core/programmers/notations/NotationAssertGeneralProgrammer.go +1 -3
- package/native/core/programmers/notations/NotationGeneralProgrammer.go +26 -28
- package/native/core/programmers/notations/NotationIsGeneralProgrammer.go +1 -3
- package/native/core/programmers/notations/NotationValidateGeneralProgrammer.go +1 -3
- package/native/core/programmers/plain/PlainAssertClassifyProgrammer.go +2 -4
- package/native/core/programmers/plain/PlainAssertCloneProgrammer.go +2 -4
- package/native/core/programmers/plain/PlainAssertPruneProgrammer.go +2 -4
- package/native/core/programmers/plain/PlainClassifyProgrammer.go +44 -46
- package/native/core/programmers/plain/PlainCloneProgrammer.go +30 -32
- package/native/core/programmers/plain/PlainIsCloneProgrammer.go +2 -4
- package/native/core/programmers/plain/PlainIsPruneProgrammer.go +2 -4
- package/native/core/programmers/plain/PlainPruneProgrammer.go +26 -28
- package/native/core/programmers/plain/PlainValidateClassifyProgrammer.go +2 -4
- package/native/core/programmers/plain/PlainValidateCloneProgrammer.go +2 -4
- package/native/core/programmers/plain/PlainValidatePruneProgrammer.go +2 -4
- package/native/core/programmers/protobuf/ProtobufAssertDecodeProgrammer.go +2 -4
- package/native/core/programmers/protobuf/ProtobufAssertEncodeProgrammer.go +2 -4
- package/native/core/programmers/protobuf/ProtobufDecodeProgrammer.go +24 -25
- package/native/core/programmers/protobuf/ProtobufEncodeProgrammer.go +23 -25
- package/native/core/programmers/protobuf/ProtobufIsDecodeProgrammer.go +2 -4
- package/native/core/programmers/protobuf/ProtobufIsEncodeProgrammer.go +2 -4
- package/native/core/programmers/protobuf/ProtobufMessageProgrammer.go +1 -3
- package/native/core/programmers/protobuf/ProtobufValidateDecodeProgrammer.go +2 -4
- package/native/core/programmers/protobuf/ProtobufValidateEncodeProgrammer.go +3 -5
- package/native/core/programmers/protobuf/protobuf_programmer_helper_coverage_test.go +1 -1
- package/native/core/programmers/reflect/ReflectLiteralsProgrammer.go +1 -3
- package/native/core/schemas/metadata/MetadataCollection.go +2 -2
- package/native/core/schemas/metadata/MetadataDefaultLibrary.go +1 -1
- package/native/core/schemas/metadata/MetadataDependency.go +13 -13
- package/native/core/utils/PromiseTypeFactory.go +3 -3
- package/native/go.mod +3 -4
- package/native/go.work +1 -1
- package/native/transform/CallExpressionTransformer.go +4 -4
- package/native/transform/FileTransformer.go +2 -4
- package/native/transform/features/RandomTransformer.go +1 -3
- package/native/transform/features/compare/CompareEqualTransformer.go +1 -1
- package/native/transform/features/compare/CompareLessTransformer.go +1 -1
- package/native/transform/features/functional/FunctionalGenericTransformer.go +2 -2
- package/native/transform/features/llm/LlmCoerceTransformer.go +1 -1
- package/native/transform/features/llm/LlmEvaluationProbabilityDeclarations.go +1 -1
- package/native/transform/features/llm/LlmEvaluationTransformer.go +1 -1
- package/native/transform/features/llm/LlmParseTransformer.go +1 -1
- package/native/transform/features/llm/LlmSchemaTransformer.go +1 -3
- package/native/transform/features/reflect/ReflectNameTransformer.go +1 -3
- package/native/transform/file_transformer_coverage_test.go +2 -1
- package/native/transform/internal/GenericTransformer.go +1 -3
- package/package.json +6 -6
- package/src/transform.ts +6 -2
|
@@ -54,10 +54,8 @@ type StringifyJoiner_TupleProps struct {
|
|
|
54
54
|
Emit *shimprinter.EmitContext
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
var stringifyJoiner_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
58
|
-
|
|
59
57
|
func (stringifyJoinerNamespace) Object(props StringifyJoiner_ObjectProps) *shimast.Node {
|
|
60
|
-
f := nativecontext.
|
|
58
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
61
59
|
if len(props.Entries) == 0 {
|
|
62
60
|
return f.NewStringLiteral("{}", shimast.TokenFlagsNone)
|
|
63
61
|
}
|
|
@@ -117,7 +115,7 @@ func (stringifyJoinerNamespace) Object(props StringifyJoiner_ObjectProps) *shima
|
|
|
117
115
|
// runtime whatever the element type declares, so this is not confined to `any`
|
|
118
116
|
// (#2253).
|
|
119
117
|
func (stringifyJoinerNamespace) Array(props StringifyJoiner_ArrayProps) *shimast.Node {
|
|
120
|
-
f := nativecontext.
|
|
118
|
+
f := nativecontext.NodeFactoryOf(props.Emit)
|
|
121
119
|
return nativefactories.TemplateFactory.Generate([]*shimast.Node{
|
|
122
120
|
f.NewStringLiteral("[", shimast.TokenFlagsNone),
|
|
123
121
|
f.NewCallExpression(
|
|
@@ -132,7 +130,7 @@ func (stringifyJoinerNamespace) Array(props StringifyJoiner_ArrayProps) *shimast
|
|
|
132
130
|
}
|
|
133
131
|
|
|
134
132
|
func (stringifyJoinerNamespace) Tuple(props StringifyJoiner_TupleProps) *shimast.Node {
|
|
135
|
-
f := nativecontext.
|
|
133
|
+
f := nativecontext.NodeFactoryOf(props.Emit)
|
|
136
134
|
if len(props.Elements) == 0 {
|
|
137
135
|
return f.NewStringLiteral("[]", shimast.TokenFlagsNone)
|
|
138
136
|
}
|
|
@@ -158,7 +156,7 @@ func (stringifyJoinerNamespace) Tuple(props StringifyJoiner_TupleProps) *shimast
|
|
|
158
156
|
}
|
|
159
157
|
|
|
160
158
|
func stringifyJoiner_regular_properties(context nativecontext.ITypiaContext, regular []IExpressionEntry, dynamic []IExpressionEntry, emit ...*shimprinter.EmitContext) []*shimast.Node {
|
|
161
|
-
f := nativecontext.
|
|
159
|
+
f := nativecontext.NodeFactoryOf(emit...)
|
|
162
160
|
output := []*shimast.Node{}
|
|
163
161
|
// Members keep their declaration order, which is what the guide promises and
|
|
164
162
|
// what `JSON.stringify` produces for a value assigned in that order. They used
|
|
@@ -269,7 +267,7 @@ func stringifyJoiner_result_undefinable(meta *nativemetadata.MetadataSchema) boo
|
|
|
269
267
|
}
|
|
270
268
|
|
|
271
269
|
func stringifyJoiner_regular_condition(entry IExpressionEntry, emit ...*shimprinter.EmitContext) *shimast.Node {
|
|
272
|
-
f := nativecontext.
|
|
270
|
+
f := nativecontext.NodeFactoryOf(emit...)
|
|
273
271
|
conditions := []*shimast.Node{}
|
|
274
272
|
if !entry.Meta.IsRequired() || entry.Meta.Any {
|
|
275
273
|
conditions = append(conditions, f.NewBinaryExpression(
|
|
@@ -293,7 +291,7 @@ func stringifyJoiner_regular_condition(entry IExpressionEntry, emit ...*shimprin
|
|
|
293
291
|
}
|
|
294
292
|
|
|
295
293
|
func stringifyJoiner_dynamic_properties(context nativecontext.ITypiaContext, dynamic []IExpressionEntry, regular []string, emit ...*shimprinter.EmitContext) *shimast.Node {
|
|
296
|
-
f := nativecontext.
|
|
294
|
+
f := nativecontext.NodeFactoryOf(emit...)
|
|
297
295
|
statements := []*shimast.Node{
|
|
298
296
|
f.NewIfStatement(
|
|
299
297
|
f.NewBinaryExpression(
|
|
@@ -310,7 +308,7 @@ func stringifyJoiner_dynamic_properties(context nativecontext.ITypiaContext, dyn
|
|
|
310
308
|
output := func() *shimast.Node {
|
|
311
309
|
mapped := f.NewCallExpression(
|
|
312
310
|
nativefactories.IdentifierFactory.Access(
|
|
313
|
-
|
|
311
|
+
context.Emit,
|
|
314
312
|
f.NewCallExpression(
|
|
315
313
|
f.NewIdentifier("Object.entries"),
|
|
316
314
|
nil,
|
|
@@ -338,7 +336,7 @@ func stringifyJoiner_dynamic_properties(context nativecontext.ITypiaContext, dyn
|
|
|
338
336
|
shimast.NodeFlagsNone,
|
|
339
337
|
)
|
|
340
338
|
filtered := f.NewCallExpression(
|
|
341
|
-
nativefactories.IdentifierFactory.Access(
|
|
339
|
+
nativefactories.IdentifierFactory.Access(context.Emit, mapped, "filter"),
|
|
342
340
|
nil,
|
|
343
341
|
nil,
|
|
344
342
|
f.NewNodeList([]*shimast.Node{
|
|
@@ -361,7 +359,7 @@ func stringifyJoiner_dynamic_properties(context nativecontext.ITypiaContext, dyn
|
|
|
361
359
|
shimast.NodeFlagsNone,
|
|
362
360
|
)
|
|
363
361
|
return f.NewCallExpression(
|
|
364
|
-
nativefactories.IdentifierFactory.Access(
|
|
362
|
+
nativefactories.IdentifierFactory.Access(context.Emit, filtered, "join"),
|
|
365
363
|
nil,
|
|
366
364
|
nil,
|
|
367
365
|
f.NewNodeList([]*shimast.Node{f.NewStringLiteral(",", shimast.TokenFlagsNone)}),
|
|
@@ -376,7 +374,7 @@ func stringifyJoiner_dynamic_properties(context nativecontext.ITypiaContext, dyn
|
|
|
376
374
|
statements = append(statements, f.NewIfStatement(
|
|
377
375
|
f.NewCallExpression(
|
|
378
376
|
nativefactories.IdentifierFactory.Access(
|
|
379
|
-
|
|
377
|
+
context.Emit,
|
|
380
378
|
f.NewArrayLiteralExpression(f.NewNodeList(elements), false),
|
|
381
379
|
"some",
|
|
382
380
|
),
|
|
@@ -415,7 +413,7 @@ func stringifyJoiner_dynamic_properties(context nativecontext.ITypiaContext, dyn
|
|
|
415
413
|
}
|
|
416
414
|
|
|
417
415
|
func stringifyJoiner_stringify(context nativecontext.ITypiaContext, entry IExpressionEntry, emit ...*shimprinter.EmitContext) *shimast.Node {
|
|
418
|
-
f := nativecontext.
|
|
416
|
+
f := nativecontext.NodeFactoryOf(emit...)
|
|
419
417
|
head := nativefactories.TemplateFactory.Generate([]*shimast.Node{
|
|
420
418
|
f.NewCallExpression(
|
|
421
419
|
f.NewIdentifier("JSON.stringify"),
|
|
@@ -451,7 +449,7 @@ func stringifyJoiner_stringify(context nativecontext.ITypiaContext, entry IExpre
|
|
|
451
449
|
}
|
|
452
450
|
|
|
453
451
|
func stringifyJoiner_regular_arrow(emit ...*shimprinter.EmitContext) *shimast.Node {
|
|
454
|
-
f := nativecontext.
|
|
452
|
+
f := nativecontext.NodeFactoryOf(emit...)
|
|
455
453
|
return f.NewArrowFunction(
|
|
456
454
|
nil,
|
|
457
455
|
nil,
|
|
@@ -470,7 +468,7 @@ func stringifyJoiner_regular_arrow(emit ...*shimprinter.EmitContext) *shimast.No
|
|
|
470
468
|
}
|
|
471
469
|
|
|
472
470
|
func stringifyJoiner_binding_pattern(emit ...*shimprinter.EmitContext) *shimast.Node {
|
|
473
|
-
f := nativecontext.
|
|
471
|
+
f := nativecontext.NodeFactoryOf(emit...)
|
|
474
472
|
return f.NewBindingPattern(
|
|
475
473
|
shimast.KindArrayBindingPattern,
|
|
476
474
|
f.NewNodeList([]*shimast.Node{
|
|
@@ -481,7 +479,7 @@ func stringifyJoiner_binding_pattern(emit ...*shimprinter.EmitContext) *shimast.
|
|
|
481
479
|
}
|
|
482
480
|
|
|
483
481
|
func stringifyJoiner_reduce(expressions []*shimast.Node, operator shimast.Kind, emit ...*shimprinter.EmitContext) *shimast.Node {
|
|
484
|
-
f := nativecontext.
|
|
482
|
+
f := nativecontext.NodeFactoryOf(emit...)
|
|
485
483
|
if len(expressions) == 0 {
|
|
486
484
|
return f.NewKeywordExpression(shimast.KindFalseKeyword)
|
|
487
485
|
}
|
|
@@ -496,7 +494,7 @@ func stringifyJoiner_internal(context nativecontext.ITypiaContext, name string)
|
|
|
496
494
|
if importer := context.Importer; importer != nil {
|
|
497
495
|
return importer.Internal(name)
|
|
498
496
|
}
|
|
499
|
-
return nativecontext.
|
|
497
|
+
return nativecontext.NodeFactoryOf(context.Emit).NewIdentifier(name)
|
|
500
498
|
}
|
|
501
499
|
|
|
502
500
|
func stringifyJoiner_all_string_literals(elements []*shimast.Expression) bool {
|
|
@@ -324,7 +324,7 @@ type UnionExplorer_MapProps struct {
|
|
|
324
324
|
}
|
|
325
325
|
|
|
326
326
|
func (unionExplorerNamespace) Object(props UnionExplorer_ObjectProps) *shimast.Node {
|
|
327
|
-
f := nativecontext.
|
|
327
|
+
f := nativecontext.NodeFactoryOf(props.Emit)
|
|
328
328
|
if len(props.Objects) == 1 {
|
|
329
329
|
return props.Config.Objector.Decoder(UnionExplorer_ObjectorDecoderProps{
|
|
330
330
|
Input: props.Input,
|
|
@@ -398,7 +398,7 @@ func (unionExplorerNamespace) Object(props UnionExplorer_ObjectProps) *shimast.N
|
|
|
398
398
|
for i := len(filtered) - 1; i >= 0; i-- {
|
|
399
399
|
spec := filtered[i]
|
|
400
400
|
key := *spec.Property.Key.GetSoleLiteral()
|
|
401
|
-
accessor := nativefactories.IdentifierFactory.Access(
|
|
401
|
+
accessor := nativefactories.IdentifierFactory.Access(props.Emit, props.Input, key)
|
|
402
402
|
|
|
403
403
|
var pred *shimast.Node
|
|
404
404
|
if spec.Neighbor {
|
|
@@ -408,7 +408,7 @@ func (unionExplorerNamespace) Object(props UnionExplorer_ObjectProps) *shimast.N
|
|
|
408
408
|
Explore: unionExplorer_with_postfix(props.Explore, false, nativefactories.IdentifierFactory.Postfix(key)),
|
|
409
409
|
})
|
|
410
410
|
} else {
|
|
411
|
-
pred = nativefactories.ExpressionFactory.IsRequired(accessor)
|
|
411
|
+
pred = nativefactories.ExpressionFactory.IsRequired(accessor, props.Emit)
|
|
412
412
|
if props.Config.Objector.Required != nil {
|
|
413
413
|
pred = props.Config.Objector.Required(pred)
|
|
414
414
|
}
|
|
@@ -495,7 +495,7 @@ func (unionExplorerNamespace) Tuple(props UnionExplorer_TupleProps) *shimast.Nod
|
|
|
495
495
|
}
|
|
496
496
|
|
|
497
497
|
func (unionExplorerNamespace) Array(props UnionExplorer_ArrayProps) *shimast.Node {
|
|
498
|
-
f := nativecontext.
|
|
498
|
+
f := nativecontext.NodeFactoryOf(props.Emit)
|
|
499
499
|
definitions := make([]any, 0, len(props.Arrays))
|
|
500
500
|
for _, array := range props.Arrays {
|
|
501
501
|
definitions = append(definitions, array)
|
|
@@ -508,7 +508,7 @@ func (unionExplorerNamespace) Array(props UnionExplorer_ArrayProps) *shimast.Nod
|
|
|
508
508
|
return x.(*nativemetadata.MetadataArray).Type.Value
|
|
509
509
|
},
|
|
510
510
|
Size: func(input *shimast.Expression) *shimast.Node {
|
|
511
|
-
return nativefactories.IdentifierFactory.Access(
|
|
511
|
+
return nativefactories.IdentifierFactory.Access(props.Emit, input, "length")
|
|
512
512
|
},
|
|
513
513
|
Front: func(input *shimast.Expression) *shimast.Node {
|
|
514
514
|
return f.NewElementAccessExpression(input, nil, nativefactories.ExpressionFactory.Number(0, props.Emit), shimast.NodeFlagsNone)
|
|
@@ -527,7 +527,7 @@ func (unionExplorerNamespace) Array(props UnionExplorer_ArrayProps) *shimast.Nod
|
|
|
527
527
|
}
|
|
528
528
|
|
|
529
529
|
func (unionExplorerNamespace) Array_or_tuple(props UnionExplorer_ArrayOrTupleProps) *shimast.Node {
|
|
530
|
-
f := nativecontext.
|
|
530
|
+
f := nativecontext.NodeFactoryOf(props.Emit)
|
|
531
531
|
return unionExplorer_check_union_array_like(unionExplorer_check_union_array_likeProps{
|
|
532
532
|
Config: props.Config,
|
|
533
533
|
Accessor: unionExplorer_check_union_array_likeAccessor{
|
|
@@ -539,7 +539,7 @@ func (unionExplorerNamespace) Array_or_tuple(props UnionExplorer_ArrayOrTuplePro
|
|
|
539
539
|
return x
|
|
540
540
|
},
|
|
541
541
|
Size: func(input *shimast.Expression) *shimast.Node {
|
|
542
|
-
return nativefactories.IdentifierFactory.Access(
|
|
542
|
+
return nativefactories.IdentifierFactory.Access(props.Emit, input, "length")
|
|
543
543
|
},
|
|
544
544
|
Front: func(input *shimast.Expression) *shimast.Node {
|
|
545
545
|
return f.NewElementAccessExpression(input, nil, nativefactories.ExpressionFactory.Number(0, props.Emit), shimast.NodeFlagsNone)
|
|
@@ -565,7 +565,7 @@ func (unionExplorerNamespace) Array_or_tuple(props UnionExplorer_ArrayOrTuplePro
|
|
|
565
565
|
}
|
|
566
566
|
|
|
567
567
|
func (unionExplorerNamespace) Set(props UnionExplorer_SetProps) *shimast.Node {
|
|
568
|
-
f := nativecontext.
|
|
568
|
+
f := nativecontext.NodeFactoryOf(props.Emit)
|
|
569
569
|
definitions := make([]any, 0, len(props.Sets))
|
|
570
570
|
for _, set := range props.Sets {
|
|
571
571
|
definitions = append(definitions, set.Value)
|
|
@@ -591,24 +591,24 @@ func (unionExplorerNamespace) Set(props UnionExplorer_SetProps) *shimast.Node {
|
|
|
591
591
|
return array.(*nativemetadata.MetadataArray).Type.Value
|
|
592
592
|
},
|
|
593
593
|
Size: func(input *shimast.Expression) *shimast.Node {
|
|
594
|
-
return nativefactories.IdentifierFactory.Access(
|
|
594
|
+
return nativefactories.IdentifierFactory.Access(props.Emit, input, "size")
|
|
595
595
|
},
|
|
596
596
|
Front: func(input *shimast.Expression) *shimast.Node {
|
|
597
597
|
values := f.NewCallExpression(
|
|
598
|
-
nativefactories.IdentifierFactory.Access(
|
|
598
|
+
nativefactories.IdentifierFactory.Access(props.Emit, input, "values"),
|
|
599
599
|
nil,
|
|
600
600
|
nil,
|
|
601
601
|
nil,
|
|
602
602
|
shimast.NodeFlagsNone,
|
|
603
603
|
)
|
|
604
604
|
next := f.NewCallExpression(
|
|
605
|
-
nativefactories.IdentifierFactory.Access(
|
|
605
|
+
nativefactories.IdentifierFactory.Access(props.Emit, values, "next"),
|
|
606
606
|
nil,
|
|
607
607
|
nil,
|
|
608
608
|
nil,
|
|
609
609
|
shimast.NodeFlagsNone,
|
|
610
610
|
)
|
|
611
|
-
return nativefactories.IdentifierFactory.Access(
|
|
611
|
+
return nativefactories.IdentifierFactory.Access(props.Emit, next, "value")
|
|
612
612
|
},
|
|
613
613
|
Array: func(input *shimast.Expression) *shimast.Node {
|
|
614
614
|
return f.NewArrayLiteralExpression(
|
|
@@ -631,7 +631,7 @@ func (unionExplorerNamespace) Set(props UnionExplorer_SetProps) *shimast.Node {
|
|
|
631
631
|
}
|
|
632
632
|
|
|
633
633
|
func (unionExplorerNamespace) Map(props UnionExplorer_MapProps) *shimast.Node {
|
|
634
|
-
f := nativecontext.
|
|
634
|
+
f := nativecontext.NodeFactoryOf(props.Emit)
|
|
635
635
|
definitions := make([]any, 0, len(props.Maps))
|
|
636
636
|
for _, m := range props.Maps {
|
|
637
637
|
definitions = append(definitions, m)
|
|
@@ -644,24 +644,24 @@ func (unionExplorerNamespace) Map(props UnionExplorer_MapProps) *shimast.Node {
|
|
|
644
644
|
return []*nativemetadata.MetadataSchema{elements[0], elements[1]}
|
|
645
645
|
},
|
|
646
646
|
Size: func(input *shimast.Expression) *shimast.Node {
|
|
647
|
-
return nativefactories.IdentifierFactory.Access(
|
|
647
|
+
return nativefactories.IdentifierFactory.Access(props.Emit, input, "size")
|
|
648
648
|
},
|
|
649
649
|
Front: func(input *shimast.Expression) *shimast.Node {
|
|
650
650
|
entries := f.NewCallExpression(
|
|
651
|
-
nativefactories.IdentifierFactory.Access(
|
|
651
|
+
nativefactories.IdentifierFactory.Access(props.Emit, input, "entries"),
|
|
652
652
|
nil,
|
|
653
653
|
nil,
|
|
654
654
|
nil,
|
|
655
655
|
shimast.NodeFlagsNone,
|
|
656
656
|
)
|
|
657
657
|
next := f.NewCallExpression(
|
|
658
|
-
nativefactories.IdentifierFactory.Access(
|
|
658
|
+
nativefactories.IdentifierFactory.Access(props.Emit, entries, "next"),
|
|
659
659
|
nil,
|
|
660
660
|
nil,
|
|
661
661
|
nil,
|
|
662
662
|
shimast.NodeFlagsNone,
|
|
663
663
|
)
|
|
664
|
-
return nativefactories.IdentifierFactory.Access(
|
|
664
|
+
return nativefactories.IdentifierFactory.Access(props.Emit, next, "value")
|
|
665
665
|
},
|
|
666
666
|
Array: func(input *shimast.Expression) *shimast.Node {
|
|
667
667
|
return f.NewArrayLiteralExpression(
|
|
@@ -749,7 +749,7 @@ type unionExplorer_check_union_array_likeAccessor struct {
|
|
|
749
749
|
}
|
|
750
750
|
|
|
751
751
|
func unionExplorer_check_union_array_like(props unionExplorer_check_union_array_likeProps) *shimast.Node {
|
|
752
|
-
f := nativecontext.
|
|
752
|
+
f := nativecontext.NodeFactoryOf(props.Emit)
|
|
753
753
|
transform := props.Accessor.Transform
|
|
754
754
|
if transform == nil {
|
|
755
755
|
transform = func(origin any) any { return origin }
|
|
@@ -970,7 +970,7 @@ func unionExplorer_check_union_array_like(props unionExplorer_check_union_array_
|
|
|
970
970
|
nativefactories.StatementFactory.Constant(nativefactories.StatementFactory_ConstantProps{
|
|
971
971
|
Name: "passed",
|
|
972
972
|
Value: f.NewCallExpression(
|
|
973
|
-
nativefactories.IdentifierFactory.Access(
|
|
973
|
+
nativefactories.IdentifierFactory.Access(props.Emit, f.NewIdentifier("arrayPredicators"), "filter"),
|
|
974
974
|
nil,
|
|
975
975
|
nil,
|
|
976
976
|
f.NewNodeList([]*shimast.Node{
|
|
@@ -1041,10 +1041,10 @@ func unionExplorer_check_union_array_like(props unionExplorer_check_union_array_
|
|
|
1041
1041
|
}
|
|
1042
1042
|
|
|
1043
1043
|
func unionExplorer_array_if(iterate func(init string, from *shimast.Expression, ifStatement *shimast.Node) *shimast.Node, array *shimast.Node, top *shimast.Node, success *shimast.Expression, candidate bool, emit ...*shimprinter.EmitContext) *shimast.Node {
|
|
1044
|
-
f := nativecontext.
|
|
1044
|
+
f := nativecontext.NodeFactoryOf(emit...)
|
|
1045
1045
|
if candidate {
|
|
1046
1046
|
elementCondition := f.NewCallExpression(
|
|
1047
|
-
|
|
1047
|
+
f.NewPropertyAccessExpression(array, nil, f.NewIdentifier("every"), shimast.NodeFlagsNone),
|
|
1048
1048
|
nil,
|
|
1049
1049
|
nil,
|
|
1050
1050
|
f.NewNodeList([]*shimast.Node{
|
|
@@ -1147,7 +1147,7 @@ func unionExplorer_array_if(iterate func(init string, from *shimast.Expression,
|
|
|
1147
1147
|
f.NewIdentifier("passed"),
|
|
1148
1148
|
f.NewIfStatement(
|
|
1149
1149
|
f.NewCallExpression(
|
|
1150
|
-
|
|
1150
|
+
f.NewPropertyAccessExpression(array, nil, f.NewIdentifier("every"), shimast.NodeFlagsNone),
|
|
1151
1151
|
nil,
|
|
1152
1152
|
nil,
|
|
1153
1153
|
f.NewNodeList([]*shimast.Node{
|
|
@@ -1202,7 +1202,7 @@ func unionExplorer_array_candidate_condition(element *shimast.Node, candidate bo
|
|
|
1202
1202
|
if candidate == false {
|
|
1203
1203
|
return element
|
|
1204
1204
|
}
|
|
1205
|
-
f := nativecontext.
|
|
1205
|
+
f := nativecontext.NodeFactoryOf(emit...)
|
|
1206
1206
|
return f.NewBinaryExpression(
|
|
1207
1207
|
nil,
|
|
1208
1208
|
f.NewCallExpression(
|
|
@@ -1219,7 +1219,7 @@ func unionExplorer_array_candidate_condition(element *shimast.Node, candidate bo
|
|
|
1219
1219
|
}
|
|
1220
1220
|
|
|
1221
1221
|
func unionExplorer_return_or_statement(node *shimast.Node, emit ...*shimprinter.EmitContext) *shimast.Node {
|
|
1222
|
-
f := nativecontext.
|
|
1222
|
+
f := nativecontext.NodeFactoryOf(emit...)
|
|
1223
1223
|
if node == nil || node.Kind == shimast.KindReturnStatement {
|
|
1224
1224
|
return node
|
|
1225
1225
|
}
|
|
@@ -1236,5 +1236,3 @@ func unionExplorer_with_postfix(base UnionExplorer_IExplore, tracable bool, post
|
|
|
1236
1236
|
base.Postfix = postfix
|
|
1237
1237
|
return base
|
|
1238
1238
|
}
|
|
1239
|
-
|
|
1240
|
-
var unionExplorer_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
@@ -31,8 +31,6 @@ type HttpAssertFormDataProgrammer_DecomposeProps struct {
|
|
|
31
31
|
Init *shimast.Node
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
var httpAssertProgrammer_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
35
|
-
|
|
36
34
|
func (httpAssertFormDataProgrammerNamespace) Decompose(props HttpAssertFormDataProgrammer_DecomposeProps) nativeinternal.FeatureProgrammer_IDecomposed {
|
|
37
35
|
assert := nativeprogrammers.AssertProgrammer.Decompose(nativeprogrammers.AssertProgrammer_DecomposeProps{
|
|
38
36
|
Context: httpProgrammer_context(props.Context, false, true),
|
|
@@ -63,7 +61,7 @@ func (httpAssertFormDataProgrammerNamespace) Write(props nativecontext.IProgramm
|
|
|
63
61
|
Name: props.Name,
|
|
64
62
|
Init: props.Init,
|
|
65
63
|
})
|
|
66
|
-
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{
|
|
64
|
+
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{Emit: props.Context.Emit,
|
|
67
65
|
Modulo: props.Modulo,
|
|
68
66
|
Functor: functor,
|
|
69
67
|
Result: result,
|
|
@@ -71,7 +69,7 @@ func (httpAssertFormDataProgrammerNamespace) Write(props nativecontext.IProgramm
|
|
|
71
69
|
}
|
|
72
70
|
|
|
73
71
|
func httpProgrammer_assert_result(context nativecontext.ITypiaContext, init *shimast.Node, assert nativeinternal.FeatureProgrammer_IDecomposed, decode nativeinternal.FeatureProgrammer_IDecomposed) nativeinternal.FeatureProgrammer_IDecomposed {
|
|
74
|
-
f := nativecontext.
|
|
72
|
+
f := nativecontext.NodeFactoryOf(context.Emit)
|
|
75
73
|
decodeArrow := decode.Arrow.AsArrowFunction()
|
|
76
74
|
statements := append([]*shimast.Node{}, assert.Statements...)
|
|
77
75
|
statements = append(statements, decode.Statements...)
|
|
@@ -60,7 +60,7 @@ func (httpAssertHeadersProgrammerNamespace) Write(props nativecontext.IProgramme
|
|
|
60
60
|
Name: props.Name,
|
|
61
61
|
Init: props.Init,
|
|
62
62
|
})
|
|
63
|
-
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{
|
|
63
|
+
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{Emit: props.Context.Emit,
|
|
64
64
|
Modulo: props.Modulo,
|
|
65
65
|
Functor: functor,
|
|
66
66
|
Result: result,
|
|
@@ -83,7 +83,7 @@ func (httpAssertQueryProgrammerNamespace) Write(props HttpAssertQueryProgrammer_
|
|
|
83
83
|
Init: props.Init,
|
|
84
84
|
AllowOptional: props.AllowOptional,
|
|
85
85
|
})
|
|
86
|
-
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{
|
|
86
|
+
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{Emit: props.Context.Emit,
|
|
87
87
|
Modulo: props.Modulo,
|
|
88
88
|
Functor: functor,
|
|
89
89
|
Result: result,
|
|
@@ -31,10 +31,8 @@ type HttpFormDataProgrammer_DecomposeProps struct {
|
|
|
31
31
|
Name *string
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
var httpFormDataProgrammer_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
35
|
-
|
|
36
34
|
func (httpFormDataProgrammerNamespace) Decompose(props HttpFormDataProgrammer_DecomposeProps) nativeinternal.FeatureProgrammer_IDecomposed {
|
|
37
|
-
f := nativecontext.
|
|
35
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
38
36
|
collection := schemametadata.NewMetadataCollection()
|
|
39
37
|
result := nativefactories.MetadataFactory.Analyze(nativefactories.MetadataFactory_IProps{
|
|
40
38
|
Checker: props.Context.Checker,
|
|
@@ -101,7 +99,7 @@ func (httpFormDataProgrammerNamespace) Write(props nativecontext.IProgrammerProp
|
|
|
101
99
|
Type: props.Type,
|
|
102
100
|
Name: props.Name,
|
|
103
101
|
})
|
|
104
|
-
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{
|
|
102
|
+
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{Emit: props.Context.Emit,
|
|
105
103
|
Modulo: props.Modulo,
|
|
106
104
|
Functor: functor,
|
|
107
105
|
Result: result,
|
|
@@ -175,7 +173,7 @@ func httpFormDataProgrammer_decode_object(props struct {
|
|
|
175
173
|
Context nativecontext.ITypiaContext
|
|
176
174
|
Object *schemametadata.MetadataObjectType
|
|
177
175
|
}) []*shimast.Node {
|
|
178
|
-
f := nativecontext.
|
|
176
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
179
177
|
output := f.NewIdentifier("output")
|
|
180
178
|
properties := make([]*shimast.Node, 0, len(props.Object.Properties))
|
|
181
179
|
for _, p := range props.Object.Properties {
|
|
@@ -205,7 +203,7 @@ func httpFormDataProgrammer_decode_regular_property(props struct {
|
|
|
205
203
|
Context nativecontext.ITypiaContext
|
|
206
204
|
Property *schemametadata.MetadataProperty
|
|
207
205
|
}) *shimast.Node {
|
|
208
|
-
f := nativecontext.
|
|
206
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
209
207
|
key := httpProgrammer_property_key(props.Property)
|
|
210
208
|
value := props.Property.Value
|
|
211
209
|
typ, isArray := httpProgrammer_decode_type(value, true)
|
|
@@ -302,7 +300,7 @@ func httpFormDataProgrammer_decode_value(props struct {
|
|
|
302
300
|
Coalesce bool
|
|
303
301
|
Input *shimast.Node
|
|
304
302
|
}) *shimast.Node {
|
|
305
|
-
f := nativecontext.
|
|
303
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
306
304
|
call := f.NewCallExpression(
|
|
307
305
|
httpParameterProgrammer_internal(props.Context, "httpFormDataRead"+httpParameterProgrammer_capitalize(props.Type)),
|
|
308
306
|
nil,
|
|
@@ -327,7 +325,7 @@ func httpFormDataProgrammer_decode_array(props struct {
|
|
|
327
325
|
Metadata *schemametadata.MetadataSchema
|
|
328
326
|
Input *shimast.Node
|
|
329
327
|
}) *shimast.Node {
|
|
330
|
-
f := nativecontext.
|
|
328
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
331
329
|
if props.Metadata.Nullable == false && props.Metadata.IsRequired() == true {
|
|
332
330
|
return props.Input
|
|
333
331
|
}
|
|
@@ -355,7 +353,7 @@ func httpProgrammer_import_type(context nativecontext.ITypiaContext, props nativ
|
|
|
355
353
|
if importer := context.Importer; importer != nil {
|
|
356
354
|
return importer.Type(props)
|
|
357
355
|
}
|
|
358
|
-
f := nativecontext.
|
|
356
|
+
f := nativecontext.NodeFactoryOf(context.Emit)
|
|
359
357
|
if str, ok := props.Name.(string); ok {
|
|
360
358
|
return f.NewTypeReferenceNode(
|
|
361
359
|
f.NewIdentifier(str),
|
|
@@ -366,7 +364,7 @@ func httpProgrammer_import_type(context nativecontext.ITypiaContext, props nativ
|
|
|
366
364
|
}
|
|
367
365
|
|
|
368
366
|
func httpProgrammer_typeReference(context nativecontext.ITypiaContext, typ *shimchecker.Type, name *string) *shimast.Node {
|
|
369
|
-
f := nativecontext.
|
|
367
|
+
f := nativecontext.NodeFactoryOf(context.Emit)
|
|
370
368
|
if name != nil {
|
|
371
369
|
return f.NewTypeReferenceNode(f.NewIdentifier(*name), nil)
|
|
372
370
|
}
|
|
@@ -415,7 +413,7 @@ func httpProgrammer_read_arguments(typ string, nullable bool, input *shimast.Nod
|
|
|
415
413
|
if typ != "string" || nullable {
|
|
416
414
|
return []*shimast.Node{input}
|
|
417
415
|
}
|
|
418
|
-
f := nativecontext.
|
|
416
|
+
f := nativecontext.NodeFactoryOf(emit...)
|
|
419
417
|
return []*shimast.Node{input, f.NewKeywordExpression(shimast.KindFalseKeyword)}
|
|
420
418
|
}
|
|
421
419
|
|
|
@@ -34,10 +34,8 @@ type HttpHeadersProgrammer_DecomposeProps struct {
|
|
|
34
34
|
Name *string
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
var httpHeadersProgrammer_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
38
|
-
|
|
39
37
|
func (httpHeadersProgrammerNamespace) Decompose(props HttpHeadersProgrammer_DecomposeProps) nativeinternal.FeatureProgrammer_IDecomposed {
|
|
40
|
-
f := nativecontext.
|
|
38
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
41
39
|
collection := schemametadata.NewMetadataCollection()
|
|
42
40
|
result := nativefactories.MetadataFactory.Analyze(nativefactories.MetadataFactory_IProps{
|
|
43
41
|
Checker: props.Context.Checker,
|
|
@@ -104,7 +102,7 @@ func (httpHeadersProgrammerNamespace) Write(props nativecontext.IProgrammerProps
|
|
|
104
102
|
Type: props.Type,
|
|
105
103
|
Name: props.Name,
|
|
106
104
|
})
|
|
107
|
-
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{
|
|
105
|
+
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{Emit: props.Context.Emit,
|
|
108
106
|
Modulo: props.Modulo,
|
|
109
107
|
Functor: functor,
|
|
110
108
|
Result: result,
|
|
@@ -217,7 +215,7 @@ func httpHeadersProgrammer_decode_object(props struct {
|
|
|
217
215
|
Context nativecontext.ITypiaContext
|
|
218
216
|
Object *schemametadata.MetadataObjectType
|
|
219
217
|
}) []*shimast.Node {
|
|
220
|
-
f := nativecontext.
|
|
218
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
221
219
|
output := f.NewIdentifier("output")
|
|
222
220
|
optionals := []string{}
|
|
223
221
|
properties := make([]*shimast.Node, 0, len(props.Object.Properties))
|
|
@@ -274,7 +272,7 @@ func httpHeadersProgrammer_decode_regular_property(props struct {
|
|
|
274
272
|
Context nativecontext.ITypiaContext
|
|
275
273
|
Property *schemametadata.MetadataProperty
|
|
276
274
|
}) *shimast.Node {
|
|
277
|
-
f := nativecontext.
|
|
275
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
278
276
|
key := httpProgrammer_property_key(props.Property)
|
|
279
277
|
value := props.Property.Value
|
|
280
278
|
typ, isArray := httpProgrammer_decode_type(value, false)
|
|
@@ -331,7 +329,7 @@ func httpHeadersProgrammer_decode_regular_property(props struct {
|
|
|
331
329
|
// (samchon/typia#2447), and a non-string element type is read by the same
|
|
332
330
|
// reader other array headers use.
|
|
333
331
|
func httpHeadersProgrammer_decode_set_cookie(context nativecontext.ITypiaContext, typ string, input *shimast.Node, required bool) *shimast.Node {
|
|
334
|
-
f := nativecontext.
|
|
332
|
+
f := nativecontext.NodeFactoryOf(context.Emit)
|
|
335
333
|
array := input
|
|
336
334
|
single := input
|
|
337
335
|
if typ != "string" {
|
|
@@ -376,7 +374,7 @@ func httpHeadersProgrammer_decode_value(props struct {
|
|
|
376
374
|
if props.Type == "string" {
|
|
377
375
|
return props.Input
|
|
378
376
|
}
|
|
379
|
-
f := nativecontext.
|
|
377
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
380
378
|
return f.NewCallExpression(
|
|
381
379
|
httpParameterProgrammer_internal(props.Context, "httpHeaderRead"+httpParameterProgrammer_capitalize(props.Type)),
|
|
382
380
|
nil,
|
|
@@ -397,7 +395,7 @@ func httpHeadersProgrammer_decode_array(props struct {
|
|
|
397
395
|
// requested for non-string types; string[] headers map inline (str => str.trim())
|
|
398
396
|
// and must not pull in a non-existent _httpHeaderReadString helper. Mirrors the
|
|
399
397
|
// scalar path (decode_value), which short-circuits string before building a reader.
|
|
400
|
-
f := nativecontext.
|
|
398
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
401
399
|
var reader *shimast.Node
|
|
402
400
|
if props.Type == "string" {
|
|
403
401
|
reader = f.NewArrowFunction(
|
|
@@ -30,8 +30,6 @@ type HttpIsFormDataProgrammer_DecomposeProps struct {
|
|
|
30
30
|
Name *string
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
var httpIsProgrammer_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
34
|
-
|
|
35
33
|
func (httpIsFormDataProgrammerNamespace) Decompose(props HttpIsFormDataProgrammer_DecomposeProps) nativeinternal.FeatureProgrammer_IDecomposed {
|
|
36
34
|
is := nativeprogrammers.IsProgrammer.Decompose(nativeprogrammers.IsProgrammer_DecomposeProps{
|
|
37
35
|
Context: httpProgrammer_context(props.Context, false, false),
|
|
@@ -57,7 +55,7 @@ func (httpIsFormDataProgrammerNamespace) Write(props nativecontext.IProgrammerPr
|
|
|
57
55
|
Type: props.Type,
|
|
58
56
|
Name: props.Name,
|
|
59
57
|
})
|
|
60
|
-
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{
|
|
58
|
+
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{Emit: props.Context.Emit,
|
|
61
59
|
Modulo: props.Modulo,
|
|
62
60
|
Functor: functor,
|
|
63
61
|
Result: result,
|
|
@@ -65,7 +63,7 @@ func (httpIsFormDataProgrammerNamespace) Write(props nativecontext.IProgrammerPr
|
|
|
65
63
|
}
|
|
66
64
|
|
|
67
65
|
func httpProgrammer_is_result(is nativeinternal.FeatureProgrammer_IDecomposed, decode nativeinternal.FeatureProgrammer_IDecomposed, emit ...*shimprinter.EmitContext) nativeinternal.FeatureProgrammer_IDecomposed {
|
|
68
|
-
f := nativecontext.
|
|
66
|
+
f := nativecontext.NodeFactoryOf(emit...)
|
|
69
67
|
decodeArrow := decode.Arrow.AsArrowFunction()
|
|
70
68
|
output := decodeArrow.Type
|
|
71
69
|
if output == nil {
|
|
@@ -53,7 +53,7 @@ func (httpIsHeadersProgrammerNamespace) Write(props nativecontext.IProgrammerPro
|
|
|
53
53
|
Type: props.Type,
|
|
54
54
|
Name: props.Name,
|
|
55
55
|
})
|
|
56
|
-
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{
|
|
56
|
+
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{Emit: props.Context.Emit,
|
|
57
57
|
Modulo: props.Modulo,
|
|
58
58
|
Functor: functor,
|
|
59
59
|
Result: result,
|
|
@@ -75,7 +75,7 @@ func (httpIsQueryProgrammerNamespace) Write(props HttpIsQueryProgrammer_IProps)
|
|
|
75
75
|
Name: props.Name,
|
|
76
76
|
AllowOptional: props.AllowOptional,
|
|
77
77
|
})
|
|
78
|
-
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{
|
|
78
|
+
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{Emit: props.Context.Emit,
|
|
79
79
|
Modulo: props.Modulo,
|
|
80
80
|
Functor: functor,
|
|
81
81
|
Result: result,
|
|
@@ -18,10 +18,8 @@ type httpParameterProgrammerNamespace struct{}
|
|
|
18
18
|
|
|
19
19
|
var HttpParameterProgrammer = httpParameterProgrammerNamespace{}
|
|
20
20
|
|
|
21
|
-
var httpParameterProgrammer_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
22
|
-
|
|
23
21
|
func (httpParameterProgrammerNamespace) Write(props nativecontext.IProgrammerProps) *shimast.Node {
|
|
24
|
-
f := nativecontext.
|
|
22
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
25
23
|
result := nativefactories.MetadataFactory.Analyze(nativefactories.MetadataFactory_IProps{
|
|
26
24
|
Checker: props.Context.Checker,
|
|
27
25
|
Options: nativefactories.MetadataFactory_IOptions{
|
|
@@ -154,7 +152,7 @@ func httpParameterProgrammer_internal(context nativecontext.ITypiaContext, name
|
|
|
154
152
|
if importer := context.Importer; importer != nil {
|
|
155
153
|
return importer.Internal(name)
|
|
156
154
|
}
|
|
157
|
-
return nativecontext.
|
|
155
|
+
return nativecontext.NodeFactoryOf(context.Emit).NewIdentifier(name)
|
|
158
156
|
}
|
|
159
157
|
|
|
160
158
|
func httpParameterProgrammer_capitalize(str string) string {
|