Skip to content

Add option to close tags in body when serializing #9

@tioback

Description

@tioback

Hi,

Currently, when an object is serialized, there are body elements that don't get closed, such as:

	<SIGNONMSGSRSV1>
		<SONRS>
			<STATUS>
				<CODE>0
				<SEVERITY>INFO
			</STATUS>
			<DTSERVER>20210330
			<LANGUAGE>POR
			<FI>
				<ORG>Some Bank Out There
				<FID>0123
			</FI>
		</SONRS>
	</SIGNONMSGSRSV1>

It would be interesting if there was an option to close all tags, like:

const options: { closeTags: true }
ofx.serialize(header, body, options);

Which in turn would result in the following content:

	<SIGNONMSGSRSV1>
		<SONRS>
			<STATUS>
				<CODE>0</CODE>
				<SEVERITY>INFO</SEVERITY>
			</STATUS>
			<DTSERVER>20210330</DTSERVER>
			<LANGUAGE>POR</LANGUAGE>
			<FI>
				<ORG>Some Bank Out There</ORG>
				<FID>0123</FID>
			</FI>
		</SONRS>
	</SIGNONMSGSRSV1>

I'll work on a PR later on today.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions