Skip to content

Commit af40250

Browse files
authored
feat(xml-builder): use DOMParser for browser XML parsing (#7347)
* feat(xml-builder): use DOMParser for browser XML parsing * test(xml-builder): move tests to browser group * test: verify DOMParser in Node.js * fix: update empty aggregate shape string check with trim * feat(xml-builder): restore fast-xml-parser in Node.js
1 parent 6cdb1ae commit af40250

File tree

39 files changed

+2244
-1970
lines changed

39 files changed

+2244
-1970
lines changed

clients/client-auto-scaling/src/protocols/Aws_query.ts

Lines changed: 67 additions & 67 deletions
Large diffs are not rendered by default.

clients/client-cloudformation/src/protocols/Aws_query.ts

Lines changed: 83 additions & 83 deletions
Large diffs are not rendered by default.

clients/client-cloudfront/src/protocols/Aws_restXml.ts

Lines changed: 75 additions & 75 deletions
Large diffs are not rendered by default.

clients/client-cloudsearch/src/protocols/Aws_query.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2369,7 +2369,7 @@ const de_BaseException = (output: any, context: __SerdeContext): BaseException =
23692369
*/
23702370
const de_BuildSuggestersResponse = (output: any, context: __SerdeContext): BuildSuggestersResponse => {
23712371
const contents: any = {};
2372-
if (output.FieldNames === "") {
2372+
if (String(output.FieldNames).trim() === "") {
23732373
contents[_FN] = [];
23742374
} else if (output[_FN] != null && output[_FN][_m] != null) {
23752375
contents[_FN] = de_FieldNameList(__getArrayIfSingleItem(output[_FN][_m]), context);
@@ -2541,7 +2541,7 @@ const de_DeleteSuggesterResponse = (output: any, context: __SerdeContext): Delet
25412541
*/
25422542
const de_DescribeAnalysisSchemesResponse = (output: any, context: __SerdeContext): DescribeAnalysisSchemesResponse => {
25432543
const contents: any = {};
2544-
if (output.AnalysisSchemes === "") {
2544+
if (String(output.AnalysisSchemes).trim() === "") {
25452545
contents[_ASna] = [];
25462546
} else if (output[_ASna] != null && output[_ASna][_m] != null) {
25472547
contents[_ASna] = de_AnalysisSchemeStatusList(__getArrayIfSingleItem(output[_ASna][_m]), context);
@@ -2582,7 +2582,7 @@ const de_DescribeDomainEndpointOptionsResponse = (
25822582
*/
25832583
const de_DescribeDomainsResponse = (output: any, context: __SerdeContext): DescribeDomainsResponse => {
25842584
const contents: any = {};
2585-
if (output.DomainStatusList === "") {
2585+
if (String(output.DomainStatusList).trim() === "") {
25862586
contents[_DSL] = [];
25872587
} else if (output[_DSL] != null && output[_DSL][_m] != null) {
25882588
contents[_DSL] = de_DomainStatusList(__getArrayIfSingleItem(output[_DSL][_m]), context);
@@ -2595,7 +2595,7 @@ const de_DescribeDomainsResponse = (output: any, context: __SerdeContext): Descr
25952595
*/
25962596
const de_DescribeExpressionsResponse = (output: any, context: __SerdeContext): DescribeExpressionsResponse => {
25972597
const contents: any = {};
2598-
if (output.Expressions === "") {
2598+
if (String(output.Expressions).trim() === "") {
25992599
contents[_Ex] = [];
26002600
} else if (output[_Ex] != null && output[_Ex][_m] != null) {
26012601
contents[_Ex] = de_ExpressionStatusList(__getArrayIfSingleItem(output[_Ex][_m]), context);
@@ -2608,7 +2608,7 @@ const de_DescribeExpressionsResponse = (output: any, context: __SerdeContext): D
26082608
*/
26092609
const de_DescribeIndexFieldsResponse = (output: any, context: __SerdeContext): DescribeIndexFieldsResponse => {
26102610
const contents: any = {};
2611-
if (output.IndexFields === "") {
2611+
if (String(output.IndexFields).trim() === "") {
26122612
contents[_IFn] = [];
26132613
} else if (output[_IFn] != null && output[_IFn][_m] != null) {
26142614
contents[_IFn] = de_IndexFieldStatusList(__getArrayIfSingleItem(output[_IFn][_m]), context);
@@ -2649,7 +2649,7 @@ const de_DescribeServiceAccessPoliciesResponse = (
26492649
*/
26502650
const de_DescribeSuggestersResponse = (output: any, context: __SerdeContext): DescribeSuggestersResponse => {
26512651
const contents: any = {};
2652-
if (output.Suggesters === "") {
2652+
if (String(output.Suggesters).trim() === "") {
26532653
contents[_Sug] = [];
26542654
} else if (output[_Sug] != null && output[_Sug][_m] != null) {
26552655
contents[_Sug] = de_SuggesterStatusList(__getArrayIfSingleItem(output[_Sug][_m]), context);
@@ -2891,7 +2891,7 @@ const de_FieldNameList = (output: any, context: __SerdeContext): string[] => {
28912891
*/
28922892
const de_IndexDocumentsResponse = (output: any, context: __SerdeContext): IndexDocumentsResponse => {
28932893
const contents: any = {};
2894-
if (output.FieldNames === "") {
2894+
if (String(output.FieldNames).trim() === "") {
28952895
contents[_FN] = [];
28962896
} else if (output[_FN] != null && output[_FN][_m] != null) {
28972897
contents[_FN] = de_FieldNameList(__getArrayIfSingleItem(output[_FN][_m]), context);
@@ -3107,7 +3107,7 @@ const de_Limits = (output: any, context: __SerdeContext): Limits => {
31073107
*/
31083108
const de_ListDomainNamesResponse = (output: any, context: __SerdeContext): ListDomainNamesResponse => {
31093109
const contents: any = {};
3110-
if (output.DomainNames === "") {
3110+
if (String(output.DomainNames).trim() === "") {
31113111
contents[_DNo] = {};
31123112
} else if (output[_DNo] != null && output[_DNo][_e] != null) {
31133113
contents[_DNo] = de_DomainNameMap(__getArrayIfSingleItem(output[_DNo][_e]), context);

clients/client-cloudwatch/src/protocols/Aws_query.ts

Lines changed: 52 additions & 52 deletions
Large diffs are not rendered by default.

clients/client-docdb/src/protocols/Aws_query.ts

Lines changed: 42 additions & 42 deletions
Large diffs are not rendered by default.

clients/client-ec2/src/protocols/Aws_ec2.ts

Lines changed: 708 additions & 708 deletions
Large diffs are not rendered by default.

clients/client-elastic-beanstalk/src/protocols/Aws_query.ts

Lines changed: 41 additions & 41 deletions
Large diffs are not rendered by default.

clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts

Lines changed: 58 additions & 58 deletions
Large diffs are not rendered by default.

clients/client-elastic-load-balancing/src/protocols/Aws_query.ts

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2892,7 +2892,7 @@ const de_AccessPointNotFoundException = (output: any, context: __SerdeContext):
28922892
*/
28932893
const de_AddAvailabilityZonesOutput = (output: any, context: __SerdeContext): AddAvailabilityZonesOutput => {
28942894
const contents: any = {};
2895-
if (output.AvailabilityZones === "") {
2895+
if (String(output.AvailabilityZones).trim() === "") {
28962896
contents[_AZ] = [];
28972897
} else if (output[_AZ] != null && output[_AZ][_m] != null) {
28982898
contents[_AZ] = de_AvailabilityZones(__getArrayIfSingleItem(output[_AZ][_m]), context);
@@ -2966,7 +2966,7 @@ const de_ApplySecurityGroupsToLoadBalancerOutput = (
29662966
context: __SerdeContext
29672967
): ApplySecurityGroupsToLoadBalancerOutput => {
29682968
const contents: any = {};
2969-
if (output.SecurityGroups === "") {
2969+
if (String(output.SecurityGroups).trim() === "") {
29702970
contents[_SG] = [];
29712971
} else if (output[_SG] != null && output[_SG][_m] != null) {
29722972
contents[_SG] = de_SecurityGroups(__getArrayIfSingleItem(output[_SG][_m]), context);
@@ -2982,7 +2982,7 @@ const de_AttachLoadBalancerToSubnetsOutput = (
29822982
context: __SerdeContext
29832983
): AttachLoadBalancerToSubnetsOutput => {
29842984
const contents: any = {};
2985-
if (output.Subnets === "") {
2985+
if (String(output.Subnets).trim() === "") {
29862986
contents[_S] = [];
29872987
} else if (output[_S] != null && output[_S][_m] != null) {
29882988
contents[_S] = de_Subnets(__getArrayIfSingleItem(output[_S][_m]), context);
@@ -3009,7 +3009,7 @@ const de_BackendServerDescription = (output: any, context: __SerdeContext): Back
30093009
if (output[_IPn] != null) {
30103010
contents[_IPn] = __strictParseInt32(output[_IPn]) as number;
30113011
}
3012-
if (output.PolicyNames === "") {
3012+
if (String(output.PolicyNames).trim() === "") {
30133013
contents[_PNo] = [];
30143014
} else if (output[_PNo] != null && output[_PNo][_m] != null) {
30153015
contents[_PNo] = de_PolicyNames(__getArrayIfSingleItem(output[_PNo][_m]), context);
@@ -3181,7 +3181,7 @@ const de_DependencyThrottleException = (output: any, context: __SerdeContext): D
31813181
*/
31823182
const de_DeregisterEndPointsOutput = (output: any, context: __SerdeContext): DeregisterEndPointsOutput => {
31833183
const contents: any = {};
3184-
if (output.Instances === "") {
3184+
if (String(output.Instances).trim() === "") {
31853185
contents[_I] = [];
31863186
} else if (output[_I] != null && output[_I][_m] != null) {
31873187
contents[_I] = de_Instances(__getArrayIfSingleItem(output[_I][_m]), context);
@@ -3194,7 +3194,7 @@ const de_DeregisterEndPointsOutput = (output: any, context: __SerdeContext): Der
31943194
*/
31953195
const de_DescribeAccessPointsOutput = (output: any, context: __SerdeContext): DescribeAccessPointsOutput => {
31963196
const contents: any = {};
3197-
if (output.LoadBalancerDescriptions === "") {
3197+
if (String(output.LoadBalancerDescriptions).trim() === "") {
31983198
contents[_LBD] = [];
31993199
} else if (output[_LBD] != null && output[_LBD][_m] != null) {
32003200
contents[_LBD] = de_LoadBalancerDescriptions(__getArrayIfSingleItem(output[_LBD][_m]), context);
@@ -3210,7 +3210,7 @@ const de_DescribeAccessPointsOutput = (output: any, context: __SerdeContext): De
32103210
*/
32113211
const de_DescribeAccountLimitsOutput = (output: any, context: __SerdeContext): DescribeAccountLimitsOutput => {
32123212
const contents: any = {};
3213-
if (output.Limits === "") {
3213+
if (String(output.Limits).trim() === "") {
32143214
contents[_Li] = [];
32153215
} else if (output[_Li] != null && output[_Li][_m] != null) {
32163216
contents[_Li] = de_Limits(__getArrayIfSingleItem(output[_Li][_m]), context);
@@ -3226,7 +3226,7 @@ const de_DescribeAccountLimitsOutput = (output: any, context: __SerdeContext): D
32263226
*/
32273227
const de_DescribeEndPointStateOutput = (output: any, context: __SerdeContext): DescribeEndPointStateOutput => {
32283228
const contents: any = {};
3229-
if (output.InstanceStates === "") {
3229+
if (String(output.InstanceStates).trim() === "") {
32303230
contents[_IS] = [];
32313231
} else if (output[_IS] != null && output[_IS][_m] != null) {
32323232
contents[_IS] = de_InstanceStates(__getArrayIfSingleItem(output[_IS][_m]), context);
@@ -3256,7 +3256,7 @@ const de_DescribeLoadBalancerPoliciesOutput = (
32563256
context: __SerdeContext
32573257
): DescribeLoadBalancerPoliciesOutput => {
32583258
const contents: any = {};
3259-
if (output.PolicyDescriptions === "") {
3259+
if (String(output.PolicyDescriptions).trim() === "") {
32603260
contents[_PD] = [];
32613261
} else if (output[_PD] != null && output[_PD][_m] != null) {
32623262
contents[_PD] = de_PolicyDescriptions(__getArrayIfSingleItem(output[_PD][_m]), context);
@@ -3272,7 +3272,7 @@ const de_DescribeLoadBalancerPolicyTypesOutput = (
32723272
context: __SerdeContext
32733273
): DescribeLoadBalancerPolicyTypesOutput => {
32743274
const contents: any = {};
3275-
if (output.PolicyTypeDescriptions === "") {
3275+
if (String(output.PolicyTypeDescriptions).trim() === "") {
32763276
contents[_PTD] = [];
32773277
} else if (output[_PTD] != null && output[_PTD][_m] != null) {
32783278
contents[_PTD] = de_PolicyTypeDescriptions(__getArrayIfSingleItem(output[_PTD][_m]), context);
@@ -3285,7 +3285,7 @@ const de_DescribeLoadBalancerPolicyTypesOutput = (
32853285
*/
32863286
const de_DescribeTagsOutput = (output: any, context: __SerdeContext): DescribeTagsOutput => {
32873287
const contents: any = {};
3288-
if (output.TagDescriptions === "") {
3288+
if (String(output.TagDescriptions).trim() === "") {
32893289
contents[_TD] = [];
32903290
} else if (output[_TD] != null && output[_TD][_m] != null) {
32913291
contents[_TD] = de_TagDescriptions(__getArrayIfSingleItem(output[_TD][_m]), context);
@@ -3301,7 +3301,7 @@ const de_DetachLoadBalancerFromSubnetsOutput = (
33013301
context: __SerdeContext
33023302
): DetachLoadBalancerFromSubnetsOutput => {
33033303
const contents: any = {};
3304-
if (output.Subnets === "") {
3304+
if (String(output.Subnets).trim() === "") {
33053305
contents[_S] = [];
33063306
} else if (output[_S] != null && output[_S][_m] != null) {
33073307
contents[_S] = de_Subnets(__getArrayIfSingleItem(output[_S][_m]), context);
@@ -3571,7 +3571,7 @@ const de_ListenerDescription = (output: any, context: __SerdeContext): ListenerD
35713571
if (output[_Lis] != null) {
35723572
contents[_Lis] = de_Listener(output[_Lis], context);
35733573
}
3574-
if (output.PolicyNames === "") {
3574+
if (String(output.PolicyNames).trim() === "") {
35753575
contents[_PNo] = [];
35763576
} else if (output[_PNo] != null && output[_PNo][_m] != null) {
35773577
contents[_PNo] = de_PolicyNames(__getArrayIfSingleItem(output[_PNo][_m]), context);
@@ -3632,7 +3632,7 @@ const de_LoadBalancerAttributes = (output: any, context: __SerdeContext): LoadBa
36323632
if (output[_CS] != null) {
36333633
contents[_CS] = de_ConnectionSettings(output[_CS], context);
36343634
}
3635-
if (output.AdditionalAttributes === "") {
3635+
if (String(output.AdditionalAttributes).trim() === "") {
36363636
contents[_AA] = [];
36373637
} else if (output[_AA] != null && output[_AA][_m] != null) {
36383638
contents[_AA] = de_AdditionalAttributes(__getArrayIfSingleItem(output[_AA][_m]), context);
@@ -3657,33 +3657,33 @@ const de_LoadBalancerDescription = (output: any, context: __SerdeContext): LoadB
36573657
if (output[_CHZNID] != null) {
36583658
contents[_CHZNID] = __expectString(output[_CHZNID]);
36593659
}
3660-
if (output.ListenerDescriptions === "") {
3660+
if (String(output.ListenerDescriptions).trim() === "") {
36613661
contents[_LD] = [];
36623662
} else if (output[_LD] != null && output[_LD][_m] != null) {
36633663
contents[_LD] = de_ListenerDescriptions(__getArrayIfSingleItem(output[_LD][_m]), context);
36643664
}
36653665
if (output[_Po] != null) {
36663666
contents[_Po] = de_Policies(output[_Po], context);
36673667
}
3668-
if (output.BackendServerDescriptions === "") {
3668+
if (String(output.BackendServerDescriptions).trim() === "") {
36693669
contents[_BSD] = [];
36703670
} else if (output[_BSD] != null && output[_BSD][_m] != null) {
36713671
contents[_BSD] = de_BackendServerDescriptions(__getArrayIfSingleItem(output[_BSD][_m]), context);
36723672
}
3673-
if (output.AvailabilityZones === "") {
3673+
if (String(output.AvailabilityZones).trim() === "") {
36743674
contents[_AZ] = [];
36753675
} else if (output[_AZ] != null && output[_AZ][_m] != null) {
36763676
contents[_AZ] = de_AvailabilityZones(__getArrayIfSingleItem(output[_AZ][_m]), context);
36773677
}
3678-
if (output.Subnets === "") {
3678+
if (String(output.Subnets).trim() === "") {
36793679
contents[_S] = [];
36803680
} else if (output[_S] != null && output[_S][_m] != null) {
36813681
contents[_S] = de_Subnets(__getArrayIfSingleItem(output[_S][_m]), context);
36823682
}
36833683
if (output[_VPCI] != null) {
36843684
contents[_VPCI] = __expectString(output[_VPCI]);
36853685
}
3686-
if (output.Instances === "") {
3686+
if (String(output.Instances).trim() === "") {
36873687
contents[_I] = [];
36883688
} else if (output[_I] != null && output[_I][_m] != null) {
36893689
contents[_I] = de_Instances(__getArrayIfSingleItem(output[_I][_m]), context);
@@ -3694,7 +3694,7 @@ const de_LoadBalancerDescription = (output: any, context: __SerdeContext): LoadB
36943694
if (output[_SSG] != null) {
36953695
contents[_SSG] = de_SourceSecurityGroup(output[_SSG], context);
36963696
}
3697-
if (output.SecurityGroups === "") {
3697+
if (String(output.SecurityGroups).trim() === "") {
36983698
contents[_SG] = [];
36993699
} else if (output[_SG] != null && output[_SG][_m] != null) {
37003700
contents[_SG] = de_SecurityGroups(__getArrayIfSingleItem(output[_SG][_m]), context);
@@ -3752,17 +3752,17 @@ const de_OperationNotPermittedException = (output: any, context: __SerdeContext)
37523752
*/
37533753
const de_Policies = (output: any, context: __SerdeContext): Policies => {
37543754
const contents: any = {};
3755-
if (output.AppCookieStickinessPolicies === "") {
3755+
if (String(output.AppCookieStickinessPolicies).trim() === "") {
37563756
contents[_ACSP] = [];
37573757
} else if (output[_ACSP] != null && output[_ACSP][_m] != null) {
37583758
contents[_ACSP] = de_AppCookieStickinessPolicies(__getArrayIfSingleItem(output[_ACSP][_m]), context);
37593759
}
3760-
if (output.LBCookieStickinessPolicies === "") {
3760+
if (String(output.LBCookieStickinessPolicies).trim() === "") {
37613761
contents[_LBCSP] = [];
37623762
} else if (output[_LBCSP] != null && output[_LBCSP][_m] != null) {
37633763
contents[_LBCSP] = de_LBCookieStickinessPolicies(__getArrayIfSingleItem(output[_LBCSP][_m]), context);
37643764
}
3765-
if (output.OtherPolicies === "") {
3765+
if (String(output.OtherPolicies).trim() === "") {
37663766
contents[_OP] = [];
37673767
} else if (output[_OP] != null && output[_OP][_m] != null) {
37683768
contents[_OP] = de_PolicyNames(__getArrayIfSingleItem(output[_OP][_m]), context);
@@ -3840,7 +3840,7 @@ const de_PolicyDescription = (output: any, context: __SerdeContext): PolicyDescr
38403840
if (output[_PTN] != null) {
38413841
contents[_PTN] = __expectString(output[_PTN]);
38423842
}
3843-
if (output.PolicyAttributeDescriptions === "") {
3843+
if (String(output.PolicyAttributeDescriptions).trim() === "") {
38443844
contents[_PAD] = [];
38453845
} else if (output[_PAD] != null && output[_PAD][_m] != null) {
38463846
contents[_PAD] = de_PolicyAttributeDescriptions(__getArrayIfSingleItem(output[_PAD][_m]), context);
@@ -3892,7 +3892,7 @@ const de_PolicyTypeDescription = (output: any, context: __SerdeContext): PolicyT
38923892
if (output[_D] != null) {
38933893
contents[_D] = __expectString(output[_D]);
38943894
}
3895-
if (output.PolicyAttributeTypeDescriptions === "") {
3895+
if (String(output.PolicyAttributeTypeDescriptions).trim() === "") {
38963896
contents[_PATD] = [];
38973897
} else if (output[_PATD] != null && output[_PATD][_m] != null) {
38983898
contents[_PATD] = de_PolicyAttributeTypeDescriptions(__getArrayIfSingleItem(output[_PATD][_m]), context);
@@ -3927,7 +3927,7 @@ const de_PolicyTypeNotFoundException = (output: any, context: __SerdeContext): P
39273927
*/
39283928
const de_RegisterEndPointsOutput = (output: any, context: __SerdeContext): RegisterEndPointsOutput => {
39293929
const contents: any = {};
3930-
if (output.Instances === "") {
3930+
if (String(output.Instances).trim() === "") {
39313931
contents[_I] = [];
39323932
} else if (output[_I] != null && output[_I][_m] != null) {
39333933
contents[_I] = de_Instances(__getArrayIfSingleItem(output[_I][_m]), context);
@@ -3940,7 +3940,7 @@ const de_RegisterEndPointsOutput = (output: any, context: __SerdeContext): Regis
39403940
*/
39413941
const de_RemoveAvailabilityZonesOutput = (output: any, context: __SerdeContext): RemoveAvailabilityZonesOutput => {
39423942
const contents: any = {};
3943-
if (output.AvailabilityZones === "") {
3943+
if (String(output.AvailabilityZones).trim() === "") {
39443944
contents[_AZ] = [];
39453945
} else if (output[_AZ] != null && output[_AZ][_m] != null) {
39463946
contents[_AZ] = de_AvailabilityZones(__getArrayIfSingleItem(output[_AZ][_m]), context);
@@ -4058,7 +4058,7 @@ const de_TagDescription = (output: any, context: __SerdeContext): TagDescription
40584058
if (output[_LBN] != null) {
40594059
contents[_LBN] = __expectString(output[_LBN]);
40604060
}
4061-
if (output.Tags === "") {
4061+
if (String(output.Tags).trim() === "") {
40624062
contents[_T] = [];
40634063
} else if (output[_T] != null && output[_T][_m] != null) {
40644064
contents[_T] = de_TagList(__getArrayIfSingleItem(output[_T][_m]), context);

0 commit comments

Comments
 (0)